/* ══════════════════════════════════════════════════════════════════
   AI Experts — Invoice Suite
   Brand: dark premium (#080808), amber (#E8A855), Playfair/IBM Plex
══════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:         #080808;
  --bg-2:       #0E0E10;
  --bg-3:       #141418;
  --surface:    #1A1A1F;
  --surface-2:  #1F1F25;
  --border:     rgba(232,168,85,0.12);
  --border-hi:  rgba(232,168,85,0.30);
  --text:       #F0EBE1;
  --text-2:     #8C867E;
  --text-3:     #4A4540;
  --amber:      #E8A855;
  --amber-light:#F0BC72;
  --amber-dim:  rgba(232,168,85,0.08);
  --amber-glow: rgba(232,168,85,0.15);
  --red:        #E05A4E;
  --green:      #5AB87E;
  --serif:      'Playfair Display', Georgia, serif;
  --sans:       'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --mono:       'IBM Plex Mono', 'Courier New', monospace;
  --sidebar-w:  220px;
  --topbar-h:   56px;
  --radius:     6px;
  --radius-lg:  10px;
  --shadow:     0 2px 20px rgba(0,0,0,0.4);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--amber-glow); color: var(--text); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

/* ── App shell ──────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

.sidebar-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.sidebar-logo-text {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--amber-dim); }
.nav-item.active { color: var(--amber); background: var(--amber-dim); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--amber);
  border-radius: 2px;
}
.nav-logout { color: var(--text-3); }
.nav-logout:hover { color: var(--red); background: rgba(224,90,78,0.08); }

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  grid-column: 2;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: var(--topbar-h);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--radius);
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle:hover { background: var(--amber-dim); color: var(--text); }
.topbar-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-2);
  flex: 1;
}

/* ── Main content ───────────────────────────────────────────────── */
.main-content {
  grid-column: 2;
  padding: 28px 28px 60px;
  overflow-x: hidden;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-amber { background: var(--amber); color: #080808; border-color: var(--amber); }
.btn-amber:hover { background: var(--amber-light); border-color: var(--amber-light); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-hi); }
.btn-ghost:hover { color: var(--text); background: var(--amber-dim); border-color: var(--border-hi); }
.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-xs { padding: 4px 8px; font-size: 0.7rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Typography helpers ─────────────────────────────────────────── */
.text-muted { color: var(--text-2); }
.text-sm    { font-size: 0.8rem; }
.mono       { font-family: var(--mono); }
.link-amber { color: var(--amber); }
.link-amber:hover { text-decoration: underline; }

/* ── Page header ────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-family: var(--serif);
  font-size: 1.8rem; font-weight: 700;
  color: var(--text); line-height: 1.2;
}
.page-sub { color: var(--text-2); font-size: 0.875rem; margin-top: 4px; }

/* ── KPI cards ──────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.kpi-card:hover { border-color: var(--border-hi); }
.kpi-card--amber { border-color: rgba(232,168,85,0.25); }
.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.kpi-card--amber .kpi-value { color: var(--amber); }
.kpi-icon {
  position: absolute; right: 20px; top: 20px;
  color: var(--text-3);
  opacity: 0.5;
}
.kpi-icon svg { width: 24px; height: 24px; }

/* ── Section block ──────────────────────────────────────────────── */
.section-block { margin-bottom: 32px; }
.section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 700;
  color: var(--text);
}

/* ── Data tables ────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table thead tr {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--amber-dim); }
.data-table tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

/* ── Status chips ───────────────────────────────────────────────── */
.status-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.status-draft { background: rgba(140,134,126,0.15); color: var(--text-2); border: 1px solid var(--border); }
.status-sent  { background: rgba(232,168,85,0.12); color: var(--amber); border: 1px solid rgba(232,168,85,0.3); }
.status-paid  { background: rgba(90,184,126,0.12); color: var(--green); border: 1px solid rgba(90,184,126,0.3); }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.badge-warning { background: rgba(232,168,85,0.12); color: var(--amber); border: 1px solid rgba(232,168,85,0.3); }
.badge-success { background: rgba(90,184,126,0.1); color: var(--green); border: 1px solid rgba(90,184,126,0.3); }

/* ── Action groups ──────────────────────────────────────────────── */
.action-group { display: flex; gap: 4px; align-items: center; }
.btn-remove-row {
  width: 22px; height: 22px;
  border: none; background: none;
  color: var(--text-3);
  font-size: 1.1rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.btn-remove-row:hover { color: var(--red); background: rgba(224,90,78,0.1); }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.card-title { font-family: var(--serif); font-size: 0.95rem; font-weight: 700; color: var(--text); }
.card-body  { padding: 20px; }

/* ── Form elements ──────────────────────────────────────────────── */
.field-group { margin-bottom: 14px; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin-bottom: 5px;
  font-weight: 600;
}
.field-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.15s;
  appearance: none;
}
.field-input:focus { outline: none; border-color: var(--amber); }
.field-input::placeholder { color: var(--text-3); }
.field-input option { background: var(--bg-3); }
.field-textarea { resize: vertical; line-height: 1.5; min-height: 72px; }
.field-input--sm { padding: 6px 8px; font-size: 0.8rem; }
.field-input--xs { padding: 4px 7px; font-size: 0.78rem; }
.field-mono { font-family: var(--mono); }
.field-warning { color: #E8905A; font-size: 0.78rem; margin-top: 4px; }
.field-hint    { color: var(--text-2); font-size: 0.78rem; margin-top: 4px; }
.text-right    { text-align: right; }

.input-with-action { display: flex; gap: 6px; align-items: flex-start; }
.input-with-action .field-input { flex: 1; }

.divider-text {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 14px 0;
  position: relative;
}
.divider-text::before, .divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

.checkbox-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8rem; color: var(--text-2); cursor: pointer;
}
.checkbox-label input { accent-color: var(--amber); }

/* ── Services quick-add ─────────────────────────────────────────── */
.services-picker {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.services-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin-bottom: 8px;
  font-weight: 600;
}
.services-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.service-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text);
  transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.service-chip:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.chip-price { font-family: var(--mono); font-size: 0.72rem; color: var(--text-2); }

/* ── Line items edit table ──────────────────────────────────────── */
.items-table-wrap { overflow-x: auto; }
.items-edit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.items-edit-table thead th {
  padding: 8px 6px;
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.items-edit-table tbody td {
  padding: 6px 4px;
  vertical-align: top;
}
.items-edit-table tbody tr { border-bottom: 1px solid var(--border); }
.items-edit-table tbody tr:last-child { border-bottom: none; }

/* ── Totals block ───────────────────────────────────────────────── */
.totals-block {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  max-width: 300px;
  margin-left: auto;
}
.totals-row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
  font-size: 0.85rem;
  color: var(--text-2);
}
.totals-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 10px;
}

/* ── Form layout ────────────────────────────────────────────────── */
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.form-col { display: flex; flex-direction: column; }
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 8px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Modals ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,8,8,0.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.modal-sub   { color: var(--text-2); font-size: 0.875rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.modal-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.modal-icon--success { background: rgba(90,184,126,0.12); color: var(--green); border: 1px solid rgba(90,184,126,0.3); }

/* ── Toasts ─────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text);
  min-width: 220px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
}
.toast-success { border-color: rgba(90,184,126,0.4); }
.toast-error   { border-color: rgba(224,90,78,0.4);  }
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:none; } }
@keyframes toastOut { to { opacity:0; transform: translateX(20px); } }

/* ── Checkbox component ─────────────────────────────────────────── */
.checkbox-wrap { display: inline-block; width: 20px; height: 20px; cursor: pointer; position: relative; }
.checkbox-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkmark {
  position: absolute; inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  transition: all 0.15s;
}
.checkbox-wrap input:checked ~ .checkmark { background: var(--green); border-color: var(--green); }
.checkbox-wrap input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-left: none; border-top: none;
  transform: rotate(45deg);
}

/* ── Filter tabs ────────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s;
}
.filter-tab:hover { border-color: var(--border-hi); color: var(--text); }
.filter-tab.active { background: var(--amber-dim); border-color: var(--amber); color: var(--amber); }

/* ── Invoice action bar ─────────────────────────────────────────── */
.invoice-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 24px;
}

/* ── Tooltips ───────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #1F1F25;
  color: var(--text);
  font-size: 0.7rem;
  font-family: var(--sans);
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(4px);
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
[data-tip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-hi);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 999;
}
[data-tip]:hover::after,
[data-tip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Sortable table headers ─────────────────────────────────────── */
th.sortable:hover { color: var(--text); background: var(--amber-dim); }
th.sortable.sort-active { color: var(--amber); }
th.sortable .sort-icon { font-style: normal; margin-left: 4px; opacity: 0.5; }
th.sortable.sort-active .sort-icon { opacity: 1; color: var(--amber); }

/* ── Inv number display ─────────────────────────────────────────── */
.inv-num { font-family: var(--mono); font-size: 0.82rem; color: var(--amber); }

/* ── Services grid ──────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.15s;
}
.service-card:hover { border-color: var(--border-hi); }
.service-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.service-name { font-family: var(--serif); font-size: 0.95rem; font-weight: 700; color: var(--text); }
.service-desc { margin-bottom: 12px; }
.service-price { font-family: var(--mono); font-size: 1rem; color: var(--amber); }

/* ── Detail rows ────────────────────────────────────────────────── */
.detail-row { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-2); min-width: 90px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; padding-top: 2px; }

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state svg { color: var(--text-3); }
.empty-state h3 { font-family: var(--serif); color: var(--text); font-size: 1.1rem; }

/* ── Flash messages ─────────────────────────────────────────────── */
.flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.85rem; }
.flash-error { background: rgba(224,90,78,0.1); border: 1px solid rgba(224,90,78,0.3); color: #E8905A; }
.flash-success { background: rgba(90,184,126,0.1); border: 1px solid rgba(90,184,126,0.3); color: var(--green); }

/* ── Info box ───────────────────────────────────────────────────── */
.info-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
}
.info-box svg { flex-shrink: 0; margin-top: 1px; color: var(--amber); }
.code-inline {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--amber);
}

/* ── Login page ─────────────────────────────────────────────────── */
.login-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-container {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.login-logo { height: 36px; width: auto; }
.login-logo-fallback { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--amber); }
.login-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-sub   { color: var(--text-2); text-align: center; font-size: 0.85rem; margin-bottom: 24px; }
.login-error { background: rgba(224,90,78,0.1); border: 1px solid rgba(224,90,78,0.3); color: #E8905A; border-radius: var(--radius); padding: 10px 14px; font-size: 0.82rem; margin-bottom: 16px; }
.login-footer { font-size: 0.75rem; color: var(--text-3); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-2col { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    width: 240px;
    height: 100%;
    transition: left 0.25s ease;
    z-index: 200;
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 190;
  }
  .sidebar-overlay.visible { display: block; }

  .topbar { grid-column: 1; padding: 0 16px; }
  .menu-toggle { display: flex; }
  .main-content { grid-column: 1; padding: 20px 16px 60px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .btn { justify-content: center; }
}

@media (max-width: 480px) {
  .page-header { flex-direction: column; }
  .btn-group { width: 100%; }
  .data-table { font-size: 0.78rem; }
  .data-table thead th, .data-table tbody td { padding: 9px 10px; }
}
