/* ============================================
   ADMIN PANEL — Microsite UBISA
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --navy:      #0f2654;
  --navy-mid:  #1a3a7c;
  --navy-soft: #e8edf8;
  --gold:      #d4a017;
  --gold-lt:   #f5c842;
  --green:     #16a34a;
  --green-lt:  #dcfce7;
  --red:       #dc2626;
  --red-lt:    #fee2e2;
  --orange:    #ea580c;
  --orange-lt: #ffedd5;
  --surface:   #f1f4fb;
  --white:     #ffffff;
  --text:      #1c1c2e;
  --muted:     #6b7280;
  --border:    #e2e8f0;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 1px 8px rgba(15,38,84,0.09);
  --shadow-lg: 0 4px 24px rgba(15,38,84,0.13);
  --sidebar-w: 256px;
  --font-h:    'Plus Jakarta Sans', sans-serif;
  --font-b:    'Inter', sans-serif;
  --tr:        0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-b); background: var(--surface); color: var(--text);
       -webkit-font-smoothing: antialiased; display: flex; min-height: 100vh; }

a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── SIDEBAR ──────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; transition: transform var(--tr);
  overflow-y: auto;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-title {
  font-family: var(--font-h); font-weight: 800;
  font-size: 1rem; color: #fff; line-height: 1.2;
}
.sidebar-logo .logo-sub { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 2px; }

.sidebar-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--gold); color: var(--navy);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-h); font-weight: 800; font-size: 0.85rem;
}
.user-name  { font-size: 0.82rem; font-weight: 600; color: #fff; }
.user-role  { font-size: 0.7rem; color: rgba(255,255,255,0.45); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 14px 12px; }
.nav-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3); padding: 10px 10px 6px;
  font-weight: 700; font-family: var(--font-h);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.7); font-size: 0.85rem;
  font-weight: 500; text-decoration: none;
  transition: var(--tr); margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--gold); color: var(--navy); font-weight: 700; }
.nav-item .ni { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.5); font-size: 0.8rem; padding: 8px 10px;
  border-radius: 8px; transition: var(--tr);
}
.sidebar-footer a:hover { background: rgba(220,38,38,0.2); color: #fca5a5; text-decoration: none; }

/* ── MAIN LAYOUT ──────────────────────────── */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-family: var(--font-h); font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

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

/* ── CARDS ────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: var(--font-h); font-weight: 700; font-size: 1rem; color: var(--navy); }
.card-body { padding: 22px; }

/* ── STAT BOXES ───────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
            padding: 20px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px;
             display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: var(--green-lt); }
.stat-icon.gold   { background: #fef3c7; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.red    { background: var(--red-lt); }
.stat-num  { font-family: var(--font-h); font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-lbl  { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }

/* ── TABLES ───────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--surface); }
th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--muted);
     font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
     border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8faff; }

/* ── BADGES ───────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; font-family: var(--font-h);
}
.badge-green  { background: var(--green-lt);  color: #15803d; }
.badge-red    { background: var(--red-lt);    color: #b91c1c; }
.badge-gold   { background: #fef3c7;          color: #92400e; }
.badge-navy   { background: var(--navy-soft); color: var(--navy); }
.badge-purple { background: #ede9fe;          color: #6d28d9; }

/* ── BUTTONS ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: none; font-family: var(--font-b); transition: var(--tr);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: 0.88; }
.btn-primary   { background: var(--navy);    color: #fff; }
.btn-gold      { background: var(--gold);    color: var(--navy); }
.btn-green     { background: var(--green);   color: #fff; }
.btn-red       { background: var(--red);     color: #fff; }
.btn-ghost     { background: transparent;    color: var(--text); border: 1px solid var(--border); }
.btn-sm        { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon      { padding: 6px 10px; }

/* ── FORMS ────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 0.82rem;
              color: var(--text); margin-bottom: 6px; }
.form-label span { color: var(--red); margin-left: 2px; }
.form-control {
  width: 100%; padding: 9px 13px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.88rem; font-family: var(--font-b);
  color: var(--text); background: var(--white); transition: var(--tr);
  outline: none;
}
.form-control:focus { border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(26,58,124,0.1); }
.form-control::placeholder { color: #adb5bd; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── ALERTS / FLASH ───────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.875rem; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 500;
}
.alert-success { background: var(--green-lt); color: #15803d; border-left: 3px solid var(--green); }
.alert-error   { background: var(--red-lt);   color: #b91c1c; border-left: 3px solid var(--red); }
.alert-warning { background: var(--orange-lt);color: var(--orange); border-left: 3px solid var(--orange); }
.alert-info    { background: var(--navy-soft); color: var(--navy); border-left: 3px solid var(--navy); }

/* ── EMPTY STATE ──────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state .empty-title { font-family: var(--font-h); font-weight: 700; font-size: 1rem; color: var(--text); }
.empty-state .empty-desc  { font-size: 0.85rem; margin-top: 6px; }

/* ── MODAL ────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 500;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  margin: 16px; animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95) } to { opacity:1; transform:scale(1) } }
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-h); font-weight: 700; font-size: 1rem; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--red); }
.modal-body   { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border);
                display: flex; justify-content: flex-end; gap: 10px; }

/* ── TOGGLE SWITCH ────────────────────────── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #cbd5e1;
  border-radius: 22px; cursor: pointer; transition: var(--tr);
}
.slider:before {
  content: ''; position: absolute;
  height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: var(--tr);
}
.toggle input:checked + .slider { background: var(--green); }
.toggle input:checked + .slider:before { transform: translateX(18px); }

/* ── LOGIN PAGE ───────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center;
              justify-content: center; background: var(--navy);
              padding: 24px; margin-left: 0 !important; }
.login-box {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-badge {
  width: 60px; height: 60px; background: var(--navy);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 1.8rem;
}
.login-logo h1 { font-family: var(--font-h); font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.login-logo p  { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
