/* ==========================================================================
   Supervisi Bebas Mengajar — Design System
   Identitas: "ruang kendali" pengawasan sekolah — indigo tegas + amber sebagai
   sinyal perhatian (bukan biru langit yang dipakai app guru, supaya kedua
   aplikasi terasa jadi keluarga yang sama tapi peran berbeda terlihat jelas).
   ========================================================================== */

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

:root{
  --ink:            #0F172A;
  --ink-soft:       #334155;
  --muted:          #64748B;
  --bg:             #F1F3F9;
  --surface:        #FFFFFF;
  --border:         #E2E8F0;

  --primary:        #4338CA;
  --primary-dark:   #362FA0;
  --primary-light:  #EEF2FF;

  --accent:         #D97706;   /* sinyal perhatian: belum lapor, perlu tindak lanjut */
  --accent-light:   #FEF3C7;

  --success:        #16A34A;
  --success-light:  #DCFCE7;
  --danger:         #DC2626;
  --danger-light:   #FEE2E2;

  --radius:         14px;
  --radius-sm:      9px;
  --shadow:         0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg:      0 12px 32px rgba(15,23,42,.10);

  --font-display:   'Sora', system-ui, sans-serif;
  --font-body:      'Inter', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--font-body); font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ font-family:var(--font-display); color:var(--ink); margin:0 0 4px; letter-spacing:-.01em; }
a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }
code,.mono{ font-family:var(--font-mono); }
:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }

/* ---------- Layout shell ---------- */
.app-shell{ display:flex; min-height:100vh; }

.sidebar{
  width:264px; flex-shrink:0; background:var(--ink);
  color:#CBD5E1; display:flex; flex-direction:column;
  position:fixed; top:0; bottom:0; left:0; z-index:40;
  transition:transform .25s ease;
}
.sidebar-brand{
  padding:22px 22px 18px; display:flex; align-items:center; gap:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar-brand .dot{ width:10px; height:10px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px rgba(217,119,6,.25); }
.sidebar-brand strong{ font-family:var(--font-display); color:#fff; font-size:16px; display:block; }
.sidebar-brand span{ font-size:11.5px; color:#94A3B8; }

.sidebar-sekolah{ padding:14px 22px; font-size:12.5px; color:#94A3B8; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar-sekolah strong{ display:block; color:#E2E8F0; font-size:13.5px; font-weight:600; margin-bottom:2px; }

.nav{ padding:14px 12px; display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto; }
.nav a{
  display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px;
  color:#CBD5E1; font-size:14px; font-weight:500; text-decoration:none;
  border-left:3px solid transparent;
}
.nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.nav a.active{ background:rgba(67,56,202,.35); color:#fff; border-left-color:var(--accent); }
.nav .icon{ width:18px; text-align:center; opacity:.85; }
.nav-group-label{ font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:#64748B; padding:14px 12px 4px; }

.sidebar-foot{ padding:16px 22px; border-top:1px solid rgba(255,255,255,.08); font-size:12.5px; color:#94A3B8; }
.sidebar-foot a{ color:#CBD5E1; }

.main{ flex:1; margin-left:264px; display:flex; flex-direction:column; min-height:100vh; }
.topbar{
  background:var(--surface); border-bottom:1px solid var(--border);
  padding:14px 28px; display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:30;
}
.topbar h1{ font-size:19px; }
.topbar-sub{ color:var(--muted); font-size:13px; margin-top:2px; }
.menu-toggle{ display:none; background:none; border:none; font-size:20px; cursor:pointer; color:var(--ink); }

.content{ padding:26px 28px 60px; max-width:1320px; width:100%; }

/* ---------- Cards & stats ---------- */
.grid{ display:grid; gap:18px; }
.grid-4{ grid-template-columns:repeat(4,1fr); }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-2{ grid-template-columns:repeat(2,1fr); }
@media (max-width:1100px){ .grid-4{grid-template-columns:repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .grid-4,.grid-3,.grid-2{grid-template-columns:1fr;} }

.card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); }
.card-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.card-head h3{ font-size:15px; }

.stat-card{ padding:18px 20px; }
.stat-card .label{ font-size:12.5px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.stat-card .value{ font-family:var(--font-display); font-size:30px; font-weight:700; margin-top:6px; color:var(--ink); }
.stat-card .delta{ font-size:12.5px; margin-top:6px; color:var(--muted); }
.stat-card .delta.up{ color:var(--success); }
.stat-card .delta.warn{ color:var(--accent); }

/* ---------- Activity pulse (elemen signature: kesegaran data guru) ---------- */
.pulse{ display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; }
.pulse .dot{ width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.pulse.aktif .dot{ background:var(--success); box-shadow:0 0 0 3px var(--success-light); }
.pulse.aktif{ color:#166534; }
.pulse.jarang .dot{ background:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
.pulse.jarang{ color:#92400E; }
.pulse.sepi .dot{ background:var(--danger); box-shadow:0 0 0 3px var(--danger-light); }
.pulse.sepi{ color:#991B1B; }

/* ---------- Table ---------- */
.table-wrap{ overflow-x:auto; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface); }
table{ width:100%; border-collapse:collapse; font-size:14px; }
thead th{
  text-align:left; padding:12px 16px; background:#F8FAFC; color:var(--muted);
  font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.04em;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
tbody td{ padding:12px 16px; border-bottom:1px solid var(--border); vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background:#FAFBFF; }

/* ---------- Buttons & forms ---------- */
.btn{
  display:inline-flex; align-items:center; gap:7px; padding:10px 16px; border-radius:10px;
  font-weight:600; font-size:14px; border:1px solid transparent; cursor:pointer;
  background:var(--primary); color:#fff; transition:.15s;
}
.btn:hover{ background:var(--primary-dark); text-decoration:none; }
.btn.secondary{ background:var(--surface); color:var(--ink); border-color:var(--border); }
.btn.secondary:hover{ background:#F8FAFC; }
.btn.ghost{ background:transparent; color:var(--primary); }
.btn.danger{ background:var(--danger); }
.btn.sm{ padding:6px 12px; font-size:13px; border-radius:8px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.form-group{ margin-bottom:16px; }
label{ display:block; font-size:13px; font-weight:600; color:var(--ink-soft); margin-bottom:6px; }
input[type=text],input[type=email],input[type=password],input[type=date],input[type=tel],select,textarea{
  width:100%; padding:10px 13px; border:1px solid var(--border); border-radius:10px;
  font-size:14px; font-family:var(--font-body); background:#fff; color:var(--ink);
}
input:focus,select:focus,textarea:focus{ border-color:var(--primary); outline:none; box-shadow:0 0 0 3px var(--primary-light); }
.hint{ font-size:12.5px; color:var(--muted); margin-top:5px; }

.badge{ display:inline-block; padding:3px 10px; border-radius:99px; font-size:12px; font-weight:600; }
.badge.pro{ background:var(--primary-light); color:var(--primary); }
.badge.aktif{ background:var(--success-light); color:#166534; }
.badge.nonaktif{ background:var(--danger-light); color:#991B1B; }

.chip-kode{ font-family:var(--font-mono); background:var(--primary-light); color:var(--primary); padding:4px 10px; border-radius:8px; font-size:13px; letter-spacing:.02em; }

/* ---------- Auth pages ---------- */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--ink); padding:24px; }
.auth-card{ width:100%; max-width:440px; background:var(--surface); border-radius:20px; padding:36px 32px; box-shadow:var(--shadow-lg); }
.auth-logo{ display:flex; align-items:center; gap:10px; margin-bottom:22px; }
.auth-logo .dot{ width:11px; height:11px; border-radius:50%; background:var(--accent); }
.auth-logo strong{ font-family:var(--font-display); font-size:18px; }
.auth-foot{ text-align:center; margin-top:20px; font-size:13.5px; color:var(--muted); }
.alert{ padding:12px 14px; border-radius:10px; font-size:13.5px; margin-bottom:16px; }
.alert.error{ background:var(--danger-light); color:#991B1B; }
.alert.success{ background:var(--success-light); color:#166534; }
.alert.info{ background:var(--primary-light); color:var(--primary); }

/* ---------- Empty state ---------- */
.empty{ text-align:center; padding:48px 20px; color:var(--muted); }
.empty .icon{ font-size:34px; margin-bottom:10px; }

/* ---------- Modal ---------- */
.modal-overlay{ position:fixed; inset:0; background:rgba(15,23,42,.55); display:none; align-items:center; justify-content:center; z-index:100; padding:20px; }
.modal-overlay.open{ display:flex; }
.modal{ background:#fff; border-radius:16px; width:100%; max-width:560px; max-height:88vh; overflow-y:auto; padding:24px; }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.modal-close{ background:none; border:none; font-size:20px; cursor:pointer; color:var(--muted); }

.toast{ position:fixed; bottom:24px; right:24px; background:var(--ink); color:#fff; padding:13px 18px; border-radius:10px; font-size:14px; box-shadow:var(--shadow-lg); z-index:200; opacity:0; transform:translateY(8px); transition:.2s; }
.toast.show{ opacity:1; transform:translateY(0); }

.filter-bar{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; align-items:end; }
.filter-bar .form-group{ margin-bottom:0; min-width:150px; }

.link-drive{ display:inline-flex; align-items:center; gap:5px; font-size:13px; font-weight:600; color:var(--primary); background:var(--primary-light); padding:5px 10px; border-radius:8px; }
.link-drive:hover{ text-decoration:none; background:#E0E5FB; }
.no-drive{ font-size:12.5px; color:var(--muted); font-style:italic; }

@media (max-width:900px){
  .sidebar{ transform:translateX(-100%); }
  .sidebar.open{ transform:translateX(0); }
  .main{ margin-left:0; }
  .menu-toggle{ display:block; }
  .content{ padding:18px; }
}
