/* ============================================================
   theme.css – Light/Dark Theme für AR-Workflow
   Wird NACH den Inline-Styles geladen und überschreibt nur im
   Dark-Mode. Das Dokument (A4-Papier) bleibt in beiden Modi hell.
   ============================================================ */

:root {
  /* Dark-Mode-Palette (zentral pflegbar) */
  --ar-bg: #12141f;
  --ar-surface: #1e2130;
  --ar-surface-2: #262a3d;
  --ar-text: #e2e4ee;
  --ar-muted: #a7acbf;
  --ar-soft: #767c91;
  --ar-border: #2a2e42;
  --ar-border-strong: #353a54;
  --ar-hover: #282d43;
  --ar-head-bg: #262a3d;
  --accent: #4fc3f7;
}

body { transition: background-color .25s ease, color .25s ease; }

/* ============================================================
   THEME-TOGGLE-BUTTON
   ============================================================ */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff; color: #666;
  cursor: pointer; font-size: 15px; transition: all .2s ease;
  flex-shrink: 0; margin-left: 8px;
}
.theme-toggle:hover { background: #f0f2f5; color: var(--accent); }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }

/* Button in dunklen Topbars */
.topnav .theme-toggle, .topbar .theme-toggle {
  background: transparent; border-color: rgba(255,255,255,.25);
  color: rgba(255,255,255,.8); margin-left: 8px;
}
.topnav .theme-toggle:hover, .topbar .theme-toggle:hover {
  background: rgba(255,255,255,.12); color: #fff;
}

/* Login: Button oben rechts fixieren (hell auf dunklem Verlauf) */
.theme-toggle-floating { position: fixed; top: 16px; right: 16px; z-index: 9999; }
.theme-toggle-floating .theme-toggle { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; margin-left: 0; }
.theme-toggle-floating .theme-toggle:hover { background: rgba(255,255,255,.2); }

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] { color-scheme: dark; }

[data-theme="dark"] body { background: var(--ar-bg); color: var(--ar-text); }

/* Kopfzeilen */
[data-theme="dark"] .topnav,
[data-theme="dark"] .topbar { background: #0c0e18; }

/* Karten & Flächen */
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .upload-box,
[data-theme="dark"] .login-card {
  background: var(--ar-surface);
  box-shadow: 0 2px 12px rgba(0,0,0,.45);
}
[data-theme="dark"] .sidebar { background: #181b28; border-color: var(--ar-border); }
[data-theme="dark"] .upload-zone { background: #1a1d2b; }
[data-theme="dark"] .sidebar h4 { background: var(--ar-head-bg); color: var(--ar-muted); }

/* Text */
[data-theme="dark"] .stat-label,
[data-theme="dark"] .form-group label { color: var(--ar-muted); }
[data-theme="dark"] .desc-preview,
[data-theme="dark"] .empty,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .activity-time,
[data-theme="dark"] .login-footer { color: var(--ar-soft); }
[data-theme="dark"] .login-header p { color: var(--ar-muted); }
[data-theme="dark"] .login-header h1 { color: var(--ar-text); }

/* Tabellen */
[data-theme="dark"] th { background: var(--ar-head-bg); color: var(--ar-muted); }
[data-theme="dark"] td { border-color: var(--ar-border); }
[data-theme="dark"] tr:hover td { background: var(--ar-hover); }

/* Rahmen / Trennlinien */
[data-theme="dark"] .card-header,
[data-theme="dark"] .activity-item,
[data-theme="dark"] .kat-group,
[data-theme="dark"] .article-item { border-color: var(--ar-border); }
[data-theme="dark"] .article-item:hover { background: var(--ar-hover); }

/* Eingabefelder */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--ar-surface-2); color: var(--ar-text); border-color: var(--ar-border-strong);
}
[data-theme="dark"] input::placeholder { color: var(--ar-soft); }

/* Artikelnummer & Preise heller für Kontrast */
[data-theme="dark"] .art-nr { color: var(--ar-soft); }
[data-theme="dark"] .article-item .price,
[data-theme="dark"] .stat-card .stat-number { color: #6ea8fe; }
[data-theme="dark"] .stat-card.green .stat-number { color: #2ecc71; }
[data-theme="dark"] .stat-card.orange .stat-number { color: #f5b041; }
[data-theme="dark"] .stat-card.blue .stat-number { color: #4fc3f7; }

/* Tabs (Kundenverwaltung) */
[data-theme="dark"] .tab { background: var(--ar-surface-2); color: var(--ar-muted); }
[data-theme="dark"] .tab.active { background: var(--ar-surface); color: var(--accent); }

/* ============================================================
   DOKUMENT-VORSCHAU (A4 "Papier") bleibt in beiden Modi hell
   ============================================================ */
[data-theme="dark"] .doc-page { background: #fff; color: #1a1a2e; }
[data-theme="dark"] .doc-page input,
[data-theme="dark"] .doc-page textarea { background: transparent; color: #1a1a2e; }
