/* =========================================================
   Absensi LOVUS — palet: gold #B8924B, black #14110F,
   ivory #F7F3EA, wine #5B1A22 (aksen status), sukses #3A6B4A
   ========================================================= */

:root {
  --gold: #b8924b;
  --gold-light: #d9b876;
  --gold-dark: #8f6f34;
  --black: #14110f;
  --charcoal: #211d19;
  --ivory: #f7f3ea;
  --ivory-dim: #efe8d8;
  --wine: #5b1a22;
  --success: #3a6b4a;
  --danger: #a13b3b;
  --warning: #b8924b;
  --muted: #8a8478;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(20, 17, 15, 0.08);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--black);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, .brand-serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }

/* ---------- Auth (login) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #1e1a16 0%, var(--black) 60%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--ivory);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border-top: 3px solid var(--gold);
}

.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}

.auth-logo .wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px;
  letter-spacing: 0.18em;
  color: var(--black);
  font-weight: 700;
}

.auth-logo .wordmark span { color: var(--gold); }

.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd3ba;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--black);
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 146, 75, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--black);
  color: var(--gold-light);
  width: 100%;
}
.btn-primary:hover { background: #292420; }

.btn-gold {
  background: var(--gold);
  color: var(--black);
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--black);
  color: var(--black);
}
.btn-outline:hover { background: var(--black); color: var(--ivory); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: #fbe7e7; color: var(--danger); border: 1px solid #f0c6c6; }
.alert-success { background: #e6efe8; color: var(--success); border: 1px solid #bcd8c4; }

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

.sidebar {
  width: 240px;
  background: var(--black);
  color: var(--ivory-dim);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}

.sidebar .brand .wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.16em;
  color: var(--ivory);
}
.sidebar .brand .wordmark span { color: var(--gold); }
.sidebar .brand .tag {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 14px;
  color: var(--ivory-dim);
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.04); }
.nav-item.active {
  border-left-color: var(--gold);
  background: rgba(184, 146, 75, 0.12);
  color: var(--gold-light);
  font-weight: 600;
}

.nav-section {
  margin-top: auto;
  padding: 12px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-user {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.nav-user strong { color: var(--ivory); display: block; font-size: 14px; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid #eee3cd;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}
.topbar .date {
  font-size: 13px;
  color: var(--muted);
}

.content { padding: 28px 32px 60px; }

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gold);
}
.stat-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.stat-card .value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  margin-top: 6px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2, .card h3 { margin-top: 0; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--ivory-dim);
  padding: 10px 12px;
}
tbody td {
  padding: 12px;
  border-bottom: 1px solid #f0ebdd;
  vertical-align: middle;
}
tbody tr:hover { background: #fbf8f1; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-hadir { background: #e6efe8; color: var(--success); }
.badge-terlambat { background: #fbeee0; color: #a35d1f; }
.badge-izin { background: #eae4f5; color: #5a3fa0; }
.badge-sakit { background: #e3edf7; color: #2e5f8f; }
.badge-alpha { background: #fbe7e7; color: var(--danger); }
.badge-menunggu { background: #fbeee0; color: #a35d1f; }
.badge-disetujui { background: #e6efe8; color: var(--success); }
.badge-ditolak { background: #fbe7e7; color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

/* ---------- Absen (check-in) page ---------- */
.clock-card {
  text-align: center;
  padding: 40px 24px;
}
.clock-time {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 56px;
  color: var(--black);
  margin: 4px 0;
}
.clock-date {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.checkin-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}
.checkin-actions .btn { min-width: 160px; padding: 16px 24px; font-size: 15px; }

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters .field { margin-bottom: 0; min-width: 160px; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--black);
  cursor: pointer;
}

@media (max-width: 880px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 50;
    transition: left 0.2s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
  }
  .sidebar.open { left: 0; }
  .mobile-toggle { display: inline-flex; }
  .content { padding: 20px 16px 60px; }
  .topbar { padding: 16px; }
  .clock-time { font-size: 40px; }
}
