:root {
  color-scheme: dark;
  --navy-950: #06192c;
  --navy-900: #0a213a;
  --navy-800: #12345c;
  --navy-700: #28557f;
  --gold: #f5b700;
  --gold-soft: #ffd65a;
  --green: #16cf6a;
  --red: #ff5a5f;
  --white: #f7f9fc;
  --muted: #a8b9cf;
  --line: #2b5b87;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--navy-950); color: var(--white); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.app-shell { min-height: 100vh; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(245, 183, 0, 0.13), transparent 32%),
    linear-gradient(145deg, var(--navy-950), #0d2b4c);
}
.login-card { width: min(440px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 26px; background: rgba(18, 52, 92, 0.94); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--gold); color: var(--navy-950); font-size: 25px; font-weight: 900; }
.brand h1 { margin: 0; font-size: 25px; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.login-copy { margin: 28px 0 20px; }
.login-copy h2 { margin: 0 0 8px; font-size: 30px; }
.login-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 750; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px;
  background: var(--navy-900); color: var(--white); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.16); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 72px; }
.text-button { border: 0; background: transparent; color: var(--gold); font-weight: 800; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 7px; }
.primary-button, .secondary-button, .danger-button {
  border-radius: 12px; padding: 11px 16px; font-weight: 850; border: 1px solid transparent;
}
.primary-button { background: var(--gold); color: var(--navy-950); }
.primary-button:hover:not(:disabled) { background: var(--gold-soft); }
.secondary-button { background: transparent; color: var(--white); border-color: var(--line); }
.secondary-button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.danger-button { background: rgba(255, 90, 95, 0.14); color: #ff9295; border-color: rgba(255, 90, 95, 0.4); }
.wide { width: 100%; }
.form-error { min-height: 20px; margin: 8px 0 12px; color: #ffb0b3; font-size: 13px; }
.security-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.dashboard { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px clamp(18px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(6, 25, 44, 0.96); backdrop-filter: blur(12px); }
.topbar .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 21px; }
.admin-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.content { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 36px 0 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h2 { margin: 0; font-size: clamp(30px, 5vw, 46px); }
.page-head p { margin: 7px 0 0; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(22, 207, 106, 0.8); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 12px; }
.tab { white-space: nowrap; padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-weight: 800; }
.tab.active { background: var(--gold); color: var(--navy-950); border-color: var(--gold); }
.panel { display: none; }
.panel.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 18px 0 24px; }
.metric, .card { border: 1px solid var(--line); border-radius: 18px; background: var(--navy-800); box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
.metric { padding: 20px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 7px; font-size: 31px; font-weight: 900; }
.metric-value.gold { color: var(--gold); }
.card { padding: 22px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.card h3 { margin: 0; font-size: 20px; }
.card-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-group { border: 1px solid var(--line); border-radius: 15px; padding: 17px; background: rgba(6, 25, 44, 0.3); }
.settings-group h4 { margin: 0 0 15px; color: var(--gold); }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 16px; color: var(--muted); }
.check-row input { accent-color: var(--gold); width: 18px; height: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.warning { border-left: 4px solid var(--gold); padding: 13px 14px; border-radius: 10px; background: rgba(245, 183, 0, 0.09); color: #ffe49a; font-size: 13px; line-height: 1.5; }
.filters { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 180px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(43, 91, 135, 0.7); font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(6, 25, 44, 0.38); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; text-transform: capitalize; background: rgba(168,185,207,.13); color: var(--muted); }
.badge.pending { background: rgba(245,183,0,.14); color: var(--gold-soft); }
.badge.approved, .badge.paid { background: rgba(22,207,106,.14); color: #64eea2; }
.badge.rejected, .badge.failed { background: rgba(255,90,95,.14); color: #ff9da0; }
.row-actions { display: flex; gap: 7px; }
.row-actions button { padding: 7px 10px; font-size: 12px; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--white); font-size: 18px; }
.skeleton { height: 90px; border-radius: 16px; background: linear-gradient(90deg, var(--navy-800), #19436f, var(--navy-800)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: 360px; padding: 13px 16px; border-radius: 12px; background: var(--white); color: var(--navy-950); box-shadow: var(--shadow); transform: translateY(130%); transition: transform .2s ease; font-weight: 750; }
.toast.show { transform: translateY(0); }
.toast.error { background: #ffd8da; color: #6d1115; }

@media (max-width: 850px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-card { padding: 25px 20px; }
  .topbar { align-items: flex-start; }
  .admin-meta { flex-direction: column; align-items: flex-end; gap: 5px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 16px; }
  .metric-value { font-size: 24px; }
  .inline-fields { grid-template-columns: 1fr; }
  .filters { align-items: stretch; flex-direction: column; }
  .filters .field { min-width: 0; }
}
