/* ============================================================================
   APP LAYOUT · Sidebar + Main + Dashboard
   ============================================================================ */

/* --- Auth layout (full screen) --- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
@media (min-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr 1fr; }
}
.auth-hero {
  background: var(--ink);
  color: var(--bg);
  padding: var(--sp-8);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 40vh;
  position: relative;
  overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(250, 248, 245, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(250, 248, 245, 0.05) 0%, transparent 50%);
  pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .eyebrow { color: var(--ink-faint); }
.auth-hero h1 {
  color: var(--bg);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-style: italic;
  line-height: 1;
}
.auth-hero p { color: var(--ink-faint); max-width: 32ch; }
.auth-form-wrap {
  padding: var(--sp-8);
  display: flex; flex-direction: column; justify-content: center;
  min-height: 60vh;
}
.auth-form { max-width: 380px; margin: 0 auto; width: 100%; }
.auth-form h2 { font-size: 2rem; margin-bottom: var(--sp-2); }
.auth-form .sub { color: var(--ink-muted); margin-bottom: var(--sp-6); }

/* --- App shell --- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
}

/* Sidebar */
.sidebar {
  background: var(--ink);
  color: var(--bg);
  padding: var(--sp-6) 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 260px; height: 100vh;
    z-index: 800;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
}
.sidebar-brand {
  padding: 0 var(--sp-6) var(--sp-6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1;
}
.sidebar-brand .tag {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: var(--sp-2);
}
.sidebar-nav { padding: var(--sp-5) 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group { padding: var(--sp-4) var(--sp-6) var(--sp-2); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(250,248,245,0.4); }
.nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0.625rem var(--sp-6);
  color: rgba(250,248,245,0.7);
  font-size: 0.9375rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  border-left: 2px solid transparent;
  cursor: pointer;
}
.nav-link:hover { color: var(--bg); background: rgba(255,255,255,0.04); text-decoration: none; }
.nav-link.active {
  color: var(--bg);
  background: rgba(255,255,255,0.12);
  border-left-color: var(--bg);
  font-weight: 500;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: var(--small-size);
  color: rgba(250,248,245,0.5);
}
.sidebar-user {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.125rem;
  color: var(--bg);
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(26, 26, 26, 0.5);
  z-index: 790;
}
@media (max-width: 900px) {
  .sidebar-backdrop.show { display: block; }
}

/* --- Main --- */
.main-area {
  min-width: 0;
  display: flex; flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex; align-items: center;
  padding: 0 var(--sp-6);
  position: sticky; top: 0; z-index: 100;
  gap: var(--sp-4);
}
@media (max-width: 640px) { .topbar { padding: 0 var(--sp-4); } }
.topbar .menu-toggle { display: none; }
@media (max-width: 900px) {
  .topbar .menu-toggle { display: inline-flex; }
}
.topbar .page-title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  flex: 1;
}
.topbar .actions { display: flex; gap: var(--sp-3); align-items: center; }
.global-search {
  position: relative;
  display: none;
}
@media (min-width: 720px) { .global-search { display: block; flex: 1; max-width: 360px; } }
.global-search input {
  width: 100%;
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  background: var(--bg-alt);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--small-size);
  transition: border-color var(--dur) var(--ease);
}
.global-search input:focus { outline: none; border-color: var(--ink-faint); background: var(--bg-elev); }
.global-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--ink-muted);
}

.page-content {
  padding: var(--sp-7) var(--sp-6);
  flex: 1;
  max-width: var(--max-content);
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 640px) { .page-content { padding: var(--sp-5) var(--sp-4); } }

/* --- Page header (editorial) --- */
.page-head {
  margin-bottom: var(--sp-7);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.page-head .left { max-width: 60ch; }
.page-head .eyebrow { margin-bottom: var(--sp-3); }
.page-head h1 { margin: 0; }
.page-head .desc { color: var(--ink-muted); margin-top: var(--sp-3); max-width: 52ch; }

/* --- KPI cards (dashboard) --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-7);
}
.kpi {
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}
.kpi:hover { border-color: var(--ink-faint); }
.kpi .kpi-label {
  font-size: var(--eyebrow-size);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--sp-4);
}
.kpi .kpi-value {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.kpi .kpi-sub {
  font-size: var(--small-size);
  color: var(--ink-muted);
  margin-top: var(--sp-3);
}

/* --- Two-column layout --- */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-6);
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Section heading (editorial) */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
}
.section-head a { font-size: var(--small-size); color: var(--ink-muted); }
.section-head a:hover { color: var(--ink); }

/* --- Activity timeline --- */
.timeline { display: flex; flex-direction: column; gap: var(--sp-4); }
.timeline-item {
  display: flex; gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-soft);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
  margin-top: 8px;
  flex-shrink: 0;
}
.timeline-item .meta { font-size: var(--small-size); color: var(--ink-muted); }

/* --- Kanban (pipeline) --- */
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}
@media (min-width: 900px) {
  .kanban {
    display: flex;
    gap: var(--sp-4);
    overflow-x: auto;
    padding-bottom: var(--sp-3);
  }
  .kanban-col { min-width: 280px; width: 280px; flex-shrink: 0; }
}
.kanban-col {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 200px);
}
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
}
.kanban-col-head .title {
  font-size: var(--eyebrow-size);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.kanban-col-head .count {
  font-size: var(--small-size);
  color: var(--ink-muted);
}
.kanban-cards { display: flex; flex-direction: column; gap: var(--sp-3); overflow-y: auto; flex: 1; padding-right: 2px; }
.kanban-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  cursor: grab;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.kanban-card:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.5; transform: scale(0.98); }
.kanban-card .title { font-size: var(--body-size); font-weight: 500; margin-bottom: var(--sp-2); }
.kanban-card .client { font-size: var(--small-size); color: var(--ink-muted); }
.kanban-card .value { font-family: var(--font-serif); font-size: 1.25rem; margin-top: var(--sp-3); }
.kanban-col.drop-target { background: var(--line-soft); }

/* --- Calendar --- */
.cal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.cal-head h3 { font-family: var(--font-serif); font-size: 1.5rem; font-style: italic; }
.cal-nav { display: flex; gap: var(--sp-2); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-day-header {
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  font-size: var(--eyebrow-size);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-soft);
}
.cal-day-header:last-child { border-right: 0; }
.cal-day {
  min-height: 100px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: var(--sp-2);
  background: var(--bg-elev);
  transition: background var(--dur-fast) var(--ease);
  cursor: pointer;
}
@media (max-width: 640px) { .cal-day { min-height: 70px; } }
.cal-day:hover { background: var(--bg-alt); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other-month { background: var(--bg); color: var(--ink-faint); }
.cal-day.today .num { background: var(--ink); color: var(--bg); }
.cal-day .num {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-2);
}
.cal-event {
  display: block;
  font-size: 0.6875rem;
  padding: 2px 6px;
  margin-bottom: 2px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.completed { background: var(--success); }
.cal-event.canceled { background: var(--ink-faint); text-decoration: line-through; }

/* --- Detail drawer --- */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  z-index: 850;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--bg);
  z-index: 1;
}
.drawer-head h2 { font-size: 1.5rem; }
.drawer-body { padding: var(--sp-6); flex: 1; }
.drawer-foot {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: var(--sp-3);
}

/* --- Tabs --- */
.tabs { display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); }
.tab {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 2px solid transparent;
  font-size: var(--small-size);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab.active { color: var(--ink); border-color: var(--ink); }
.tab:hover { color: var(--ink); }

/* --- Invoice preview --- */
.invoice-preview {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: var(--sp-7);
  font-family: var(--font-sans);
  min-height: 600px;
}
.invoice-preview h1 { font-family: var(--font-serif); font-size: 3rem; margin-bottom: var(--sp-2); }
.invoice-preview .num-label { font-size: var(--eyebrow-size); color: var(--ink-muted); letter-spacing: 0.14em; text-transform: uppercase; }

/* Status dots */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: var(--sp-2);
  vertical-align: middle;
}
.status-draft    { background: var(--ink-faint); }
.status-sent     { background: var(--info); }
.status-paid     { background: var(--success); }
.status-overdue  { background: var(--danger); }
.status-partial  { background: var(--warn); }
.status-canceled { background: var(--ink-faint); }

/* AI panel */
.ai-panel {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}
.ai-panel .ai-label {
  font-size: var(--eyebrow-size);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.ai-panel .ai-content {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: var(--body-size);
}
.ai-mode-badge {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 2px;
  text-transform: uppercase;
}

/* Chart */
.chart { height: 240px; }
.chart svg { width: 100%; height: 100%; }

/* Print (invoice pdf trigger fallback) */
@media print {
  .sidebar, .topbar, .drawer, .btn, .modal-backdrop { display: none !important; }
  .page-content { padding: 0; }
}

/* ============================================================================
   MOBILE FIXES & OVERFLOW PROTECTION
   ============================================================================ */
html, body { overflow-x: hidden; max-width: 100vw; }
.main-area { min-width: 0; max-width: 100vw; overflow-x: hidden; }
.page-content { max-width: 100%; overflow-x: hidden; }
.page-content iframe { max-width: 100%; }
.two-col > * { min-width: 0; max-width: 100%; }
.card iframe { width: 100%; max-width: 100%; }
.table { max-width: 100%; }

/* table overflow wrap helper */
.card.card-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
  .page-head .row { flex-wrap: wrap; gap: var(--sp-2); }
  .page-head h1 { font-size: 2.25rem; }

  .topbar { flex-wrap: nowrap; padding: 0 var(--sp-3); gap: var(--sp-2); height: auto; min-height: var(--topbar-h); }
  .topbar .page-title { font-size: 1.125rem; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .global-search { display: none !important; }
  .topbar .actions { flex-shrink: 0; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .kpi { padding: var(--sp-4); }
  .kpi .kpi-value { font-size: 1.75rem; }

  .two-col { grid-template-columns: 1fr !important; gap: var(--sp-4); }
  .card { padding: var(--sp-4); }
  .form-row-2 { grid-template-columns: 1fr !important; }

  .table { font-size: 0.85rem; }
  .table th, .table td { padding: var(--sp-2) var(--sp-3); }
  .section-head { flex-wrap: wrap; gap: var(--sp-2); }
  .section-head h2 { font-size: 1.25rem; }

  iframe { height: 400px !important; }

  .drawer { max-width: 100vw; }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-content { padding: var(--sp-4) var(--sp-3); }
}

/* ============ DRAWER Z-INDEX FIX (backdrop below drawer) ============ */
#drawer-container .modal-backdrop { z-index: 840; }
.drawer { z-index: 860; }

/* ============ SIDEBAR SCROLL FIX ============ */
@media (min-width: 901px) {
  .app {
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    height: 100vh;
    max-height: 100vh;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .main-area {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .topbar { position: sticky; top: 0; z-index: 100; }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(250,248,245,0.15); border-radius: 3px; }
  .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(250,248,245,0.3); }
}

/* ============ TOTALS BLOCK (used in offer detail) ============ */
.totals-block {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 360px;
  margin-left: auto;
}
.totals-block .grand { font-weight: 600; }

/* ============ MOBILE OPTIMIERUNG v13 ============ */

/* Modal: volle Breite auf kleinen Screens */
@media (max-width: 640px) {
  .modal { max-width: calc(100vw - 24px) !important; max-height: 90vh; margin: 5vh 12px; }
  .modal .modal-body { max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal .modal-foot { flex-wrap: wrap; gap: var(--sp-2); }
  .modal .modal-foot .row { flex-wrap: wrap; gap: var(--sp-2); }
  .modal .modal-foot .btn { flex: 1 0 auto; min-width: 100px; }

  /* Form-Grid auf mobile: 1 Spalte */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid > .field[style*="grid-column"] { grid-column: 1 / -1 !important; }

  /* Buttons in page-head: kleiner und wrapping */
  .page-head .btn { font-size: 0.8rem; padding: 6px 10px; }

  /* Tabellen: horizontales Scrollen */
  .card-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-table-wrap .table { min-width: 600px; }

  /* Tabs: scrollbar statt wrap */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; gap: 0; }
  .tabs .tab { flex-shrink: 0; white-space: nowrap; font-size: 0.85rem; padding: var(--sp-2) var(--sp-3); }

  /* Row-between: stacking auf sehr kleinen Screens */
  .card-flat .row-between { flex-wrap: wrap; gap: var(--sp-2); }

  /* Notifications dropdown: volle Breite */
  .notif-dropdown { width: calc(100vw - 24px) !important; right: -40px !important; }

  /* Offer items Grid im Create-Modal */
  div[style*="grid-template-columns: 1fr 80px 100px"] {
    grid-template-columns: 1fr !important;
    gap: var(--sp-2) !important;
  }

  /* Statistics Charts: kleinere Höhe */
  div[style*="height: 120px"] { height: 80px !important; }
  div[style*="height: 140px"] { height: 100px !important; }

  /* Global search overlay: mobilfreundlich */
  .gsearch-box { max-width: calc(100vw - 24px) !important; margin: 0 12px; border-radius: 12px; }
  .gsearch-input { font-size: 16px !important; } /* Prevents iOS zoom */
}

/* Kleine Tablets: 2-spaltig bleibt, aber enger */
@media (min-width: 641px) and (max-width: 900px) {
  .modal { max-width: 90vw; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
}

/* Touch targets: mindestens 44px */
@media (pointer: coarse) {
  .btn-sm { min-height: 36px; }
  .icon-btn { min-width: 36px; min-height: 36px; }
  .nav-link { min-height: 44px; display: flex; align-items: center; }
  .table td, .table th { padding: var(--sp-3); }
  .card-flat { padding: var(--sp-3); }
  input, select, textarea { min-height: 40px; font-size: 16px; } /* Prevents iOS zoom */
}

/* ============ SETUP WIZARD ============ */
.setup-wizard {
  max-width: 560px; margin: 0 auto; padding: var(--sp-6);
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
}
.wizard-head { text-align: center; margin-bottom: var(--sp-6); }
.wizard-head h1 { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 3rem); margin-bottom: var(--sp-3); }
.wizard-head p { color: var(--ink-muted); font-family: var(--font-serif); font-style: italic; }
.wizard-steps { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); justify-content: center; }
.wizard-step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background 0.3s; }
.wizard-step-dot.active { background: var(--ink); }
.wizard-step-dot.done { background: var(--success); }
.wizard-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-6); }
.wizard-card h2 { font-family: var(--font-serif); font-size: 1.5rem; margin-bottom: var(--sp-2); }
.wizard-card .desc { color: var(--ink-muted); margin-bottom: var(--sp-5); font-size: var(--small-size); }
.wizard-foot { display: flex; justify-content: space-between; margin-top: var(--sp-5); }
.wizard-error { background: var(--danger-bg); color: var(--danger); padding: var(--sp-3); border-radius: var(--radius); margin-bottom: var(--sp-3); }

/* ============ DRUCK / PRINT ============ */
@media print {
  /* Verstecke Navigation, Topbar, Sidebar */
  .sidebar, .topbar, .pwa-install-banner, .notif-dropdown,
  .gsearch-overlay, .modal-backdrop, .drawer,
  .page-head .btn, .page-head .row > .btn,
  .nav-link, .nav-group, #quick-new-btn { display: none !important; }

  /* App-Layout: volle Breite */
  .app { display: block !important; }
  .main-area { margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important; }
  .page-content { padding: 0 !important; }

  /* Karten: kein Schatten, dünner Rand */
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .card-flat { box-shadow: none !important; }

  /* Tabellen: lesbar */
  .table { width: 100% !important; min-width: 0 !important; font-size: 11px !important; }
  .table th, .table td { padding: 4px 8px !important; border: 1px solid #ddd !important; }

  /* KPIs: inline, kompakter */
  .kpi-grid { display: flex !important; flex-wrap: wrap !important; gap: 12px !important; }
  .kpi { border: 1px solid #ddd !important; padding: 8px 12px !important; flex: 1 1 120px !important; }

  /* Badges: Outline statt Farbe */
  .badge { border: 1px solid currentColor !important; background: transparent !important; }

  /* Font: schwarz auf weiß */
  body, .app, .main-area, .page-content { background: white !important; color: black !important; }
  * { color: black !important; }

  /* Links: URL anzeigen */
  a[href]:after { content: " (" attr(href) ")"; font-size: 9px; color: #666 !important; }
  a.btn:after, a.nav-link:after, a.back-link:after { content: none !important; }

  /* Seitenumbruch */
  .page-head { break-after: avoid; }
  .two-col { display: block !important; }
  .two-col > * { break-inside: avoid; margin-bottom: 16px; }

  /* Statistik-Charts: nicht drucken (sind CSS-basiert, sehen im Druck kaputt aus) */
  .kpi-grid + .two-col div[style*="height: 120px"],
  .kpi-grid + .two-col div[style*="height: 140px"] { display: none !important; }
}

/* ============ INLINE HELP ============ */
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-alt); color: var(--ink-muted);
  font-size: 11px; font-weight: 600; cursor: help;
  border: 1px solid var(--line); flex-shrink: 0;
  position: relative;
}
.help-tip:hover { background: var(--ink); color: var(--bg); }
.help-tip .help-text {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); width: 260px; max-width: 80vw;
  background: var(--ink); color: var(--bg); padding: 10px 14px;
  border-radius: 8px; font-size: 12px; font-weight: 400; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index: 200;
  pointer-events: none; text-align: left;
}
.help-tip .help-text::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); border: 6px solid transparent;
  border-top-color: var(--ink);
}
.help-tip:hover .help-text { display: block; }
@media (max-width: 640px) {
  .help-tip .help-text { width: 220px; left: auto; right: -10px; transform: none; }
  .help-tip .help-text::after { left: auto; right: 14px; }
}

/* ============ MOBILE: Horizontal-Scroll-Fix v25 ============ */
@media (max-width: 640px) {
  /* Page head: buttons wrappen */
  .page-head { flex-direction: column !important; align-items: flex-start !important; gap: var(--sp-3) !important; }
  .page-head .row { flex-wrap: wrap !important; gap: var(--sp-2) !important; width: 100% !important; }
  .page-head .left { width: 100% !important; }

  /* Alle row-Elemente wrappen */
  .row { flex-wrap: wrap !important; }

  /* Body + HTML: absolut kein horizontales Scrollen */
  html, body, .app, .main-area, .page-content, #page-content {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* KPI-Grid: 2 statt 4 Spalten */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: var(--sp-3) !important; }

  /* Two-col: single column */
  .two-col { grid-template-columns: 1fr !important; }

  /* Drawer: volle Breite */
  .drawer { width: 100vw !important; max-width: 100vw !important; }

  /* Cards: kein Overflow */
  .card, .card-flat { max-width: 100% !important; box-sizing: border-box !important; overflow-wrap: break-word !important; word-break: break-word !important; }

  /* Mono/code: umbrechen statt overflow */
  .mono, code, pre { word-break: break-all !important; overflow-wrap: break-word !important; }

  /* Stack-LG spacing reduzieren */
  .stack-lg { gap: var(--sp-4) !important; }
}

/* ============================================================================
   SHOOTSBYSIRIN · COMPLETE SHELL REDESIGN
   ============================================================================ */
body { letter-spacing: .005em; }
.sidebar {
  background: #090909 !important;
  color: #f7f6f3;
  border-right: 0 !important;
}
.sidebar-brand { padding: 34px 28px 26px !important; border-bottom: 1px solid rgba(255,255,255,.1) !important; }
.sidebar-logo { width: 178px; height: auto; filter: invert(1); display: block; }
.sidebar-brand .tag { margin-top: 13px; color: rgba(255,255,255,.42) !important; letter-spacing: .24em !important; text-transform: uppercase; font-size: 9px !important; }
.sidebar-nav { padding: 22px 14px 32px !important; }
.nav-group { color: rgba(255,255,255,.32) !important; letter-spacing: .22em !important; margin: 22px 14px 7px !important; }
.nav-link { color: rgba(255,255,255,.68) !important; border-radius: 0 !important; padding: 10px 14px !important; border-left: 1px solid transparent; }
.nav-link:hover { color: #fff !important; background: rgba(255,255,255,.04) !important; text-decoration: none; }
.nav-link.active { color: #fff !important; background: transparent !important; border-left-color: #fff; }
.nav-link svg { opacity: .72; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.1) !important; padding: 20px 28px 24px !important; }
.avatar { border-radius: 50% !important; background: #fff !important; color: #090909 !important; }
.topbar { background: rgba(246,245,242,.92) !important; backdrop-filter: blur(18px); border-bottom: 1px solid var(--line) !important; }
.page-title { letter-spacing: .16em; text-transform: uppercase; font-size: 11px !important; font-weight: 600; }
.page-content { padding-top: 50px !important; }
.page-head { border-bottom: 1px solid var(--ink); padding-bottom: 34px !important; margin-bottom: 42px !important; }
.page-head h1 { font-size: clamp(3rem, 5.5vw, 6rem) !important; line-height: .92 !important; }
.page-head .desc { max-width: 580px; }
.eyebrow { letter-spacing: .24em; }
.kpi-grid { gap: 16px !important; background: transparent !important; border: 0 !important; }
.kpi { border: 1px solid var(--line) !important; border-radius: var(--radius-lg) !important; background: var(--bg-elev) !important; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.kpi:hover { border-color: var(--ink-muted) !important; }
.kpi .kpi-value { font-family: var(--font-serif); font-weight: 400 !important; font-size: clamp(2rem,4vw,3.5rem) !important; }
.card { border-color: var(--line); }
.section-head { border-bottom-color: var(--ink) !important; }
.section-head h2 { font-style: normal !important; font-size: 1.7rem !important; }
.table th { border-bottom-color: var(--ink); }
.tabs { border-bottom-color: var(--ink) !important; }
.tab { letter-spacing: .16em !important; text-transform: uppercase; font-size: 10px !important; }
.auth-wrap { background: #090909 !important; }
.auth-hero { background: #090909 !important; color: white !important; }
.auth-hero h1 { color: #fff !important; font-size: clamp(4rem,9vw,8rem) !important; line-height: .82 !important; letter-spacing: -.04em !important; }
.auth-hero p { color: rgba(255,255,255,.6) !important; max-width: 40ch; }
.auth-logo { width: min(320px, 78%); filter: invert(1); }
.auth-form-wrap { background: #f6f5f2 !important; }
.auth-form h2 { font-size: 3rem !important; }
.modal { background: #f6f5f2; }
.status-badge, .badge { border-radius: 999px !important; }
.document-preview { background:#e5e2dc; padding:28px; min-height:520px; display:flex; justify-content:center; }
.document-sheet { background:white; width:min(100%,430px); aspect-ratio:210/297; padding:42px 34px; box-shadow:0 18px 45px rgba(0,0,0,.08); display:flex; flex-direction:column; }
.document-sheet-logo { width:130px; margin-bottom:40px; }
.document-sheet-title { font-family:var(--font-serif); font-size:38px; line-height:1; margin-bottom:8px; }
.document-sheet-line { height:1px; background:currentColor; margin:18px 0 25px; opacity:.25; }
.permission-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:8px 22px; }
.permission-item { display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-bottom:1px solid var(--line-soft); }
@media (max-width: 760px) { .sidebar-logo { width:150px; } .page-content { padding-top:28px !important; } }

/* v3.4 · Professional export hub */
.export-hub{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:18px;
  align-items:stretch;
}
.export-tile{
  grid-column:span 4;
  min-height:330px;
  display:flex;
  flex-direction:column;
  background:var(--bg-elev);
  border:1px solid var(--line);
  padding:26px;
  position:relative;
  overflow:hidden;
}
.export-tile--wide{grid-column:span 6;min-height:350px}
.export-tile--featured{
  background:linear-gradient(180deg,var(--bg-elev) 0%,color-mix(in srgb,var(--bg-alt) 45%,var(--bg-elev)) 100%);
  color:var(--ink);
  border-color:var(--line);
  box-shadow:0 12px 34px rgba(20,20,20,.045);
}
.export-tile--featured::before{
  content:'';position:absolute;left:0;right:0;top:0;height:3px;background:var(--accent);opacity:.85;
}
.export-tile--featured .export-tile__tag,
.export-tile--featured .export-tile__head p,
.export-tile--featured .field label{color:var(--ink-muted)}
.export-tile--featured .input{background:var(--bg-elev);color:var(--ink);border-color:var(--line)}
.export-tile__head{display:grid;gap:11px}
.export-tile__tag{
  font-size:.66rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  font-weight:700;
  color:var(--ink-muted);
}
.export-tile__head h2{
  margin:0;
  padding:0 0 14px;
  border-bottom:1px solid currentColor;
  font-family:var(--font-serif);
  font-weight:400;
  font-size:1.65rem;
  line-height:1.05;
}
.export-tile__head p{
  margin:6px 0 0;
  color:var(--ink-muted);
  font-size:.82rem;
  line-height:1.55;
  max-width:52ch;
}
.export-tile__body{margin-top:22px;flex:1;display:flex;flex-direction:column;justify-content:flex-start}
.export-period{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.export-period .field,.export-year.field{margin:0}
.export-year{max-width:220px}
.export-tile__footer{
  margin-top:auto;
  padding-top:24px;
  display:flex;
  align-items:center;
  gap:10px;
}
.export-tile__footer--split{justify-content:space-between;flex-wrap:wrap}
.export-primary{min-width:190px;justify-content:center}
.export-preview{
  margin-top:18px;
  padding:15px;
  border:1px solid var(--line);
  background:var(--bg-alt);
  border-radius:var(--radius);
}
.export-preview__title{font-size:.68rem;letter-spacing:.14em;text-transform:uppercase;margin-bottom:12px;color:var(--ink-muted)}
.export-preview__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.export-preview__metric{display:grid;gap:3px;padding:10px 11px;border:1px solid var(--line-soft);background:var(--bg-elev);border-radius:var(--radius-sm)}
.export-preview__metric span{font-size:.72rem;color:var(--ink-muted)}
.export-preview__metric strong{font-size:.95rem;font-weight:600;color:var(--ink)}
.export-secondary-card{margin-top:22px}
.export-quick-periods{margin-top:6px;flex-wrap:wrap}
@media(max-width:1100px){
  .export-tile,.export-tile--wide{grid-column:span 6}
}
@media(max-width:720px){
  .export-hub{grid-template-columns:1fr}
  .export-tile,.export-tile--wide{grid-column:1;min-height:auto;padding:20px}
  .export-period{grid-template-columns:1fr}
  .export-tile__footer,.export-tile__footer--split{align-items:stretch;flex-direction:column}
  .export-tile__footer .btn{width:100%}
}

/* ============================================================================
   v3.8 · INDUSTRY-AWARE SHELL THEMES
   The business profile changes typography, geometry and navigation mood while
   all screens continue to share the same component system.
   ============================================================================ */
html[data-business-profile="fitness_studio"] .sidebar{background:#10261a!important}
html[data-business-profile="fitness_studio"] .nav-link.active{border-left-color:#80c99e!important}
html[data-business-profile="fitness_studio"] .page-head{border-bottom-color:var(--accent)!important}
html[data-business-profile="fitness_studio"] .page-head h1{font-family:'Manrope',sans-serif!important;font-size:clamp(2.6rem,5vw,4.8rem)!important;font-weight:600!important;letter-spacing:-.045em!important}
html[data-business-profile="fitness_studio"] .card,html[data-business-profile="fitness_studio"] .card-flat{border-radius:var(--radius)!important}
html[data-business-profile="fitness_studio"] .btn{border-radius:9px!important;text-transform:none;letter-spacing:.01em}
html[data-business-profile="fitness_studio"] .tab{border-radius:8px 8px 0 0}

html[data-business-profile="band"] .sidebar{background:#141210!important}
html[data-business-profile="band"] .nav-link.active{border-left-color:#d96d49!important;color:#fff!important}
html[data-business-profile="band"] .page-head{border-bottom:2px solid var(--accent)!important}
html[data-business-profile="band"] .page-head h1{font-family:'Space Grotesk',sans-serif!important;font-weight:600!important;letter-spacing:-.055em!important;text-transform:uppercase;font-size:clamp(2.8rem,6vw,5.6rem)!important}
html[data-business-profile="band"] .section-head h2,html[data-business-profile="band"] h2,html[data-business-profile="band"] h3{font-family:'Space Grotesk',sans-serif}
html[data-business-profile="band"] .card,html[data-business-profile="band"] .card-flat,html[data-business-profile="band"] .input,html[data-business-profile="band"] .select,html[data-business-profile="band"] .textarea,html[data-business-profile="band"] .btn{border-radius:0!important}
html[data-business-profile="band"] .eyebrow{color:var(--accent);font-weight:700}

html[data-business-profile="event_service"] .sidebar{background:#281c31!important}
html[data-business-profile="event_service"] .nav-link.active{border-left-color:#c6a4dc!important}
html[data-business-profile="event_service"] .page-head h1{font-family:'Space Grotesk',sans-serif!important;font-weight:500!important;letter-spacing:-.045em!important;font-size:clamp(2.8rem,5.5vw,5rem)!important}
html[data-business-profile="event_service"] .card{box-shadow:0 8px 30px rgba(49,32,61,.065)}

html[data-business-profile="consultant"] .sidebar{background:#172c3b!important}
html[data-business-profile="consultant"] .nav-link.active{border-left-color:#9fb9ca!important}
html[data-business-profile="consultant"] .page-head h1{font-family:'Libre Baskerville',Georgia,serif!important;font-weight:400!important;letter-spacing:-.03em!important;font-size:clamp(2.6rem,5vw,4.8rem)!important;line-height:1.03!important}
html[data-business-profile="consultant"] .section-head h2{font-family:'Libre Baskerville',Georgia,serif!important;font-size:1.45rem!important}

html[data-business-profile="generic"] .sidebar{background:#252a2e!important}
html[data-business-profile="generic"] .page-head h1{font-family:'Inter',sans-serif!important;font-weight:600!important;font-size:clamp(2.6rem,5vw,4.8rem)!important;letter-spacing:-.045em!important}
html[data-business-profile="generic"] h2,html[data-business-profile="generic"] h3{font-family:'Inter',sans-serif}

/* Resources */
.resource-kind-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--sp-3)}


/* ============================================================================
   v3.8.5 · Adaptive auth / login experience by business profile
   ============================================================================ */
.auth-hero-copy { display: grid; gap: 18px; align-content: start; }
.auth-brand-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.auth-pill {
  display: inline-flex; align-items: center; min-height: 30px;
  padding: 7px 12px; border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.82); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; background: rgba(255,255,255,.06);
}
.auth-form .eyebrow { color: var(--accent-soft); }
.auth-form .field label { letter-spacing: .12em; text-transform: uppercase; font-size: 11px; }
.auth-form .btn { min-height: 46px; }

html[data-business-profile="photography_studio"] .auth-hero {
  background: radial-gradient(circle at 18% 28%, rgba(255,255,255,.08) 0%, transparent 36%), linear-gradient(180deg, #050505 0%, #0d0d0d 100%) !important;
}
html[data-business-profile="photography_studio"] .auth-hero h1 { font-style: italic !important; }
html[data-business-profile="photography_studio"] .auth-pill { border-radius: 999px; }

html[data-business-profile="fitness_studio"] .auth-wrap { background: #eff4f1 !important; }
html[data-business-profile="fitness_studio"] .auth-hero {
  background: radial-gradient(circle at 75% 22%, rgba(66, 209, 146, .18) 0%, transparent 26%),
              linear-gradient(135deg, #09120e 0%, #11241a 55%, #183625 100%) !important;
}
html[data-business-profile="fitness_studio"] .auth-hero h1 {
  font-family: var(--font-sans) !important; font-style: normal !important; text-transform: uppercase;
  letter-spacing: -.05em !important; line-height: .86 !important;
}
html[data-business-profile="fitness_studio"] .auth-brand-kicker,
html[data-business-profile="fitness_studio"] #auth-brand-kicker { color: #8fdfb5 !important; }
html[data-business-profile="fitness_studio"] .auth-pill { border-radius: 999px; border-color: rgba(143,223,181,.35); color: #d8f4e4; background: rgba(20,92,63,.28); }
html[data-business-profile="fitness_studio"] .auth-form-wrap { background: #f2f5f3 !important; }
html[data-business-profile="fitness_studio"] .auth-form h2 { font-family: var(--font-sans) !important; text-transform: uppercase; letter-spacing: -.04em; }
html[data-business-profile="fitness_studio"] .auth-form .btn { border-radius: 999px !important; }

html[data-business-profile="band"] .auth-wrap { background: #f3eee8 !important; }
html[data-business-profile="band"] .auth-hero {
  background: radial-gradient(circle at 22% 26%, rgba(255, 188, 120, .17) 0%, transparent 32%),
              linear-gradient(140deg, #120f0d 0%, #251814 58%, #382118 100%) !important;
}
html[data-business-profile="band"] .auth-hero h1 { font-family: var(--font-sans) !important; font-style: normal !important; line-height: .84 !important; text-transform: uppercase; }
html[data-business-profile="band"] .auth-pill { border-radius: 3px; border-color: rgba(255,188,120,.28); color: #ffe2ca; background: rgba(158,63,34,.22); }
html[data-business-profile="band"] .auth-form-wrap { background: #f4eee6 !important; }
html[data-business-profile="band"] .auth-form h2 { font-family: var(--font-sans) !important; text-transform: uppercase; }
html[data-business-profile="band"] .auth-form .btn { border-radius: 3px !important; }

html[data-business-profile="event_service"] .auth-wrap { background: #f4f1f7 !important; }
html[data-business-profile="event_service"] .auth-hero {
  background: radial-gradient(circle at 80% 22%, rgba(183, 140, 223, .18) 0%, transparent 30%),
              linear-gradient(135deg, #1a1420 0%, #30203a 62%, #4a2f59 100%) !important;
}
html[data-business-profile="event_service"] .auth-hero h1 { font-family: var(--font-sans) !important; font-style: normal !important; letter-spacing: -.03em !important; }
html[data-business-profile="event_service"] .auth-pill { border-radius: 999px; border-color: rgba(210,183,233,.34); color: #f1e8f8; background: rgba(103,69,123,.22); }
html[data-business-profile="event_service"] .auth-form-wrap { background: #f7f3fa !important; }
html[data-business-profile="event_service"] .auth-form .btn { border-radius: 14px !important; }

html[data-business-profile="consultant"] .auth-wrap { background: #f2f0ea !important; }
html[data-business-profile="consultant"] .auth-hero {
  background: radial-gradient(circle at 18% 28%, rgba(255,255,255,.06) 0%, transparent 34%),
              linear-gradient(145deg, #14202a 0%, #223542 100%) !important;
}
html[data-business-profile="consultant"] .auth-hero h1 { font-family: var(--font-serif) !important; font-style: normal !important; line-height: .92 !important; }
html[data-business-profile="consultant"] .auth-pill { border-radius: 999px; border-color: rgba(194,214,228,.28); color: #e7eef4; background: rgba(41,75,99,.22); }
html[data-business-profile="consultant"] .auth-form-wrap { background: #f6f3ed !important; }
html[data-business-profile="consultant"] .auth-form h2 { font-family: var(--font-serif) !important; }

html[data-business-profile="generic"] .auth-wrap { background: #f3f4f4 !important; }
html[data-business-profile="generic"] .auth-hero {
  background: radial-gradient(circle at 78% 24%, rgba(255,255,255,.08) 0%, transparent 34%),
              linear-gradient(145deg, #171b1f 0%, #2d353c 100%) !important;
}
html[data-business-profile="generic"] .auth-hero h1 { font-family: var(--font-sans) !important; font-style: normal !important; line-height: .9 !important; }
html[data-business-profile="generic"] .auth-pill { border-radius: 999px; }
html[data-business-profile="generic"] .auth-form-wrap { background: #f4f5f5 !important; }

@media (max-width: 959px) {
  .auth-hero { min-height: auto; gap: 30px; }
  .auth-hero-copy { gap: 14px; }
  .auth-brand-pills { gap: 8px; }
}


/* ============================================================================
   v3.8.6 · Dashboard / resource UI sharpening
   ============================================================================ */
.kpi .kpi-label { color: var(--ink-muted) !important; }
.kpi .kpi-sub { color: var(--ink-muted) !important; }


/* v3.8.7 · definitive KPI card styling */
.kpi-grid { background: transparent !important; border: 0 !important; gap: 16px !important; }
.kpi { border: 1px solid var(--line) !important; border-radius: var(--radius-lg) !important; background: var(--bg-elev) !important; box-shadow: none !important; }
.kpi:hover { border-color: var(--ink-muted) !important; }

/* ============================================================================
   v3.8.9 · Tax Advisor Export Center
   ============================================================================ */
.tax-advisor-tile{grid-column:span 12;min-height:auto}
.tax-advisor-preview{display:grid;gap:14px;margin-top:18px;padding-top:18px;border-top:1px solid rgba(255,255,255,.18)}
.tax-advisor-issues{display:grid;gap:5px;padding:12px 14px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.06)}
.tax-advisor-ok{padding:10px 0;color:inherit;opacity:.85}
.tax-advisor-tile .export-preview__grid{grid-template-columns:repeat(6,minmax(0,1fr))}
@media(max-width:900px){.tax-advisor-tile .export-preview__grid{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* ============================================================================
   v3.9.8 · surface consistency / export polish
   ============================================================================ */
.export-tile{border-radius:var(--radius-lg);box-shadow:0 8px 26px rgba(20,20,20,.035)}
.tax-advisor-tile{
  background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 4%,var(--bg-elev)) 0%,var(--bg-elev) 100%);
}
.tax-advisor-tile::before{background:var(--accent)}
.tax-advisor-preview{margin-top:16px;display:grid;gap:12px}
.tax-advisor-issues{padding:13px 14px;border:1px solid color-mix(in srgb,var(--warn) 30%,var(--line));background:color-mix(in srgb,var(--warn) 6%,var(--bg-elev));border-radius:var(--radius);display:grid;gap:5px}
.tax-advisor-ok{padding:12px 14px;border:1px solid color-mix(in srgb,var(--success) 28%,var(--line));background:color-mix(in srgb,var(--success) 6%,var(--bg-elev));border-radius:var(--radius);color:var(--ink-soft)!important}
.export-secondary-card{background:var(--bg-elev)!important;color:var(--ink)!important}
.page-content .card,.page-content .card-flat,.page-content .export-tile{color:var(--ink)}


/* ==========================================================================
   v3.9.8 · export surface fix + control-plane branding
   ========================================================================== */
.export-hub .export-tile,
.export-secondary-card,
.export-secondary-card table,
.export-secondary-card .table,
.export-preview,
.export-preview__metric,
.tax-advisor-preview,
.tax-advisor-issues,
.tax-advisor-ok,
.page-content .export-tile,
.page-content .export-secondary-card{
  background:var(--bg-elev)!important;
  color:var(--ink)!important;
}
.export-secondary-card .card,
.export-secondary-card .card-flat,
.export-secondary-card .notice,
.export-secondary-card .field,
.export-secondary-card .input,
.export-secondary-card .select,
.export-secondary-card textarea,
.export-hub .input,
.export-hub select,
.export-hub textarea{
  background:var(--bg-elev)!important;
  color:var(--ink)!important;
}
.export-secondary-card .table th,
.export-secondary-card .table td,
.page-content .export-tile .field label,
.page-content .export-tile p,
.page-content .export-secondary-card p{color:var(--ink)!important}
.export-secondary-card .small,
.export-secondary-card .muted,
.export-hub .small,
.export-hub .muted{color:var(--ink-muted)!important}
.export-tile .btn,
.export-secondary-card .btn{box-shadow:none}
