:root {
  --ink: #12263a;
  --ink-soft: #4b5d6e;
  --paper: #f4f6f8;
  --card: #ffffff;
  --line: #dde3ea;
  --brand: #0e6e6a;
  --brand-dark: #0a524f;
  --hadir: #1b7f4b;
  --izin: #a36a00;
  --sakit: #b3412f;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
[hidden] { display: none !important; }
h1, h2 { line-height: 1.15; letter-spacing: -0.01em; }
.muted { color: var(--ink-soft); font-size: .95rem; }

/* ---------- Form ---------- */
label { display: block; font-size: .85rem; font-weight: 600; margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
input:focus-visible, select:focus-visible, .btn:focus-visible {
  outline: 3px solid rgba(14, 110, 106, .35); outline-offset: 1px; border-color: var(--brand);
}

/* ---------- Tombol ---------- */
.btn {
  font: inherit; font-weight: 600; padding: 10px 18px; border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; transition: background .15s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-block { width: 100%; margin-top: 22px; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-danger-ghost { background: transparent; color: var(--sakit); border-color: var(--line); padding: 6px 12px; font-size: .85rem; }
.btn-danger-ghost:hover { background: #fbeae7; }

/* ---------- Pesan ---------- */
.alert { padding: 12px 14px; border-radius: 8px; margin: 16px 0; font-size: .93rem; font-weight: 500; }
.alert-success { background: #e3f4ea; color: #145c37; border: 1px solid #b6e0c7; }
.alert-error { background: #fbeae7; color: #8c2f20; border: 1px solid #f0c4bc; }

/* ---------- Halaman login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: var(--ink); }
.login-wrap { width: min(920px, 100%); display: grid; grid-template-columns: 1.1fr 1fr;
  border-radius: 16px; overflow: hidden; background: var(--card); }
.login-side { background: var(--brand); color: #fff; padding: 48px 40px; display: flex;
  flex-direction: column; justify-content: flex-end; gap: 16px; min-height: 420px; }
.login-side h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; }
.login-side p { max-width: 30ch; opacity: .9; }
.login-card { padding: 48px 40px; align-self: center; }
.login-card h2 { font-size: 1.6rem; margin-bottom: 4px; }

/* ---------- Dashboard ---------- */
.topbar { background: var(--ink); color: #fff; display: flex; justify-content: space-between;
  align-items: center; padding: 14px clamp(16px, 4vw, 40px); gap: 12px; }
.brand { font-weight: 800; font-size: 1.15rem; }
.user { display: flex; align-items: center; gap: 14px; min-width: 0; }
.user-email { font-size: .9rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container { max-width: 1120px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 48px; }

.stats { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 14px; margin-top: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; }
.stat-total { background: var(--brand); border-color: var(--brand); color: #fff; }
.stat-num { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .85rem; margin-top: 6px; color: var(--ink-soft); }
.stat-total .stat-label { color: rgba(255,255,255,.85); }

.grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 4px; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-weight: 700; font-size: .82rem; color: var(--ink-soft);
  padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f9fbfc; }
.status-select { width: auto; padding: 6px 10px; font-weight: 600; font-size: .88rem; border-radius: 999px; }
.status-hadir { color: var(--hadir); background: #e8f5ee; border-color: #b6e0c7; }
.status-izin { color: var(--izin); background: #fdf3df; border-color: #ecd49c; }
.status-sakit { color: var(--sakit); background: #fbeae7; border-color: #f0c4bc; }
.empty { padding: 28px 8px; text-align: center; color: var(--ink-soft); }

/* ---------- Responsif ---------- */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-total { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { min-height: 0; padding: 32px 28px; }
  .login-card { padding: 32px 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }