/* SteuerFlow AI — App component styles */

/* ============ TYPOGRAPHY ============ */
.h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
.h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.25; }
.h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; margin: 0; line-height: 1.3; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); margin: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-secondary); }
.tertiary { color: var(--text-tertiary); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: var(--bg-app);
}
[data-sidebar="mini"] .app { grid-template-columns: var(--sidebar-w-mini) 1fr; }

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.sb-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
}
.sb-logo {
  width: 28px; height: 28px;
  background: var(--ink-950);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 14px;
  letter-spacing: -0.02em;
  position: relative;
}
.sb-logo::after {
  content: '';
  position: absolute;
  inset: auto 4px 4px auto;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 1.5px;
}
.sb-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; line-height: 1; }
.sb-name small { display: block; font-size: 10px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; white-space: nowrap; }
[data-sidebar="mini"] .sb-name, [data-sidebar="mini"] .sb-section-label { display: none; }
[data-sidebar="mini"] .sb-item-label { display: none; }
[data-sidebar="mini"] .sb-item { justify-content: center; padding: 0 0; }
[data-sidebar="mini"] .sb-brand { padding: 0; justify-content: center; }
[data-sidebar="mini"] .sb-footer { padding: 12px 8px; }

.sb-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 14px 12px 6px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 34px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  letter-spacing: -0.005em;
  position: relative;
}
.sb-item:hover { background: var(--bg-hover); color: var(--text); }
.sb-item[data-active="true"] {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 600;
}
.sb-item[data-active="true"]::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 7px; bottom: 7px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
[data-sidebar="mini"] .sb-item[data-active="true"]::before { display: none; }
[data-sidebar="mini"] .sb-item[data-active="true"] { background: var(--accent-soft); color: var(--accent-soft-text); }
.sb-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sb-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
[data-sidebar="mini"] .sb-badge { display: none; }

.sb-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.sb-user-info { line-height: 1.25; min-width: 0; flex: 1; }
.sb-user-info b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-info span { font-size: 11.5px; color: var(--text-tertiary); }
[data-sidebar="mini"] .sb-user-info { display: none; }

/* ============ MAIN AREA ============ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  flex-shrink: 0;
}
.tb-spacer { flex: 1; }

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}
.workspace-switcher:hover { background: var(--bg-hover); border-color: var(--border); }
.ws-avatar {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--ink-900), var(--ink-700));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.ws-info { line-height: 1.15; text-align: left; }
.ws-info b { font-weight: 600; font-size: 13px; }
.ws-info span { display: block; font-size: 11px; color: var(--text-tertiary); }

.tb-divider { width: 1px; height: 22px; background: var(--border); }

.month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.month-picker:hover { background: var(--bg-hover); }
.month-picker svg { color: var(--text-tertiary); }

.tb-action {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tb-action:hover { background: var(--bg-hover); color: var(--text); }
.tb-action .dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 1.5px solid var(--bg);
}

/* ============ POPOVERS ============ */
.popover {
  position: absolute;
  top: calc(100% + 6px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  z-index: 100;
  min-width: 260px;
  padding: 6px;
}
.po-section { padding: 6px 8px; font-size: 11px; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.po-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--text);
}
.po-item:hover { background: var(--bg-hover); }
.po-item .ws-avatar { width: 28px; height: 28px; }
.po-divider { height: 1px; background: var(--border-hairline); margin: 6px 0; }

/* ============ PAGE LAYOUT ============ */
.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.page {
  padding: var(--pad-section) 30px;
  max-width: 1400px;
  margin: 0 auto;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header .crumbs {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.page-title-row { display: flex; align-items: center; gap: 14px; }
.page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
  max-width: 720px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  height: 36px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: all 0.12s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:focus-visible { outline: none; box-shadow: var(--sh-ring); }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
[data-theme="dark"] .btn-primary { color: var(--ink-950); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* ============ CARDS ============ */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--pad-card);
  box-shadow: var(--sh-xs);
}
.card-flush { padding: 0; overflow: hidden; }
.card-header {
  padding: 14px var(--pad-card);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-body { padding: var(--pad-card); }

.stat-card .label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card .value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card .delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 8px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.stat-card .delta.up { color: var(--success); }
.stat-card .delta.down { color: var(--danger); }
.stat-card .sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--r-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-processing { background: var(--processing-bg); color: var(--processing); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }

/* ============ AI CONFIDENCE ============ */
.conf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.conf-bar {
  width: 38px;
  height: 5px;
  background: var(--ink-100);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .conf-bar { background: var(--bg-subtle); }
.conf-bar-fill { height: 100%; border-radius: var(--r-pill); }
.conf-high .conf-bar-fill, .conf-high .conf-dot { background: var(--success); }
.conf-mid .conf-bar-fill, .conf-mid .conf-dot { background: var(--warning); }
.conf-low .conf-bar-fill, .conf-low .conf-dot { background: var(--danger); }
.conf-high { color: var(--success); }
.conf-mid { color: var(--warning); }
.conf-low { color: var(--danger); }
.conf-dot { width: 7px; height: 7px; border-radius: 50%; }
.conf-badge {
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 600;
}
.conf-high.conf-badge { background: var(--success-bg); }
.conf-mid.conf-badge { background: var(--warning-bg); }
.conf-low.conf-badge { background: var(--danger-bg); }

/* ============ TABLES ============ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-app);
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ============ INPUTS ============ */
.input, .select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: all 0.12s ease;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: var(--sh-ring);
}
.input::placeholder { color: var(--text-tertiary); }
textarea.input { padding: 10px 12px; height: auto; resize: vertical; min-height: 80px; font-family: inherit; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.field-hint { font-size: 11.5px; color: var(--text-tertiary); }
.field-error { font-size: 11.5px; color: var(--danger); }

.search {
  position: relative;
  width: 280px;
}
.search input {
  padding-left: 34px;
  background: var(--bg-app);
}
.search svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

/* ============ TABS ============ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.tab:hover { color: var(--text); }
.tab[data-active="true"] {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

.seg {
  display: inline-flex;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 1px;
}
.seg button {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.seg button[data-active="true"] {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--sh-xs);
}

/* ============ CHECKLIST ============ */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-hairline);
}
.check-item:last-child { border-bottom: none; }
.check-circle {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.check-item.done .check-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.check-item.warn .check-circle {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}
.check-item .ci-body { flex: 1; }
.check-item .ci-title { font-size: 13.5px; font-weight: 500; }
.check-item.done .ci-title { color: var(--text-secondary); }
.check-item .ci-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }

/* ============ PROCESSING TIMELINE ============ */
.proc-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.proc-step {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}
.proc-step::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 32px;
  bottom: -12px;
  width: 2px;
  background: var(--border);
}
.proc-step:last-child::before { display: none; }
.proc-step .ps-mark {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
}
.proc-step.done .ps-mark { background: var(--success); border-color: var(--success); color: white; }
.proc-step.done::before { background: var(--success); }
.proc-step.active .ps-mark {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.proc-step.active .ps-label { color: var(--text); font-weight: 600; }
.ps-body { flex: 1; min-width: 0; }
.ps-label { font-size: 13.5px; font-weight: 500; }
.ps-meta { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

/* ============ DROPZONE ============ */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-xl);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-app);
  transition: all 0.16s ease;
}
.dropzone.hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dz-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-xl);
  background: var(--bg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* ============ EMPTY STATE ============ */
.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-secondary);
}
.empty-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--text-tertiary);
}

/* ============ GRID UTILS ============ */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }
.wrap { flex-wrap: wrap; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ============ NOTICES ============ */
.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 13px;
  align-items: flex-start;
  color: var(--text-secondary);
  line-height: 1.45;
}
.notice .nt-icon { flex-shrink: 0; margin-top: 1px; color: var(--text-tertiary); }
.notice b { color: var(--text); font-weight: 600; }
.notice-info { background: var(--info-bg); border-color: var(--info-border); color: #1e3a8a; }
.notice-info .nt-icon { color: var(--info); }
.notice-info b { color: #1e3a8a; }
[data-theme="dark"] .notice-info, [data-theme="dark"] .notice-info b { color: #bfdbfe; }
.notice-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #78350f; }
.notice-warning .nt-icon { color: var(--warning); }
.notice-warning b { color: #78350f; }
[data-theme="dark"] .notice-warning, [data-theme="dark"] .notice-warning b { color: #fde68a; }
.notice-success { background: var(--success-bg); border-color: var(--success-border); color: #064e3b; }
.notice-success .nt-icon { color: var(--success); }
.notice-success b { color: #064e3b; }
[data-theme="dark"] .notice-success, [data-theme="dark"] .notice-success b { color: #a7f3d0; }

/* ============ MISC ============ */
.divider { height: 1px; background: var(--border-hairline); }
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.donut {
  --p: 70;
  --c: var(--accent);
  width: 130px; height: 130px;
  border-radius: 50%;
  background:
    conic-gradient(var(--c) calc(var(--p) * 1%), var(--ink-100) 0);
  display: grid; place-items: center;
  position: relative;
}
[data-theme="dark"] .donut {
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-subtle) 0);
}
.donut::before {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--bg);
}
.donut-label {
  position: relative;
  text-align: center;
}
.donut-label b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.donut-label span { display: block; font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

/* Mini bar charts */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
}
.spark span {
  flex: 1;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.9;
}

/* Progress */
.progress {
  width: 100%;
  height: 6px;
  background: var(--ink-100);
  border-radius: 999px;
  overflow: hidden;
}
[data-theme="dark"] .progress { background: var(--bg-subtle); }
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Toast/floating job */
.job-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: 14px 16px;
  min-width: 280px;
  z-index: 200;
}

/* Doc viewer */
.doc-viewer {
  background: var(--bg-app);
  border-radius: var(--r-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.doc-viewer-toolbar {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.doc-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

/* Receipt mock */
.receipt {
  background: #fffdf7;
  width: 280px;
  padding: 26px 24px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: #1c1917;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.1);
  line-height: 1.55;
  position: relative;
  transform: rotate(-0.6deg);
}
.receipt::before, .receipt::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  background-image: linear-gradient(45deg, transparent 33%, #fffdf7 33%, #fffdf7 67%, transparent 67%);
  background-size: 14px 14px;
}
.receipt::before { top: -6px; background-position: 0 -6px; }
.receipt::after { bottom: -6px; background-position: 0 0; transform: rotate(180deg); }
.receipt hr { border: none; border-top: 1px dashed #a8a29e; margin: 8px 0; }
.receipt h4 { font-family: inherit; font-size: 13px; text-align: center; margin: 0 0 4px; letter-spacing: 0.04em; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 8px; }
.receipt .r-total { font-size: 13px; font-weight: 700; }

/* Highlight overlay on receipt */
.r-highlight {
  background: rgba(16, 185, 129, 0.22);
  outline: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 2px;
  padding: 0 2px;
  margin: 0 -2px;
}

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
  padding-top: 10px;
}
.bar-chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bar-chart .bar-fill {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, var(--accent), var(--acc-600));
  border-radius: 4px 4px 0 0;
  position: relative;
}
.bar-chart .bar-fill:hover { filter: brightness(1.05); }
.bar-chart .bar-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Line chart container */
.line-chart-wrap {
  position: relative;
  height: 200px;
  width: 100%;
}

/* Status chip in tables */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}

/* Loading skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-hover) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skel 1.4s infinite;
  border-radius: 4px;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Switch */
.switch {
  position: relative;
  width: 32px; height: 18px;
  background: var(--ink-200);
  border-radius: 999px;
  cursor: pointer;
  border: none;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
[data-theme="dark"] .switch { background: var(--ink-700); }
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--sh-xs);
  transition: transform 0.18s ease;
}
.switch[data-on="true"] { background: var(--accent); }
.switch[data-on="true"]::after { transform: translateX(14px); }

/* Mobile bottom nav */
.mbn {
  height: var(--bottomnav-h);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-bottom: 4px;
}
.mbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
}
.mbn-item[data-active="true"] { color: var(--accent); }
.mbn-fab {
  background: var(--accent);
  color: white;
  width: 52px; height: 52px;
  border-radius: 50%;
  align-self: center;
  display: flex; align-items: center; justify-content: center;
  border: none;
  box-shadow: 0 6px 16px rgba(16,185,129,0.35);
  margin-top: -16px;
}

/* Hover row group */
.hover-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
}
.hover-row:hover { background: var(--bg-hover); }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-app);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.chip.active { background: var(--ink-900); color: white; border-color: var(--ink-900); }
[data-theme="dark"] .chip.active { background: var(--ink-100); color: var(--ink-900); border-color: var(--ink-100); }
