:root {
  --navy: #0B1220;
  --navy-light: #131E33;
  --gold: #D4AF37;
  --gold-soft: #E8CB6A;
  --white: #FFFFFF;
  --bg: #F5F7FA;
  --text: #1F2937;
  --text-muted: #6B7280;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #F59E0B;
  --border: #E5E7EB;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { text-decoration: none; color: inherit; }

/* ---------- Layout shell ---------- */
.app-shell { min-height: 100vh; }
.topbar {
  height: 60px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand { font-weight: 700; letter-spacing: 0.5px; font-size: 18px; }
.topbar-brand span { color: var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar-logout {
  background: var(--gold);
  color: var(--navy);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
}

.app-body { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
  width: 240px;
  background: var(--navy-light);
  color: var(--white);
  flex-shrink: 0;
  padding: 18px 0;
}
.sidebar-nav { display: flex; flex-direction: column; }
.nav-group-label {
  color: var(--gold-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 16px 20px 6px;
}
.nav-link {
  padding: 10px 20px;
  color: #D7DEEA;
  font-size: 14.5px;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-link.active {
  background: rgba(212,175,55,0.12);
  border-left-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.nav-sub { padding-left: 32px; font-size: 14px; }
.nav-logout { margin-top: 24px; color: #F1A9A9; }

.main-content { flex: 1; padding: 24px; min-width: 0; }

.hamburger-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  background: var(--navy);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.hamburger-btn span { width: 18px; height: 2px; background: var(--gold); }

/* ---------- Page heading ---------- */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; margin: 0 0 4px; }
.page-header p { color: var(--text-muted); margin: 0; font-size: 14px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #E7F7EC; color: #14532D; border: 1px solid #BBF0CB; }
.alert-error   { background: #FDECEC; color: #7F1D1D; border: 1px solid #F7C6C6; }
.alert-info    { background: #EAF2FF; color: #1E3A8A; border: 1px solid #C7DBFF; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 24px;
}
.panel h2 { font-size: 16px; margin: 0 0 16px; color: var(--navy); }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 30px; }
.info-item .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.info-item .value { font-size: 14.5px; margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.3px; }
tr:hover td { background: #FAFBFC; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-pending  { background: #FEF3C7; color: #92400E; }
.badge-approved { background: #DCFCE7; color: #166534; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-active   { background: #DCFCE7; color: #166534; }
.badge-inactive { background: #F3F4F6; color: #4B5563; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; margin-right: 4px; }

/* ---------- Filters / search ---------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type="text"], .filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.filter-bar input[type="text"] { min-width: 220px; }

/* ---------- Login page ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1A2A4A 100%);
  padding: 20px;
}
.auth-card {
  background: var(--white);
  width: 100%;
  max-width: 400px;
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; color: var(--navy); text-align: center; }
.auth-card .auth-sub { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-card .brand-gold { color: var(--gold); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; margin-bottom: 6px; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
}
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.auth-footer-link { text-align: center; font-size: 13.5px; margin-top: 18px; color: var(--text-muted); }
.auth-footer-link a { color: var(--gold); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 60px;
    bottom: 0;
    z-index: 25;
    transition: left 0.2s ease;
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }
  .topbar { padding-left: 58px; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}

/* ---------- Password show/hide eye toggle ---------- */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 42px !important; }
.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  color: var(--text-muted);
}
.toggle-password:hover { color: var(--text); }

/* ---------- Notification bell ---------- */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white);
  font-size: 19px;
  padding: 6px;
  line-height: 1;
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 38px;
  width: 320px;
  max-width: 90vw;
  max-height: 380px;
  overflow-y: auto;
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  z-index: 40;
}
.notif-dropdown.open { display: block; }
.notif-item {
  display: block;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #FAFBFC; }
.notif-item.unseen .notif-title { font-weight: 700; }
.notif-item .notif-title { font-weight: 500; color: var(--navy); }
.notif-item .notif-meta { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.notif-item .notif-time { color: var(--text-muted); font-size: 10.5px; margin-top: 4px; }
.notif-empty { padding: 18px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

.notif-kind {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 5px;
  vertical-align: middle;
}
.notif-kind-agent       { background: #E0E7FF; color: #3730A3; }
.notif-kind-application { background: #FEF3C7; color: #92400E; }
.notif-kind-lead        { background: #DCFCE7; color: #166534; }

/* ---------- Applicant / review detail ---------- */
.remarks-box {
  background: #FAFBFC;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  white-space: pre-wrap;
}
.review-actions textarea { min-height: 90px; }

/* ---------- Action button groups (mobile-friendly) ---------- */
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Extra responsive polish ---------- */
@media (max-width: 640px) {
  table.stack-on-mobile, table.stack-on-mobile thead { display: none; }
  table.stack-on-mobile, table.stack-on-mobile tbody, table.stack-on-mobile tr, table.stack-on-mobile td { display: block; width: 100%; }
  table.stack-on-mobile tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 8px 0; }
  table.stack-on-mobile td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: none;
    padding: 6px 14px;
    white-space: normal;
    text-align: right;
  }
  table.stack-on-mobile td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    font-size: 12px;
  }
  .notif-dropdown { position: fixed; left: 12px; right: 12px; width: auto; top: 58px; }
}
