/* =====================================================================
   SISTEM INFORMASI PRESENSI - SMK NEGERI 1 TOMA
   Design System v2 (2026) - Modern Academic Dashboard
   ---------------------------------------------------------------------
   Semua warna, spacing, radius, shadow memakai CSS variables.
   Jangan menulis warna hardcode di dalam halaman PHP.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@500;600;700;800&display=swap');

/* ------------------------------ TOKENS ------------------------------ */
:root {
  --navy: #0C1730;
  --navy-soft: #142B52;
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #3B82F6;
  --purple: #7C3AED;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-2: #FAFBFE;
  --text: #182230;
  --text-muted: #718096;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;

  --border: #E4EAF2;
  --border-strong: #D3DDEC;
  --ring: rgba(37, 99, 235, .18);

  --sidebar-bg: #0C1730;
  --sidebar-bg-2: #101E3E;
  --sidebar-text: #A9B7D0;
  --sidebar-text-active: #FFFFFF;
  --sidebar-border: rgba(255, 255, 255, .07);

  --gradient-brand: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --gradient-hero: linear-gradient(120deg, #0C1730 0%, #1E40AF 55%, #7C3AED 100%);
  --gradient-soft: linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(124, 58, 237, .10));

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 2px rgba(16, 30, 54, .06);
  --shadow-sm: 0 2px 10px rgba(16, 30, 54, .06);
  --shadow: 0 10px 30px rgba(16, 30, 54, .08);
  --shadow-lg: 0 22px 50px rgba(16, 30, 54, .14);

  --sidebar-w: 270px;
  --sidebar-w-collapsed: 84px;
  --topbar-h: 72px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --speed: .22s;

  --font-sans: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Poppins', 'Inter', system-ui, sans-serif;
}

/* ------------------------------ DARK MODE ------------------------------ */
html[data-theme="dark"] {
  --bg: #0A1120;
  --surface: #111C33;
  --surface-2: #16233D;
  --text: #E8EEF9;
  --text-muted: #93A2BC;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --sidebar-bg: #08101F;
  --sidebar-bg-2: #0C1730;
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, .5);
}

/* ------------------------------ RESET ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); color: var(--text); margin: 0 0 .35em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.075rem; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }

/* ------------------------------ ANIMATIONS ------------------------------ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.main > *, .page-shell > * { animation: fadeUp .32s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------ LAYOUT SHELL ------------------------------ */
.dashboard-shell { display: flex; min-height: 100vh; width: 100%; }
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 26px 30px 44px;
  transition: margin var(--speed) var(--ease);
}
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.main > .page-shell { max-width: 1440px; margin: 0 auto; padding: 0; }
.page-shell { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container { width: 100%; max-width: 520px; margin: 0 auto; padding: 48px 20px; }
body.auth-page > .container { min-height: 100vh; display: flex; align-items: center; }
body.auth-page > .container > .auth-card { width: 100%; }

/* ------------------------------ SIDEBAR ------------------------------ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px 22px;
  overflow-y: auto;
  z-index: 60;
  border-right: 1px solid var(--sidebar-border);
  transition: width var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); }
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); padding-left: 10px; padding-right: 10px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-badge {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
  overflow: hidden;
}
.sidebar-brand-logo { width: 34px; height: 34px; object-fit: contain; }
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-title { font-family: var(--font-display); font-weight: 700; font-size: .96rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-subtitle { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: #7F91B4; }

.sidebar-user {
  display: flex; align-items: center; gap: 11px;
  padding: 11px;
  margin: 4px 2px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--sidebar-border);
}
.sidebar-user-avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gradient-brand);
  color: #fff; font-weight: 700; font-size: .9rem;
}
.sidebar-user-meta { min-width: 0; }
.sidebar-user-name { display: block; color: #fff; font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { display: block; font-size: .72rem; color: #8497BB; }

.nav-section { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.nav-section-title {
  font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: #64769A; padding: 6px 12px 4px;
}
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--sidebar-text);
  font-size: .9rem; font-weight: 500;
  white-space: nowrap;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(3px); }
.nav-link.active { background: var(--gradient-brand); color: #fff; font-weight: 600; box-shadow: 0 8px 20px rgba(37, 99, 235, .35); }
.nav-link.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: #fff;
}
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-link.is-danger:hover { background: rgba(220, 38, 38, .18); color: #FCA5A5; }

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-user-meta,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .nav-link .nav-label { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 12px 0; }
body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-user { justify-content: center; }

/* Sidebar backdrop (mobile drawer) */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(8, 15, 30, .55);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--speed) var(--ease), visibility var(--speed) var(--ease);
}
body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }

/* ------------------------------ TOPBAR ------------------------------ */
.topbar,
.app-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--topbar-h);
  margin: -26px -30px 24px;
  padding: 12px 30px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar h2 { margin: 0; font-size: 1.2rem; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-titles { min-width: 0; }
.topbar-eyebrow { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.topbar-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: .84rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--border); }
.topbar-user .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: .85rem; }
.topbar-user-meta { line-height: 1.2; }
.topbar-user-name { display: block; font-weight: 600; font-size: .86rem; }
.topbar-user-role { display: block; font-size: .74rem; color: var(--text-muted); }

.icon-btn {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--gradient-soft); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .dot { position: absolute; }
.notif-btn { position: relative; }
.notif-btn .badge-dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
  animation: pulseDot 2s infinite;
}
.notification-wrap { position: relative; }
.notification-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 10px; background: var(--danger); color: #fff; border: 2px solid var(--surface); font-size: .62rem; font-weight: 800; }
.notification-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 80; width: min(380px, calc(100vw - 32px)); overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.notification-panel-head, .notification-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.notification-panel-head strong { display: block; font-size: .95rem; }
.notification-panel-head span { display: block; margin-top: 3px; color: var(--text-muted); font-size: .75rem; }
.notification-read-all { border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: .72rem; font-weight: 700; }
.notification-list { max-height: 390px; overflow-y: auto; }
.notification-item { display: flex; gap: 10px; padding: 13px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); transition: background var(--speed) var(--ease); }
.notification-item:hover { background: var(--surface-2); }
.notification-item.is-unread { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.notification-item-mark { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: transparent; }
.notification-item.is-unread .notification-item-mark { background: var(--primary); }
.notification-item-body { min-width: 0; display: grid; gap: 3px; }
.notification-item-body strong { font-size: .78rem; }
.notification-item-body span { color: var(--text-muted); font-size: .75rem; line-height: 1.4; }
.notification-item-body time { color: var(--text-muted); font-size: .68rem; }
.notification-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: .8rem; }
.notification-footer { display: block; padding: 13px 16px; color: var(--primary); text-align: center; text-decoration: none; font-size: .78rem; font-weight: 700; }
.notification-page-head h1 { margin: 0; font-size: 1.4rem; }
.notification-list-full { max-height: none; }

/* ------------------------------ PAGE HEADERS ------------------------------ */
.page-header, .admin-header, .compact-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 22px;
}
.page-header h1, .admin-header h1 { margin: 0; }
.admin-header-left p, .page-header p { margin: 4px 0 0; color: var(--text-muted); font-size: .92rem; }
.page-label { font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--primary); }
.date-card {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 10px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.date-card span { font-size: .8rem; color: var(--text-muted); }
.date-card strong { font-family: var(--font-display); font-size: 1.05rem; }

/* ------------------------------ HERO WELCOME ------------------------------ */
.hero-welcome {
  position: relative; overflow: hidden;
  padding: 34px 36px;
  border-radius: var(--radius-xl);
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}
.hero-welcome h1, .hero-welcome h2 { color: #fff; margin-bottom: 8px; }
.hero-welcome p { color: rgba(255, 255, 255, .82); max-width: 60ch; margin: 0; }
.hero-welcome::after,
.hero-welcome::before {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .22), transparent 65%);
}
.hero-welcome::before { width: 320px; height: 320px; right: -70px; top: -120px; }
.hero-welcome::after { width: 220px; height: 220px; right: 130px; bottom: -140px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin-bottom: 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.hero-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; animation: pulseDot 1.8s infinite; }
.hero-welcome .hero-actions { position: relative; z-index: 2; margin-top: 20px; }

/* ------------------------------ CARDS ------------------------------ */
.page-card, .content-card, .feature-card, .guide-card, .contact-card, .summary-card, .table-card, .add-form-card, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.page-card + .page-card { margin-top: 20px; }
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 18px;
}
.card-header h3 { margin: 0; }
.card-header p { margin: 2px 0 0; font-size: .86rem; }

.dashboard-grid { display: grid; gap: 20px; margin-top: 20px; }
.dashboard-grid.two-column { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid-two-col { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.content-grid, .features-grid, .guide-grid, .contact-grid, .form-grid, .profile-page-grid {
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ------------------------------ STAT CARDS ------------------------------ */
.stats-grid, .summary-grid, .summary-card-stats {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 22px;
}
.stat-card, .summary-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.stat-card::before, .summary-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--gradient-brand);
}
.stat-card:hover, .summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-body { display: flex; flex-direction: column; gap: 2px; }
.stat-body span, .summary-card span { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.stat-body strong, .summary-card strong { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1.15; color: var(--text); }
.stat-card small, .summary-card small { display: block; margin-top: 6px; font-size: .8rem; color: var(--text-muted); }
.stat-icon {
  position: absolute; top: 18px; right: 18px;
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--gradient-soft); color: var(--primary);
}
.stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-trend { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: .78rem; font-weight: 600; color: var(--success); }
.stat-trend.down { color: var(--danger); }

.stat-card-blue::before, .summary-card-blue::before { background: linear-gradient(180deg, #2563EB, #3B82F6); }
.stat-card-cyan::before, .summary-card-cyan::before { background: linear-gradient(180deg, #0891B2, #22D3EE); }
.stat-card-orange::before, .summary-card-orange::before { background: linear-gradient(180deg, #D97706, #FBBF24); }
.stat-card-purple::before, .summary-card-purple::before { background: linear-gradient(180deg, #7C3AED, #A855F7); }
.stat-card-green::before, .summary-card-light::before { background: linear-gradient(180deg, #16A34A, #4ADE80); }
.stat-card-blue .stat-icon { color: #2563EB; }
.stat-card-cyan .stat-icon { color: #0891B2; background: rgba(8, 145, 178, .1); }
.stat-card-orange .stat-icon { color: #D97706; background: rgba(217, 119, 6, .1); }
.stat-card-purple .stat-icon { color: #7C3AED; background: rgba(124, 58, 237, .1); }
.stat-card-green .stat-icon { color: #16A34A; background: rgba(22, 163, 74, .1); }

/* ------------------------------ BUTTONS ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: .89rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all var(--speed) var(--ease);
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .26); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(37, 99, 235, .34); }
.btn-light, .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-light:hover, .btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--gradient-soft); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-icon { padding: 9px; border-radius: 11px; background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }
.btn-block { width: 100%; }

/* ------------------------------ FORMS ------------------------------ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.form-group label, .filter-group label { font-size: .82rem; font-weight: 600; color: var(--text); }
.profile-photo-preview { display: flex; align-items: center; min-height: 104px; margin: 2px 0 4px; }
.profile-photo-preview img, .profile-photo-placeholder {
  width: 104px; height: 104px; object-fit: cover; border-radius: 18px;
  border: 1px solid var(--border-strong); background: var(--gradient-soft);
}
.profile-photo-placeholder { display: grid; place-items: center; color: var(--primary); font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; }
.profile-photo-preview img[hidden], .profile-photo-placeholder[hidden] { display: none; }
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-sans); font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 17px;
  padding-right: 38px;
}
.filter-row, .filter-row-inline, .table-filters, .search-form-inline, .schedule-form, .subject-form, .actions, .form-actions, .form-buttons, .table-actions, .action-row, .export-actions, .report-actions, .filter-actions, .filter-actions-row, .search-bar, .contact-buttons, .hero-actions, .header-actions {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
}
.filter-row > .filter-group, .table-filters > .filter-group { flex: 1 1 180px; min-width: 0; }
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.search-bar-wide { flex: 1 1 240px; }
.search-group { flex: 1 1 240px; }
.checkbox-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.checkbox-item, .checkbox-wrapper { display: flex; align-items: center; gap: 8px; }
.checkbox-item label, .checkbox-wrapper label { margin: 0; font-weight: 500; cursor: pointer; }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  background: none; border: none; border-radius: 8px; cursor: pointer; color: var(--text-muted);
}
.password-toggle:hover { background: var(--surface-2); color: var(--primary); }

/* ------------------------------ TABLES ------------------------------ */
.table-wrap {
  width: 100%; overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
thead th {
  position: sticky; top: 0;
  padding: 13px 16px;
  text-align: left; white-space: nowrap;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--speed) var(--ease); }
tbody tr:hover { background: var(--gradient-soft); }
.table-blue thead th { background: var(--gradient-brand); color: #fff; }
.col-no, .col-action, .col-actions { width: 1%; white-space: nowrap; }
.table-cell-value { font-weight: 600; }
.table-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-sm {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gradient-soft); color: var(--primary);
  font-weight: 700; font-size: .78rem;
}
.table-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }

/* ------------------------------ BADGES ------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 100px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.status-hadir, .badge.status-active, .badge.status-approved, .badge.badge-success { background: rgba(22, 163, 74, .12); color: #15803D; border-color: rgba(22, 163, 74, .22); }
.badge.status-izin, .badge.status-pending, .badge.badge-warning { background: rgba(217, 119, 6, .12); color: #B45309; border-color: rgba(217, 119, 6, .22); }
.badge.status-sakit, .badge.badge-purple { background: rgba(124, 58, 237, .12); color: #6D28D9; border-color: rgba(124, 58, 237, .22); }
.badge.status-alpha, .badge.status-alfa, .badge.status-rejected, .badge.status-inactive, .badge.badge-danger { background: rgba(220, 38, 38, .12); color: #B91C1C; border-color: rgba(220, 38, 38, .22); }
.badge.badge-info { background: rgba(37, 99, 235, .12); color: #1D4ED8; border-color: rgba(37, 99, 235, .22); }

/* ------------------------------ FLASH / ALERT ------------------------------ */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-weight: 500;
  animation: fadeUp .3s var(--ease) both;
}
.flash.success { border-left-color: var(--success); background: rgba(22, 163, 74, .07); }
.flash.error, .flash.danger { border-left-color: var(--danger); background: rgba(220, 38, 38, .07); }
.flash.warning { border-left-color: var(--warning); background: rgba(217, 119, 6, .07); }

/* ------------------------------ TOAST ------------------------------ */
.toast-stack { position: fixed; top: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 12px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  animation: slideInRight .28s var(--ease) both;
}
.toast.hide { animation: fadeIn .2s var(--ease) reverse both; }
.toast strong { display: block; font-size: .9rem; }
.toast p { margin: 2px 0 0; font-size: .84rem; color: var(--text-muted); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ------------------------------ MODAL ------------------------------ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(9, 16, 32, .55);
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s var(--ease) both; }
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 26px;
  animation: popIn .26s var(--ease) both;
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-header h3 { margin: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ------------------------------ CHART PANELS ------------------------------ */
.chart-panel { min-height: 320px; }
.chart-box { position: relative; height: 280px; }
.chart-box.donut { height: 240px; }
.chart-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.chart-tab {
  padding: 7px 14px; border: none; border-radius: 9px; background: transparent;
  font-size: .8rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.chart-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; }
.donut-center span { font-size: .8rem; color: var(--text-muted); }

/* ------------------------------ QUICK ACCESS ------------------------------ */
.quick-grid { display: grid; gap: 12px; }
.quick-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: all var(--speed) var(--ease);
}
.quick-item:hover { transform: translateX(4px); border-color: var(--primary); background: var(--gradient-soft); box-shadow: var(--shadow-sm); }
.quick-item .quick-icon {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px;
  display: grid; place-items: center; background: var(--gradient-brand); color: #fff;
}
.quick-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-item .quick-text { flex: 1; min-width: 0; }
.quick-item strong { display: block; font-size: .92rem; }
.quick-item small { font-size: .8rem; }
.quick-item .quick-arrow { color: var(--text-muted); transition: transform var(--speed) var(--ease); }
.quick-item:hover .quick-arrow { transform: translateX(4px); color: var(--primary); }

/* ------------------------------ ACTIVITY / TIMELINE ------------------------------ */
.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius);
  transition: background var(--speed) var(--ease);
}
.activity-item:hover { background: var(--surface-2); }
.activity-item.empty { justify-content: center; color: var(--text-muted); font-size: .88rem; }

/* ------------------------------ CALENDAR ------------------------------ */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-day { text-align: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 6px 0; }
.calendar-date {
  display: grid; place-items: center;
  aspect-ratio: 1; border-radius: 10px;
  font-size: .82rem; font-weight: 500; color: var(--text);
  transition: all var(--speed) var(--ease);
}
.calendar-date:hover { background: var(--surface-2); }
.calendar-date.active { background: var(--gradient-brand); color: #fff; font-weight: 700; box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }

/* ------------------------------ AUTH / LOGIN ------------------------------ */
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  padding: 60px clamp(32px, 5vw, 76px);
  background: var(--gradient-hero);
  color: #fff;
}
.auth-brand::before, .auth-brand::after {
  content: ''; position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .2), transparent 62%);
}
.auth-brand::before { width: 460px; height: 460px; top: -160px; left: -140px; }
.auth-brand::after { width: 320px; height: 320px; bottom: -120px; right: -80px; }
.auth-brand > * { position: relative; z-index: 2; }
.auth-brand h1 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.auth-brand p { color: rgba(255, 255, 255, .82); max-width: 46ch; }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo img { width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 16px; padding: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.auth-logo strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.auth-logo span { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.auth-points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: .93rem; color: rgba(255, 255, 255, .9); }
.auth-points li::before {
  content: '✓'; display: grid; place-items: center;
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); font-size: .78rem; font-weight: 700;
}
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 44px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; padding: 34px; border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 4px; }
.auth-card > p.small { margin-bottom: 22px; }
.login-icon { width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center; }
.auth-footer { margin-top: 22px; text-align: center; font-size: .86rem; color: var(--text-muted); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; font-size: .84rem; color: var(--text-muted); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.social-buttons { display: flex; flex-direction: column; gap: 10px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.social-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--primary); }
.forgot-password { text-align: right; margin-bottom: 16px; }
.forgot-password a { font-weight: 600; font-size: .88rem; }

/* Multi-step form (register) */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.step-dot {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 700; color: var(--text-muted);
  transition: all var(--speed) var(--ease);
}
.step.active .step-dot, .step.done .step-dot { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.step-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.active .step-label { color: var(--text); }
.step-line { flex: 1; height: 2px; background: var(--border); border-radius: 2px; }

/* ------------------------------ PUBLIC LANDING ------------------------------ */
.header-notice {
  padding: 10px 20px; text-align: center;
  background: var(--gradient-brand); color: #fff;
  font-size: .85rem; font-weight: 500;
}
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.site-header .topbar { position: static; margin: 0; padding: 14px 20px; background: none; border: none; backdrop-filter: none; max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-panel { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-logo img { width: 46px; height: 46px; object-fit: contain; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.brand-subtitle { font-size: .78rem; color: var(--text-muted); }
.header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; justify-content: center; min-width: 0; }
.header-nav a { padding: 8px 14px; border-radius: 100px; font-size: .88rem; font-weight: 600; color: var(--text-muted); transition: all var(--speed) var(--ease); white-space: nowrap; }
.header-nav a:hover { background: var(--gradient-soft); color: var(--primary); }
.site-header .header-actions { flex: 0 0 auto; gap: 10px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px; max-width: 1240px; margin: 0 auto; padding: 0 20px 12px; }
.site-nav a { padding: 8px 14px; border-radius: 100px; font-size: .88rem; font-weight: 600; color: var(--text-muted); transition: all var(--speed) var(--ease); }
.site-nav a:hover { background: var(--gradient-soft); color: var(--primary); }
.hero-modern {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  max-width: 1240px; margin: 0 auto; padding: 60px 20px;
}
.eyebrow { display: inline-block; padding: 6px 14px; margin-bottom: 14px; border-radius: 100px; background: var(--gradient-soft); color: var(--primary); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hero-copy h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.hero-copy p { color: var(--text-muted); font-size: 1.02rem; max-width: 54ch; }
.hero-pill-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.hero-pill-list span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 100px; background: var(--surface); border: 1px solid var(--border); font-size: .84rem; font-weight: 600; box-shadow: var(--shadow-xs); }
.hero-visual { display: grid; gap: 16px; }
.hero-card { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform var(--speed) var(--ease); }
.hero-card:hover { transform: translateY(-4px); }
.hero-card-center { display: flex; align-items: center; gap: 14px; background: var(--gradient-hero); color: #fff; border-color: transparent; }
.hero-card-center strong, .hero-card-center p { color: #fff; }
.hero-card-center p { margin: 2px 0 0; font-size: .85rem; color: rgba(255, 255, 255, .82); }
.hero-card-icon { font-size: 1.6rem; }
.hero-card-title { font-family: var(--font-display); font-weight: 700; }
.hero-card-meta { font-size: .84rem; color: var(--text-muted); }

/* Hero Banner Section - Full Width Layout */
.hero-banner-section {
  position: relative; overflow: hidden;
  width: 100vw; margin-left: calc(-50vw + 50%);
  min-height: 500px; max-height: 600px;
  display: flex; align-items: center; justify-content: center;
}
.hero-banner-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.hero-banner-image img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.hero-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, .82) 0%, rgba(15, 23, 42, .45) 50%, transparent 100%);
  display: flex; align-items: center; justify-content: flex-start;
  z-index: 2;
}
.hero-banner-content {
  position: relative; z-index: 3;
  max-width: 600px; padding: 60px 20px;
  color: #fff;
}
.hero-banner-content .eyebrow {
  background: rgba(255, 255, 255, .15);
  color: #FFFFFF;
}
.hero-banner-content h1 {
  color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 16px;
}
.hero-banner-content p {
  color: rgba(255, 255, 255, .9); font-size: 1.02rem; max-width: 54ch; margin-bottom: 20px;
}
.hero-banner-content .hero-pill-list span {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .2);
  color: #fff;
}
.hero-banner-content .btn-outline {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.hero-banner-content .btn-outline:hover {
  background: #fff;
  color: var(--primary);
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px;
}
.hero-actions .btn {
  padding: 12px 28px; font-size: .95rem; font-weight: 600;
}

.brand-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px; padding: 22px; background: var(--surface); border-block: 1px solid var(--border); color: var(--text-muted); font-size: .84rem; font-weight: 600; letter-spacing: .06em; }
.brand-logos { display: flex; flex-wrap: wrap; gap: 22px; }
.section { max-width: 1240px; margin: 0 auto; padding: 64px 20px; }
.section-light { background: transparent; }
.section-heading { margin-bottom: 26px; }
.section-heading small { display: inline-block; margin-bottom: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.feature-card:hover, .guide-card:hover, .content-card:hover, .contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card ul, .guide-card ol, .content-card ul { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: .9rem; }
.feature-card li, .guide-card li { margin-bottom: 6px; }
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1240px; margin: 0 auto; padding: 28px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .86rem;
}

/* ------------------------------ REPORT ------------------------------ */
.report-summary-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.report-footer, .report-notes { margin-top: 22px; font-size: .86rem; color: var(--text-muted); }
.report-signature, .signature-block { margin-top: 30px; text-align: right; font-size: .88rem; }

/* ------------------------------ PRINT ------------------------------ */
@media print {
  .sidebar, .topbar, .app-topbar, .sidebar-backdrop, .btn, .filter-row, .table-filters, .report-actions, .export-actions, #sidebar-toggle-mobile { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }
  .page-card { box-shadow: none; border: 1px solid #ddd; }
}

/* ------------------------------ RESPONSIVE ------------------------------ */
@media (max-width: 1199px) {
  .dashboard-grid.two-column { grid-template-columns: 1fr; }
  .hero-modern { grid-template-columns: 1fr; padding: 40px 20px; }
  .hero-banner-section { min-height: 400px; max-height: 500px; }
  .hero-banner-content { padding: 40px 20px; }
  .site-header .topbar { gap: 14px; }
  .header-nav { gap: 4px; }
  .header-nav a { padding: 6px 12px; font-size: .8rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 44px 28px; }
}

@media (max-width: 991px) {
  :root { --sidebar-w: 268px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); padding-left: 14px; padding-right: 14px; }
  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .sidebar-user-meta,
  body.sidebar-collapsed .nav-section-title,
  body.sidebar-collapsed .nav-link .nav-label { display: revert; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 10px 12px; }
  .main, body.sidebar-collapsed .main { margin-left: 0; }
}

@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .main { padding: 18px 16px 40px; }
  .topbar, .app-topbar { margin: -18px -16px 18px; padding: 10px 16px; }
  .topbar-date, .topbar-user-meta { display: none; }
  .hero-welcome { padding: 26px 22px; }
  .hero-banner-section { min-height: 300px; max-height: 400px; }
  .hero-banner-overlay { background: linear-gradient(180deg, rgba(15, 23, 42, .85) 0%, rgba(15, 23, 42, .55) 100%); }
  .hero-banner-content { padding: 30px 16px; max-width: 100%; }
  .hero-banner-content h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
  .hero-banner-content p { font-size: .95rem; }
  .hero-pill-list { gap: 8px; }
  .hero-pill-list span { padding: 6px 12px; font-size: .75rem; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { padding: 10px 20px; font-size: .85rem; }
  .stats-grid, .summary-grid, .summary-card-stats { grid-template-columns: 1fr; gap: 14px; }
  .page-card { padding: 18px; }
  .auth-brand { display: none; }
  .auth-panel { padding: 26px 16px; }
  .auth-card { padding: 26px 20px; }
  .btn { width: 100%; }
  .filter-row .btn, .table-actions .btn, .actions .btn, .form-actions .btn, .header-actions .btn { flex: 1 1 100%; }
  .topbar-user { padding-left: 0; border-left: none; }

  /* Tabel responsif -> kartu */
  .table-wrap.responsive-cards { border: none; background: none; overflow: visible; }
  .table-wrap.responsive-cards table,
  .table-wrap.responsive-cards tbody,
  .table-wrap.responsive-cards tr,
  .table-wrap.responsive-cards td { display: block; width: 100%; }
  .table-wrap.responsive-cards thead { display: none; }
  .table-wrap.responsive-cards tr {
    margin-bottom: 12px; padding: 6px 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-xs);
  }
  .table-wrap.responsive-cards td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 14px; border-bottom: 1px dashed var(--border); text-align: right;
  }
  .table-wrap.responsive-cards td:last-child { border-bottom: none; }
  .table-wrap.responsive-cards td::before {
    content: attr(data-label);
    font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); text-align: left; flex: 0 0 auto;
  }
}
