/* ============================================================
   HRIS — Attendance Platform
   Design system & styles
   ============================================================ */
:root {
  /* Brand */
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.14), rgba(168,85,247,.14));

  /* Semantic */
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Light theme */
  --bg: #f4f5fb;
  --bg-2: #eceeffc;
  --surface: #ffffff;
  --surface-2: #f8f9ff;
  --card: #ffffff;
  --text: #1a1d29;
  --text-2: #5b6178;
  --text-3: #9aa0b8;
  --border: #e8eaf3;
  --border-2: #eef0f8;
  --shadow: 0 1px 3px rgba(20,22,40,.06), 0 8px 24px rgba(20,22,40,.06);
  --shadow-lg: 0 12px 40px rgba(30,25,80,.14);
  --ring: rgba(99,102,241,.35);
  --glass: rgba(255,255,255,.72);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --sidebar-w: 264px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
}

[data-theme="dark"] {
  --bg: #0b0d16;
  --bg-2: #0f1220;
  --surface: #141827;
  --surface-2: #1a1f31;
  --card: #151a2b;
  --text: #eef0fb;
  --text-2: #a3abc9;
  --text-3: #6b7290;
  --border: #232a41;
  --border-2: #1c2236;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 12px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
  --glass: rgba(20,24,39,.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
}
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
kbd {
  font-family: var(--font); font-size: 11px; padding: 2px 6px;
  border: 1px solid var(--border); border-radius: 6px; color: var(--text-3);
  background: var(--surface-2);
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px -4px var(--ring); }
.btn-primary:hover { box-shadow: 0 10px 26px -6px var(--ring); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-soft { background: var(--grad-soft); color: var(--brand); }
.btn-danger { background: rgba(239,68,68,.12); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn .ic { width: 18px; height: 18px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: var(--text-2); transition: background .2s, color .2s, transform .15s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

/* ============ LOGIN ============ */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(139,92,246,.25), transparent 60%),
              radial-gradient(900px 500px at 0% 110%, rgba(34,211,238,.18), transparent 55%),
              var(--bg);
}
.login-bg { position: absolute; inset: 0; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: float 14s ease-in-out infinite; }
.orb-1 { width: 380px; height: 380px; background: var(--brand); top: -80px; right: -60px; }
.orb-2 { width: 320px; height: 320px; background: var(--brand-2); bottom: -100px; left: -40px; animation-delay: -4s; }
.orb-3 { width: 240px; height: 240px; background: var(--brand-3); top: 40%; left: 55%; animation-delay: -8s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(20px,-30px) scale(1.08);} }

.glass {
  background: var(--glass); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.login-card { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 40px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 22px; font-family: var(--font-display);
  box-shadow: 0 8px 20px -6px var(--ring);
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand-tag { font-size: 12px; color: var(--text-3); }
.login-title { font-family: var(--font-display); font-size: 26px; letter-spacing: -.6px; margin-bottom: 6px; }
.login-sub { color: var(--text-2); font-size: 14px; margin-bottom: 26px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field-input {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border .2s, box-shadow .2s;
}
.field-input .ic { color: var(--text-3); }
.field-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.field-input input { flex: 1; border: none; outline: none; background: none; font-size: 14px; color: var(--text); height: 100%; }
.login-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.link { color: var(--brand); font-weight: 600; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ============ APP SHELL ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface);
  border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 40; transition: transform .3s ease;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 10px; }
.brand { display: flex; align-items: center; gap: 11px; }
.sidebar-close { display: none; }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500; font-size: 14.5px; position: relative;
  transition: background .18s, color .18s;
}
.nav-item .ic { width: 20px; height: 20px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--brand); background: var(--grad-soft); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 4px; background: var(--grad);
}
.nav-item .badge {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  background: var(--brand); color: #fff;
}
.sidebar-foot { padding: 14px; }
.upsell { padding: 16px; border-radius: 16px; text-align: center; }
.upsell-ic { font-size: 22px; }
.upsell-title { font-family: var(--font-display); font-weight: 800; margin-top: 4px; }
.upsell-sub { font-size: 12px; color: var(--text-2); margin: 4px 0 12px; }

.scrim { position: fixed; inset: 0; background: rgba(6,8,18,.5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
.scrim.show { opacity: 1; pointer-events: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 72px; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 26px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }
.search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; min-width: 320px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text-3);
  transition: border .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.search input { flex: 1; border: none; outline: none; background: none; font-size: 14px; color: var(--text); }
.search kbd { margin-left: auto; }

.ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: block; }
.notif .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 40px;
  border: 1px solid var(--border); transition: background .2s;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-name { font-size: 13.5px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--text-3); }
.user-chip .chev { width: 16px; height: 16px; color: var(--text-3); }

.content { padding: 26px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ============ Page head ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-family: var(--font-display); font-size: 27px; letter-spacing: -.7px; }
.page-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ Cards / grid ============ */
.grid { display: grid; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; transition: transform .2s, box-shadow .2s, border .2s;
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.card-link { font-size: 13px; color: var(--brand); font-weight: 600; }

/* Stat cards */
.stats { grid-template-columns: repeat(4, 1fr); }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--grad-soft); opacity: .8; }
.stat-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; position: relative; z-index: 1; }
.stat-ic.i-brand { background: var(--grad-soft); color: var(--brand); }
.stat-ic.i-ok { background: rgba(16,185,129,.14); color: var(--ok); }
.stat-ic.i-warn { background: rgba(245,158,11,.14); color: var(--warn); }
.stat-ic.i-info { background: rgba(59,130,246,.14); color: var(--info); }
.stat-val { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -1px; position: relative; z-index: 1; }
.stat-label { color: var(--text-2); font-size: 13.5px; margin-top: 2px; position: relative; z-index: 1; }
.stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 10px; padding: 3px 8px; border-radius: 20px; position: relative; z-index: 1; }
.trend-up { color: var(--ok); background: rgba(16,185,129,.12); }
.trend-down { color: var(--danger); background: rgba(239,68,68,.12); }

/* ============ Attendance clock ============ */
.clock-card { text-align: center; background: var(--grad); color: #fff; border: none; position: relative; overflow: hidden; }
.clock-card::before { content:""; position:absolute; inset:0; background: radial-gradient(400px 200px at 80% 0%, rgba(255,255,255,.22), transparent 60%); }
.clock-time { font-family: var(--font-display); font-size: 52px; font-weight: 800; letter-spacing: -1px; position: relative; }
.clock-date { opacity: .85; font-size: 14px; margin-top: 2px; position: relative; }
.clock-status { display: inline-flex; align-items: center; gap: 7px; margin: 18px 0; padding: 7px 16px; border-radius: 30px; background: rgba(255,255,255,.16); font-size: 13.5px; font-weight: 600; position: relative; }
.clock-status .pulse { width: 9px; height: 9px; border-radius: 50%; background: #a7f3d0; box-shadow: 0 0 0 0 rgba(167,243,208,.7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(167,243,208,.6);} 70% { box-shadow: 0 0 0 10px rgba(167,243,208,0);} 100% { box-shadow: 0 0 0 0 rgba(167,243,208,0);} }
.clock-actions { display: flex; gap: 12px; position: relative; }
.clock-btn { flex: 1; padding: 14px; border-radius: 14px; font-weight: 700; font-size: 15px; background: #fff; color: var(--brand); transition: transform .15s, opacity .2s; }
.clock-btn:hover { transform: translateY(-2px); }
.clock-btn.out { background: rgba(255,255,255,.16); color: #fff; }
.clock-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.clock-meta { display: flex; justify-content: space-around; margin-top: 20px; position: relative; }
.clock-meta div { text-align: center; }
.clock-meta .k { font-size: 12px; opacity: .8; }
.clock-meta .v { font-family: var(--font-display); font-weight: 800; font-size: 18px; }

/* ============ Charts ============ */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; max-width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.bar { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--grad); transition: height 1s cubic-bezier(.22,1,.36,1); position: relative; }
.bar.alt { background: linear-gradient(180deg, var(--brand-3), var(--info)); opacity: .85; }
.bar-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.legend { display: flex; gap: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { --v: 0; width: 150px; height: 150px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--brand) calc(var(--v)*1%), var(--border-2) 0); transition: background 1s ease; }
.donut::after { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: var(--card); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.donut-center .big { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.donut-center .small { font-size: 11px; color: var(--text-3); }
.donut-legend { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.dl-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.dl-row .dot2 { width: 10px; height: 10px; border-radius: 4px; }
.dl-row .val { margin-left: auto; font-weight: 700; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; margin: -6px; padding: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.emp-cell { display: flex; align-items: center; gap: 12px; }
.emp-cell img, .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; background: var(--grad); }
.emp-name { font-weight: 600; }
.emp-sub { font-size: 12.5px; color: var(--text-3); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 30px; font-size: 12.5px; font-weight: 600; }
.chip .d { width: 7px; height: 7px; border-radius: 50%; }
.chip-ok { background: rgba(16,185,129,.13); color: var(--ok); } .chip-ok .d { background: var(--ok); }
.chip-warn { background: rgba(245,158,11,.14); color: #b45309; } .chip-warn .d { background: var(--warn); }
[data-theme="dark"] .chip-warn { color: #fbbf24; }
.chip-danger { background: rgba(239,68,68,.13); color: var(--danger); } .chip-danger .d { background: var(--danger); }
.chip-info { background: rgba(59,130,246,.13); color: var(--info); } .chip-info .d { background: var(--info); }
.chip-mute { background: var(--surface-2); color: var(--text-2); } .chip-mute .d { background: var(--text-3); }

/* ============ Toolbar / filters ============ */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.input, .select {
  height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none; transition: border .2s, box-shadow .2s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.search-inline { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-3); }
.search-inline input { flex: 1; border: none; outline: none; background: none; color: var(--text); font-size: 14px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: .2s; }
.seg button.active { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }

/* Progress */
.progress { height: 8px; border-radius: 20px; background: var(--border-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 20px; background: var(--grad); transition: width 1s cubic-bezier(.22,1,.36,1); }

/* Employee cards */
.emp-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.emp-card { text-align: center; }
.emp-card .cover { height: 64px; border-radius: 14px; background: var(--grad-soft); margin: -6px -6px 0; }
.emp-card .avatar-lg { width: 74px; height: 74px; border-radius: 50%; margin: -44px auto 10px; border: 4px solid var(--card); object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 24px; background: var(--grad); }
.emp-card h4 { font-family: var(--font-display); font-size: 16px; }
.emp-card .role { color: var(--text-3); font-size: 13px; margin-bottom: 12px; }
.emp-card .row3 { display: flex; justify-content: space-around; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border-2); }
.emp-card .row3 .k { font-size: 11px; color: var(--text-3); }
.emp-card .row3 .v { font-weight: 700; font-size: 14px; }

/* Leave / timeline */
.leave-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-2); }
.leave-item:last-child { border: none; }
.leave-dot { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.leave-body { flex: 1; }
.leave-body h5 { font-size: 14.5px; font-weight: 600; }
.leave-body p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.leave-actions { display: flex; gap: 8px; align-items: center; }

/* Payslip */
.pay-list { display: flex; flex-direction: column; gap: 10px; }
.pay-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.pay-row.total { border: none; font-weight: 800; font-size: 18px; font-family: var(--font-display); padding-top: 16px; }
.pay-row .plus { color: var(--ok); } .pay-row .minus { color: var(--danger); }

/* Settings */
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--border-2); }
.setting-row:last-child { border: none; }
.setting-row .st h5 { font-size: 14.5px; font-weight: 600; }
.setting-row .st p { font-size: 13px; color: var(--text-2); }
.switch { width: 46px; height: 26px; border-radius: 30px; background: var(--border); position: relative; transition: background .25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(20px); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab { padding: 12px 16px; font-weight: 600; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: .2s; }
.tab.active { color: var(--brand); border-color: var(--brand); }

/* ============ Modal ============ */
.modal-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(6,8,18,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .3s cubic-bezier(.22,1,.36,1); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-family: var(--font-display); font-size: 18px; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96);} to { opacity:1; transform: none;} }
@keyframes fade { from { opacity: 0;} to { opacity: 1;} }

/* ============ Toast ============ */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 260px; animation: slideIn .35s cubic-bezier(.22,1,.36,1); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }
.toast .t-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.toast.ok .t-ic { background: rgba(16,185,129,.14); color: var(--ok); }
.toast.warn .t-ic { background: rgba(245,158,11,.14); color: var(--warn); }
.toast.danger .t-ic { background: rgba(239,68,68,.14); color: var(--danger); }
.toast .t-ic.def { background: var(--grad-soft); color: var(--brand); }
.toast .t-body h5 { font-size: 14px; font-weight: 600; }
.toast .t-body p { font-size: 12.5px; color: var(--text-2); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px);} to { opacity: 1; transform: none;} }

/* ============ Animations (reveal) ============ */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .55s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.stagger > * { opacity: 0; transform: translateY(14px); animation: reveal .55s cubic-bezier(.22,1,.36,1) forwards; }
.stagger > *:nth-child(1){animation-delay:.03s} .stagger > *:nth-child(2){animation-delay:.08s}
.stagger > *:nth-child(3){animation-delay:.13s} .stagger > *:nth-child(4){animation-delay:.18s}
.stagger > *:nth-child(5){animation-delay:.23s} .stagger > *:nth-child(6){animation-delay:.28s}
.stagger > *:nth-child(7){animation-delay:.33s} .stagger > *:nth-child(8){animation-delay:.38s}

.count { font-variant-numeric: tabular-nums; }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty .e-ic { font-size: 40px; margin-bottom: 10px; }

/* ============ Responsive ============ */
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .menu-btn { display: grid; }
  .search { min-width: 0; width: 46px; padding: 0; justify-content: center; }
  .search input, .search kbd { display: none; }
  .user-meta { display: none; }
  .content { padding: 18px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-title { font-size: 23px; }
  .form-2 { grid-template-columns: 1fr; }
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ============================================================
   v2 additions — roles, calendar, dropdowns, feed, self-service
   ============================================================ */

/* Login role picker */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt { display: flex; align-items: center; gap: 10px; padding: 12px; text-align: left; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); transition: border .2s, background .2s, transform .15s; }
.role-opt:hover { border-color: var(--brand); }
.role-opt.active { border-color: var(--brand); background: var(--grad-soft); }
.role-opt .ic { color: var(--brand); width: 26px; height: 26px; flex: none; }
.role-opt b { font-size: 13.5px; display: block; }
.role-opt small { font-size: 11px; color: var(--text-3); }

/* Role badge (topbar) */
.role-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--grad-soft); color: var(--brand); text-transform: uppercase; letter-spacing: .4px; }

/* Dropdowns / menus */
.pop { position: fixed; z-index: 70; min-width: 300px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn .2s cubic-bezier(.22,1,.36,1); }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.97);} to { opacity: 1; transform: none;} }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pop-head h4 { font-family: var(--font-display); font-size: 15px; }
.pop-head a { font-size: 12.5px; color: var(--brand); font-weight: 600; cursor: pointer; }
.pop-list { max-height: 340px; overflow-y: auto; }
.notif-row { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border-2); cursor: pointer; transition: background .15s; position: relative; }
.notif-row:hover { background: var(--surface-2); }
.notif-row.unread::before { content: ""; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.notif-row .n-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-row h6 { font-size: 13.5px; font-weight: 600; }
.notif-row p { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.notif-row .t { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.pop-foot { padding: 10px 16px; text-align: center; }
.menu-item { display: flex; align-items: center; gap: 11px; padding: 11px 16px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { width: 18px; height: 18px; color: var(--text-2); }
.menu-item.danger { color: var(--danger); } .menu-item.danger .ic { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); }
.menu-user { padding: 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.menu-user img, .menu-user .avatar { width: 42px; height: 42px; }

/* Calendar */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .icon-btn { width: 38px; height: 38px; border: 1px solid var(--border); }
.cal-month { font-family: var(--font-display); font-size: 18px; font-weight: 700; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; padding-bottom: 4px; }
.cal-cell { aspect-ratio: 1 / .92; border-radius: 12px; border: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: transform .15s, box-shadow .2s, border .2s; position: relative; overflow: hidden; background: var(--surface); }
.cal-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cal-cell.blank { border: none; background: none; cursor: default; }
.cal-cell.blank:hover { transform: none; box-shadow: none; }
.cal-cell .dnum { font-size: 13px; font-weight: 700; }
.cal-cell.today { border-color: var(--brand); border-width: 2px; }
.cal-cell.today .dnum { color: var(--brand); }
.cal-cell .cstat { margin-top: auto; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.cal-cell .cstat .cd { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-cell .ct { font-size: 10px; color: var(--text-3); }
.cs-present { background: rgba(16,185,129,.09); } .cs-present .cstat { color: var(--ok); } .cs-present .cd { background: var(--ok); }
.cs-late { background: rgba(245,158,11,.1); } .cs-late .cstat { color: #b45309; } .cs-late .cd { background: var(--warn); }
[data-theme="dark"] .cs-late .cstat { color: #fbbf24; }
.cs-absent { background: rgba(239,68,68,.09); } .cs-absent .cstat { color: var(--danger); } .cs-absent .cd { background: var(--danger); }
.cs-leave { background: rgba(59,130,246,.09); } .cs-leave .cstat { color: var(--info); } .cs-leave .cd { background: var(--info); }
.cs-holiday { background: rgba(168,85,247,.1); } .cs-holiday .cstat { color: var(--brand-2); } .cs-holiday .cd { background: var(--brand-2); }
.cs-weekend { background: var(--surface-2); } .cs-weekend .cstat { color: var(--text-3); } .cs-weekend .cd { background: var(--text-3); }
.cs-upcoming { opacity: .55; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.cal-legend i { width: 11px; height: 11px; border-radius: 4px; }

/* Announcements feed */
.ann-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-2); }
.ann-item:last-child { border: none; }
.ann-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--grad-soft); color: var(--brand); font-size: 20px; }
.ann-body h5 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-body p { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }
.ann-body .meta { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .3px; }
.tag-libur { background: rgba(239,68,68,.12); color: var(--danger); }
.tag-kebijakan { background: rgba(59,130,246,.12); color: var(--info); }
.tag-acara { background: rgba(168,85,247,.12); color: var(--brand-2); }
.tag-info { background: var(--grad-soft); color: var(--brand); }

/* Self-service / balance ring */
.balance-ring { display: flex; align-items: center; gap: 20px; }
.ring { --p: 0; width: 110px; height: 110px; border-radius: 50%; flex: none; position: relative; background: conic-gradient(var(--ok) calc(var(--p)*1%), var(--border-2) 0); transition: background 1s ease; }
.ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--card); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.ring-c .big { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.ring-c .small { font-size: 10.5px; color: var(--text-3); }

.profile-hero { display: flex; gap: 20px; align-items: center; }
.profile-hero .avatar-xl { width: 92px; height: 92px; border-radius: 22px; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 32px; background: var(--grad); flex: none; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 30px; }
.info-grid .row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border-2); font-size: 14px; gap: 12px; }
.info-grid .row span { color: var(--text-2); }
.info-grid .row b { text-align: right; }
@media (max-width: 640px) { .info-grid { grid-template-columns: 1fr; } .cal-cell { padding: 5px; } .cal-cell .cstat span:not(.cd) { display: none; } }

/* Doc list */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.doc-row:last-child { border: none; }
.doc-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex: none; }
