/* ============================================================
   LEVIAPAY Steuerberater-Portal — portal.css
   Additions on top of the byte-copied redesign.css: sidebar
   Kanzlei card, nav badge, auth gate screens, dots menu, dark
   accent flip and small helpers the class-mapping needs.
   ============================================================ */

/* ── dark theme: monochrome accent flips light (mirrors #dashboard rule).
   The JS theme toggle also updates the inline --accent so this rule and
   the inline style never disagree. ── */
#sb-app.lp-app.theme-dark,
#sb-gate.lp-app.theme-dark {
  --accent: #f3f3f7;
  --accent-ink: #0e0e14;
}

/* ── sidebar brand logo (redesign.css defines the boxes but no image) ── */
.brand-logo.brand-logo-full { background-image: url("../img/logo-full.png"); }
.theme-dark .brand-logo.brand-logo-full { background-image: url("../img/logo-full-white.png"); }
.brand-logo.brand-logo-mark { background-image: url("../img/logo-icon.png"); }
.theme-dark .brand-logo.brand-logo-mark { background-image: url("../img/logo-icon-white.png"); }

/* ── Kanzlei card in the sidebar ── */
.sb-kanzlei {
  display: flex; align-items: center; gap: 10px;
  margin: 0 4px 14px; padding: 10px 12px;
  border: 1px solid var(--sidebar-line); border-radius: var(--r-ctl);
  background: var(--hover);
}
.sb-kanzlei-ic {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--r-chip);
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
}
.sb-kanzlei-name {
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-kanzlei-sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 1px; }
.lp-side.collapsed .sb-kanzlei { display: none; }

/* ── nav badge (Aufgaben counter) ── */
.sb-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
}
.dir-raster .sb-badge { border-radius: var(--r-chip); }
.lp-side.collapsed .sb-badge { display: none; }

/* ── row container used by the design ── */
.rows { display: flex; flex-direction: column; }

/* ── dots menu (period state changes) ── */
.sb-menu-wrap { position: relative; display: inline-flex; }
.sb-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 120;
  min-width: 210px; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-ctl); box-shadow: var(--shadow-lg);
}
.sb-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; padding: 9px 10px;
  border-radius: var(--r-chip); font-family: inherit;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  cursor: pointer; text-align: left; white-space: nowrap;
}
.sb-menu button:hover { background: var(--hover); color: var(--ink); }
.sb-menu button.active { color: var(--accent); font-weight: 700; }

/* ── mobile: burger in the topbar opens the drawer sidebar ── */
.sb-mobile-burger { display: none; }
@media (max-width: 900px) { .sb-mobile-burger { display: grid; } }
@media (max-width: 760px) { #sb-app .lp-topbar-r .lp-search { display: none; } }

/* ── loading splash (outside any .lp-app scope — standalone colors) ── */
.sb-splash {
  position: fixed; inset: 0; z-index: 500; background: #f7f7f9;
  display: flex; align-items: center; justify-content: center;
}
.sb-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid #e4e4ea; border-top-color: #111111;
  animation: sb-spin 0.7s linear infinite;
}
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* ── auth gate ── */
.sb-gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background: var(--bg);
}
.sb-gate-inner { width: 100%; max-width: 440px; }
.sb-gate-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.sb-gate-logo img { height: 32px; width: auto; display: block; }
.theme-dark .sb-gate-logo img { content: url("../img/logo-full-white.png"); }
.sb-gate-card { padding: 32px 32px 28px; }
.sb-gate-card h1 {
  font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 6px; text-align: center;
}
.sb-gate-sub {
  font-size: var(--fs-sm); color: var(--ink-2); text-align: center;
  margin: 0 0 22px; line-height: 1.5; font-weight: 500;
}
.sb-gate-ic {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: var(--r-chip);
  border: 1px solid var(--line); color: var(--ink-2);
  display: grid; place-items: center;
}
.sb-field { margin-bottom: 14px; }
.sb-field label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px;
}
.sb-gate-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 18px; font-size: var(--fs-sm);
}
.sb-gate-row label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-2); cursor: pointer; font-weight: 500;
}
.sb-gate-row a, .sb-gate-foot a, .sb-gate-link {
  color: var(--accent); font-weight: 600; cursor: pointer;
  background: none; border: 0; padding: 0; font-family: inherit;
  font-size: inherit; text-decoration: none;
}
.sb-gate-row a:hover, .sb-gate-foot a:hover, .sb-gate-link:hover { text-decoration: underline; }
.sb-gate-card .lp-btn { width: 100%; height: 44px; font-size: var(--fs-body); }
.sb-gate-foot {
  margin-top: 18px; text-align: center;
  font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500;
}
.sb-alert {
  margin-bottom: 16px; padding: 11px 13px; border-radius: var(--r-chip);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
  color: var(--danger); font-size: var(--fs-sm); line-height: 1.45; font-weight: 500;
}
.sb-alert:empty { display: none; }
.sb-code-input {
  text-align: center; font-size: 22px; letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums; height: 52px;
}
.sb-qr { display: flex; justify-content: center; padding: 6px 0 2px; }
.sb-qr canvas { border-radius: var(--r-chip); background: #fff; padding: 6px; }
.sb-secret {
  text-align: center; font-size: var(--fs-xs); color: var(--ink-3);
  word-break: break-all; margin: 10px 0 0;
  font-variant-numeric: tabular-nums;
}
.sb-accept-meta {
  border: 1px solid var(--line); border-radius: var(--r-chip);
  padding: 13px 14px; margin-bottom: 18px;
  font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6; font-weight: 500;
}
.sb-accept-meta strong { color: var(--ink); }
.sb-gate input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* The hidden attribute must always win — author display rules (flex/grid)
   on .sb-splash and the gate cards would otherwise override the UA's
   [hidden] → display:none and leave dead overlays on screen. */
[hidden] {
  display: none !important;
}

/* redesign.css .chip was written for text-only merchant buttons; the portal
   renders chips as spans/buttons WITH inline SVG icons — without flex the
   content top-aligns inside the fixed 34px height and icon glues to label. */
.lp-app .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
