/* =========================================================
   SiAjar - Design Tokens
   Palet   : teal madrasah + aksen emas prestasi
   Tipografi: Fraunces (display, dipakai terbatas) + Plus Jakarta Sans (UI/data)
   Motif   : cincin radius (mengacu pada fitur presensi GPS berbasis radius)
   ========================================================= */
:root {
  --brand-900: #0F3D3E;
  --brand-800: #124A48;
  --brand-700: #17615C;
  --brand-500: #1E8A73;
  --brand-100: #E4F2ED;
  --gold-600:  #B98A2E;
  --gold-500:  #C89B3C;
  --gold-100:  #FBF1DC;
  --ink-900:   #16211E;
  --ink-600:   #4B5A56;
  --paper-50:  #F7F7F4;
  --paper-100: #EFEFE9;
  --line:      #E3E1D9;
  --danger:    #C24545;
  --radius-lg: 18px;
  --radius-md: 12px;
}

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper-50);
  color: var(--ink-900);
  font-size: 15px;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
}

/* ---------- Brand wordmark ---------- */
.brand-mark {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark .ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-500), var(--brand-500) 70%);
  position: relative;
  flex: none;
}
.brand-mark .ring::after {
  content: "";
  position: absolute; inset: -6px;
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 50%;
}

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

.sidebar {
  width: 258px;
  background: linear-gradient(180deg, var(--brand-900), var(--brand-800));
  color: #EAF3F1;
  flex: none;
  min-height: 100vh;
  position: sticky;
  top: 0;
  padding: 22px 16px;
}
.sidebar .nav-section {
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .09em;
  color: rgba(234,243,241,.55);
  margin: 20px 10px 8px;
  font-weight: 700;
}
.sidebar .nav-link {
  color: #D7E7E3;
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  font-size: .89rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s ease, color .15s ease;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 2px 10px rgba(30,138,115,.35);
}
.sidebar .nav-link i { width: 18px; text-align: center; opacity: .9; }

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

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-wrap { padding: 24px; }

.page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--brand-900);
  margin-bottom: 2px;
}
.page-subtitle { color: var(--ink-600); font-size: .88rem; margin-bottom: 20px; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15,61,62,.04);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-weight: 700;
  color: var(--brand-900);
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.stat-card .stat-label { font-size: .78rem; color: var(--ink-600); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-family: 'Fraunces', Georgia, serif; font-size: 2.1rem; font-weight: 600; color: var(--brand-900); line-height: 1.1; margin-top: 4px; }
.stat-card .stat-ring {
  position: absolute; right: -18px; top: -18px;
  width: 90px; height: 90px; border-radius: 50%;
  border: 14px solid var(--brand-100);
}
.stat-card.gold .stat-ring { border-color: var(--gold-100); }
.stat-card.gold .stat-value { color: var(--gold-600); }

/* ---------- Buttons ---------- */
.btn-brand {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  font-weight: 600;
}
.btn-brand:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-outline-brand {
  border-color: var(--brand-500); color: var(--brand-700); font-weight: 600;
}
.btn-outline-brand:hover { background: var(--brand-500); color: #fff; }
.btn-gold { background: var(--gold-500); border-color: var(--gold-500); color: #fff; font-weight: 600; }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }

/* ---------- Tables ---------- */
.table thead th {
  background: var(--brand-900);
  color: #fff;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  border: none;
  white-space: nowrap;
}
.table-hover tbody tr:hover { background: var(--brand-100); }
.table td, .table th { vertical-align: middle; padding: 10px 12px; }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  background: var(--brand-900);
}
.login-visual {
  flex: 1.1;
  background:
    radial-gradient(circle at 70% 30%, rgba(200,155,60,.25), transparent 45%),
    radial-gradient(circle at 30% 75%, rgba(30,138,115,.5), transparent 50%),
    var(--brand-900);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-visual .ping {
  position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
}
.login-form-side {
  flex: 1;
  background: var(--paper-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login-card { max-width: 380px; width: 100%; }

/* ---------- Misc ---------- */
.badge { font-weight: 600; font-size: .72rem; padding: .42em .6em; }
a { color: var(--brand-700); }
.text-brand { color: var(--brand-700) !important; }
.section-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-600);
}
.form-label { font-weight: 600; font-size: .84rem; color: var(--ink-900); }
.form-control, .form-select {
  border-color: var(--line);
  border-radius: 9px;
  padding: 9px 12px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 .18rem rgba(30,138,115,.15);
}

#gps-status { font-size: .85rem; }
.gps-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -270px; z-index: 1050; transition: left .2s ease; height: 100vh; }
  .sidebar.open { left: 0; }
  .login-visual { display: none; }
}
