/* ============================================================
   Absensi Wajah — tema gelap (dark theme)
   ============================================================ */
:root {
  --bg: #060b16;
  --bg-2: #0a1322;
  --card: #101a2e;
  --card-2: #16233c;
  --text: #e6edf7;
  --muted: #8fa3bd;
  --border: #22314d;
  --accent: #22d3ee;
  --accent-2: #0e7490;
  --accent-3: #f59e0b;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, .14);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, .14);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, .14);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, .14);
  --sidebar: #050912;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 6, 18, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(34, 211, 238, .13), transparent 60%),
    radial-gradient(900px 520px at -10% 20%, rgba(14, 116, 144, .18), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(245, 158, 11, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.25; color: #f4f8ff; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ------------------------------------------------------------- layout */
body.admin-mode { display: flex; min-height: 100vh; align-items: stretch; }
body.standalone-mode { display: block; }

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: linear-gradient(180deg, #070d1a, #050912);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 6px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  margin-bottom: 12px;
}
.sidebar .brand img { width: 34px; height: 34px; flex: 0 0 34px; }
.sidebar .brand span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 2px;
}
.sidebar a:hover { background: rgba(34, 211, 238, .08); color: #e6edf7; text-decoration: none; }
.sidebar a.active { background: linear-gradient(90deg, rgba(34, 211, 238, .22), rgba(34, 211, 238, .06)); color: #fff; }
.sidebar .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5b7290; padding: 14px 10px 6px; }

.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
body.standalone-mode .main { max-width: 1180px; margin: 0 auto; width: 100%; padding: 24px 18px 60px; }
.content { max-width: 1180px; margin: 0 auto; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .who { color: var(--muted); font-size: 14px; }

.standalone { max-width: 1180px; margin: 0 auto; padding: 24px 18px 60px; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

/* ------------------------------------------------------------- komponen */
.card {
  background: linear-gradient(180deg, rgba(22, 35, 60, .75), rgba(16, 26, 46, .9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
  backdrop-filter: blur(6px);
}
.card.narrow { max-width: 460px; width: 100%; }
.card h2 { margin-bottom: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: #1d2d49; text-decoration: none; border-color: #33486b; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  border-color: transparent;
  color: #04202a;
  box-shadow: 0 6px 18px rgba(34, 211, 238, .25);
}
.btn-primary:hover { background: linear-gradient(135deg, #67e8f9, #0891b2); border-color: transparent; }
.btn-danger { background: linear-gradient(135deg, #f87171, #b91c1c); border-color: transparent; color: #fff; }
.btn-danger:hover { background: linear-gradient(135deg, #fca5a5, #dc2626); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: rgba(248, 113, 113, .35); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: rgba(96, 165, 250, .35); }
.badge.muted { background: rgba(148, 163, 184, .12); color: var(--muted); border-color: rgba(148, 163, 184, .25); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table th {
  background: rgba(34, 211, 238, .06);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700;
}
table.table tbody tr { transition: background .12s; }
table.table tbody tr:hover td { background: rgba(34, 211, 238, .05); }
table.table td.num, table.table th.num { text-align: right; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #b9c8de; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="email"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #0b1424;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
}
input::placeholder, textarea::placeholder { color: #7b93b0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding-top: 22px; color: #b9c8de; }
.check input { width: auto; accent-color: var(--accent); }

.alert { padding: 12px 14px; border-radius: 11px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.alert.danger { background: var(--bad-bg); color: var(--bad); border-color: rgba(248, 113, 113, .3); }
.alert.warning { background: var(--warn-bg); color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: rgba(96, 165, 250, .3); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: linear-gradient(180deg, rgba(22, 35, 60, .8), rgba(13, 22, 40, .9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, .25), transparent 70%);
}
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; color: #f4f8ff; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 10px 4px 0; }
.bar-chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart .bar { width: 100%; max-width: 54px; background: linear-gradient(180deg, #67e8f9, #0e7490); border-radius: 7px 7px 0 0; min-height: 2px; box-shadow: 0 0 18px rgba(34, 211, 238, .35); }
.bar-chart .bar-label { font-size: 11px; color: var(--muted); }
.bar-chart .bar-value { font-size: 12px; font-weight: 700; color: #e6edf7; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* ------------------------------------------------------------- absensi */
.attendance-wrap { max-width: 760px; margin: 0 auto; }

.hero {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
  background: var(--bg-2);
}
.hero img { display: block; width: 100%; height: auto; }
.hero .hero-text { position: absolute; left: 26px; bottom: 22px; right: 26px; text-shadow: 0 2px 14px rgba(0, 0, 0, .75); }
.hero .hero-text .t { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero .hero-text .s { font-size: 14px; color: #cfe6f5; margin-top: 2px; }

.att-header { text-align: center; margin-bottom: 20px; }
.att-header .office { font-size: 22px; font-weight: 700; }
.att-header .date { color: var(--muted); font-size: 14px; }

.step { display: flex; gap: 12px; margin-bottom: 14px; }
.step .no {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  color: #04202a; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; box-shadow: 0 0 16px rgba(34, 211, 238, .35);
}
.step .body { flex: 1; }

.video-box { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; border: 1px solid var(--border); }
.video-box video, .video-box canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; transform: scaleX(-1);
}
.video-box canvas { pointer-events: none; }
.video-box img.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-box .overlay { position: absolute; inset: 0; border: 3px dashed rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; margin: 18px; }
.video-box .placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #9fb3cc; text-align: center; padding: 20px; font-size: 14px;
  background: linear-gradient(180deg, rgba(10, 19, 34, .85), rgba(6, 11, 22, .95));
}

.gps-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: rgba(148, 163, 184, .08); border: 1px solid var(--border); font-size: 14px; }
.gps-status.ok { background: var(--ok-bg); border-color: rgba(52, 211, 153, .35); color: var(--ok); }
.gps-status.bad { background: var(--bad-bg); border-color: rgba(248, 113, 113, .35); color: var(--bad); }
.gps-status.warn { background: var(--warn-bg); border-color: rgba(251, 191, 36, .35); color: var(--warn); }

.result { border-radius: 12px; padding: 18px; text-align: center; margin-top: 16px; }
.result.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(52, 211, 153, .35); }
.result.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid rgba(248, 113, 113, .35); }
.result .big { font-size: 20px; font-weight: 800; }

.face-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.face-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.face-item { text-align: center; font-size: 12px; color: var(--muted); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .form-row { margin-bottom: 0; min-width: 150px; }
.empty { text-align: center; padding: 34px; color: var(--muted); }

.rules-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: #cfe0f5;
  background: rgba(6, 11, 22, .6);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
  margin: 0;
}
.penalty-box {
  background: var(--warn-bg);
  border: 1px solid rgba(251, 191, 36, .4);
  color: var(--warn);
  border-radius: 11px;
  padding: 14px 16px;
  font-size: 15px;
}
.penalty-box b { font-size: 20px; }
.penalty-done { background: var(--ok-bg); border-color: rgba(52, 211, 153, .4); color: var(--ok); }
video.penalty-video { width: 240px; max-width: 100%; border-radius: 10px; border: 1px solid var(--border); background: #000; }

/* ------------------------------------------------------------- login */
.login-hero { width: 100%; height: auto; display: block; margin-bottom: 18px; border-radius: 14px; border: 1px solid var(--border); }
.login-logo { width: 58px; height: 58px; margin: 0 auto 10px; display: block; }
.login-card { position: relative; overflow: hidden; }
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, #22d3ee, #0e7490, #f59e0b);
}

@media (max-width: 900px) {
  body.admin-mode { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
  .sidebar .brand { width: 100%; border: 0; padding: 4px 8px 8px; margin: 0; }
  .sidebar .group { display: none; }
  .sidebar a { margin: 0; font-size: 13px; padding: 7px 9px; }
  .main { padding: 16px; }
  .hero .hero-text .t { font-size: 20px; }
}

/* --- tambahan: kredit pencipta, tombol besar, pintasan hukuman --- */
.credit {
  text-align: center;
  font-size: 12px;
  color: var(--muted-foreground, #64748b);
  padding: 14px 10px 20px;
}
.credit strong { color: var(--foreground, #e2e8f0); }

.btn-lg { font-size: 16px; padding: 12px 18px; }

.card.shortcut {
  border: 1px solid var(--border, #334155);
  background: var(--card, #1e293b);
}
.card.shortcut h2 { font-size: 18px; }
