@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy: #0a1628;
  --navy-mid: #111f3a;
  --navy-light: #1a2f52;
  --navy-border: #1e3461;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dim: rgba(201,168,76,0.15);
  --teal: #0d9488;
  --teal-light: #14b8a6;
  --sidebar-w: 260px;
  --white: #ffffff;
  --text: #e8edf5;
  --text-muted: #7a95b8;
  --surface: #131f35;
  --surface2: #1a2a47;
  --border: rgba(255,255,255,0.07);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-mid);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--navy-border);
}

.sidebar-brand .brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
}

.sidebar-brand h1 {
  font-size: 15px; font-weight: 800;
  color: var(--white); letter-spacing: 0.3px;
}
.sidebar-brand p {
  font-size: 11px; color: var(--gold); font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 20px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  border-radius: 0;
  transition: all 0.2s;
  position: relative;
  margin: 1px 8px;
  border-radius: 8px;
}

.nav-item:hover { background: var(--navy-light); color: var(--white); }

.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-light);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; background: var(--gold);
  border-radius: 0 3px 3px 0;
  left: -8px;
}

.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
}

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

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--navy-light);
  border-radius: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  color: var(--text-muted); font-size: 16px;
  text-decoration: none; padding: 4px;
  transition: color 0.2s;
}
.logout-btn:hover { color: var(--danger); }

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

.topbar {
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-size: 17px; font-weight: 700; color: var(--white); }
.topbar-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

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

.content-area { padding: 28px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.card-title { font-size: 14px; font-weight: 700; color: var(--white); }
.card-header-actions { margin-left: auto; }
.card-body { padding: 20px; }

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 12px 0 80px;
  opacity: 0.07;
}

.stat-card.gold::after { background: var(--gold); }
.stat-card.teal::after { background: var(--teal); }
.stat-card.success::after { background: var(--success); }
.stat-card.info::after { background: var(--info); }

.stat-icon {
  font-size: 24px; margin-bottom: 12px;
}

.stat-value {
  font-size: 26px; font-weight: 800; color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

.stat-sub { font-size: 11px; color: var(--gold); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); color: var(--navy); }

.btn-teal { background: var(--teal); color: white; }
.btn-teal:hover { background: var(--teal-light); color: white; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; color: white; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }

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

table { width: 100%; border-collapse: collapse; }

th {
  padding: 11px 14px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px;
  border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
}

td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-gold { background: var(--gold-dim); color: var(--gold-light); }
.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-info { background: rgba(56,189,248,0.15); color: #7dd3fc; }
.badge-muted { background: rgba(122,149,184,0.15); color: var(--text-muted); }
.badge-teal { background: rgba(13,148,136,0.15); color: #2dd4bf; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }

.form-control, .form-select {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--white);
  padding: 9px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.form-check-label { font-size: 13px; color: var(--text); cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.form-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.form-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--gold); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.25); color: #4ade80; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); color: #fbbf24; }
.alert-info { background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.25); color: #7dd3fc; }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input-wrap { position: relative; }
.search-input-wrap input {
  padding-left: 36px;
  min-width: 220px;
}
.search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}

/* ── STATUS STEPS ── */
.status-flow {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px;
}
.status-step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.status-step:first-child { border-radius: 8px 0 0 8px; }
.status-step:last-child { border-radius: 0 8px 8px 0; }
.status-step.done { background: rgba(34,197,94,0.1); color: #4ade80; border-color: rgba(34,197,94,0.25); }
.status-step.active { background: var(--gold-dim); color: var(--gold-light); border-color: rgba(201,168,76,0.3); }
.status-arrow { color: var(--navy-border); font-size: 12px; }

/* ── PAYSLIP TOTALS BAR ── */
.totals-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 20px;
}
.totals-bar-item {
  background: var(--surface2); padding: 14px 16px;
}
.totals-bar-item .label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.totals-bar-item .value { font-size: 16px; font-weight: 800; color: var(--white); font-family: 'JetBrains Mono', monospace; margin-top: 4px; }
.totals-bar-item.highlight .value { color: var(--gold-light); }
.totals-bar-item.net .value { color: #4ade80; }

/* ── SIDEBAR TOGGLE ── */
.sidebar-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 22px; padding: 4px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 4px; margin-top: 16px; }
.page-link {
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  background: var(--surface2); color: var(--text-muted);
  text-decoration: none; border: 1px solid var(--border);
  transition: all 0.2s;
}
.page-link:hover, .page-link.active { background: var(--gold-dim); color: var(--gold-light); border-color: rgba(201,168,76,0.3); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .content-area { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── CHART AREA ── */
.chart-bar-wrap {
  display: flex; align-items: flex-end; gap: 6px;
  height: 80px; padding: 0 4px;
}
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar {
  width: 100%; background: var(--gold-dim);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  position: relative;
}
.chart-bar:hover { background: var(--gold); }
.chart-bar-label { font-size: 10px; color: var(--text-muted); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 16px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo .icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 12px;
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--white); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── MISC ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-light); }
.text-success { color: #4ade80; }
.text-danger { color: #f87171; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:99; }
.overlay.show { display:block; }
