/* theme.css — WealthPilot design system (Light/Dark, RTL/LTR, Mobile-first) */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --border: #e3e8f0;
  --text: #1a2333; --muted: #64748b;
  --primary: #4f46e5; --primary-2: #7c3aed; --primary-soft: #eef2ff;
  --success: #16a34a; --success-soft: #dcfce7;
  --danger: #dc2626; --danger-soft: #fee2e2;
  --warn: #d97706; --warn-soft: #fef3c7;
  --info: #0284c7; --info-soft: #e0f2fe;
  --radius: 12px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.06);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
[data-theme="dark"] {
  --bg: #0f172a; --panel: #1e293b; --border: #334155;
  --text: #e2e8f0; --muted: #94a3b8;
  --primary: #818cf8; --primary-2: #a78bfa; --primary-soft: #312e81;
  --success: #4ade80; --success-soft: #14532d;
  --danger: #f87171; --danger-soft: #7f1d1d;
  --warn: #fbbf24; --warn-soft: #78350f;
  --info: #38bdf8; --info-soft: #0c4a6e;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; overflow-x: hidden; width: 100%; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 17px; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 17px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--primary-soft); }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lang-switch button { border: none; background: var(--panel); color: var(--muted); padding: 6px 12px; font-weight: 600; font-size: 13px; }
.lang-switch button.active { background: var(--primary); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--panel); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-chip .nm { font-weight: 600; font-size: 13px; }

/* ── Sidebar (OnlineStores pattern) ── */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 250px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar .nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px; border: none; background: transparent; width: 100%; text-align: left; }
.sidebar .nav-item:hover { background: var(--primary-soft); color: var(--primary); }
.sidebar .nav-item.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: var(--shadow); }
.sidebar .nav-item .ic { width: 20px; text-align: center; font-size: 16px; }
.sidebar .nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding: 16px 14px 6px; font-weight: 700; }
.main-content { flex: 1; padding: 22px; overflow-x: hidden; }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .sidebar .nav-item { text-align: right; }

/* ── Cards ── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .main-content { padding: 14px; } }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .val { font-size: 22px; font-weight: 800; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .val.up { color: var(--success); } .stat .val.down { color: var(--danger); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; transition: .15s; }
.btn:hover { background: var(--primary-soft); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-success { background: var(--success); color: #fff; border: none; }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-border { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field > span, .field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field > input, .field input[type="email"], .field input[type="password"] { width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel); color: var(--text); outline: none; transition: .15s; }
.field > input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input, .select, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel); color: var(--text); outline: none; transition: .15s; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.err { border-color: var(--danger); }

/* ── DataTable ── */
.dt-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dt-toolbar { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.dt-toolbar .spacer { flex: 1; }
.dt-toolbar .input, .dt-toolbar .select { width: auto; min-width: 130px; }
.dt-table { width: 100%; border-collapse: collapse; }
.dt-table th { text-align: left; padding: 10px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap; cursor: pointer; user-select: none; }
.dt-table th .sort { opacity: .4; margin-left: 4px; }
.dt-table th.sortable:hover { color: var(--primary); }
.dt-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dt-table tr:last-child td { border-bottom: none; }
.dt-table tbody tr:hover { background: var(--primary-soft); }
.dt-footer { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.dt-footer .spacer { flex: 1; }
.dt-pages { display: flex; gap: 4px; }
.dt-pages button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-weight: 600; }
.dt-pages button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dt-pages button:disabled { opacity: .4; cursor: default; }
.dt-empty { padding: 34px; text-align: center; color: var(--muted); }
.dt-search input { width: 220px; max-width: 100%; }
.dt-total { font-weight: 600; }
.dt-loading .dt-body { opacity: .5; pointer-events: none; }
[dir="rtl"] .dt-table th { text-align: right; }

/* ── Badges / chips ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.purple { background: var(--primary-soft); color: var(--primary); }
.badge.gray { background: var(--bg); color: var(--muted); }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--panel); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { flex: 1; margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 11px 18px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; animation: slideup .2s ease; max-width: 92vw; }
.toast.ok { border-left: 4px solid var(--success); }
.toast.err { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }
@keyframes slideup { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Spinner ── */
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.hide { display: none !important; }

/* ── Auth pages (user-login / admin-login) ── */
.auth-body, .auth-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; position: relative;
  background:
    radial-gradient(1000px 420px at 88% -8%, var(--primary-soft), transparent 62%),
    radial-gradient(800px 380px at -8% 108%, var(--primary-soft), transparent 58%),
    var(--bg);
}
.auth-topbar { position: absolute; top: 16px; right: 20px; display: flex; gap: 10px; z-index: 5; }
[dir="rtl"] .auth-topbar { right: auto; left: 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow); padding: 32px 30px 26px; animation: pop .2s ease;
}
.auth-brand { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.auth-brand h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-brand .brand-emoji { font-size: 30px; line-height: 1; }
.auth-brand > span { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.auth-brand .muted { flex-basis: 100%; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 6px 0 22px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 20px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 13px; }

/* password wrapper + eye toggle */
.pw-wrap, .pass-wrap { position: relative; }
.pw-wrap input { width: 100%; padding: 9px 44px 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel); color: var(--text); outline: none; transition: .15s; }
.pw-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pass-wrap input { padding-right: 44px; }
[dir="rtl"] .pw-wrap input { padding: 9px 12px 9px 44px; }
[dir="rtl"] .pass-wrap input { padding-right: 12px; padding-left: 44px; }
.eye-btn, .eye {
  position: absolute; top: 50%; transform: translateY(-50%); right: 6px;
  width: 34px; height: 34px; border: none; background: transparent; color: var(--muted);
  font-size: 17px; border-radius: 8px; display: grid; place-items: center; line-height: 1;
}
.eye-btn:hover, .eye:hover { background: var(--primary-soft); color: var(--primary); }
[dir="rtl"] .eye-btn, [dir="rtl"] .eye { right: auto; left: 6px; }

/* admin-login form controls */
.f-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
.f-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text); outline: none; transition: .15s; }
.f-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.muted { color: var(--muted); }

/* button modifiers used on auth pages */
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.block, .btn-block { width: 100%; justify-content: center; margin-top: 8px; }

/* ── Tabs inside section ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 16px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Charts placeholder ── */
.chart-box { height: 240px; display: flex; align-items: center; justify-content: center; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg);
  padding: 8px; overflow: hidden; }
.chart-box:has(.wp-chart-shell) { height: auto; display: block; padding: 0; border: none; background: transparent; }

/* ── Interactive chart shell (tooltip / legend / zoom) ── */
.wp-chart-shell { position: relative; width: 100%; }
.wp-chart-shell canvas { display: block; cursor: crosshair; touch-action: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.wp-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 120px; max-width: 260px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.14);
  padding: 8px 10px; font-size: 12px; line-height: 1.5; color: var(--text); }
.wp-tip .wp-tip-date { font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.wp-tip .wp-tip-row { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.wp-tip .wp-tip-row b { font-variant-numeric: tabular-nums; }
.wp-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.wp-leg { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--bg); color: var(--text); font-size: 12px; cursor: pointer; transition: .15s; }
.wp-leg:hover { border-color: var(--primary); }
.wp-leg.off { opacity: .45; text-decoration: line-through; }
.wp-leg .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.wp-reset { margin-left: auto; font-size: 12px; padding: 3px 10px; }
[dir="rtl"] .wp-reset { margin-left: 0; margin-right: auto; }

/* ── Market charts ── */
.chart-canvas { width: 100%; height: 280px; display: block; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius); }
.live-row { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.live-row:last-child { border-bottom: none; }
.live-sym { font-weight: 600; }
.live-price { font-variant-numeric: tabular-nums; }
.live-up { color: #10b981; }
.live-down { color: #ef4444; }
.keys-ok { color: #10b981; }
.keys-missing { color: #f59e0b; }
.watch-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 3px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 13px; }
.watch-chip .x { cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 4px; }
.watch-chip .x:hover { color: #ef4444; }
.bot-state-on { color: #10b981; font-weight: 700; }
.bot-state-off { color: var(--muted); }
.stream-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #10b981; margin-right: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Misc ── */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.text-up { color: var(--success); } .text-down { color: var(--danger); }
.mono { font-variant-numeric: tabular-nums; }
.small { font-size: 12.5px; color: var(--muted); }

/* ── New panels: uploaded files / notable / whatif-history / orders ── */
.file-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.file-row:last-child { border-bottom: none; }
.file-row .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .file-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.panel-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.panel-row .field { flex: 1 1 180px; }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; }

/* ── Mobile sidebar ── */
.menu-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 90; display: none; }
.menu-overlay.open { display: block; }
/* Base: hamburger hidden on desktop — MUST stay BEFORE the media query
   so the mobile rule below wins (same specificity → source order). */
.hamburger { display: none; background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 16px; line-height: 1;
  align-items: center; justify-content: center; width: 38px; height: 38px; }
.hamburger:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 860px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 95; transform: translateX(-100%);
    transition: transform .22s ease; width: 270px; padding-top: 66px; box-shadow: var(--shadow); }
  [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════
   ── Admin dashboard layout (compat with admin-dashboard.html) ──
   ═══════════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 18px; }
.section h3 { margin: 0 0 12px; font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
[dir="rtl"] .topbar-right { margin-left: 0; margin-right: auto; }

/* sidebar header/footer/backdrop/group-title */
.sidebar-header { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 89; display: none; }
.sidebar-backdrop.open { display: block; }
.nav-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 14px 16px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }

/* cards container + card-head/label/value (app.js / admin.js) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.card-value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card-value.pos { color: #10b981; }
.card-value.neg { color: #ef4444; }
.card-value.danger { color: var(--danger); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px; }
.stat-card { text-align: center; padding: 20px 14px; }
.stat-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-value.up { color: #10b981; }
.stat-value.down { color: #ef4444; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }

/* buttons: space-separated modifiers (datatable.js uses `btn ghost sm`) */
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.ok { background: linear-gradient(135deg, var(--success), #059669); color: #fff; border: none; }
.btn.danger { background: linear-gradient(135deg, var(--danger), #b91c1c); color: #fff; border: none; }
.btn.success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; border: none; }
.btn-ok { background: linear-gradient(135deg, var(--success), #059669); color: #fff; border: none; }
.btn-ok:hover { filter: brightness(1.1); }

/* badges: dashed-name variants (admin.js/app.js) */
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-admin { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.badge-zelle { background: var(--primary-soft); color: var(--primary); }
.badge-manual { background: var(--warn-soft); color: var(--warn); }

/* plain table (admin-dashboard.html) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.table th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); }
[dir="rtl"] .table th { text-align: right; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--primary-soft); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; }
.pagination button { min-width: 32px; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* DataTable extra pieces (datatable.js) */
.dt { display: flex; flex-direction: column; gap: 10px; }
.dt-search input { min-width: 200px; }
@media (max-width: 560px) { .dt-search { width: 100%; } .dt-search input { min-width: 0; width: 100%; } }
.dt-body { width: 100%; }
.dt-total { font-weight: 800; color: var(--primary); }
.dt-page, .dt-pages { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.dt-pager { display: inline-flex; align-items: center; gap: 6px; }

/* toast-box (toast.js) — alias of toast-wrap */
.toast-box { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
[dir="rtl"] .toast-box { right: auto; left: 16px; }

/* modal-backdrop (user-dashboard.html / app.js) — alias of modal-overlay */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex;
  align-items: center; justify-content: center; z-index: 200; padding: 20px; }

/* dropzone (upload) */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 34px 20px;
  text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: var(--bg); }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* utils */
.w-auto { width: auto !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.gap { gap: 10px; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.pos { color: #10b981 !important; }
.neg { color: #ef4444 !important; }
.danger { color: var(--danger) !important; }

/* ── DataTable footer controls (datatable.js) ── */
.dt-pager { display: flex; align-items: center; gap: 8px; }
.dt-prev, .dt-next, .dt-export { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.dt-total, .dt-page { font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-pages b { font-weight: 700; }

/* ── User dashboard sections (user-dashboard.html) ── */
.sec { display: none; }
.sec.active { display: block; animation: slideup .18s ease; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap; }
.sec-head h2 { font-size: 18px; font-weight: 700; margin: 0; }

/* ── Indices TREE checklist (app.js ix*) ── */
.ix-btn-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ix-scroll { max-height: 380px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px; background: var(--bg); }
.ix-group { margin-bottom: 2px; }
.ix-group-hdr { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--text); padding: 6px 4px; border-radius: 6px; cursor: pointer; user-select: none; }
.ix-group-hdr:hover { background: var(--primary-soft); }
.ix-chev { display: inline-flex; align-items: center; justify-content: center; width: 14px;
  font-size: 10px; color: var(--muted); cursor: pointer; }
.ix-gsel { width: auto; margin: 0; cursor: pointer; accent-color: var(--primary); }
.ix-group-hdr .g-name { flex: 0 1 auto; white-space: nowrap; }
.ix-group-hdr .g-cnt { font-size: 10px; font-weight: 700; background: var(--primary-soft);
  color: var(--primary); border-radius: 10px; padding: 1px 8px; margin-left: 2px; white-space: nowrap; }
.ix-group-hdr .g-act { margin-left: auto; display: flex; gap: 4px; }
.ix-group-hdr .mini { font-size: 10px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer; line-height: 1.5; }
.ix-group-hdr .mini:hover { border-color: var(--primary); color: var(--primary); }
.ix-children { border-left: 1px solid var(--border); margin-left: 6px; padding-left: 8px;
  margin-top: 2px; margin-bottom: 4px; }
[dir="rtl"] .ix-children { border-left: none; border-right: 1px solid var(--border);
  margin-left: 0; margin-right: 6px; padding-left: 0; padding-right: 8px; }
.idx-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 12.5px;
  cursor: pointer; border-radius: 6px; }
.idx-row:hover { background: var(--primary-soft); }
.idx-row input { width: auto; cursor: pointer; margin: 0; accent-color: var(--primary); }
.idx-row .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text); white-space: nowrap; }
.idx-row .idx-lbl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-empty { font-size: 12px; color: var(--muted); padding: 6px 2px 8px; font-style: italic; }
#ixChart { width: 100%; }

