/* ============================================================
   YES CENTRE — Operations Manager
   Main stylesheet
   ============================================================ */

:root {
  /* ── Palette ── */
  --bg:        #f0f2f5;
  --bg-paper:  #ffffff;
  --surface:   #f8fafc;
  --ink:       #111827;
  --ink-soft:  #374151;
  --ink-mute:  #6b7280;
  --line:      #e5e7eb;
  --line-soft: #f3f4f6;

  /* Brand */
  --pine:      #1d5fa8;
  --pine-deep: #0f3460;
  --pine-soft: #2d7dd2;
  --pine-tint: #eff6ff;

  /* Status */
  --burgundy:      #dc2626;
  --burgundy-soft: #ef4444;
  --gold:          #d97706;
  --gold-soft:     #f59e0b;

  /* Tints */
  --green-tint: #dcfce7;
  --red-tint:   #fee2e2;
  --gold-tint:  #fef9c3;
  --blue-tint:  #dbeafe;

  /* Compatibility aliases (used in login + older page styles) */
  --primary: var(--pine);
  --border:  var(--line);
  --text:    var(--ink);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);
  --shadow-modal: 0 20px 50px rgba(0,0,0,0.14), 0 8px 20px rgba(0,0,0,0.08);

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Outfit', 'Segoe UI', system-ui, sans-serif;

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h:  56px;
  --radius:    10px;
  --radius-sm: 6px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--pine-deep);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid rgba(0,0,0,0.25);
}

.sidebar.hidden-nav { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--gold-soft);
  color: var(--pine-deep);
  font-size: 17px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 10px;
  color: var(--gold-soft);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: 0.75;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.nav-group { margin-bottom: 18px; }

.nav-group-title {
  font-size: 9.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(226,232,240,0.35);
  padding: 6px 10px 7px;
  font-weight: 700;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: rgba(226,232,240,0.72);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  margin: 1px 0;
  transition: background 0.14s, color 0.14s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.nav-link.active {
  background: rgba(255,255,255,0.11);
  color: #fff;
  font-weight: 500;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--gold-soft);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.14s;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-link.active .nav-icon { color: var(--gold-soft); }

.sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* Developer attribution */
.sidebar-dev {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-dev-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(226,232,240,0.28);
  font-weight: 600;
}

.sidebar-dev-name {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(226,232,240,0.55);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.3;
}

.sidebar-dev-name:hover {
  color: var(--gold-soft);
}

.sidebar-dev-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.sidebar-dev-details span {
  font-size: 9.5px;
  color: rgba(226,232,240,0.28);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.5;
}

.sidebar-dev-details i {
  width: 10px;
  text-align: center;
  opacity: 0.7;
}

/* ── Topbar ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.14s;
}
.menu-btn:hover { background: var(--line-soft); }

.crumbs {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* User chip in topbar */
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 32px;
  height: 32px;
  background: var(--pine);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-role { font-size: 11px; color: var(--ink-mute); }

.topbar-action-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--ink-mute);
  font-size: 13px;
  display: inline-grid;
  place-items: center;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.topbar-action-btn:hover { background: var(--line-soft); color: var(--ink); }
.topbar-action-btn.danger:hover { background: var(--red-tint); color: var(--burgundy); border-color: #fca5a5; }

/* ── Frame ── */
.frame {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

.frame > * { animation: fadeIn 0.22s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 0;
  color: var(--ink-mute);
  font-size: 14px;
}
.loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--pine);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PAGE COMPONENTS
   ============================================================ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 3px;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.page-desc { color: var(--ink-mute); font-size: 13.5px; margin: 0; }

/* ── Stat Cards ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.income  { background: var(--green-tint); color: #16a34a; }
.stat-icon.expense { background: var(--red-tint);   color: var(--burgundy); }
.stat-icon.balance { background: var(--blue-tint);  color: var(--pine); }
.stat-icon.neutral { background: var(--line-soft);  color: var(--ink-mute); }
.stat-icon.gold    { background: var(--gold-tint);  color: var(--gold); }

.stat-body { flex: 1; min-width: 0; }

.stat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-sub { font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; }

/* ── Cards ── */
.card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.card-sub { font-size: 12px; color: var(--ink-mute); }

/* ── Layout grids ── */
.grid-2 {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: start;
}
.modal .grid-2 { grid-template-columns: 1fr 1fr; gap: 12px 14px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Forms ── */
.form-row,
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .full { grid-column: 1 / -1; }

label,
.form-label {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.input {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--pine);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus,
.form-control:focus,
.input:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(29,95,168,0.1);
}

input::placeholder { color: var(--ink-mute); opacity: 0.7; }
textarea { resize: vertical; min-height: 72px; }

/* ── Buttons ── */
.btn {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.14s, box-shadow 0.14s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--pine);
  color: #fff;
  box-shadow: 0 1px 3px rgba(29,95,168,0.2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--pine-deep);
  box-shadow: 0 3px 8px rgba(29,95,168,0.28);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover:not(:disabled) { background: var(--line-soft); }

.btn-danger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--burgundy);
  padding: 5px 10px;
  font-size: 12px;
}
.btn-danger:hover:not(:disabled) { background: var(--red-tint); border-color: #fca5a5; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #fff;
}

table.data th,
table.data td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}

table.data th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--ink-mute);
  font-weight: 700;
  background: var(--surface);
  white-space: nowrap;
}

table.data tbody tr:hover { background: #fafbfc; }
table.data tbody tr:last-child td { border-bottom: none; }

table.data td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}

.empty-row td {
  text-align: center;
  color: var(--ink-mute);
  font-style: italic;
  padding: 40px 20px !important;
  font-size: 13px;
  background: var(--surface);
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-green { background: var(--green-tint); color: #15803d; }
.badge-red   { background: var(--red-tint);   color: #b91c1c; }
.badge-gold  { background: var(--gold-tint);  color: #92400e; }
.badge-blue  { background: var(--blue-tint);  color: #1e40af; }
.badge-mute  { background: var(--line-soft);  color: var(--ink-mute); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}
.toast.show    { opacity: 1; transform: translateY(0); }
.toast.success { background: #15803d; }
.toast.error   { background: var(--burgundy); }

/* ── Summary strip (dashboard) ── */
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
}
.summary-strip .si { display: flex; flex-direction: column; gap: 2px; }
.summary-strip .si-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-mute);
  font-weight: 700;
}
.summary-strip .si-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.summary-strip .si-value.income  { color: #16a34a; }
.summary-strip .si-value.expense { color: var(--burgundy); }
.summary-strip .si-value.balance { color: var(--pine); }

/* ── Chart grid ── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.chart-wide { grid-column: 1 / -1; }

.chart-card { padding: 18px 18px 14px; }
.chart-box        { width: 100%; height: 300px; min-width: 0; }
.chart-box.tall   { height: 340px; }
.chart-box.short  { height: 220px; }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,0.52);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}

.modal {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 92%;
  max-width: 500px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: scale(0.97);
  opacity: 0;
}
.modal.modal-wide { max-width: 960px; }

@keyframes modalIn {
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.14s, color 0.14s;
}
.modal-close:hover { background: var(--red-tint); color: var(--burgundy); }

.modal-body { padding: 22px; overflow-y: auto; flex: 1; }

.modal-foot {
  position: sticky;
  bottom: -22px;
  background: var(--bg-paper);
  margin-left: -22px;
  margin-right: -22px;
  margin-top: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  z-index: 10;
}

/* ── Quick actions ── */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: background 0.14s, border-color 0.14s, transform 0.1s, box-shadow 0.14s;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
}

.quick-action-btn:hover {
  background: var(--pine-tint);
  border-color: var(--pine-soft);
  color: var(--pine-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-action-btn i {
  font-size: 20px;
  color: var(--pine);
}

/* ============================================================
   HELP PAGE COMPONENTS
   ============================================================ */

.help-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.help-toc-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--ink-mute);
  font-weight: 700;
  margin: 0 0 14px;
}

.help-toc ol {
  margin: 0;
  padding-left: 18px;
  columns: 2;
  column-gap: 24px;
}

.help-toc li { margin-bottom: 7px; }

.help-toc a {
  color: var(--pine);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
}
.help-toc a:hover { text-decoration: underline; }

.help-section { margin-bottom: 32px; }

.help-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-section-title i {
  color: var(--pine);
  font-size: 16px;
}

.help-section-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 16px;
}

.help-body {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.help-body p { margin: 0 0 12px; }

.help-body ul,
.help-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.help-body li { margin-bottom: 6px; }

.help-body strong { color: var(--ink); font-weight: 600; }

.callout {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.6;
  border-left: 3px solid transparent;
}

.callout-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.callout.tip     { background: var(--blue-tint);  border-left-color: var(--pine);     color: #1e3a8a; }
.callout.warning { background: var(--gold-tint);  border-left-color: var(--gold);     color: #78350f; }
.callout.success { background: var(--green-tint); border-left-color: #16a34a;          color: #14532d; }
.callout.danger  { background: var(--red-tint);   border-left-color: var(--burgundy); color: #7f1d1d; }

.step-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  padding: 9px 12px 9px 44px;
  position: relative;
  border-left: 2px solid var(--line);
  margin-left: 12px;
  margin-bottom: 2px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: -13px;
  top: 9px;
  width: 24px;
  height: 24px;
  background: var(--pine);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.account-type-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}

.account-type-card .type-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
}

.account-type-card .type-desc {
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.5;
}

.account-type-card.asset  .type-label { color: #16a34a; }
.account-type-card.revenue .type-label { color: var(--pine); }
.account-type-card.expense .type-label { color: var(--burgundy); }
.account-type-card.other   .type-label { color: var(--ink-mute); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--pine-deep) 0%, #1a3a6b 55%, #0d2744 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: var(--bg-paper);
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 8px 24px rgba(0,0,0,0.15);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.login-brand-mark {
  width: 56px;
  height: 56px;
  background: var(--pine);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(29,95,168,0.4);
}

.login-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-mute);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.role-box {
  background: var(--surface);
  border: 2px solid var(--line);
  padding: 16px 10px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
}

.role-box:hover {
  border-color: var(--pine);
  background: var(--pine-tint);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.role-box i {
  font-size: 22px;
  color: var(--pine);
  margin-bottom: 8px;
  display: block;
}

.role-box .role-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* ============================================================
   SCROLLBARS — thin & subtle
   ============================================================ */
::-webkit-scrollbar         { width: 5px; height: 5px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: rgba(0,0,0,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.12) transparent; }

/* ============================================================
   DATATABLES OVERRIDES
   ============================================================ */
.dataTables_wrapper { font-family: var(--font-body); }

/* Reset global label/input/select styles that bleed into DataTables */
.dataTables_wrapper label {
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dataTables_wrapper select {
  width: auto !important;
  display: inline-block;
  padding: 5px 8px;
  font-size: 13px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.dataTables_wrapper .dataTables_filter input {
  width: auto !important;
  min-width: 180px;
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(29,95,168,0.08);
}

.dataTables_wrapper .dataTables_info { font-size: 12px; color: var(--ink-mute); padding-top: 8px; }

.dataTables_wrapper .dataTables_paginate { padding-top: 8px; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm) !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
  color: var(--ink-soft) !important;
  border: 1px solid transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--blue-tint) !important;
  border-color: var(--line) !important;
  color: var(--pine) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--pine) !important;
  border-color: var(--pine) !important;
  color: #fff !important;
}

.dt-buttons { margin-bottom: 8px; }

.dt-buttons .dt-button {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-soft) !important;
  border-radius: var(--radius-sm) !important;
  padding: 5px 12px !important;
  font-family: var(--font-body) !important;
  font-size: 12.5px !important;
  transition: background 0.14s !important;
}
.dt-buttons .dt-button:hover { background: var(--line-soft) !important; }

div.top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ============================================================
   SELECT2 OVERRIDES
   ============================================================ */
/* Reset global label styles inside Select2 containers */
.select2-container label,
.select2-results label {
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.select2-container--default .select2-selection--single {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: var(--font-body);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: 12px;
  color: var(--ink);
  font-size: 14px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: 4px; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open  .select2-selection--single {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(29,95,168,0.1);
}
.select2-container .select2-dropdown {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  font-family: var(--font-body);
  z-index: 9999 !important;
  box-shadow: var(--shadow-lg);
}
.select2-container .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 7px 10px;
}
.select2-container .select2-search--dropdown .select2-search__field:focus {
  outline: none;
  border-color: var(--pine);
}
.select2-container--default .select2-results__option { font-size: 14px; padding: 8px 12px; color: var(--ink); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--pine); color: #fff; }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--blue-tint); color: var(--pine-deep); }

/* ============================================================
   FLATPICKR OVERRIDES
   ============================================================ */
.flatpickr-calendar {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  box-shadow: var(--shadow-lg);
}
.flatpickr-months .flatpickr-month {
  background: var(--pine);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  height: 44px;
}
.flatpickr-current-month {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  padding-top: 8px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: #fff; font-weight: 500; }

/* Reset global input styles that bleed into the Flatpickr year field */
.flatpickr-calendar input.cur-year {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  width: 5ch !important;
  font-size: 15px !important;
  border-radius: 0 !important;
}
.flatpickr-calendar input.cur-year:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months { background: transparent; }
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--pine-deep); color: #fff; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--pine); border-color: var(--pine); }
.flatpickr-day:hover { background: var(--blue-tint); border-color: var(--blue-tint); }
.flatpickr-weekday { color: var(--ink-mute); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.hidden-nav { display: none !important; }
  .menu-btn { display: inline-grid; place-items: center; }
  .frame { padding: 18px; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .help-toc ol { columns: 1; }
  .account-type-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .chart-box        { height: 240px; }
  .chart-box.tall   { height: 280px; }
  .page-title       { font-size: 22px; }
  .crumbs           { font-size: 15px; }
  .date-pill        { display: none; }
  .frame            { padding: 14px; }
  .card             { padding: 16px; }
  .chart-card       { padding: 14px; }
  .stat-value       { font-size: 18px; }
  table.data th,
  table.data td     { padding: 9px 10px; font-size: 12.5px; }
  .account-type-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .chart-box { height: 200px; }
  .stats     { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.muted   { color: var(--ink-mute); }
.small   { font-size: 12px; }
.right   { text-align: right; }
.mt-0    { margin-top: 0; }
.mb-0    { margin-bottom: 0; }
.nowrap  { white-space: nowrap; }
.bold    { font-weight: 600; }
.center  { text-align: center; }
