/* ============================================================
   SENATUS REFERRAL SYSTEM — Main Stylesheet
   Navy #0D1F3C | Gold #C9A84C | White #FFFFFF
   ============================================================ */

:root {
  --navy:       #0D1F3C;
  --navy2:      #15284F;
  --gold:       #C9A84C;
  --gold-light: #F0D080;
  --gold-bg:    #FBF3DC;
  --white:      #FFFFFF;
  --off-white:  #F7F8FA;
  --muted:      #64748B;
  --border:     #E2E8F0;
  --text:       #1E293B;
  --danger:     #EF4444;
  --success:    #059669;
  --info:       #3B82F6;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(13,31,60,.10);
  --shadow-lg:  0 4px 24px rgba(13,31,60,.16);
}

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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--off-white);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 240px; height: 100vh;
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  transition: transform .3s;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(201,168,76,.2);
}
.sidebar-logo img { width: 140px; height: auto; }
.sidebar-logo .app-label {
  color: var(--gold); font-size: 10px;
  letter-spacing: 3px; text-transform: uppercase;
  margin-top: 6px; display: block;
}
.sidebar nav { flex: 1; padding: 12px 0; }
.nav-section { padding: 12px 20px 4px; font-size: 10px;
  color: rgba(201,168,76,.5); text-transform: uppercase; letter-spacing: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; color: #8A9AB8;
  font-size: 14px; transition: all .2s;
  border-left: 3px solid transparent;
}
.nav-link:hover, .nav-link.active {
  color: var(--white); background: rgba(255,255,255,.06);
  border-left-color: var(--gold);
}
.nav-link i { width: 18px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.user-badge {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info .name { color: var(--white); font-size: 13px; font-weight: 600; }
.user-info .role { color: var(--muted); font-size: 11px; }
.btn-logout {
  display: block; text-align: center;
  background: rgba(239,68,68,.15); color: #FCA5A5;
  padding: 8px; border-radius: var(--radius);
  font-size: 12px; transition: background .2s;
}
.btn-logout:hover { background: rgba(239,68,68,.3); color: #fff; }

/* ── MAIN LAYOUT ── */
.main { margin-left: 240px; padding: 28px; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--navy); }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── CARDS ── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 700; color: var(--navy); }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  border-left: 4px solid var(--gold);
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-card.blue  { border-left-color: var(--info); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.red   { border-left-color: var(--danger); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy2); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger  { background: var(--danger);  color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 12px; font-weight: 600;
  color: var(--navy); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], textarea, select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 14px; background: var(--white); color: var(--text);
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--navy); color: var(--gold);
  padding: 12px 16px; text-align: left; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: #F8FAFC; }
tbody td { padding: 13px 16px; vertical-align: middle; }
.no-data { text-align: center; color: var(--muted); padding: 40px; }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.service-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content:''; position:absolute; left:10px; top:0; bottom:0;
  width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline-date { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.timeline-content {
  background: var(--off-white); border-radius: var(--radius);
  padding: 12px 16px; border-left: 3px solid var(--gold);
}
.timeline-title { font-weight: 700; color: var(--navy); font-size: 13px; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 28px;
  width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-close { cursor: pointer; color: var(--muted); font-size: 20px;
  background: none; border: none; line-height: 1; }
.modal-close:hover { color: var(--danger); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: 13px; display: flex;
  align-items: center; gap: 10px;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-danger   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info     { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }
.alert-gold     { background: var(--gold-bg); color: #78350F; border: 1px solid var(--gold); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--navy);
}
.login-box {
  background: var(--white); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 44px 40px;
  width: 100%; max-width: 420px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 160px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--navy); text-align: center; margin-bottom: 6px; }
.login-sub   { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }

/* ── SEARCH / FILTERS ── */
.filter-bar {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap; margin-bottom: 18px;
}
.filter-bar input, .filter-bar select {
  flex: 1; min-width: 150px; max-width: 220px;
}
.filter-bar .btn { flex-shrink: 0; }

/* ── HAMBURGER (mobile) ── */
.hamburger { display: none; cursor: pointer;
  background: var(--navy); color: var(--white); border: none;
  padding: 10px; border-radius: 6px; font-size: 18px; }

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  thead { display: none; }
  tbody tr { display: block; padding: 12px; border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 10px; }
  tbody td { display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border: none; font-size: 13px; }
  tbody td::before { content: attr(data-label);
    font-weight: 700; color: var(--muted); font-size: 11px;
    text-transform: uppercase; flex-shrink: 0; margin-right: 8px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ── MISC ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted  { color: var(--muted); }
.text-gold   { color: var(--gold); }
.text-navy   { color: var(--navy); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.ref-code { font-family: monospace; background: var(--gold-bg);
  color: var(--navy); padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 700; }
