/* ═══════════════════════════════════════════════════════════════
   LEAVE v1.5 — Design System
   Layanan Elektronik Administrasi Verifikasi Cuti Pegawai
   Puskesmas Tambora
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* ── Sidebar: Modern Blue ── */
  --sb-bg:        #0f172a;
  --sb-mid:       #082f49;
  --sb-glow-1:    rgba(14,165,233,.22);
  --sb-glow-2:    rgba(6,182,212,.14);
  --sb-active-bg: rgba(14,165,233,.16);
  --sb-active-border: #38bdf8;
  --sb-text:      #bae6fd;
  --sb-muted:     #64748b;
  --sb-section:   #0ea5e9;

  /* ── Brand Accent ── */
  --indigo-300:  #7dd3fc;
  --indigo-400:  #38bdf8;
  --indigo-500:  #0ea5e9;
  --indigo-600:  #0284c7;
  --indigo-700:  #0369a1;
  --violet-400:  #22d3ee;
  --violet-500:  #06b6d4;
  --violet-600:  #0891b2;

  /* ── Semantic Colors ── */
  --green-400:   #4ade80;
  --green-500:   #22c55e;
  --green-600:   #16a34a;
  --amber-400:   #fbbf24;
  --amber-500:   #f59e0b;
  --amber-600:   #d97706;
  --rose-400:    #f87171;
  --rose-500:    #ef4444;
  --rose-600:    #dc2626;
  --sky-400:     #38bdf8;
  --sky-500:     #0ea5e9;
  --orange-400:  #fb923c;
  --orange-500:  #f97316;

  /* ── Neutrals ── */
  --slate-50:   #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-300:  #cbd5e1;
  --slate-400:  #94a3b8;
  --slate-500:  #64748b;
  --slate-600:  #475569;
  --slate-700:  #334155;
  --slate-800:  #1e293b;
  --slate-900:  #0f172a;

  /* ── Layout ── */
  --sidebar-w:  260px;
  --header-h:   64px;

  /* ── Type ── */
  --font-body:    'Plus Jakarta Sans', sans-serif;
  --font-display: 'DM Serif Display', serif;

  /* ── Radius ── */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* ── Shadow ── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.08);

  /* ── Transition ── */
  --ease: cubic-bezier(.4,0,.2,1);
}


/* ═══════════════════════════════ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--slate-50);
  color: var(--slate-800);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); }


/* ═══════════════════════════════ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform .3s var(--ease);
}
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 10% 0%, var(--sb-glow-1) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 100%, var(--sb-glow-2) 0%, transparent 55%);
  pointer-events: none;
}
/* animated top stripe */
.sidebar::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--indigo-500), var(--violet-500), var(--sky-400), var(--indigo-500));
  background-size: 300% 100%;
  animation: gradShift 4s linear infinite;
}
@keyframes gradShift { to { background-position: -300% 0; } }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  position: relative;
}
.logo-mark {
  display: flex; align-items: center; gap: 11px; margin-bottom: 4px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--indigo-500), var(--violet-500));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(14,165,233,.42);
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: #fff;
  letter-spacing: .3px;
}
.logo-sub {
  font-size: .63rem; color: #0ea5e980; line-height: 1.5; margin-top: 1px;
  letter-spacing: .02em;
}
.logo-pill {
  display: inline-block; margin-top: 6px;
  background: rgba(14,165,233,.16); border: 1px solid rgba(56,189,248,.30);
  color: var(--indigo-400); font-size: .58rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; letter-spacing: .06em; text-transform: uppercase;
}

/* ── Role Display ── */
.role-display {
  margin: 14px 16px 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.role-label {
  font-size: .6rem; color: #4b5a7a; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
}
.role-value {
  font-size: .75rem; font-weight: 600; color: var(--indigo-400);
}

/* ── Sidebar Navigation ── */
.sb-section {
  font-size: .58rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sb-section);
  padding: 18px 20px 5px; opacity: .7;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  cursor: pointer; transition: background .15s, color .15s;
  position: relative; text-decoration: none;
  color: #7aa7a3; font-size: .8rem; font-weight: 500;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--indigo-400); }
.nav-item.active {
  background: var(--sb-active-bg);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; background: var(--indigo-400); border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  font-size: .58rem; font-weight: 700; padding: 1px 7px;
  border-radius: 20px; color: #fff;
}
.nav-badge.indigo { background: var(--indigo-500); }
.nav-badge.amber  { background: var(--amber-500); }
.nav-badge.rose   { background: var(--rose-500); }
.nav-badge.green  { background: var(--green-500); }

/* ── Sidebar Footer ── */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo-500), var(--violet-500));
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar.lg { width: 48px; height: 48px; font-size: .95rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .6rem; }
.footer-name { font-size: .76rem; font-weight: 600; color: #e0f2fe; }
.footer-role { font-size: .62rem; color: #4b5a7a; }


/* ═══════════════════════════════ MAIN CONTENT ═══ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center;
  padding: 0 28px; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--slate-900); }
.topbar-sub { font-size: .72rem; color: var(--slate-400); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 11px; }

.hamburger {
  display: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--slate-100); border: 1px solid var(--slate-200);
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem;
  transition: all .15s;
}
.hamburger:hover { background: #e0f2fe; border-color: var(--indigo-300); }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--slate-100); border: 1px solid var(--slate-200);
  border-radius: 30px; padding: 7px 14px;
  width: 220px; transition: border-color .15s;
}
.search-bar:focus-within,
.search-bar:hover { border-color: var(--indigo-400); }
.search-bar input {
  border: none; background: transparent; outline: none;
  font-family: var(--font-body); font-size: .76rem; color: var(--slate-600); width: 100%;
}
.search-bar input::placeholder { color: var(--slate-400); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--slate-100); border: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .88rem; transition: all .15s; position: relative;
}
.icon-btn:hover { background: #e0f2fe; border-color: var(--indigo-300); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--rose-500); border-radius: 50%; border: 1.5px solid #fff;
}


/* ═══════════════════════════════ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 30px;
  font-family: var(--font-body); font-size: .76rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(14,165,233,.28);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(14,165,233,.42); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: #fff; color: var(--slate-600);
  border: 1px solid var(--slate-200);
}
.btn-outline:hover { border-color: var(--indigo-400); color: var(--indigo-600); background: #e0f2fe; }

.btn-danger {
  background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.28);
}
.btn-danger:hover { box-shadow: 0 6px 18px rgba(239,68,68,.42); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(34,197,94,.28);
}
.btn-success:hover { box-shadow: 0 6px 18px rgba(34,197,94,.42); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,158,11,.28);
}
.btn-warning:hover { box-shadow: 0 6px 18px rgba(245,158,11,.42); transform: translateY(-1px); }

.btn-sm { padding: 5px 12px; font-size: .68rem; }
.btn-lg { padding: 11px 24px; font-size: .85rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn:disabled, .btn.disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none;
}

/* Action Buttons */
.action-btn {
  font-size: .65rem; font-weight: 700; padding: 5px 11px;
  border-radius: 8px; cursor: pointer; border: 1px solid;
  font-family: var(--font-body); transition: all .15s;
}
.action-btn.approve { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.action-btn.approve:hover { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.action-btn.reject  { background: #fee2e2; color: var(--rose-500); border-color: #fecaca; }
.action-btn.reject:hover  { background: var(--rose-500); color: #fff; border-color: var(--rose-500); }
.action-btn.revise  { background: #fef3c7; color: #d97706; border-color: #fde68a; }
.action-btn.revise:hover  { background: var(--amber-500); color: #fff; border-color: var(--amber-500); }
.action-btn.view    { background: #e0f2fe; color: var(--indigo-600); border-color: #bae6fd; }
.action-btn.view:hover    { background: var(--indigo-500); color: #fff; border-color: var(--indigo-500); }


/* ═══════════════════════════════ PAGE ═══ */
.page { padding: 26px 28px; flex: 1; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 16px;
}
.page-title { font-size: 1.35rem; font-weight: 800; color: var(--slate-900); }
.page-desc { font-size: .76rem; color: var(--slate-500); margin-top: 3px; }

.tab-nav { display: flex; gap: 4px; background: var(--slate-100); border-radius: 30px; padding: 3px; }
.tab-btn {
  padding: 6px 14px; border-radius: 30px; border: none;
  background: transparent; font-family: var(--font-body); font-size: .72rem; font-weight: 600;
  color: var(--slate-500); cursor: pointer; transition: all .15s;
}
.tab-btn.active { background: #fff; color: var(--indigo-600); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.tab-btn:hover:not(.active) { color: var(--slate-700); }


/* ═══════════════════════════════ STAT CARDS ═══ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border-radius: var(--r-lg);
  border: 1px solid var(--slate-200);
  padding: 20px; position: relative; overflow: hidden;
  transition: box-shadow .2s, transform .2s; cursor: default;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .35s ease both;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.indigo::before { background: linear-gradient(90deg, var(--indigo-400), #bae6fd); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--green-400), #bbf7d0); }
.stat-card.amber::before  { background: linear-gradient(90deg, var(--amber-400), #fde68a); }
.stat-card.rose::before   { background: linear-gradient(90deg, var(--rose-400), #fecaca); }

.stat-card:nth-child(1) { animation-delay: .04s; }
.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .16s; }

.stat-icon {
  width: 42px; height: 42px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; margin-bottom: 14px;
}
.stat-icon.indigo { background: #e0f2fe; }
.stat-icon.green  { background: #f0fdf4; }
.stat-icon.amber  { background: #fffbeb; }
.stat-icon.rose   { background: #fff5f5; }

.stat-label { font-size: .65rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--slate-900); line-height: 1; }
.stat-sub { font-size: .68rem; color: var(--slate-400); margin-top: 7px; }
.stat-tag {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 8px; padding: 2px 7px; border-radius: 20px;
  font-size: .65rem; font-weight: 600;
}
.stat-tag.up   { background: #f0fdf4; color: var(--green-500); }
.stat-tag.warn { background: #fffbeb; color: var(--amber-500); }
.stat-tag.down { background: #fff5f5; color: var(--rose-500); }


/* ═══════════════════════════════ QUOTA METER ═══ */
.quota-bar-wrap { height: 8px; background: var(--slate-100); border-radius: 20px; overflow: hidden; margin-top: 6px; }
.quota-bar { height: 100%; border-radius: 20px; transition: width .6s ease; }


/* ═══════════════════════════════ CARD ═══ */
.card {
  background: #fff; border-radius: var(--r-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm); overflow: hidden;
  animation: fadeUp .4s ease both;
}
.card-header {
  padding: 16px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--slate-100);
}
.card-title { font-size: .86rem; font-weight: 700; color: var(--slate-800); }
.card-sub { font-size: .67rem; color: var(--slate-400); margin-top: 1px; }
.card-body { padding: 16px 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
}


/* ═══════════════════════════════ LEAVE QUOTA TABLE ═══ */
.quota-table { width: 100%; border-collapse: collapse; }
.quota-table th {
  text-align: left; padding: 8px 12px;
  font-size: .62rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--slate-400); background: var(--slate-50); border-bottom: 1px solid var(--slate-200);
}
.quota-table td {
  padding: 11px 12px; font-size: .78rem;
  color: var(--slate-700); border-bottom: 1px solid var(--slate-100);
}
.quota-table tr:hover td { background: #e0f2fe80; }
.quota-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 22px; border-radius: 6px;
  font-size: .7rem; font-weight: 800;
}
.quota-pill.ok   { background: #dcfce7; color: #16a34a; }
.quota-pill.warn { background: #fef3c7; color: #d97706; }
.quota-pill.zero { background: #fee2e2; color: #dc2626; }


/* ═══════════════════════════════ WORKFLOW STAGES ═══ */
.wf-track {
  display: flex; align-items: center; gap: 0; margin-bottom: 20px;
  overflow-x: auto; padding-bottom: 4px;
}
.wf-stage {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  flex: 1; min-width: 80px; position: relative;
}
.wf-stage:not(:last-child)::after {
  content: '';
  position: absolute; top: 16px; left: calc(50% + 16px); right: calc(-50% + 16px);
  height: 2px;
}
.wf-stage.done::after   { background: var(--green-400); }
.wf-stage.active::after { background: repeating-linear-gradient(90deg, var(--indigo-400) 0,var(--indigo-400) 6px, transparent 6px, transparent 10px); }
.wf-stage.idle::after   { background: var(--slate-200); }
.wf-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; transition: all .2s;
  position: relative; z-index: 1;
}
.wf-circle.done   { background: var(--green-500); color: #fff; }
.wf-circle.active { background: var(--indigo-500); color: #fff; box-shadow: 0 0 0 4px rgba(14,165,233,.20); animation: ringPulse 1.5s ease infinite; }
.wf-circle.idle   { background: var(--slate-100); color: var(--slate-400); border: 2px solid var(--slate-200); }
.wf-label { font-size: .6rem; font-weight: 600; text-align: center; color: var(--slate-500); line-height: 1.3; }
.wf-label.active { color: var(--indigo-600); }
.wf-label.done   { color: var(--green-500); }
@keyframes ringPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(14,165,233,.20); }
  50%     { box-shadow: 0 0 0 7px rgba(14,165,233,.10); }
}


/* ═══════════════════════════════ REQUEST ITEMS ═══ */
.req-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--slate-100);
  transition: background .1s; cursor: pointer;
}
.req-item:last-child { border-bottom: none; }
.req-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.req-name   { font-size: .8rem; font-weight: 700; color: var(--slate-800); }
.req-meta   { font-size: .68rem; color: var(--slate-400); margin-top: 2px; }
.req-type   { font-size: .68rem; font-weight: 600; color: var(--slate-600); margin-top: 3px; }
.req-actions { margin-left: auto; display: flex; gap: 5px; flex-shrink: 0; }


/* ═══════════════════════════════ STATUS BADGE ═══ */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: .63rem; font-weight: 700;
}
.status-badge::before { content: '●'; font-size: .45rem; }
.status-badge.approved  { background: #dcfce7; color: #16a34a; }
.status-badge.pending   { background: #e0f2fe; color: var(--indigo-600); }
.status-badge.review    { background: #fef3c7; color: #d97706; }
.status-badge.rejected  { background: #fee2e2; color: var(--rose-500); }
.status-badge.bypass    { background: #ecfeff; color: var(--violet-600); }
.status-badge.draft     { background: var(--slate-100); color: var(--slate-500); }


/* ═══════════════════════════════ CUTI TYPE CARDS ═══ */
.cuti-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cuti-type-card {
  border: 1px solid var(--slate-200); border-radius: var(--r-md);
  padding: 12px 14px; cursor: pointer; transition: all .15s;
  background: #fff; position: relative; overflow: hidden;
}
.cuti-type-card:hover { border-color: var(--indigo-400); background: #e0f2fe80; transform: translateY(-1px); }
.cuti-type-card.selected { border-color: var(--indigo-500); background: #e0f2fe; }
.ct-icon { font-size: 1.4rem; margin-bottom: 6px; }
.ct-name { font-size: .72rem; font-weight: 700; color: var(--slate-800); }
.ct-sisa { font-size: .62rem; color: var(--slate-400); margin-top: 2px; }
.ct-sisa strong { color: var(--indigo-600); }


/* ═══════════════════════════════ WA LOG ═══ */
.wa-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--slate-100);
}
.wa-item:last-child { border-bottom: none; }
.wa-icon-box { width: 30px; height: 30px; border-radius: 8px; background: #dcfce7; display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.wa-name { font-size: .77rem; font-weight: 600; color: var(--slate-800); }
.wa-desc { font-size: .65rem; color: var(--slate-400); }
.wa-status { margin-left: auto; font-size: .62rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; flex-shrink: 0; }
.wa-status.sent    { background: #dcfce7; color: #16a34a; }
.wa-status.pending { background: #fef3c7; color: #d97706; }
.wa-status.fail    { background: #fee2e2; color: var(--rose-500); }


/* ═══════════════════════════════ DAILY QUOTA VISUAL ═══ */
.quota-day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.quota-day {
  border-radius: var(--r-sm); padding: 8px 4px;
  text-align: center; cursor: pointer; transition: all .15s;
  border: 1px solid var(--slate-200);
}
.quota-day:hover { transform: translateY(-2px); }
.qd-label { font-size: .58rem; color: var(--slate-400); font-weight: 600; text-transform: uppercase; }
.qd-num   { font-size: 1rem; font-weight: 800; margin: 3px 0; }
.qd-sub   { font-size: .55rem; color: var(--slate-400); }
.quota-day.open  { background: #f0fdf4; border-color: #bbf7d0; }
.quota-day.open .qd-num { color: var(--green-500); }
.quota-day.warn  { background: #fffbeb; border-color: #fde68a; }
.quota-day.warn .qd-num  { color: var(--amber-500); }
.quota-day.full  { background: #fee2e2; border-color: #fecaca; }
.quota-day.full .qd-num  { color: var(--rose-500); }
.quota-day.today { border-color: var(--indigo-400); box-shadow: 0 0 0 2px rgba(14,165,233,.16); }


/* ═══════════════════════════════ TIMELINE ═══ */
.tl-item { display: flex; gap: 12px; margin-bottom: 14px; }
.tl-dot-wrap { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px;
}
.tl-line { flex: 1; width: 1px; background: var(--slate-200); margin-top: 4px; }
.tl-content { flex: 1; padding-bottom: 14px; }
.tl-title { font-size: .76rem; font-weight: 600; color: var(--slate-800); }
.tl-desc  { font-size: .68rem; color: var(--slate-500); margin-top: 2px; }
.tl-time  { font-size: .62rem; color: var(--slate-400); margin-top: 3px; }


/* ═══════════════════════════════ TABLE ═══ */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left; padding: 9px 14px;
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--slate-400);
  background: var(--slate-50); border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}
.tbl tbody tr { transition: background .1s; cursor: pointer; }
.tbl tbody tr:hover td { background: #e0f2fe70; }
.tbl tbody td {
  padding: 11px 14px; font-size: .77rem;
  color: var(--slate-700); border-bottom: 1px solid var(--slate-100);
}


/* ═══════════════════════════════ DONUT CHART ═══ */
.donut-wrap { display: flex; justify-content: center; align-items: center; position: relative; padding: 8px 0; }
.donut-center { position: absolute; text-align: center; }
.donut-num { font-size: 1.6rem; font-weight: 800; color: var(--slate-900); line-height: 1; }
.donut-lbl { font-size: .62rem; color: var(--slate-400); }
.legend-row { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend-name { font-size: .72rem; color: var(--slate-600); flex: 1; }
.legend-val  { font-size: .72rem; font-weight: 700; color: var(--slate-800); }


/* ═══════════════════════════════ TREND CHART ═══ */
.trend-card { margin-bottom: 16px; }
.trend-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
}
.trend-chart {
  min-height: 230px;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 72%);
  padding: 14px 14px 8px;
  position: relative;
  overflow: hidden;
}
.trend-chart svg { width: 100%; height: 178px; display: block; overflow: visible; }
.trend-grid-line { stroke: var(--slate-200); stroke-width: 1; stroke-dasharray: 4 5; }
.trend-area { fill: url(#trendFill); }
.trend-line {
  fill: none;
  stroke: var(--indigo-500);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 6px 10px rgba(14,165,233,.18));
}
.trend-point {
  fill: #fff;
  stroke: var(--indigo-500);
  stroke-width: 3;
}
.trend-point.today {
  fill: var(--indigo-500);
  stroke: #fff;
  filter: drop-shadow(0 4px 8px rgba(14,165,233,.35));
}
.trend-y-label {
  position: absolute;
  left: 14px;
  font-size: .58rem;
  color: var(--slate-400);
  font-weight: 700;
}
.trend-y-label.top { top: 13px; }
.trend-y-label.mid { top: 88px; }
.trend-y-label.low { bottom: 34px; }
.trend-x {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 6px;
}
.trend-x span {
  text-align: center;
  font-size: .6rem;
  color: var(--slate-400);
  font-weight: 700;
  text-transform: uppercase;
}
.trend-summary {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}
.trend-metric {
  border: 1px solid var(--slate-200);
  border-radius: var(--r-md);
  background: var(--slate-50);
  padding: 12px 13px;
}
.trend-metric.primary {
  background: #e0f2fe;
  border-color: #bae6fd;
}
.trend-metric-label {
  font-size: .6rem;
  color: var(--slate-500);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.trend-metric-value {
  margin-top: 5px;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 800;
  color: var(--slate-900);
}
.trend-metric.primary .trend-metric-value { color: var(--indigo-700); }
.trend-metric-note {
  margin-top: 5px;
  font-size: .64rem;
  color: var(--slate-400);
}
.trend-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 7px;
  height: 74px;
  margin-top: 10px;
}
.trend-bar {
  min-height: 12px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--indigo-400), var(--indigo-600));
}


/* ═══════════════════════════════ PAGINATION ═══ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--slate-100);
}
.pagination-info { font-size: .7rem; color: var(--slate-400); }
.pagination-buttons { display: flex; gap: 4px; }
.page-btn {
  padding: 4px 9px;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-body);
  font-size: .7rem;
  cursor: pointer;
  color: var(--slate-500);
  transition: all .15s;
}
.page-btn:hover { border-color: var(--indigo-400); color: var(--indigo-600); background: #e0f2fe; }
.page-btn.active {
  background: var(--indigo-500);
  border-color: var(--indigo-400);
  color: #fff;
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }


/* ═══════════════════════════════ FORMS ═══ */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: .72rem; font-weight: 600; color: var(--slate-700);
  margin-bottom: 6px;
}
.form-label .required {
  color: var(--rose-500); margin-left: 2px;
}
.form-hint {
  font-size: .62rem; color: var(--slate-400); margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--slate-700);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--indigo-400);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.form-control::placeholder { color: var(--slate-400); }
.form-control:disabled {
  background: var(--slate-50);
  color: var(--slate-400);
  cursor: not-allowed;
}

/* Select */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Textarea */
textarea.form-control {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

/* Input group */
.input-group {
  display: flex; align-items: stretch;
}
.input-group .form-control {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.input-group-append {
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-left: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .72rem;
  color: var(--slate-500);
}

/* Checkbox & Radio */
.form-check {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px; height: 16px;
  margin-top: 1px;
  accent-color: var(--indigo-500);
  cursor: pointer;
}
.form-check-label {
  font-size: .76rem; color: var(--slate-700);
  cursor: pointer;
}

/* Validation states */
.form-control.is-invalid {
  border-color: var(--rose-400);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.form-control.is-valid {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(34,197,94,.1);
}
.invalid-feedback {
  font-size: .65rem; color: var(--rose-500);
  margin-top: 4px;
  display: none;
}
.form-control.is-invalid ~ .invalid-feedback,
.was-validated .form-control:invalid ~ .invalid-feedback {
  display: block;
}
.valid-feedback {
  font-size: .65rem; color: var(--green-500);
  margin-top: 4px;
  display: none;
}
.form-control.is-valid ~ .valid-feedback {
  display: block;
}

/* File Upload */
.file-upload {
  border: 2px dashed var(--slate-200);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--slate-50);
}
.file-upload:hover {
  border-color: var(--indigo-400);
  background: #e0f2fe40;
}
.file-upload.dragover {
  border-color: var(--indigo-500);
  background: #e0f2fe;
}
.file-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.file-upload-text { font-size: .76rem; color: var(--slate-500); }
.file-upload-hint { font-size: .62rem; color: var(--slate-400); margin-top: 4px; }
.file-upload input[type="file"] { display: none; }

/* Date Input Enhancement */
input[type="date"].form-control {
  cursor: pointer;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator {
  opacity: .5;
  cursor: pointer;
}


/* ═══════════════════════════════ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay.active { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,.15);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn .3s var(--ease);
}
.modal.lg { max-width: 720px; }
.modal.sm { max-width: 400px; }
.modal.xl { max-width: 960px; }

.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: .92rem; font-weight: 700; color: var(--slate-900); }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--slate-100); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .85rem;
  color: var(--slate-500);
  transition: all .15s;
}
.modal-close:hover { background: var(--rose-100, #fee2e2); color: var(--rose-500); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Confirm Dialog */
.confirm-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 16px;
}
.confirm-icon.warning { background: #fef3c7; }
.confirm-icon.danger  { background: #fee2e2; }
.confirm-icon.success { background: #dcfce7; }
.confirm-icon.info    { background: #e0f2fe; }
.confirm-title {
  font-size: 1rem; font-weight: 700; text-align: center;
  color: var(--slate-900); margin-bottom: 6px;
}
.confirm-text {
  font-size: .78rem; color: var(--slate-500); text-align: center;
  line-height: 1.6;
}


/* ═══════════════════════════════ ALERTS / FLASH ═══ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: .78rem;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
  animation: fadeUp .3s ease both;
  position: relative;
}
.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: -1px; }
.alert-content { flex: 1; }
.alert-title {
  font-weight: 700; margin-bottom: 2px;
}
.alert-dismiss {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none;
  font-size: 1rem; cursor: pointer;
  opacity: .5; transition: opacity .15s;
  color: inherit;
}
.alert-dismiss:hover { opacity: 1; }

.alert-success {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d;
}
.alert-error,
.alert-danger {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
}
.alert-warning {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
}
.alert-info {
  background: #e0f2fe; border: 1px solid #bae6fd; color: #0369a1;
}


/* ═══════════════════════════════ ANIMATIONS ═══ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}

.animate-fadeUp { animation: fadeUp .4s ease both; }
.animate-slideIn { animation: slideInRight .4s ease both; }


/* ═══════════════════════════════ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 20px; }


/* ═══════════════════════════════ TOOLTIP ═══ */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--slate-800); color: #fff;
  font-size: .62rem; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; pointer-events: none; z-index: 999;
}


/* ═══════════════════════════════ DROPDOWN ═══ */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all .15s var(--ease);
  overflow: hidden;
}
.dropdown.open .dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  font-size: .76rem; color: var(--slate-600);
  cursor: pointer; transition: background .1s;
}
.dropdown-item:hover { background: var(--slate-50); color: var(--indigo-600); }
.dropdown-divider { height: 1px; background: var(--slate-100); margin: 2px 0; }


/* ═══════════════════════════════ LOADING ═══ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--slate-200);
  border-top-color: var(--indigo-500);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.spinner.lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}


/* ═══════════════════════════════ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--slate-700); margin-bottom: 4px; }
.empty-state-text { font-size: .78rem; color: var(--slate-400); max-width: 320px; margin: 0 auto; }


/* ═══════════════════════════════ SIDEBAR OVERLAY (Mobile) ═══ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }


/* ═══════════════════════════════ FOOTER ═══ */
.page-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; font-size: .63rem; color: var(--slate-400);
}


/* ═══════════════════════════════ GRIDS (utility) ═══ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }


/* ═══════════════════════════════ RESPONSIVE ═══ */

/* Tablet */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .trend-layout { grid-template-columns: 1fr; }
  .trend-summary { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
  }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger { display: flex; }

  .topbar {
    padding: 0 16px;
  }
  .topbar .search-bar { display: none; }

  .page {
    padding: 16px;
  }
  .page-header {
    flex-direction: column;
  }
  .page-title { font-size: 1.15rem; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.5rem; }
  .stat-icon { width: 34px; height: 34px; font-size: .95rem; margin-bottom: 10px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cuti-type-grid { grid-template-columns: repeat(2, 1fr); }
  .quota-day-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; }

  .req-item { flex-wrap: wrap; }
  .req-actions { width: 100%; margin-left: 48px; margin-top: 6px; }

  .tbl { font-size: .72rem; }
  .tbl thead th, .tbl tbody td { padding: 8px 10px; }

  .modal { max-width: 95vw; margin: auto 10px; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 12px 16px; }

  .page-footer { flex-direction: column; gap: 4px; text-align: center; }

  .wf-track { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wf-stage { min-width: 70px; }

  .trend-summary { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .cuti-type-grid { grid-template-columns: 1fr; }
  .quota-day-grid { grid-template-columns: repeat(4, 1fr); }

  .topbar-right .btn-primary { display: none; }
  .topbar-right .icon-btn[data-tip="Ekspor Laporan"] { display: none; }
}


/* ═══════════════════════════════ PRINT ═══ */
@media print {
  .sidebar, .topbar, .hamburger, .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .btn, .action-btn { display: none !important; }
}
