@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Figtree:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════════
   ORION ACCOUNTS ERP — Dark Luxury UI v2
   ═══════════════════════════════════════════════ */

:root {
  /* === LIGHT THEME — inverted from dark === */
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --card: #f8fafc;
  --card2: #eef2f7;
  --ink: #0f1e2e;
  --muted: #6b7d93;
  --border: rgba(15,40,70,0.10);
  --border2: rgba(15,40,70,0.18);
  --primary: #b07c10;
  --primary-2: #c89320;
  --accent: #d49a1a;
  --accent-2: #b07c10;
  --gold: #b07c10;
  --gold2: #d49a1a;
  --gold-dim: rgba(176,124,16,0.10);
  --blue: #1d6fa4;
  --blue-dim: rgba(29,111,164,0.10);
  --teal: #1a8a72;
  --teal-dim: rgba(26,138,114,0.10);
  --red: #c0392b;
  --red-dim: rgba(192,57,43,0.10);
  --green: #16a34a;
  --green-dim: rgba(22,163,74,0.10);
  --amber: #d97706;
  --text-primary: #0f1e2e;
  --text2: #4a5568;
  --text3: #6b7d93;
  --shadow: 0 4px 24px rgba(15,40,70,0.10);
  --shadow-soft: 0 2px 12px rgba(15,40,70,0.07);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --odoo-primary: var(--primary);
  --odoo-primary-soft: var(--gold-dim);
  --odoo-text: var(--ink);
  --odoo-muted: var(--muted);
  --odoo-border: var(--border);
  --odoo-border-soft: var(--border);
  --odoo-surface: var(--surface-strong);
  --odoo-surface-soft: var(--card);
  --odoo-sidebar-width: 264px;
  --odoo-sidebar-collapsed: 80px;
  --odoo-topbar-height: 60px;
  --odoo-radius: var(--radius-sm);
  --v-primary: var(--primary);
  --v-text: var(--ink);
  --v-muted: var(--muted);
  --v-good: var(--green);
  --v-danger: var(--red);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--ink);
  direction: ltr;
  font-family: 'Figtree','Segoe UI',Tahoma,sans-serif;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}

body::before, body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: 0; left: 0;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.06), transparent 70%);
}

body::after {
  right: 0; bottom: 0;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,158,255,0.05), transparent 70%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* ───────────────────────────────────────
   SCROLLBAR
─────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.3) rgba(255,255,255,0.05);
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
*::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.25); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.4); }

/* ───────────────────────────────────────
   SHELL
─────────────────────────────────────── */
.app-shell, .auth-shell {
  position: relative;
  z-index: 1;
}

.app-shell.has-sidebar .container {
  padding-inline-start: calc(var(--odoo-sidebar-width) + 18px);
}

/* ───────────────────────────────────────
   HEADER
─────────────────────────────────────── */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  color: var(--ink);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(201,168,76,0.04) 0%, transparent 50%, rgba(74,158,255,0.03) 100%);
  pointer-events: none;
}

.header-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.header-side.left { align-items: flex-start; text-align: left; }
.header-side.right { align-items: flex-end; text-align: left; }

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Figtree', sans-serif;
  letter-spacing: 0;
}

.header-subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.header-subtitle a { color: var(--gold); }

.header-center {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-logo {
  width: auto;
  height: 44px;
  max-width: 120px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
}

/* ───────────────────────────────────────
   DATE BAR
─────────────────────────────────────── */
.date-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 8px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  position: sticky;
  top: var(--odoo-topbar-height);
  z-index: 90;
}

.date-item span {
  font-weight: 700;
  color: var(--gold);
  margin-inline-start: 5px;
}

.date-author {
  margin-inline-start: auto;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* ───────────────────────────────────────
   CONTAINER
─────────────────────────────────────── */
.container {
  max-width: none;
  margin: 0 auto;
  padding: 18px 24px 32px;
}

/* ───────────────────────────────────────
   FLASH / ALERTS
─────────────────────────────────────── */
.flash-stack { display: grid; gap: 10px; margin-bottom: 14px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.7;
}

.alert.success {
  background: rgba(52,211,153,0.08);
  border-color: rgba(52,211,153,0.25);
  color: var(--green);
}

.alert.error {
  background: rgba(255,92,92,0.08);
  border-color: rgba(255,92,92,0.25);
  color: var(--red);
}

/* ───────────────────────────────────────
   PANELS / CARDS
─────────────────────────────────────── */
.panel,
.filters-card,
.table-card,
.chart-card,
.summary-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
}

.panel-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.panel-subtitle {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

.panel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.2);
  font-size: 11px;
  font-weight: 700;
}

/* ───────────────────────────────────────
   TABS
─────────────────────────────────────── */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 13px;
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.is-active {
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: #06091a;
}

.tab-panel { display: none; margin-top: 14px; }
.tab-panel.is-active { display: block; }

/* ───────────────────────────────────────
   SECTION HEADINGS
─────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.section-heading span {
  font-size: 11px;
  color: var(--muted);
}

/* ───────────────────────────────────────
   FORM GRIDS
─────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }

/* ───────────────────────────────────────
   DESIGN BUILDER CARDS
─────────────────────────────────────── */
.design-builder-grid { display: grid; gap: 12px; margin-top: 8px; }

.design-section-card {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border2);
  background: rgba(255,255,255,0.03);
  padding: 14px;
}

.design-style-classic { border-color: rgba(201,168,76,0.2); background: rgba(201,168,76,0.04); }
.design-style-glass { border-color: rgba(74,158,255,0.2); background: rgba(74,158,255,0.04); }
.design-style-sunset { border-color: rgba(255,92,92,0.2); background: rgba(255,92,92,0.04); }
.design-style-forest { border-color: rgba(52,211,153,0.2); background: rgba(52,211,153,0.04); }
.design-style-royal { border-color: rgba(139,92,246,0.2); background: rgba(139,92,246,0.04); }

.design-compare-grid { display: grid; gap: 10px; margin-top: 6px; }

.design-compare-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.design-report-skin .chart-card { border-width: 2px; }

/* ───────────────────────────────────────
   FIELD / FORM INPUTS
─────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input,
.field select,
.field textarea,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="search"],
input[type="email"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 38px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(201,168,76,0.55);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

.field input[readonly],
input[readonly],
textarea[readonly] {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}

.field textarea,
textarea {
  min-height: 88px;
  resize: vertical;
}

.field-help, .hint, .helper, .muted {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stacked { display: grid; gap: 12px; }

/* ───────────────────────────────────────
   BUTTONS
─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  font-size: 13px;
  min-height: 36px;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; opacity: 0.4; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--gold), var(--primary));
  color: #06091a;
  font-weight: 800;
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border: 1px solid var(--border2);
}

.btn-secondary:hover { background: rgba(255,255,255,0.10); }

.btn-danger {
  background: rgba(255,92,92,0.1);
  color: var(--red);
  border: 1px solid rgba(255,92,92,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border2);
}

.btn-ghost:hover { background: var(--gold-dim); border-color: rgba(201,168,76,0.3); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  min-height: 30px;
}

.icon-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

.icon-btn.danger {
  background: rgba(255,92,92,0.08);
  color: var(--red);
  border-color: rgba(255,92,92,0.2);
}

.icon-btn.danger:hover { background: rgba(255,92,92,0.16); }

.icon-btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--gold));
  color: #06091a;
  border-color: transparent;
}

.icon-btn.warning {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.1);
  color: var(--amber);
}

/* ───────────────────────────────────────
   KPI CARDS
─────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 18px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  min-height: 116px;
  transition: border-color 0.2s;
}

.kpi-card:hover { border-color: var(--border2); }

.kpi-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(201,168,76,0.06);
}

.kpi-card.c-purple::after { background: rgba(139,92,246,0.1); }
.kpi-card.c-pink::after { background: rgba(255,92,92,0.1); }
.kpi-card.c-blue::after { background: rgba(74,158,255,0.1); }
.kpi-card.c-green::after { background: rgba(52,211,153,0.1); }
.kpi-card.c-orange::after { background: rgba(245,158,11,0.1); }
.kpi-card.c-cyan::after { background: rgba(34,211,200,0.1); }
.kpi-card.c-rose::after { background: rgba(255,92,92,0.1); }
.kpi-card.c-indigo::after { background: rgba(99,102,241,0.1); }

.c-purple, .c-pink, .c-blue, .c-green,
.c-orange, .c-cyan, .c-rose, .c-indigo {
  background: var(--surface-strong);
  color: var(--ink);
  border: 1px solid var(--border);
}

.kpi-icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gold-dim);
  color: var(--gold);
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-transform: uppercase;
}

.kpi-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

/* ───────────────────────────────────────
   CHARTS
─────────────────────────────────────── */
.charts-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.charts-grid.three { grid-template-columns: 1.15fr 0.95fr 1fr; }
.charts-grid.two { grid-template-columns: 1fr 1fr; }

.chart-card { padding: 18px; }

.chart-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.chart-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-empty {
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border2);
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.chart-subnote { margin-top: -2px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }

/* ───────────────────────────────────────
   DONUT CHARTS
─────────────────────────────────────── */
.donut-wrap {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 16px;
  align-items: center;
}

.donut {
  position: relative;
  width: 166px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0deg 120deg, var(--blue) 120deg 210deg, var(--teal) 210deg 280deg, var(--red) 280deg 360deg);
  margin-inline: auto;
}

.donut::after {
  content: '';
  position: absolute;
  inset: 21%;
  border-radius: 50%;
  background: var(--surface-strong);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  padding: 0 18px;
}

.donut-center .big {
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.donut-center .small {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.section-donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.section-donut {
  position: relative;
  width: 168px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  margin-inline: auto;
}

.section-donut::after {
  content: '';
  position: absolute;
  inset: 23%;
  border-radius: 50%;
  background: var(--surface-strong);
}

.section-donut.as-pie::after { display: none; }

.section-donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 14px;
}

.section-donut-center .big {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}

.section-donut-center .small {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
}

/* ───────────────────────────────────────
   BAR LISTS
─────────────────────────────────────── */
.bar-list { display: flex; flex-direction: column; gap: 12px; }

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 64px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.bar-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); font-weight: 700; }

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--gold));
}

.bar-value { text-align: left; color: var(--gold); font-weight: 700; white-space: nowrap; }

.legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 11px; color: var(--muted); }

.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ───────────────────────────────────────
   SECTION SUMMARY
─────────────────────────────────────── */
.section-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.section-summary-tile {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--card);
}

.section-summary-tile .summary-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.section-summary-tile .summary-value { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--gold); }

.section-detail-table { margin-top: 10px; }

.line-chart-wrap {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 10px 12px 12px;
}

.line-chart-svg { width: 100%; height: auto; display: block; }

.line-axis-labels { margin-top: 8px; display: flex; gap: 10px; overflow: auto; padding-bottom: 2px; }
.line-axis-labels span { font-size: 10px; color: var(--muted); white-space: nowrap; min-width: 70px; }

/* ───────────────────────────────────────
   COMPARISON
─────────────────────────────────────── */
.comparison-list { display: grid; gap: 12px; }

.comparison-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.comparison-row-label { font-weight: 700; color: var(--gold); line-height: 1.5; padding-top: 4px; }
.comparison-bars { display: grid; gap: 10px; }
.comparison-bar-row { display: grid; grid-template-columns: 1fr 72px; gap: 10px; align-items: center; }
.comparison-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.07); }
.comparison-fill { display: block; height: 100%; border-radius: 999px; }
.comparison-value { text-align: left; color: var(--gold); font-weight: 700; white-space: nowrap; font-size: 12px; }

/* ───────────────────────────────────────
   FILTERS CARD
─────────────────────────────────────── */
.filters-card { padding: 16px; margin-bottom: 16px; }

.filters-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(6, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

/* ───────────────────────────────────────
   TABLE CARD
─────────────────────────────────────── */
.table-card { padding: 0; overflow: hidden; }

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.table-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.table-header .hint { font-size: 12px; color: var(--muted); }

.table-wrap {
  overflow: auto;
  border-radius: 0;
}

.data-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  vertical-align: middle;
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card2);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 11px;
}

.data-table td { color: var(--ink); background: transparent; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.025); }
.data-table tfoot th, .data-table tfoot td { background: var(--card2); font-weight: 700; color: var(--gold); }
.data-table tbody tr.is-row-selected td { background: rgba(201,168,76,0.08) !important; }

.nowrap { white-space: nowrap; }
.text-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────────────────────────────────
   BADGES
─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-soft { background: var(--gold-dim); color: var(--gold); border-color: rgba(201,168,76,0.2); }
.badge-green { background: rgba(52,211,153,0.1); color: var(--green); border-color: rgba(52,211,153,0.25); }
.badge-yellow { background: rgba(245,158,11,0.1); color: var(--amber); border-color: rgba(245,158,11,0.25); }
.badge-red { background: rgba(255,92,92,0.1); color: var(--red); border-color: rgba(255,92,92,0.25); }

/* ───────────────────────────────────────
   ACTIONS
─────────────────────────────────────── */
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ───────────────────────────────────────
   PAGINATION
─────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.page-links { display: flex; gap: 5px; flex-wrap: wrap; }

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-link:hover { border-color: var(--gold); color: var(--gold); }

.page-link.is-active {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(201,168,76,0.3);
}

/* ───────────────────────────────────────
   FOOTER
─────────────────────────────────────── */
.footer {
  margin-top: 18px;
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 12px;
}

/* ───────────────────────────────────────
   FLOATING BUTTONS
─────────────────────────────────────── */
.floating-print-btn {
  position: fixed;
  left: 20px; bottom: 20px;
  z-index: 1000;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: #06091a;
  background: linear-gradient(135deg, var(--accent-2), var(--gold));
  font-weight: 800;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(201,168,76,0.3);
  transition: transform 0.18s;
}

.floating-print-btn:hover { transform: translateY(-2px); }

.floating-back-btn {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--border2);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  transition: transform 0.18s;
}

.floating-back-btn:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--gold); }

/* ───────────────────────────────────────
   SIDEBAR (standard + collapsed)
─────────────────────────────────────── */
.app-shell.has-sidebar { min-height: 100vh; }

.site-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--odoo-sidebar-width);
  height: 100vh;
  border: 0;
  border-inline-end: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0;
  padding: 16px 10px;
  z-index: 150;
  transition: width 0.2s ease;
  overflow: hidden;
}

.site-sidebar__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}

.site-sidebar__hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 12px;
}

.site-sidebar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.site-sidebar__logo-card {
  width: 72px; height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  padding: 8px;
  border: 1px solid var(--border2);
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
}

.site-sidebar__logo-card img { width: 100%; height: 100%; object-fit: contain; }

.site-sidebar__eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.site-sidebar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.05);
  color: var(--gold);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
}

.site-sidebar__toggle:hover { background: var(--gold-dim); }

.site-sidebar__username {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.site-sidebar__school { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 4px; }

.site-sidebar__section-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 6px;
  margin-bottom: 4px;
}

.site-sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  padding-inline-end: 3px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
}

.site-sidebar__panel > div:last-child {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.site-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
  cursor: pointer;
}

.site-sidebar__link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--ink);
}

.site-sidebar__link.is-active {
  border-color: rgba(201,168,76,0.25);
  background: var(--gold-dim);
  color: var(--gold);
}

.site-sidebar__icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.site-sidebar__link.is-active .site-sidebar__icon {
  border-color: rgba(201,168,76,0.3);
  background: rgba(201,168,76,0.15);
  color: var(--gold);
}

.site-sidebar__label { font-size: 13px; font-weight: 600; }

.site-sidebar__group { border-radius: 8px; }
.site-sidebar__group summary { list-style: none; }
.site-sidebar__group summary::-webkit-details-marker { display: none; }
.site-sidebar__group .site-sidebar__link--group { background: transparent; }

.site-sidebar__caret { color: var(--muted); font-size: 12px; margin-inline-start: auto; }
.site-sidebar__group[open] .site-sidebar__caret { transform: rotate(45deg); }

.site-sidebar__sublinks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 6px;
  padding-inline-start: 12px;
}

.site-sidebar__sublink {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}

.site-sidebar__sublink:hover { background: rgba(255,255,255,0.05); color: var(--ink); }

.site-sidebar__sublink.is-active {
  border-color: rgba(201,168,76,0.2);
  background: var(--gold-dim);
  color: var(--gold);
}

.site-sidebar__subicon {
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
}

.site-sidebar__sublink.is-active .site-sidebar__subicon { color: var(--gold); }

.site-sidebar__link--logout { color: var(--red); }
.site-sidebar__link--logout:hover { background: rgba(255,92,92,0.08); }

/* Sidebar margin adjustments */
.app-shell.has-sidebar .header,
.app-shell.has-sidebar .date-bar,
.app-shell.has-sidebar .container {
  margin-inline-start: var(--odoo-sidebar-width);
  transition: margin-inline-start 0.2s ease;
}

body.sidebar-collapsed .site-sidebar {
  width: var(--odoo-sidebar-collapsed);
  padding-inline: 7px;
}

body.sidebar-collapsed .app-shell.has-sidebar .header,
body.sidebar-collapsed .app-shell.has-sidebar .date-bar,
body.sidebar-collapsed .app-shell.has-sidebar .container {
  margin-inline-start: var(--odoo-sidebar-collapsed);
}

body.sidebar-collapsed .site-sidebar__eyebrow,
body.sidebar-collapsed .site-sidebar__username,
body.sidebar-collapsed .site-sidebar__school,
body.sidebar-collapsed .site-sidebar__section-title,
body.sidebar-collapsed .site-sidebar__label,
body.sidebar-collapsed .site-sidebar__sublinks,
body.sidebar-collapsed .site-sidebar__caret { display: none; }

body.sidebar-collapsed .site-sidebar__brand-row { justify-content: center; margin-bottom: 4px; }

body.sidebar-collapsed .site-sidebar__link,
body.sidebar-collapsed .site-sidebar__link--group { justify-content: center; padding-inline: 7px; }

body.sidebar-collapsed .site-sidebar__icon { width: 30px; height: 30px; }

/* ───────────────────────────────────────
   TOP MEGA NAV
─────────────────────────────────────── */
.top-mega-nav.site-sidebar {
  position: sticky !important;
  top: 0 !important; left: auto !important; right: auto !important;
  width: 100% !important; max-width: none !important;
  height: 64px !important; max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 0 16px !important;
  margin: 0 !important;
  border: 0 !important; border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  z-index: 2200 !important;
}

.top-mega-nav__quick,
.top-mega-nav__menus,
.top-mega-nav__controls,
.top-mega-nav__user,
.top-mega-nav__brand { display: flex; align-items: center; }

.top-mega-nav__brand {
  flex: 0 0 auto;
  padding-inline: 0 16px;
  color: var(--gold) !important;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-inline-end: 1px solid var(--border);
  margin-inline-end: 8px;
}

.top-mega-nav__menus {
  position: static;
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
}

.top-mega-nav__controls { flex: 0 0 auto; }
.top-mega-nav__quick { gap: 8px; flex: 0 0 auto; }

.top-mega-nav__user {
  gap: 10px;
  min-width: 140px;
  max-width: 220px;
  color: var(--ink) !important;
  font-weight: 700;
  white-space: nowrap;
}

.top-mega-nav__user img {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: contain;
  padding: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border2);
}

.top-mega-nav__group {
  position: static !important;
  display: flex !important;
  align-items: stretch !important;
  height: 64px;
}

.top-mega-nav__group-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 100%;
  min-height: 64px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 14px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent !important;
  transition: all 0.15s;
  cursor: pointer;
}

.top-mega-nav__group:hover .top-mega-nav__group-button,
.top-mega-nav__group:focus-within .top-mega-nav__group-button,
.top-mega-nav__group.is-active .top-mega-nav__group-button {
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
  border-bottom-color: var(--gold) !important;
}

.top-mega-nav__group .site-sidebar__caret {
  margin-inline-start: 2px;
  color: var(--muted);
  transform: none !important;
}

.top-mega-nav__dropdown {
  position: absolute !important;
  top: 64px !important;
  inset-inline: 0 !important;
  z-index: 2250 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 0 !important;
  max-height: min(70vh, 600px);
  overflow: auto !important;
  padding: 20px 28px !important;
  border: 1px solid var(--border2) !important;
  border-top: 2px solid var(--gold) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  box-shadow: 0 28px 70px rgba(0,0,0,0.5) !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.top-mega-nav__group:hover .top-mega-nav__dropdown,
.top-mega-nav__group:focus-within .top-mega-nav__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.top-mega-nav__dropdown .site-sidebar__sublink {
  min-height: 40px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  justify-content: flex-start;
  font-size: 13px;
  font-weight: 600;
}

.top-mega-nav__dropdown .site-sidebar__sublink::before {
  content: '›';
  color: var(--gold);
  font-weight: 700;
}

.top-mega-nav__dropdown .site-sidebar__subicon { display: none !important; }

.top-mega-nav__dropdown .site-sidebar__sublink:hover,
.top-mega-nav__dropdown .site-sidebar__sublink.is-active {
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
  border-radius: 6px !important;
}

.top-mega-nav__quick-link {
  height: 36px;
  min-height: 36px;
  min-width: 36px;
  border: 0 !important;
  border-radius: 6px !important;
  padding: 0 12px !important;
  background: rgba(255,92,92,0.15) !important;
  color: var(--red) !important;
  box-shadow: none !important;
  justify-content: center !important;
  display: inline-flex;
  align-items: center;
}

.top-mega-nav__quick-link:hover { background: rgba(255,92,92,0.25) !important; }
.top-mega-nav__quick-link .site-sidebar__label { display: none !important; }
.top-mega-nav__quick-link .site-sidebar__icon {
  border-radius: 4px !important;
  background: transparent !important;
  color: var(--red) !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Sidebar when mega nav is active */
.app-shell.has-sidebar .header,
body.sidebar-collapsed .app-shell.has-sidebar .header {
  margin-inline-start: 0 !important;
  position: sticky !important;
  top: 64px;
  z-index: 99;
  border-radius: 0;
  border-top: none;
}

.app-shell.has-sidebar .date-bar,
body.sidebar-collapsed .app-shell.has-sidebar .date-bar { display: none !important; }

.app-shell.has-sidebar .container,
body.sidebar-collapsed .app-shell.has-sidebar .container {
  max-width: none !important;
  margin-inline-start: 0 !important;
  padding: 16px 20px 32px !important;
}

/* USER MENU */
.top-mega-nav__user-menu { position: relative; align-self: stretch; }

.top-mega-nav__user-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  min-width: 160px;
  max-width: 240px;
  padding: 0 14px;
  border: 0;
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-inline-start: 1px solid var(--border);
  transition: background 0.15s;
}

.top-mega-nav__user-button:hover,
.top-mega-nav__user-menu:hover .top-mega-nav__user-button { background: var(--gold-dim); }

.top-mega-nav__user-caret { margin-inline-start: auto; color: var(--muted); }

.top-mega-nav__user-dropdown {
  position: absolute;
  top: 64px;
  inset-inline-end: 0;
  z-index: 2350;
  display: grid;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--border2);
  border-top: 2px solid var(--gold);
  background: var(--surface-strong);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.top-mega-nav__user-menu:hover .top-mega-nav__user-dropdown,
.top-mega-nav__user-menu:focus-within .top-mega-nav__user-dropdown {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}

.top-mega-nav__user-dropdown strong {
  display: block;
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.top-mega-nav__user-dropdown a {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
  transition: all 0.15s;
}

.top-mega-nav__user-dropdown a:hover { background: var(--gold-dim); color: var(--gold); }
.top-mega-nav__user-dropdown a.is-danger { color: var(--red); }
.top-mega-nav__user-dropdown a.is-danger:hover { background: rgba(255,92,92,0.1); }

/* ───────────────────────────────────────
   AUTH / LOGIN
─────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(201,168,76,0.08), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(74,158,255,0.06), transparent 28%),
    var(--bg);
}

.auth-card {
  width: min(100%, 900px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border2);
  background: var(--surface);
}

.auth-hero {
  padding: 36px 32px;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(201,168,76,0.08), transparent 30%),
    linear-gradient(160deg, #050c1e 0%, #081429 60%, #0a1730 100%);
  border-inline-end: 1px solid var(--border);
}

.auth-hero h1 {
  margin: 18px 0 10px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}

.auth-hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}

.auth-logo {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  padding: 8px;
}

.auth-meta {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.auth-meta .chip {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(201,168,76,0.2);
}

.auth-form {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  background: var(--surface-strong);
}

.auth-form h2 {
  margin: 0;
  font-size: 22px;
  color: var(--ink);
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}

.auth-form .helper {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.auth-form .field input { padding: 12px 14px; }

.auth-footnote { font-size: 11px; color: var(--muted); line-height: 1.7; }

.password-control { position: relative; }
.password-control input { padding-inline-end: 74px !important; }

.password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  min-height: 28px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.password-toggle:hover { background: var(--gold); color: #06091a; }

/* COMPANY SELECTORS */
.company-select-card { width: min(100%, 980px); }

.company-picker-grid,
.company-access-grid { display: grid; gap: 12px; }

.company-picker-card,
.company-access-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: all 0.18s ease;
}

.company-picker-card:hover,
.company-access-option:hover { border-color: rgba(201,168,76,0.4); background: var(--gold-dim); }

.company-picker-card.is-current,
.company-access-option:has(input:checked) {
  border-color: rgba(201,168,76,0.5);
  background: var(--gold-dim);
}

.company-picker-card input,
.company-access-option input {
  width: 18px; height: 18px;
  accent-color: var(--gold);
  min-height: auto;
}

.company-picker-card__logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.company-picker-card__logo img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }

.company-picker-card__content,
.company-access-option span { display: grid; gap: 3px; min-width: 0; }

.company-picker-card strong,
.company-access-option strong { color: var(--ink); font-size: 14px; font-weight: 700; }

.company-picker-card small,
.company-access-option small { color: var(--muted); font-size: 11px; font-weight: 600; }

/* ───────────────────────────────────────
   ERP CONTROL PANEL
─────────────────────────────────────── */
.erp-control-panel {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.erp-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.erp-breadcrumbs a { color: var(--gold); font-weight: 700; }
.erp-breadcrumbs strong { color: var(--ink); }

.erp-control-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.erp-control-main h1 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.erp-control-main p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.erp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 720px);
}

.erp-search input[type="search"],
.erp-search input[type="date"] {
  min-height: 36px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}

.erp-search input[type="search"] { flex: 1 1 240px; }
.erp-search input[type="date"] { flex: 0 0 148px; }

.erp-document-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.erp-document-actions, .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-workflow-form { display: inline-flex; margin: 0; }

.erp-statusbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.erp-status-step {
  position: relative;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-inline-end: 1px solid var(--border);
  color: var(--muted);
  background: var(--card);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.erp-status-step:last-child { border-inline-end: 0; }
.erp-status-step.is-current { background: var(--gold-dim); color: var(--gold); }
.erp-status-step.is-done:not(.is-current) { color: var(--green); background: rgba(52,211,153,0.08); }
.erp-status-step.is-progress:not(.is-current) { color: var(--amber); background: rgba(245,158,11,0.08); }
.erp-status-step.is-cancelled:not(.is-current) { color: var(--red); background: rgba(255,92,92,0.08); }

.erp-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.erp-form-head h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.erp-form-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.erp-smart-buttons {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
}

.erp-smart-button {
  min-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.erp-smart-button:hover { border-color: var(--gold); background: var(--gold-dim); }
.erp-smart-value { color: var(--gold); font-size: 13px; font-weight: 700; }
.erp-smart-label { color: var(--muted); font-size: 11px; font-weight: 600; }

/* ───────────────────────────────────────
   BUDGET STRIP
─────────────────────────────────────── */
.erp-budget-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.erp-budget-tile {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.erp-budget-tile span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.erp-budget-tile strong { color: var(--ink); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.erp-budget-tile.is-ok strong { color: var(--green); }
.erp-budget-tile.is-over { border-color: rgba(255,92,92,0.2); background: rgba(255,92,92,0.05); }
.erp-budget-tile.is-over strong { color: var(--red); }

/* ───────────────────────────────────────
   JOURNAL EDITOR
─────────────────────────────────────── */
.journal-editor { overflow: visible; }
.journal-entry-form { gap: 18px; }

.journal-sheet {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  overflow: hidden;
}

.journal-sheet-header {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.journal-title-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  padding: 16px;
}

.journal-title-block label,
.journal-lines-head span,
.journal-total-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.journal-title-block input {
  margin-top: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 700;
  padding: 0;
  min-height: auto;
  font-family: 'JetBrains Mono', monospace;
}

.journal-header-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.journal-field-wide { grid-column: 1 / -1; }

.journal-lines-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px 10px;
}

.journal-lines-head h4 { margin: 0 0 4px; color: var(--ink); font-size: 16px; font-weight: 700; }

.journal-lines-wrap {
  margin: 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: auto;
}

.journal-lines-table { border-collapse: separate; border-spacing: 0; }

.journal-lines-table th {
  background: var(--card2);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.journal-lines-table td,
.journal-lines-table th { vertical-align: middle; }

.journal-lines-table select,
.journal-lines-table input { min-height: 38px; }

.journal-lines-table .select-search__input { min-height: 32px; margin-bottom: 4px; }

.journal-line-number { color: var(--muted); font-weight: 700; text-align: center; }
.amount-col, .amount-input { text-align: end; }

.journal-remove-line { min-height: 32px; padding: 6px 10px; font-size: 11px; }

.journal-total-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 22px 22px;
}

.journal-total-strip > div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 14px 16px;
}

.journal-total-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.journal-difference { display: flex; align-items: center; justify-content: center; color: var(--red); font-weight: 700; }
.journal-difference.is-balanced { color: var(--green); }

/* ───────────────────────────────────────
   ODOO MOVE CARDS (Invoice/Bill form)
─────────────────────────────────────── */
.odoo-move-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  margin-bottom: 14px;
  overflow: hidden;
}

.odoo-move-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.odoo-move-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.odoo-move-subtitle { margin-top: 3px; font-size: 12px; color: var(--muted); }
.odoo-move-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.odoo-move-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
}

.odoo-meta-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.odoo-meta-item span { font-size: 11px; color: var(--muted); font-weight: 600; }
.odoo-meta-item strong { font-size: 13px; color: var(--ink); font-weight: 700; }

.odoo-journal-table td, .odoo-journal-table th { font-size: 12px; }

/* ───────────────────────────────────────
   JOURNAL LIST
─────────────────────────────────────── */
.journal-list-card { margin-bottom: 16px; }
.journal-list-table td { vertical-align: middle; }
.journal-list-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.journal-list-actions .inline-workflow-form { display: inline-flex; margin: 0; }

/* ───────────────────────────────────────
   TAX LIVE SUMMARY
─────────────────────────────────────── */
.tax-live-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 14px;
}

.tax-live-summary > div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  padding: 12px 14px;
}

.tax-live-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tax-live-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.tax-live-summary .is-total { background: var(--gold-dim); border-color: rgba(201,168,76,0.2); }
.tax-live-summary .is-total strong { color: var(--gold); }

/* ───────────────────────────────────────
   BULK SELECTION
─────────────────────────────────────── */
.bulk-delete-form { display: contents; }

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-count {
  min-width: 86px;
  padding: 7px 11px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.bulk-select-cell {
  width: 52px;
  min-width: 52px;
  text-align: center !important;
  vertical-align: middle;
  transition: width 0.18s ease, padding 0.18s ease, opacity 0.18s ease;
}

[data-bulk-scope]:not(.is-bulk-selecting) .bulk-select-cell {
  width: 0; min-width: 0; max-width: 0;
  padding-left: 0 !important; padding-right: 0 !important;
  overflow: hidden; color: transparent !important;
  border-left: 0 !important; border-right: 0 !important;
}

[data-bulk-scope]:not(.is-bulk-selecting) .bulk-select-cell > * { opacity: 0; pointer-events: none; }

.bulk-select-cell input[type="checkbox"] {
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.bulk-select-cell input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.38; }

.data-table tbody tr.is-row-selected td { background: rgba(201,168,76,0.08) !important; }

/* ───────────────────────────────────────
   SELECT SEARCH
─────────────────────────────────────── */
.select-search { position: relative; display: block; }

.select-search__input {
  width: 100%;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.select-search select {
  position: absolute !important;
  inset: auto auto 0 0;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important;
}

.select-search__menu {
  position: absolute;
  z-index: 2600;
  inset-inline: 0;
  top: calc(100% + 6px);
  display: none;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}

.select-search__menu.is-open { display: grid; gap: 3px; }

.select-search__option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: inherit;
  cursor: pointer;
  font-size: 13px;
}

.select-search__option small { color: var(--muted); font-size: 11px; }

.select-search__option:hover,
.select-search__option.is-active { background: var(--gold-dim); color: var(--gold); }

/* ───────────────────────────────────────
   EMPTY STATE
─────────────────────────────────────── */
.empty-state {
  border-radius: var(--radius-sm);
  padding: 18px;
  border: 1px dashed var(--border2);
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

/* ───────────────────────────────────────
   REPORT ACTIONS
─────────────────────────────────────── */
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* ───────────────────────────────────────
   UI SWITCHER (dark/light/lang toggle)
─────────────────────────────────────── */
.ui-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.ui-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
}

.ui-toggle:hover { color: var(--ink); border-color: var(--gold); }

.ui-toggle.is-active {
  border-color: rgba(201,168,76,0.4);
  background: var(--gold-dim);
  color: var(--gold);
}

.ui-toggle__icon {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 12px;
}

.ui-toggle__text { font-size: 12px; white-space: nowrap; }

.ui-switcher--auth {
  position: fixed;
  top: 18px;
  inset-inline-end: 18px;
  z-index: 50;
  width: 260px;
}

/* PRINT CLONE */
.print-clone-root { display: none; }

/* SCREEN/PRINT ONLY */
.screen-only { display: block; }
.print-only { display: none; }

/* ───────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────── */
@media (max-width: 1260px) {
  .panel-grid,
  .auth-card,
  .charts-grid.three,
  .filters-grid { grid-template-columns: 1fr; }

  .kpi-grid,
  .charts-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .app-shell.has-sidebar .header,
  .app-shell.has-sidebar .date-bar,
  .app-shell.has-sidebar .container,
  body.sidebar-collapsed .app-shell.has-sidebar .header,
  body.sidebar-collapsed .app-shell.has-sidebar .date-bar,
  body.sidebar-collapsed .app-shell.has-sidebar .container { margin-inline-start: 0 !important; }

  .site-sidebar {
    position: static;
    width: auto !important;
    height: auto;
    border-inline-end: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: 12px 12px 0;
  }

  .site-sidebar__toggle { display: none; }
  .site-sidebar__panel { height: auto; }

  .header, .date-bar { position: static; }
}

@media (max-width: 900px) {
  .container { padding: 14px 16px; }

  .header {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    padding: 14px 16px;
  }

  .header-side.left, .header-side.right { align-items: center; text-align: center; }

  .date-bar { padding-inline: 14px; }
  .date-author { margin-inline-start: 0; }

  .kpi-grid,
  .form-grid, .form-grid.two, .form-grid.four,
  .design-compare-row,
  .charts-grid.two, .charts-grid.three,
  .auth-card { grid-template-columns: 1fr; }

  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .section-donut-wrap { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 52px; }

  .floating-print-btn { left: 14px; bottom: 14px; padding: 10px 14px; font-size: 12px; }
  .floating-back-btn { right: 14px; bottom: 14px; padding: 10px 14px; font-size: 12px; }

  .odoo-move-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .erp-control-main, .erp-form-head { align-items: stretch; flex-direction: column; }
  .erp-search, .erp-document-actions, .erp-smart-buttons { width: 100%; }
  .erp-search { flex-wrap: wrap; }
  .erp-budget-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-document-toolbar { grid-template-columns: 1fr; }
  .erp-smart-button { flex: 1; min-width: 0; }

  .journal-sheet-header, .journal-header-grid, .journal-total-strip { grid-template-columns: 1fr; }
  .journal-lines-head { align-items: stretch; flex-direction: column; }

  .tax-live-summary { grid-template-columns: 1fr; }

  .top-mega-nav.site-sidebar { height: auto !important; min-height: 60px; flex-wrap: wrap; padding: 8px !important; }
  .top-mega-nav__menus { order: 5; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .top-mega-nav__group, .top-mega-nav__group-button { height: 48px; min-height: 48px; }
  .top-mega-nav__dropdown { top: 100% !important; inset-inline: 8px !important; grid-template-columns: 1fr; padding: 14px !important; }
  .top-mega-nav__brand { font-size: 18px; margin-inline-start: auto; }
  .top-mega-nav__user span { display: none; }

  .bulk-actions { justify-content: flex-start; width: 100%; }
  .ui-switcher--auth { position: static; width: auto; margin: 12px; }
}

/* ───────────────────────────────────────
   PRINT STYLES
─────────────────────────────────────── */
@media print {
  @page { size: A4 landscape; margin: 10mm; }

  html, body {
    width: auto !important;
    min-height: auto !important;
    background: #fff !important;
    color: #111827 !important;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
  }

  body::before, body::after,
  .header, .date-bar, .footer,
  .site-sidebar, .screen-only,
  .floating-print-btn, .floating-back-btn,
  .report-actions, .print-hide { display: none !important; }

  .app-shell.has-sidebar .header,
  .app-shell.has-sidebar .date-bar,
  .app-shell.has-sidebar .container,
  body.sidebar-collapsed .app-shell.has-sidebar .header,
  body.sidebar-collapsed .app-shell.has-sidebar .date-bar,
  body.sidebar-collapsed .app-shell.has-sidebar .container { margin: 0 !important; }

  .container { max-width: none !important; padding: 0 !important; }

  .panel:not(.screen-only), .table-card, .chart-card, .odoo-move-card {
    display: block !important;
    background: #fff !important;
    color: #111827 !important;
    border: 1px solid #d8e3ee !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .panel:not(.screen-only), .table-card, .chart-card, .odoo-move-card {
    padding: 12px !important;
    border-radius: 8px !important;
    margin: 0 0 10px !important;
  }

  .table-card { break-inside: auto !important; page-break-inside: auto !important; }
  .chart-card, .odoo-move-card { break-inside: avoid !important; page-break-inside: avoid !important; }

  .table-wrap { overflow: visible !important; max-height: none !important; }

  .data-table {
    width: 100% !important; min-width: 0 !important;
    border-collapse: collapse !important; background: #fff !important;
  }

  .data-table thead { display: table-header-group !important; }

  .data-table th, .data-table td {
    color: #111827 !important; background: #fff !important;
    border: 1px solid #d8e3ee !important;
    font-size: 9px !important; line-height: 1.35 !important;
    padding: 5px 6px !important; white-space: normal !important;
  }

  .data-table th {
    background: #f4f4f0 !important;
    color: #333 !important;
    font-weight: 800 !important;
  }

  body.is-printing-selection .app-shell,
  body.is-printing-selection .floating-print-btn,
  body.is-printing-selection .floating-back-btn { display: none !important; }

  body.is-printing-selection .print-clone-root {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important; padding: 0 !important;
    background: #fff !important; color: #111827 !important;
  }
}

/* ─── DASHBOARD BUTTON (top-left quick link) ─── */
.top-mega-nav__quick-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 100% !important;
  min-height: var(--odoo-topbar-height) !important;
  min-width: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 18px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-bottom: 2px solid transparent !important;
  cursor: pointer !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: all 0.15s !important;
}

.top-mega-nav__quick-link:hover {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
  border-bottom-color: var(--gold) !important;
}

.top-mega-nav__quick-link.is-active {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
  border-bottom-color: var(--gold) !important;
}

.top-mega-nav__quick-link .site-sidebar__icon {
  display: none !important;
}

.top-mega-nav__quick-link .site-sidebar__label {
  display: inline !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

/* ─── NAV LAYOUT: brand LEFT, dashboard left too ─── */
.top-mega-nav.site-sidebar {
  flex-direction: row !important;
  gap: 0 !important;
}

/* Remove the old header-related margin since header is gone */
.app-shell.has-sidebar .header,
body.sidebar-collapsed .app-shell.has-sidebar .header {
  display: none !important;
}

.app-shell.has-sidebar .date-bar,
body.sidebar-collapsed .app-shell.has-sidebar .date-bar {
  display: none !important;
}

.app-shell.has-sidebar .container,
body.sidebar-collapsed .app-shell.has-sidebar .container {
  margin-inline-start: 0 !important;
  padding: 20px 24px 36px !important;
  max-width: none !important;
}

/* ─── THEME/LANG TOGGLE IN TOPBAR ─── */
.ui-switcher {
  display: flex !important;
  flex-direction: row !important;
  gap: 6px !important;
  align-items: center !important;
  grid-template-columns: unset !important;
  margin: 0 !important;
}

.ui-toggle {
  min-height: 32px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  border: 1px solid var(--border2) !important;
  background: rgba(255,255,255,0.06) !important;
  color: var(--muted) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-weight: 700 !important;
  transition: all 0.15s !important;
  white-space: nowrap !important;
}

.ui-toggle:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
}

.ui-toggle__icon {
  width: 18px !important;
  height: 18px !important;
  font-size: 13px !important;
  border-radius: 999px !important;
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ui-toggle__text { font-size: 11px !important; }

/* ══════════════════════════════════════════
   FIXES — DARK MODE
══════════════════════════════════════════ */

/* 1. Container — no sidebar offset needed (top-nav only) */
.app-shell.has-sidebar .container,
.app-shell.has-sidebar .header,
.app-shell.has-sidebar .date-bar,
body.sidebar-collapsed .app-shell.has-sidebar .container,
body.sidebar-collapsed .app-shell.has-sidebar .header,
body.sidebar-collapsed .app-shell.has-sidebar .date-bar {
  margin-inline-start: 0 !important;
  padding: 20px 24px 36px !important;
  max-width: none !important;
}

/* 2. Hide leftover date-bar/header at all times */
.header, .date-bar, .date-item, .date-author { display: none !important; }

/* 3. Back button — keep visible */
.floating-back-btn { display: inline-flex !important; }

/* 4. User dropdown — anchor to right side of user button */
.top-mega-nav__user-menu { position: relative !important; }
.top-mega-nav__user-dropdown {
  position: absolute !important;
  top: var(--odoo-topbar-height) !important;
  right: 0 !important;
  left: auto !important;
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  min-width: 200px !important;
  max-width: 260px !important;
  z-index: 3000 !important;
}

/* 5. Chart colors — dark mode palette */
[data-theme="dark"] .bar-fill,
.bar-fill {
  background: linear-gradient(90deg, #b8922a, #c9a84c) !important;
}

[data-theme="dark"] .donut,
.donut {
  background: conic-gradient(
    var(--gold)  0deg 120deg,
    var(--blue)  120deg 210deg,
    var(--teal)  210deg 280deg,
    var(--red)   280deg 360deg
  ) !important;
}

/* SVG line chart strokes */
[data-theme="dark"] .line-chart-svg polyline,
[data-theme="dark"] .line-chart-svg path {
  stroke: var(--gold) !important;
  fill: rgba(201,168,76,0.08) !important;
}

/* Pie/donut SVG circles in reports */
[data-theme="dark"] svg circle[stroke]:not([stroke="none"]):not([stroke="transparent"]) {
  filter: saturate(1.2) brightness(1.1);
}

/* Chart badge */
[data-theme="dark"] .chart-badge {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
}

/* Section donut dark */
[data-theme="dark"] .section-donut::after,
.section-donut::after {
  background: var(--surface-strong) !important;
}

/* Fix kpi-card glow overlays for dark */
.kpi-card.c-blue .kpi-icon  { background: var(--blue-dim); color: var(--blue); }
.kpi-card.c-green .kpi-icon { background: var(--green-dim); color: var(--green); }
.kpi-card.c-red .kpi-icon   { background: var(--red-dim); color: var(--red); }
.kpi-card.c-teal .kpi-icon  { background: var(--teal-dim); color: var(--teal); }
.kpi-card.c-orange .kpi-icon { background: rgba(245,158,11,0.12); color: var(--amber); }
.kpi-card.c-purple .kpi-icon { background: rgba(139,92,246,0.12); color: #a78bfa; }

/* Nav overflow must be visible for dropdowns to escape */
nav.site-sidebar.top-mega-nav.screen-only {
  overflow: visible !important;
  position: sticky !important;
}

/* ════════════════════════════════
   PORTAL PAGE — DARK
════════════════════════════════ */
[data-theme="dark"] .portal-topbar,
.portal-topbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
}

[data-theme="dark"] .portal-node-label,
.portal-node-label {
  background: var(--card) !important;
  border-color: var(--border2) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .portal-hub-inner,
.portal-hub-inner {
  background: var(--surface) !important;
  border-color: var(--gold) !important;
}

[data-theme="dark"] .portal-node:hover .portal-node-label {
  border-color: var(--gold) !important;
  background: var(--gold-dim) !important;
}

/* Fix nav user dropdown — always anchor right */
.top-mega-nav__user-menu {
  position: relative !important;
  align-self: stretch !important;
  display: flex !important;
  align-items: stretch !important;
}
.top-mega-nav__user-dropdown {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  z-index: 3000 !important;
  min-width: 180px !important;
}
/* Override any RTL flip */
[dir="rtl"] .top-mega-nav__user-dropdown {
  right: auto !important;
  left: 0 !important;
  inset-inline-end: auto !important;
  inset-inline-start: 0 !important;
}

/* ════════════════════════════════
   REPORT AMOUNT COLOR CODING
════════════════════════════════ */

/* Debit amounts — neutral/text color */
.data-table td.amt-dr,
.data-table th.amt-dr { color: var(--ink) !important; font-family: 'JetBrains Mono','Courier New',monospace; }

/* Credit amounts — green (good) */
.data-table td.amt-cr,
.data-table th.amt-cr { color: var(--green) !important; font-family: 'JetBrains Mono','Courier New',monospace; }

/* Money cells — monospace */
.data-table td.money,
.data-table th.money { font-family: 'JetBrains Mono','Courier New',monospace; text-align: right; }

/* Negative values in income statement */
.data-table td.is-negative { color: var(--red) !important; }
.data-table td.is-positive { color: var(--green) !important; }

/* Trial balance Dr/Cr columns */
.data-table th.col-dr,
.data-table td.col-dr { text-align: right; font-family: 'JetBrains Mono',monospace; }
.data-table th.col-cr,
.data-table td.col-cr { text-align: right; font-family: 'JetBrains Mono',monospace; color: var(--green); }

/* Running balance label */
.bal-dr { color: var(--ink); font-weight: 700; }
.bal-cr { color: var(--green); font-weight: 700; }
.bal-zero { color: var(--muted); }

/* Panel section titles */
.panel .section-heading h3 {
  font-family: 'Playfair Display','Georgia',serif;
  font-size: 16px;
}

/* Report print date header */
.report-print-header {
  display: none;
}
@media print {
  .report-print-header {
    display: block;
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
  }
  .report-print-header span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #555;
  }
}

/* ════════════════════════════════════════
   UI POLISH v2 — DARK
════════════════════════════════════════ */

/* Module context badge in nav */
.top-mega-nav__module-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #b8922a);
  color: #06091a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-inline-start: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(201,168,76,0.25);
}
.top-mega-nav__module-badge.is-students { background: linear-gradient(135deg, #6d28d9, #a78bfa); color: #fff; }
.top-mega-nav__module-badge.is-hr       { background: linear-gradient(135deg, #c0392b, #ff5c5c); color: #fff; }
.top-mega-nav__module-badge.is-settings { background: linear-gradient(135deg, #3730a3, #818cf8); color: #fff; }

/* Quick portal back-button special styling */
.top-mega-nav__quick-link--portal {
  background: rgba(201,168,76,0.08) !important;
  color: var(--gold) !important;
  border-bottom-color: rgba(201,168,76,0.3) !important;
}
.top-mega-nav__quick-link--portal:hover {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
  border-bottom-color: var(--gold) !important;
}

/* Polish KPI cards with subtle gradients */
.kpi-card {
  background: linear-gradient(155deg, var(--surface-strong) 0%, rgba(22,37,64,0.7) 100%);
  transition: all 0.25s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201,168,76,0.25);
  box-shadow: 0 12px 28px rgba(0,0,0,0.32);
}

/* Polish data tables */
.data-table thead th {
  background: linear-gradient(180deg, var(--card2), rgba(22,37,64,0.85));
  color: var(--gold);
  border-bottom: 2px solid rgba(201,168,76,0.18);
}
.data-table tbody tr {
  transition: background 0.12s ease;
}

/* Buttons: refined motion */
.btn { transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease; }
.btn-primary { box-shadow: 0 6px 16px rgba(201,168,76,0.25); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(201,168,76,0.4); }

/* Form inputs subtly more visible */
input[type="text"], input[type="number"], input[type="date"],
input[type="password"], input[type="search"], input[type="email"],
select, textarea {
  background: rgba(22,37,64,0.55);
  transition: all 0.18s ease;
}
input:focus, select:focus, textarea:focus {
  background: rgba(22,37,64,0.85);
}

/* Badges glow */
.badge-soft { box-shadow: 0 0 0 1px rgba(201,168,76,0.15); }

/* Section panels */
.panel {
  background: linear-gradient(155deg, var(--surface-strong) 0%, rgba(22,37,64,0.5) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Sticky table header improvement */
.table-wrap { max-height: 70vh; }

/* Micro-animation for nav items on hover */
.top-mega-nav__group-button { position: relative; }
.top-mega-nav__group-button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: all 0.2s ease;
  transform: translateX(-50%);
}
.top-mega-nav__group:hover .top-mega-nav__group-button::after,
.top-mega-nav__group.is-active .top-mega-nav__group-button::after {
  width: 60%;
}

/* ════════════════════════════════════════
   NAV LAYOUT — Final Polish
════════════════════════════════════════ */

/* Nav container: brand → quick → menus → spacer → controls → user */
nav.site-sidebar.top-mega-nav.screen-only {
  display: flex !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  height: var(--odoo-topbar-height, 60px) !important;
  padding: 0 !important;
  overflow: visible !important;
  position: sticky !important;
  top: 0;
  z-index: 200;
}

/* Brand sits at the LEFT (or RIGHT in RTL) */
.top-mega-nav__brand {
  flex: 0 0 auto !important;
  display: flex;
  align-items: center;
  padding: 0 22px !important;
  margin: 0 !important;
  border-inline-end: 1px solid var(--border) !important;
  font-family: 'Playfair Display','Georgia',serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  height: 100%;
}

/* Module badge centered between brand and quick links */
.top-mega-nav__module-badge {
  align-self: center !important;
  margin: 0 14px 0 14px !important;
}

/* Quick links group */
.top-mega-nav__quick {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  gap: 0;
  height: 100%;
}

/* Menus stretch to fill */
.top-mega-nav__menus {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  gap: 0;
  height: 100%;
  min-width: 0;
}

/* SPACER — pushes controls + user to the right */
.top-mega-nav__spacer {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* Controls (theme/lang) */
.top-mega-nav__controls {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px !important;
  gap: 8px;
  height: 100%;
}

/* User menu — sits LAST (right edge) */
.top-mega-nav__user-menu {
  position: relative !important;
  display: flex !important;
  align-items: stretch !important;
  flex: 0 0 auto !important;
  height: 100% !important;
  margin: 0 !important;
}

.top-mega-nav__user-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 100% !important;
  min-width: auto !important;
  max-width: none !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-inline-start: 1px solid var(--border) !important;
  background: transparent !important;
  color: var(--ink) !important;
  font: inherit;
  font-weight: 700 !important;
  cursor: pointer;
  transition: background 0.15s !important;
}

/* User avatar circle inside button */
.top-mega-nav__user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.top-mega-nav__user-caret {
  font-size: 11px;
  color: var(--muted);
  margin-inline-start: 2px;
}

/* User dropdown — anchor right */
.top-mega-nav__user-dropdown {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  z-index: 3000 !important;
  min-width: 200px !important;
  padding: 8px !important;
}
[dir="rtl"] .top-mega-nav__user-dropdown {
  right: auto !important;
  left: 0 !important;
}

/* Brand removed from the right side - it's at left now */
.top-mega-nav.site-sidebar > .top-mega-nav__brand:last-child {
  display: none;
}

/* Container always full-width below sticky nav */
.app-shell.has-sidebar .container,
body.sidebar-collapsed .app-shell.has-sidebar .container,
.container {
  max-width: none !important;
  margin: 0 !important;
  padding: 20px 24px 36px !important;
  width: 100% !important;
}

/* App shell minimum height fills viewport */
.app-shell {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}
.app-shell > .container {
  flex: 1 1 auto !important;
}

/* Hide any leftover header/date-bar elements completely */
.header, .date-bar, .date-item, .date-author { display: none !important; }

/* DARK avatar */
.top-mega-nav__user-avatar {
  background: linear-gradient(135deg, var(--gold, #c9a84c), #b8922a) !important;
  color: #06091a !important;
  box-shadow: 0 2px 8px rgba(201,168,76,0.25);
}
.top-mega-nav__user-button:hover { background: var(--gold-dim) !important; }


/* ════════════════════════════════
   LIGHT-SPECIFIC OVERRIDES
════════════════════════════════ */

html, body { color-scheme: light; }

body {
  background:
    radial-gradient(circle at 5% 5%, rgba(29,111,164,0.07), transparent 28%),
    radial-gradient(circle at 95% 5%, rgba(26,138,114,0.07), transparent 28%),
    linear-gradient(180deg, #eaf3fb 0%, #f0f4f8 50%, #f5f7fa 100%) !important;
}

body::before, body::after { display: none !important; }

/* Scrollbars */
* { scrollbar-color: #b8cfe4 #e8f0f8 !important; }
*::-webkit-scrollbar-track { background: #e8f0f8 !important; }
*::-webkit-scrollbar-thumb { background: #b8cfe4 !important; }
*::-webkit-scrollbar-thumb:hover { background: #8ab0cc !important; }

/* Auth hero — light variant */
.auth-hero {
  background: linear-gradient(155deg, #0e4a73 0%, #1d6fa4 50%, #1a8a72 100%) !important;
  color: #fff !important;
}
.auth-hero h1 { color: #fff !important; }
.auth-hero p { color: rgba(255,255,255,0.9) !important; }
.auth-meta .chip {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.25) !important;
}
.auth-logo {
  background: rgba(255,255,255,0.15) !important;
  border-color: rgba(255,255,255,0.3) !important;
}

/* Tables — light data look */
.data-table thead th {
  background: linear-gradient(180deg, #f8fafc, #eef2f7) !important;
  color: #475569 !important;
  border-bottom: 2px solid rgba(29,111,164,0.18) !important;
}
.data-table tbody td { background: #fff !important; color: var(--ink) !important; }
.data-table tbody tr:hover td { background: #f8faff !important; }
.data-table tfoot th, .data-table tfoot td { background: #eef2f7 !important; color: var(--primary) !important; }

/* KPI gradient */
.kpi-card {
  background: linear-gradient(155deg, #ffffff 0%, #f8fafc 100%) !important;
}

/* Inputs */
input[type="text"], input[type="number"], input[type="date"],
input[type="password"], input[type="search"], input[type="email"],
select, textarea {
  background: #fff !important;
  color: var(--ink) !important;
}
input:focus, select:focus, textarea:focus { background: #fafcff !important; }

/* Brand color in light = darker primary */
.top-mega-nav__brand { color: var(--primary) !important; }

/* Theme/lang toggle in light */
.ui-toggle { background: rgba(255,255,255,0.6) !important; }
.ui-toggle:hover { background: var(--blue-dim) !important; color: var(--primary) !important; }

/* User dropdown */
.top-mega-nav__user-dropdown {
  background: #fff !important;
  border-color: var(--border2) !important;
  border-top-color: var(--primary) !important;
  box-shadow: 0 16px 40px rgba(15,40,70,0.14) !important;
}
.top-mega-nav__user-dropdown a { color: var(--ink) !important; }
.top-mega-nav__user-dropdown a:hover { background: var(--blue-dim) !important; color: var(--primary) !important; }
.top-mega-nav__user-dropdown a.is-danger { color: var(--red) !important; }
.top-mega-nav__user-dropdown a.is-danger:hover { background: var(--red-dim) !important; }
.top-mega-nav__user-dropdown strong { color: var(--muted) !important; border-bottom-color: var(--border) !important; }

/* Menu group dropdowns — light */
.top-mega-nav__dropdown {
  background: #fff !important;
  border-color: var(--border2) !important;
  border-top-color: var(--primary) !important;
  box-shadow: 0 16px 48px rgba(15,40,70,0.14) !important;
}
.top-mega-nav__dropdown .site-sidebar__sublink { color: var(--muted) !important; }
.top-mega-nav__dropdown .site-sidebar__sublink::before { color: var(--primary) !important; }
.top-mega-nav__dropdown .site-sidebar__sublink:hover,
.top-mega-nav__dropdown .site-sidebar__sublink.is-active {
  background: var(--blue-dim) !important;
  color: var(--primary) !important;
}

/* Icons in nav (MV/RP/ST badges) */
.site-sidebar__icon {
  background: rgba(29,111,164,0.08) !important;
  color: var(--primary) !important;
  border-color: var(--border) !important;
}

/* Active menu group accent */
.top-mega-nav__group:hover .top-mega-nav__group-button,
.top-mega-nav__group.is-active .top-mega-nav__group-button {
  background: var(--blue-dim) !important;
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

/* Quick links active/hover */
.top-mega-nav__quick-link:hover,
.top-mega-nav__quick-link.is-active {
  background: var(--blue-dim) !important;
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

/* Avatar in light */
.top-mega-nav__user-avatar {
  background: linear-gradient(135deg, var(--primary), var(--teal)) !important;
  color: #fff !important;
}
.top-mega-nav__user-button:hover { background: var(--blue-dim) !important; }

/* Module badge in light */
.top-mega-nav__module-badge {
  background: linear-gradient(135deg, var(--primary), var(--teal)) !important;
  color: #fff !important;
}
.top-mega-nav__module-badge.is-students { background: linear-gradient(135deg, #6d28d9, #a78bfa) !important; color: #fff !important; }
.top-mega-nav__module-badge.is-hr       { background: linear-gradient(135deg, #c0392b, #ff5c5c) !important; color: #fff !important; }
.top-mega-nav__module-badge.is-settings { background: linear-gradient(135deg, #3730a3, #818cf8) !important; color: #fff !important; }

/* Buttons primary — light blue/teal gradient */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--teal)) !important;
  color: #fff !important;
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(29,111,164,0.4) !important; }

.floating-print-btn {
  background: linear-gradient(135deg, var(--primary), var(--teal)) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(29,111,164,0.3) !important;
}

/* Alerts */
.alert.success { background: rgba(22,163,74,0.08) !important; border-color: rgba(22,163,74,0.3) !important; color: #14532d !important; }
.alert.error { background: rgba(192,57,43,0.08) !important; border-color: rgba(192,57,43,0.3) !important; color: #7f1d1d !important; }

/* Section panels */
.panel, .filters-card, .table-card, .chart-card, .summary-card {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 14px rgba(15,40,70,0.06) !important;
}

/* Footer */
.footer {
  background: #fff !important;
  border-color: var(--border) !important;
  box-shadow: 0 2px 8px rgba(15,40,70,0.04) !important;
}

/* Status pills, badges */
.badge-soft { background: var(--blue-dim) !important; color: var(--primary) !important; border-color: rgba(29,111,164,0.2) !important; }
.badge-green { background: var(--green-dim) !important; color: var(--green) !important; border-color: rgba(22,163,74,0.25) !important; }
.badge-yellow { background: rgba(217,119,6,0.1) !important; color: var(--amber) !important; border-color: rgba(217,119,6,0.25) !important; }
.badge-red { background: var(--red-dim) !important; color: var(--red) !important; border-color: rgba(192,57,43,0.25) !important; }

/* Status step bar in module forms */
.erp-status-step { background: #fff !important; color: var(--muted) !important; }
.erp-status-step.is-current { background: var(--blue-dim) !important; color: var(--primary) !important; }
.erp-status-step.is-done:not(.is-current) { background: var(--green-dim) !important; color: var(--green) !important; }
.erp-status-step.is-progress:not(.is-current) { background: rgba(217,119,6,0.08) !important; color: var(--amber) !important; }
.erp-status-step.is-cancelled:not(.is-current) { background: var(--red-dim) !important; color: var(--red) !important; }

/* Print: same as dark */
@media print {
  html, body { background: #fff !important; color: #111 !important; }
}


/* ════════════════════════════════
   FINAL FIX — Page fills from TOP
════════════════════════════════ */

/* Reset app-shell — no flex column behavior */
.app-shell {
  min-height: 100vh !important;
  display: block !important;
}

.app-shell.has-sidebar {
  display: block !important;
}

/* Container takes full height naturally */
.app-shell > .container,
.app-shell.has-sidebar > .container {
  flex: none !important;
  min-height: calc(100vh - var(--odoo-topbar-height, 60px) - 60px) !important;
}

/* Make sure floating buttons don't get pushed off */
.floating-print-btn,
.floating-back-btn { z-index: 1000; }

/* Remove any leftover orphan elements */
body > .date-item,
body > .date-author,
.app-shell > .date-item,
.app-shell > .date-author { display: none !important; }
