/* =========================================================
   PT INTUISI TATA BESTARI — HR SYSTEM
   Design tokens
   ========================================================= */
:root {
  --navy-950: #0B1526;
  --navy-900: #10243E;
  --navy-800: #16324F;
  --navy-700: #1E425F;
  --teal-600: #0E8388;
  --teal-500: #14A0A0;
  --teal-100: #DCF3F1;
  --gold-500: #E3B23C;
  --gold-100: #FBF0D6;
  --bg: #F2F5F9;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --border: #E3E8EF;
  --text: #1B2733;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --success: #16A34A;
  --success-bg: #E8F8EE;
  --danger: #DC2626;
  --danger-bg: #FDEAEA;
  --warning: #D97706;
  --warning-bg: #FDF3E3;
  --info: #0E8388;
  --info-bg: #E1F3F2;

  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 62, 0.06), 0 1px 3px rgba(16, 36, 62, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 36, 62, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 36, 62, 0.14);
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--navy-900); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--teal-500); outline-offset: 2px; }

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(185deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(14,131,136,0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; }
.brand-text span { font-size: 11.5px; color: rgba(255,255,255,0.5); letter-spacing: 0.03em; text-transform: uppercase; }

.nav { padding: 18px 14px; flex: 1; overflow-y: auto; }
.nav-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.35);
  padding: 6px 12px 10px;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  margin-bottom: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active {
  background: rgba(20,160,160,0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--teal-500);
}

.sidebar-footer {
  padding: 16px 18px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), #C98F1F);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--navy-950);
  flex-shrink: 0;
}
.user-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-chip-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text span { font-size: 11px; color: rgba(255,255,255,0.45); }
.btn-logout {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-logout:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-logout svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; }

.main-col { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-title h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 100px;
}

.content { padding: 28px 32px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* =========================================================
   ALERTS
   ========================================================= */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  font-weight: 500;
}
.alert-success { background: var(--success-bg); color: #0F7A38; border-color: #BFE8CE; }
.alert-error { background: var(--danger-bg); color: #B32424; border-color: #F3C4C4; }

/* =========================================================
   CARDS / GRID
   ========================================================= */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }

.stat-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; stroke-width: 1.9; fill: none; stroke: currentColor; }
.stat-icon.teal { background: var(--teal-100); color: var(--teal-600); }
.stat-icon.gold { background: var(--gold-100); color: #A9770E; }
.stat-icon.navy { background: #E4EAF1; color: var(--navy-800); }
.stat-icon.danger { background: var(--danger-bg); color: var(--danger); }
.stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* =========================================================
   TABLES  — ledger style, tabular numerals for money/data
   ========================================================= */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  white-space: nowrap;
}
tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-alt); }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cell-name { font-weight: 600; color: var(--navy-900); }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: #EEF1F5; color: var(--text-muted); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); }
.btn-teal { background: var(--teal-600); color: #fff; }
.btn-teal:hover { background: #0B6E72; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-alt); border-color: #C9D2DE; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: #F3C4C4; }
.btn-danger-outline:hover { background: var(--danger-bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #128A3E; }
.btn-sm { padding: 6.5px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* =========================================================
   FORMS
   ========================================================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy-800);
}
input, select, textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20,160,160,0.14);
  outline: none;
}
textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--text-faint); }
.search-box { position: relative; }
.search-box input { padding-left: 38px; width: 260px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-faint); fill: none; stroke-width: 2; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--navy-950);
}
.login-visual {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(20,160,160,0.35), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(227,178,60,0.18), transparent 45%),
    linear-gradient(165deg, var(--navy-900), var(--navy-950));
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-visual .brand-mark { width: 48px; height: 48px; font-size: 17px; }
.login-visual-content { max-width: 420px; margin-top: auto; margin-bottom: auto; }
.login-visual-content .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-500);
  margin-bottom: 18px;
  display: block;
}
.login-visual-content h2 {
  font-size: 34px;
  color: #fff;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.login-visual-content p {
  color: rgba(255,255,255,0.55);
  font-size: 14.5px;
  line-height: 1.65;
  margin-top: 16px;
}
.ledger-strip {
  display: flex;
  gap: 26px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.ledger-strip div strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  color: #fff;
}
.ledger-strip div span { font-size: 11.5px; color: rgba(255,255,255,0.45); }

.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 34px;
  border: 1px solid var(--border);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 26px; }
.login-card .form-group { margin-bottom: 16px; }
.demo-box {
  margin-top: 22px;
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}
.demo-box strong { color: var(--navy-800); font-family: var(--font-mono); }

/* =========================================================
   MISC
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 46px; height: 46px; stroke: var(--text-faint); fill: none; stroke-width: 1.5; margin-bottom: 14px; }
.empty-state h4 { color: var(--navy-800); margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin: 0; }

.tabs { display: flex; gap: 6px; background: var(--surface-alt); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.tabs a { padding: 7px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.tabs a.active { background: var(--surface); color: var(--navy-900); box-shadow: var(--shadow-sm); }

.detail-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-muted); }
.detail-row span:last-child { font-weight: 600; color: var(--navy-900); }

.progress-track { height: 7px; background: var(--surface-alt); border-radius: 100px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); border-radius: 100px; }

.dept-list { display: flex; flex-direction: column; gap: 14px; }
.dept-row { display: flex; align-items: center; gap: 12px; }
.dept-row .dept-name { width: 130px; font-size: 12.5px; font-weight: 600; color: var(--navy-800); flex-shrink: 0; }
.dept-row .dept-count { width: 26px; text-align: right; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); flex-shrink: 0; }

.punch-card {
  background: linear-gradient(155deg, var(--navy-900), var(--navy-950));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.punch-time { font-family: var(--font-mono); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; }
.punch-sub { color: rgba(255,255,255,0.5); font-size: 12.5px; }
.punch-actions { display: flex; gap: 10px; }
.punch-actions form { flex: 1; }
.punch-actions .btn { width: 100%; }

/* Responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}
@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-col { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 50px; }
  .topbar { padding: 0 16px; }
}
.mobile-menu { display:none; }
.text-center { text-align:center; }
.small { font-size:12.5px; }
.muted { color:var(--text-muted); font-size:13px; margin:2px 0 0; }
.strong { font-weight:700; color:var(--navy-900); }
.actions { display:flex; gap:8px; justify-content:flex-end; align-items:center; white-space:nowrap; }
.actions form { display:inline; }
.dark-outline { background:transparent !important; color:#fff !important; border-color:rgba(255,255,255,0.25) !important; }
@media (max-width: 780px) {
  .mobile-menu { display:inline-flex; width:42px; height:42px; border:1px solid var(--border); background:var(--surface); border-radius:8px; align-items:center; justify-content:center; margin-right:10px; }
  .topbar { justify-content:flex-start; gap:10px; }
  .topbar-date { margin-left:auto; display:none; }
  .actions { justify-content:flex-start; }
}

/* =========================================================
   ENHANCEMENTS — Excel requirement modules + premium polish
   ========================================================= */
.kpi-grid .stat-card,
.grid-3 .stat-card { min-height: 118px; }
.stat-icon.info { background: #E5F2FC; color: #2783DE; }
.person-cell { display:flex; align-items:center; gap:12px; min-width:240px; }
.person-cell img, .person-cell span {
  width:40px; height:40px; border-radius:12px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--teal-500), var(--navy-800));
  color:#fff; font-weight:800; font-family:var(--font-display);
  object-fit:cover;
}
.form-card { max-width: 980px; }
.form-inline { display:grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap:12px; align-items:end; }
.compact-form { display:flex; flex-direction:column; gap:12px; }
.big-money { font-family:var(--font-mono); font-size:26px; color:var(--navy-900); font-weight:700; margin-top:10px; letter-spacing:-.02em; }
.mini-progress { width:110px; height:8px; border-radius:99px; background:#EEF1F5; overflow:hidden; display:inline-flex; vertical-align:middle; margin-right:8px; border:1px solid var(--border); }
.mini-progress span { display:block; height:100%; background:linear-gradient(90deg, var(--teal-500), #2783DE); border-radius:99px; }
.link { color: var(--teal-600); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: 12px; }
.strong { font-weight: 800; }
.muted { color: var(--text-muted); }
.dark-outline { background: rgba(255,255,255,.06); color:#fff; border-color: rgba(255,255,255,.22); }
.dark-outline:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.34); }
.punch-form { display:grid; gap:10px; }
.punch-form input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color:#fff; }
.punch-form input::placeholder { color: rgba(255,255,255,.45); }
.mobile-menu { display:none; background:var(--surface-alt); border:1px solid var(--border); border-radius:10px; width:42px; height:42px; font-size:20px; color:var(--navy-800); }
.login-card-mark {
  width:54px; height:54px; border-radius:16px; margin-bottom:20px;
  background:linear-gradient(135deg, var(--teal-500), var(--navy-800));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:800; box-shadow:0 12px 26px rgba(14,131,136,.25);
}
.login-footer-note { font-size:11.5px; color:rgba(255,255,255,0.35); }
.login-card { position: relative; overflow: hidden; }
.login-card::before {
  content:''; position:absolute; top:-70px; right:-70px; width:150px; height:150px;
  background:radial-gradient(circle, rgba(20,160,160,.18), transparent 70%); pointer-events:none;
}
.login-card form { position:relative; z-index:1; }
.login-card h1, .login-card .sub, .login-card .alert, .login-card-mark { position:relative; z-index:1; }
.actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.actions form { margin:0; }

@media (max-width: 780px) {
  .mobile-menu { display:inline-flex; align-items:center; justify-content:center; }
  .topbar-title h1 { font-size:16px; }
  .topbar-date { display:none; }
  .form-inline { grid-template-columns:1fr; }
  .person-cell { min-width: 220px; }
  .login-card { padding: 34px 26px; }
}

/* Visual QA refinement: keep the login card clean without clipped pseudo overflow. */
.login-card { overflow: visible; }
.login-card::before { display: none; }
