/* Bingo Finance — Brand: #FF6B00 orange, #0A0A0A black, #FFFFFF white, Plus Jakarta Sans */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #FF6B00;
  --orange-light: #FFF0E6;
  --orange-dark: #CC5500;
  --black: #0A0A0A;
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-400: #999999;
  --gray-600: #555555;
  --green: #16A34A;
  --green-light: #DCFCE7;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --yellow: #D97706;
  --yellow-light: #FEF3C7;
  --sidebar-w: 220px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--black);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--orange);
  color: white;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 18px; font-weight: 800;
  flex-shrink: 0;
}

.logo-name { font-size: 15px; font-weight: 800; letter-spacing: 0.05em; }
.logo-sub { font-size: 11px; color: var(--gray-400); font-weight: 500; }

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.nav-item.active { background: var(--orange); color: var(--white); }

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

.alert-badge {
  background: var(--red);
  color: white;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  display: inline-block;
}

.sidebar-tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  line-height: 1.5;
  font-style: italic;
}

/* ── Main ────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0;
  z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 700; color: var(--black); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.month-picker input {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--black);
  background: var(--gray-50);
  cursor: pointer;
}

.topbar-date { font-size: 12px; color: var(--gray-400); font-weight: 500; }

.content { padding: 24px 28px; flex: 1; }

/* ── Flash Messages ──────────────────────────────────── */
.flash-messages { padding: 12px 28px 0; }
.flash { padding: 10px 16px; border-radius: 7px; font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.flash-success { background: var(--green-light); color: var(--green); }
.flash-danger, .flash-error { background: var(--red-light); color: var(--red); }
.flash-warning { background: var(--yellow-light); color: var(--yellow); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 14px; font-weight: 700; color: var(--black); }
.card-body { padding: 20px; }
.card-body-sm { padding: 12px 20px; }

/* ── Stat Cards ──────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label { font-size: 12px; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--black); line-height: 1.1; }
.stat-value.orange { color: var(--orange); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.stat-accent { width: 3px; height: 36px; background: var(--orange); border-radius: 2px; margin-right: 12px; flex-shrink: 0; }
.stat-card-inner { display: flex; align-items: flex-start; }
.stat-card-inner .stat-accent { margin-top: 2px; }

/* ── Progress Bar ────────────────────────────────────── */
.progress-wrap { margin-top: 8px; }
.progress-bar-track { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--orange); border-radius: 99px; transition: width 0.4s; }
.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.red { background: var(--red); }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th { font-size: 11.5px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 16px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); text-align: left; }
td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-orange { background: var(--orange-light); color: var(--orange-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-200); color: var(--black); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { color: var(--orange); background: var(--orange-light); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { opacity: 0.9; }

/* ── Forms ───────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 600; color: var(--gray-600); }
input, select, textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--black);
  background: var(--white);
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Alert Boxes ─────────────────────────────────────── */
.alert-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
}
.alert-item.danger { background: var(--red-light); color: var(--red); }
.alert-item.warning { background: var(--yellow-light); color: var(--yellow); }
.alert-item.info { background: var(--orange-light); color: var(--orange-dark); }
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-content strong { display: block; font-weight: 700; margin-bottom: 2px; }

/* ── Grid Layouts ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── Chart Container ─────────────────────────────────── */
.chart-container { position: relative; height: 240px; }

/* ── Category List ───────────────────────────────────── */
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-item { display: flex; align-items: center; gap: 10px; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cat-name { flex: 1; font-size: 13px; font-weight: 500; }
.cat-amount { font-size: 13.5px; font-weight: 700; }
.cat-bar { height: 4px; background: var(--gray-100); border-radius: 99px; margin-top: 2px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: var(--orange); border-radius: 99px; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 12px;
  width: 480px; max-width: 95vw;
  box-shadow: var(--shadow-md);
  max-height: 85vh; overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-400); padding: 0 4px; }
.modal-close:hover { color: var(--black); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Section Headers ─────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--black); }

/* ── Empty State ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-400); }
.empty-state p { font-size: 13.5px; }

/* ── Metric Cards (Intelligence) ─────────────────────── */
.metric-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.metric-label { font-size: 11.5px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.metric-value { font-size: 26px; font-weight: 800; color: var(--black); }
.metric-target { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.metric-card.highlight { border-color: var(--orange); }
.metric-card.highlight .metric-value { color: var(--orange); }

/* ── Goal Cards ──────────────────────────────────────── */
.goal-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
}
.goal-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.goal-numbers { display: flex; justify-content: space-between; font-size: 13px; color: var(--gray-600); margin-bottom: 10px; }
.goal-on-track { color: var(--green); font-size: 12px; font-weight: 600; }
.goal-behind { color: var(--red); font-size: 12px; font-weight: 600; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-wide { grid-template-columns: 1fr; }
}

/* ── Utilities ───────────────────────────────────────── */
.text-orange { color: var(--orange); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gray { color: var(--gray-400); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Courier New', monospace; }
.nowrap { white-space: nowrap; }
