/* ═══════════════════════════════════════════════
   Dashboard v2: Seiten-Navigation, Übersicht, Feature-Formulare, Statistik
═══════════════════════════════════════════════ */

/* Es ist immer nur eine Seite sichtbar */
.main .section { display: none; margin-bottom: 0; }
.main .section.page-active { display: block; animation: tfpage .18s ease; }
@keyframes tfpage { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.main { max-width: 1040px; padding-top: 28px; }
.bottom-bar { z-index: 50; }

/* ── Sidebar ── */
.sidebar { width: 252px; }
.bottom-bar { left: 252px; }
.nav-search { position: relative; margin: 2px 0 8px; }
.nav-search input { padding: 8px 40px 8px 32px; font-size: 12.5px; background: var(--bg-input); }
.nav-search .ns-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; pointer-events: none; }
.nav-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 10px var(--font); color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--bg-card); pointer-events: none; }
.nav-group.tf-open .nav-items { display: block; }
.nav-item { position: relative; }
.nav-item .ni-new { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; background: var(--accent-dim); color: var(--accent-tx); }
.nav-item.nav-hidden, .nav-group.nav-hidden { display: none !important; }
.nav-empty { padding: 14px 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
.nav-item .ni-badge { margin-left: auto; min-width: 18px; text-align: center; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--red-dim); color: var(--red); }

/* ── Seitenkopf ── */
.pg-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.pg-ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--juxt-surface-sunken, var(--bg-input)); border: 1px solid var(--border); flex-shrink: 0; }
.pg-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.pg-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; max-width: 640px; line-height: 1.5; }
.pg-master { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pg-master span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pg-master span.on { color: var(--accent-tx); }
.tf-new { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--accent-dim); color: var(--accent-tx); }

/* ── Hinweise ── */
.tf-banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg-input); font-size: 12.5px; line-height: 1.55; color: var(--text-dim); margin-bottom: 12px; }
.tf-banner i { margin-top: 3px; flex-shrink: 0; }
.tf-banner.warn { border-color: rgba(201,154,24,.4); background: rgba(201,154,24,.08); }
.tf-banner.warn i { color: var(--yellow); }
.tf-banner.off i { color: var(--text-muted); }
.tf-banner.info i { color: var(--juxt-info-text, #5865f2); }
.tf-banner.danger { border-color: var(--juxt-danger-border, rgba(216,60,62,.4)); background: var(--red-dim); }
.tf-banner.danger i { color: var(--red); }
.tf-banner ul { margin: 4px 0 0 16px; }
.tf-banner a { color: var(--accent-tx); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tf-banner .tb-body { flex: 1; min-width: 0; }
.tf-banner .tb-act { flex-shrink: 0; }

/* ── Tabs ── */
.tf-tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1px solid var(--border); }
.tf-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; font: 600 12.5px var(--font); color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; transition: color var(--tr), border-color var(--tr); }
.tf-tab:hover { color: var(--text); }
.tf-tab.active { color: var(--text); border-bottom-color: var(--text); }
.tf-tab i { font-size: 12px; opacity: .8; }
.tf-panel { display: none; }
.tf-panel.active { display: block; }
.fp-off .tf-panel > .card { opacity: .72; }

/* ── Felder ── */
.tf-card { padding: 4px 0; }
.tf-field { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.tf-field:last-child { border-bottom: none; }
.tf-field.tf-hidden { display: none; }
.tf-label { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tf-field .hint { margin-top: 6px; }
.tf-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tf-toggle .tf-label { margin-bottom: 0; }
.tf-toggle .hint { margin-top: 3px; }
.tf-inline { display: flex; align-items: center; gap: 8px; }
.tf-inline input[type=number] { max-width: 140px; }
.tf-unit { font-size: 12px; color: var(--text-muted); }
.tf-color { display: flex; align-items: center; gap: 8px; }
.tf-color input[type=color] { width: 40px; height: 34px; padding: 2px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg-input); cursor: pointer; }
.tf-color .tf-color-txt { font: 12px var(--mono); color: var(--text-muted); }
.tf-actionrow { padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.tf-actionrow:last-child { border-bottom: none; }
.tf-actionrow .hint { margin: 0; flex: 1; min-width: 180px; }
.tf-note { padding: 14px 20px; font-size: 12.5px; line-height: 1.6; color: var(--text-dim); background: var(--bg-input); border-bottom: 1px solid var(--border); display: flex; gap: 10px; }
.tf-note i { color: var(--juxt-info-text, #5865f2); margin-top: 3px; }
.tf-note:last-child { border-bottom: none; }
.btn-warn { background: var(--red-dim); color: var(--red); border-color: var(--juxt-danger-border, var(--red)); }
.btn-warn:hover { background: var(--red); color: #fff; }

/* ── Tags ── */
.tf-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: text; min-height: 38px; align-items: center; }
.tf-tags:focus-within { border-color: var(--border-fo); box-shadow: 0 0 0 3px var(--accent-dim); }
.tf-tags input { flex: 1; min-width: 120px; border: none !important; box-shadow: none !important; background: none !important; padding: 3px 2px !important; }

/* ── Listen (Items) ── */
.tf-items { padding: 14px 20px; }
.tf-items-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tf-items-head .tf-label { margin: 0; }
.tf-item { border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-input); margin-top: 10px; overflow: hidden; }
.tf-item-h { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; cursor: pointer; user-select: none; }
.tf-item-h:hover { background: var(--bg-hover); }
.tf-item-n { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); font-size: 11px; font-weight: 700; display: grid; place-items: center; color: var(--text-muted); flex-shrink: 0; }
.tf-item-t { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-item-t em { font-style: normal; color: var(--text-muted); font-weight: 400; }
.tf-item-chev { font-size: 10px; color: var(--text-muted); transition: transform .15s; }
.tf-item.open > .tf-item-h .tf-item-chev { transform: rotate(90deg); }
.tf-item-b { display: none; border-top: 1px solid var(--border); background: var(--bg-card); }
.tf-item.open > .tf-item-b { display: grid; grid-template-columns: 1fr 1fr; }
.tf-item-b > .tf-field { padding: 12px 16px; }
.tf-item-b > .tf-wide, .tf-item-b > .tf-items, .tf-item-b > .tf-toggle { grid-column: 1 / -1; }
@media (max-width: 760px) { .tf-item.open > .tf-item-b { grid-template-columns: 1fr; } }
.tf-ibtn { background: none; border: none; color: var(--text-muted); cursor: pointer; width: 26px; height: 26px; border-radius: 6px; font-size: 12px; display: grid; place-items: center; transition: background var(--tr), color var(--tr); }
.tf-ibtn:hover { background: var(--bg-card); color: var(--text); }
.tf-ibtn.del:hover { background: var(--red-dim); color: var(--red); }
.tf-ibtn:disabled { opacity: .3; cursor: default; }
.tf-items-empty { margin-top: 10px; border: 1px dashed var(--border-fo); border-radius: var(--r); padding: 22px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.tf-items-foot { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tf-menu { position: relative; }
.tf-menu-list { position: absolute; z-index: 30; bottom: calc(100% + 4px); left: 0; min-width: 190px; background: var(--juxt-surface-raised, var(--bg-card)); border: 1px solid var(--border-fo); border-radius: var(--r); box-shadow: var(--juxt-shadow-lg, 0 8px 24px rgba(0,0,0,.3)); padding: 4px; display: none; }
.tf-menu.open .tf-menu-list { display: block; }
.tf-menu-list button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); font: 500 13px var(--font); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.tf-menu-list button:hover { background: var(--bg-hover); }
.tf-item .tf-item .tf-item-h { padding: 7px 8px 7px 10px; }

/* ── Vorschau ── */
.tf-prev { padding: 14px 20px; }
.tf-prev-t { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.tf-modal { background: #313338; color: #dbdee1; border-radius: 8px; padding: 18px 18px 14px; max-width: 460px; font-family: "gg sans","Segoe UI",system-ui,sans-serif; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.tf-modal h4 { font-size: 18px; font-weight: 700; color: #f2f3f5; margin-bottom: 14px; }
.tf-modal .mf { margin-bottom: 12px; }
.tf-modal .mf b { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #b5bac1; margin-bottom: 6px; }
.tf-modal .mf b i { color: #f23f43; font-style: normal; margin-left: 3px; }
.tf-modal .mf div { background: #1e1f22; border-radius: 4px; padding: 9px 10px; font-size: 14px; color: #6d6f78; min-height: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-modal .mf.p div { min-height: 76px; white-space: normal; }
.tf-modal .mb { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tf-modal .mb span { padding: 7px 14px; border-radius: 3px; font-size: 13px; font-weight: 500; background: #4e5058; color: #fff; }
.tf-modal .mb span.pri { background: #5865f2; }
.tf-pollp .po { margin-bottom: 10px; font-size: 13px; }
.tf-pollp .po small { color: #949ba4; }
.tf-pollp .pb { font-family: var(--mono); letter-spacing: 1px; font-size: 13px; color: #5865f2; }

/* ── Übersicht ── */
.home-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.home-hero .gi { width: 54px; height: 54px; border-radius: 14px; background: var(--bg-input) center/cover; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--text-dim); border: 1px solid var(--border); flex-shrink: 0; }
.home-hero h1 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.home-hero p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; text-align: left; cursor: default; font-family: inherit; color: inherit; }
button.kpi { cursor: pointer; transition: border-color var(--tr), transform var(--tr); }
button.kpi:hover { border-color: var(--border-fo); transform: translateY(-1px); }
.kpi .kl { font-size: 11.5px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.kpi .kv { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.kpi .ks { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.kpi.alert .kv { color: var(--yellow); }
.home-sec { margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-sec h2 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.home-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.home-filter .hf-search { position: relative; flex: 1; min-width: 200px; }
.home-filter .hf-search input { padding-left: 34px; }
.home-filter .hf-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; }
.chip { font: 600 12px var(--font); padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-dim); cursor: pointer; transition: all var(--tr); }
.chip:hover { border-color: var(--border-fo); color: var(--text); }
.chip.on { background: var(--juxt-ink, var(--text)); color: var(--juxt-ink-fg, var(--bg-deep)); border-color: transparent; }
.grp-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.grp-title i { font-size: 11px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fcard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color var(--tr), transform var(--tr), box-shadow var(--tr); text-align: left; font-family: inherit; color: inherit; position: relative; }
.fcard:hover { border-color: var(--border-fo); transform: translateY(-1px); box-shadow: var(--juxt-shadow-xs); }
.fcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fcard .fc-top { display: flex; align-items: center; gap: 10px; }
.fcard .fc-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: var(--bg-input); border: 1px solid var(--border); flex-shrink: 0; }
.fcard.is-on .fc-ic { background: var(--accent-dim); color: var(--accent-tx); border-color: transparent; }
.fcard .fc-name { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.fcard .fc-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.fcard .fc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-muted); }
.fcard .fc-st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.fcard .fc-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border-fo); }
.fcard.is-on .fc-st { color: var(--accent-tx); }
.fcard.is-on .fc-st::before { background: var(--juxt-accent, #3ba55d); }
.fcard.is-warn .fc-st { color: var(--yellow); }
.fcard.is-warn .fc-st::before { background: var(--yellow); }
.fcard .sw { transform: scale(.9); }
.home-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 36px 10px; border: 1px dashed var(--border-fo); border-radius: var(--r-lg); }

/* ── Statistik ── */
.st-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.st-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.st-grid .wide { grid-column: 1 / -1; }
.st-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.st-card h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.st-card .sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 10px; }
.st-chart { width: 100%; height: auto; display: block; }
.st-chart text { fill: var(--text-muted); font: 10px var(--font); }
.st-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-muted); margin-top: 6px; flex-wrap: wrap; }
.st-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.st-hbar { display: grid; grid-template-columns: minmax(70px, 130px) 1fr auto; gap: 10px; align-items: center; font-size: 12px; margin: 7px 0; }
.st-hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.st-hbar .tr { height: 8px; background: var(--bg-input); border-radius: 99px; overflow: hidden; }
.st-hbar .fi { height: 100%; border-radius: 99px; background: var(--juxt-ink, var(--text)); opacity: .8; }
.st-hbar .vl { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.st-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 8px; }
.st-nums .n b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.st-nums .n span { font-size: 11px; color: var(--text-muted); }
.st-empty { color: var(--text-muted); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* ── Befehlspalette ── */
.pal-ov { position: fixed; inset: 0; z-index: 10002; background: var(--juxt-overlay, rgba(0,0,0,.5)); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; animation: cmfade .1s ease; }
.pal { width: 100%; max-width: 560px; background: var(--juxt-surface-raised, var(--bg-card)); border: 1px solid var(--border-fo); border-radius: var(--r-lg); box-shadow: var(--juxt-shadow-lg, 0 20px 50px rgba(0,0,0,.4)); overflow: hidden; }
.pal input { border: none !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important; padding: 15px 18px !important; font-size: 15px !important; box-shadow: none !important; background: transparent !important; }
.pal-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.pal-it { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.pal-it.sel { background: var(--bg-hover); }
.pal-it i { width: 18px; text-align: center; color: var(--text-muted); }
.pal-it .pt { font-size: 13.5px; font-weight: 600; }
.pal-it .pd { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.pal-it .pg { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); display: flex; gap: 14px; }

/* ── Mobil ── */
.mobile-nav { display: none; }
@media (max-width: 760px) {
  .mobile-nav { display: block; margin-bottom: 14px; }
  .bottom-bar { left: 0; }
  .pg-head { flex-wrap: wrap; }
  .pg-master { margin-left: 0; width: 100%; }
  .st-grid { grid-template-columns: 1fr; }
  .tf-field { padding: 12px 14px; }
  .tf-items { padding: 12px 14px; }
}

/* ── Server-Dropdown ── */
.guild-strip { position: relative; }
.guild-strip.open { border-color: var(--border-fo); }
.guild-strip.open .guild-strip-arrow { transform: rotate(180deg); }
.guild-strip-arrow { transition: transform .15s; }
.gs-menu { flex-shrink: 0; position: relative; z-index: 60; margin: -2px 0 8px; background: var(--juxt-surface-raised, var(--bg-card)); border: 1px solid var(--border-fo); border-radius: var(--r); box-shadow: var(--juxt-shadow-lg, 0 10px 30px rgba(0,0,0,.35)); overflow: hidden; animation: tfpage .12s ease; }
.gs-search { padding: 8px; border-bottom: 1px solid var(--border); }
.gs-search input { padding: 7px 10px; font-size: 12.5px; }
.gs-list { max-height: 320px; overflow-y: auto; padding: 4px; }
.gs-it { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.gs-it:hover { background: var(--bg-hover); }
.gs-it.cur { background: var(--accent-dim); }
.gs-ic { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-input) center/cover; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-dim); flex-shrink: 0; }
.gs-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.gs-tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--bg-input); color: var(--text-muted); white-space: nowrap; }
.gs-tag.warn { background: rgba(201,154,24,.14); color: var(--yellow); }
.gs-ck { color: var(--accent-tx); font-size: 11px; }
.gs-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--text-muted); }
