/* =====================================================================
   APLIKASI PIKET GURU — design tokens & layout
   Palette  : deep pine emerald (#123B33) + warm gold accent (#C89B3C)
              on a quiet off-white canvas (#F7F7F5)
   Type     : "Lexend" (display / nav / headings) + "Inter" (body / data)
   Signature: the "jam pelajaran" period-strip used on the dashboard &
              kehadiran screens — a school-bell timeline, not a generic stat card.
   ===================================================================== */

:root{
  --emerald-950:#0B2B25;
  --emerald-900:#123B33;
  --emerald-800:#194F44;
  --emerald-700:#206455;
  --emerald-100:#DCEAE6;
  --emerald-50:#EEF5F3;

  --gold-600:#B98A2E;
  --gold-500:#C89B3C;
  --gold-100:#F5E9CE;

  --ink-900:#1B221F;
  --ink-600:#4B564F;
  --ink-400:#7C877F;
  --line:#E4E4DE;
  --canvas:#F7F7F5;
  --card:#FFFFFF;

  --red-600:#C0392B;
  --red-100:#FBE3DF;
  --amber-600:#B7791F;
  --amber-100:#FBEBD0;
  --blue-600:#2563A8;
  --blue-100:#DDEBF9;
  --violet-600:#6D4EA6;
  --violet-100:#E9E1F5;
  --green-600:#1F7A4D;
  --green-100:#DDF0E4;

  --radius-lg:16px;
  --radius-md:12px;
  --radius-sm:8px;
  --shadow-card:0 1px 2px rgba(18,59,51,.06), 0 8px 24px -12px rgba(18,59,51,.12);
  --sidebar-w:264px;
}

*{box-sizing:border-box;}

body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  background:var(--canvas);
  color:var(--ink-900);
  margin:0;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4,h5,h6,.font-display{
  font-family:'Lexend',sans-serif;
  color:var(--emerald-950);
  letter-spacing:-0.01em;
}

a{ color:var(--emerald-800); text-decoration:none; }
a:hover{ color:var(--emerald-900); }

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

.sidebar{
  width:var(--sidebar-w);
  background:linear-gradient(180deg,var(--emerald-950) 0%, var(--emerald-900) 100%);
  color:#EAF3F0;
  position:fixed;
  top:0; left:0; bottom:0;
  display:flex;
  flex-direction:column;
  z-index:1030;
  transition:transform .25s ease;
}

.sidebar-brand{
  display:flex; align-items:center; gap:.7rem;
  padding:1.35rem 1.4rem 1.1rem;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar-brand .badge-mark{
  width:38px; height:38px; border-radius:10px;
  background:var(--gold-500);
  display:flex; align-items:center; justify-content:center;
  color:var(--emerald-950); font-family:'Lexend',sans-serif; font-weight:700; font-size:1.05rem;
  flex-shrink:0;
}
.sidebar-brand .brand-text{ line-height:1.15; }
.sidebar-brand .brand-text strong{ font-family:'Lexend',sans-serif; font-size:.98rem; display:block; color:#fff;}
.sidebar-brand .brand-text span{ font-size:.72rem; color:#9FC3B7; }

.sidebar-nav{ padding:1rem .8rem; overflow-y:auto; flex:1; }
.sidebar-nav .nav-group-label{
  font-size:.68rem; text-transform:uppercase; letter-spacing:.08em;
  color:#6E998A; padding:.9rem .6rem .35rem;
  font-weight:600;
}
.sidebar-nav a.nav-link{
  display:flex; align-items:center; gap:.65rem;
  padding:.62rem .7rem; border-radius:10px;
  color:#CFE4DC; font-size:.9rem; font-weight:500;
  margin-bottom:.15rem;
}
.sidebar-nav a.nav-link i{ font-size:1.05rem; width:20px; text-align:center; color:#8FBBAC; }
.sidebar-nav a.nav-link:hover{ background:rgba(255,255,255,.06); color:#fff; }
.sidebar-nav a.nav-link.active{
  background:var(--gold-500); color:var(--emerald-950); font-weight:600;
}
.sidebar-nav a.nav-link.active i{ color:var(--emerald-950); }

.sidebar-foot{
  padding:1rem 1.2rem 1.3rem; border-top:1px solid rgba(255,255,255,.08);
  font-size:.74rem; color:#7FA898;
}

.main-wrap{ margin-left:var(--sidebar-w); flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar{
  background:var(--card); border-bottom:1px solid var(--line);
  padding:.85rem 1.75rem; display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:1020;
}
.topbar .page-title{ font-size:1.15rem; font-weight:600; margin:0; }
.topbar .page-eyebrow{ font-size:.72rem; color:var(--ink-400); text-transform:uppercase; letter-spacing:.07em; font-weight:600;}

.topbar-user{ display:flex; align-items:center; gap:.7rem; }
.topbar-user .avatar{
  width:36px; height:36px; border-radius:50%; background:var(--emerald-100);
  color:var(--emerald-800); display:flex; align-items:center; justify-content:center; font-weight:700; font-family:'Lexend',sans-serif;
}
.topbar-user .u-name{ font-size:.85rem; font-weight:600; color:var(--ink-900); }
.topbar-user .u-role{ font-size:.72rem; color:var(--ink-400); text-transform:capitalize; }

.content{ padding:1.75rem; flex:1; }

.btn-toggle-sidebar{ display:none; background:none; border:0; font-size:1.3rem; color:var(--ink-600); }

/* ---------- Cards ---------- */
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);
}
.card-header-plain{
  padding:1.1rem 1.35rem; border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.6rem;
}
.card-header-plain h5{ margin:0; font-size:1rem; font-weight:600; }
.card-body-plain{ padding:1.35rem; }

.stat-card{
  border-radius:var(--radius-lg); padding:1.25rem 1.4rem; background:var(--card);
  border:1px solid var(--line); box-shadow:var(--shadow-card);
  display:flex; flex-direction:column; gap:.35rem; height:100%;
}
.stat-card .stat-label{ font-size:.76rem; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-400); font-weight:600;}
.stat-card .stat-value{ font-family:'Lexend',sans-serif; font-size:1.9rem; font-weight:700; color:var(--emerald-950); }
.stat-card .stat-sub{ font-size:.78rem; color:var(--ink-600); }
.stat-card.accent-gold{ border-top:3px solid var(--gold-500); }
.stat-card.accent-emerald{ border-top:3px solid var(--emerald-800); }
.stat-card.accent-red{ border-top:3px solid var(--red-600); }
.stat-card.accent-green{ border-top:3px solid var(--green-600); }

/* ---------- Period strip (signature element) ---------- */
.period-strip{
  display:flex; gap:.5rem; overflow-x:auto; padding:.25rem 0 .5rem;
}
.period-chip{
  flex:0 0 auto; min-width:74px; text-align:center; padding:.55rem .5rem;
  border-radius:12px; border:1px solid var(--line); background:#fff;
  font-size:.72rem; color:var(--ink-600);
}
.period-chip .pc-jam{ font-family:'Lexend',sans-serif; font-weight:700; color:var(--emerald-900); font-size:.95rem;}
.period-chip .pc-time{ font-size:.66rem; color:var(--ink-400); }
.period-chip.is-now{ background:var(--emerald-900); border-color:var(--emerald-900); }
.period-chip.is-now .pc-jam, .period-chip.is-now .pc-time{ color:#fff; }

/* ---------- Tables ---------- */
.table-modern{ width:100%; border-collapse:separate; border-spacing:0; font-size:.875rem; }
.table-modern thead th{
  background:var(--emerald-50); color:var(--emerald-900); font-weight:600;
  padding:.7rem .85rem; border-bottom:1px solid var(--line); font-size:.75rem;
  text-transform:uppercase; letter-spacing:.04em; white-space:nowrap;
}
.table-modern tbody td{ padding:.65rem .85rem; border-bottom:1px solid var(--line); vertical-align:middle; }
.table-modern tbody tr:hover{ background:var(--emerald-50); }
.table-modern tbody tr:last-child td{ border-bottom:none; }

/* Cegah kolom/select "menyempit" & memotong teks (mis. "Hadir" -> "Had") saat
   tabel diperas ke layar sempit (HP). table-responsive akan scroll horizontal
   ketimbang mengecilkan elemen di bawah lebar ini. */
.table-modern select.select-status,
.table-modern select.select-tugas{ min-width:135px; }
.table-modern th, .table-modern td{ white-space:nowrap; }
.table-modern td.wrap, .table-modern th.wrap{ white-space:normal; }

/* ---------- Badges ---------- */
.badge-status{ display:inline-flex; align-items:center; gap:.3rem; padding:.28rem .65rem; border-radius:999px; font-size:.72rem; font-weight:600; }
.badge-hadir{ background:var(--green-100); color:var(--green-600); }
.badge-sakit{ background:var(--amber-100); color:var(--amber-600); }
.badge-izin{ background:var(--blue-100); color:var(--blue-600); }
.badge-alpha{ background:var(--red-100); color:var(--red-600); }
.badge-dinas{ background:var(--violet-100); color:var(--violet-600); }

.pill-tugas-ya{ background:var(--green-100); color:var(--green-600); padding:.25rem .6rem; border-radius:999px; font-size:.72rem; font-weight:600; }
.pill-tugas-tidak{ background:var(--red-100); color:var(--red-600); padding:.25rem .6rem; border-radius:999px; font-size:.72rem; font-weight:600; }
.pill-tugas-na{ color:var(--ink-400); font-size:.78rem; }

/* ---------- Forms ---------- */
.form-label{ font-size:.82rem; font-weight:600; color:var(--ink-900); }
.form-control, .form-select{
  border-radius:var(--radius-sm); border:1px solid var(--line); font-size:.88rem; padding:.5rem .75rem;
}
.form-control:focus, .form-select:focus{ border-color:var(--emerald-700); box-shadow:0 0 0 3px var(--emerald-100); }

.btn{ border-radius:10px; font-size:.86rem; font-weight:600; padding:.5rem 1rem; }
.btn-primary{ background:var(--emerald-900); border-color:var(--emerald-900); }
.btn-primary:hover{ background:var(--emerald-800); border-color:var(--emerald-800); }
.btn-gold{ background:var(--gold-500); border-color:var(--gold-500); color:var(--emerald-950); }
.btn-gold:hover{ background:var(--gold-600); border-color:var(--gold-600); color:var(--emerald-950); }
.btn-outline-emerald{ border:1px solid var(--emerald-700); color:var(--emerald-800); background:transparent; }
.btn-outline-emerald:hover{ background:var(--emerald-50); color:var(--emerald-900); }
.btn-soft-danger{ background:var(--red-100); border-color:var(--red-100); color:var(--red-600); }
.btn-soft-danger:hover{ background:#f6cdc6; color:var(--red-600); }

.nav-tabs-modern{ border-bottom:1px solid var(--line); margin-bottom:1.25rem; }
.nav-tabs-modern .nav-link{
  border:none; color:var(--ink-400); font-weight:600; font-size:.86rem; padding:.65rem 0; margin-right:1.5rem; border-bottom:2px solid transparent;
}
.nav-tabs-modern .nav-link.active{ color:var(--emerald-900); border-bottom-color:var(--gold-500); background:transparent; }

.login-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 20% 20%, var(--emerald-800), var(--emerald-950) 70%);
  padding:1.5rem;
}
.login-card{
  width:100%; max-width:400px; background:var(--card); border-radius:var(--radius-lg);
  box-shadow:0 30px 60px -20px rgba(0,0,0,.4); padding:2.2rem 2rem;
}
.login-mark{
  width:52px; height:52px; border-radius:14px; background:var(--gold-500);
  display:flex; align-items:center; justify-content:center; color:var(--emerald-950);
  font-family:'Lexend',sans-serif; font-weight:700; font-size:1.3rem; margin-bottom:1rem;
}

.empty-state{ text-align:center; padding:3rem 1.5rem; color:var(--ink-400); }
.empty-state i{ font-size:2.2rem; color:var(--emerald-100); }

.progress-modern{ height:8px; border-radius:99px; background:var(--emerald-50); overflow:hidden; }
.progress-modern .bar{ height:100%; border-radius:99px; }

@media (max-width: 991px){
  .sidebar{ transform:translateX(-100%); }
  .sidebar.show{ transform:translateX(0); }
  .main-wrap{ margin-left:0; }
  .btn-toggle-sidebar{ display:inline-block; }
}
