:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
.sidebar { width: 280px; background: #0f172a; color: white; padding: 28px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg, #60a5fa, #a78bfa); font-weight: 800; }
.brand span, .profile span { display: block; color: #94a3b8; font-size: 13px; margin-top: 3px; }
nav { display: grid; gap: 8px; }
nav a { color: #cbd5e1; text-decoration: none; padding: 13px 14px; border-radius: 14px; font-weight: 600; }
nav a.active, nav a:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-card { margin-top: auto; padding: 20px; border-radius: 22px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); }
.sidebar-card p { margin: 0; color: #cbd5e1; }
.sidebar-card h2 { margin: 8px 0; font-size: 30px; }
.sidebar-card small { color: #94a3b8; }
.main { flex: 1; padding: 32px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
h1, h2 { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.04em; }
h2 { font-size: 22px; letter-spacing: -0.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; color: var(--primary); font-weight: 800; font-size: 12px; margin: 0 0 8px; }
.profile { display: flex; align-items: center; gap: 12px; background: white; padding: 10px 14px; border-radius: 18px; box-shadow: var(--shadow); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #dbeafe; display: grid; place-items: center; font-weight: 800; color: #1d4ed8; }
.ghost, .primary, .mini { border: 0; cursor: pointer; font-weight: 800; border-radius: 12px; }
.ghost { background: #eff6ff; color: var(--primary); padding: 10px 14px; }
.primary { background: var(--primary); color: white; padding: 14px 18px; width: 100%; font-size: 15px; }
.primary:hover { background: var(--primary-dark); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card { padding: 22px; border-radius: 24px; color: white; box-shadow: var(--shadow); display: grid; gap: 12px; }
.stat-card strong { font-size: 34px; }
.blue { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.green { background: linear-gradient(135deg, #059669, #34d399); }
.orange { background: linear-gradient(135deg, #ea580c, #fbbf24); }
.purple { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.grid { display: grid; grid-template-columns: 0.9fr 1.4fr; gap: 18px; margin-bottom: 18px; }
.lower-grid { grid-template-columns: 1fr 1fr; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.pill { background: #f1f5f9; color: #475569; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: #334155; font-weight: 700; font-size: 13px; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px; font: inherit; color: var(--text); background: white; }
textarea { resize: vertical; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.message { font-weight: 700; color: #059669; margin: 0; min-height: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 14px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.status { padding: 7px 10px; border-radius: 999px; font-weight: 800; font-size: 12px; display: inline-block; }
.status.pending { background: #fff7ed; color: #c2410c; }
.status.approved { background: #ecfdf5; color: #047857; }
.status.rejected { background: #fef2f2; color: #b91c1c; }
.actions { display: flex; gap: 8px; }
.mini { padding: 8px 10px; }
.approve { background: #dcfce7; color: #15803d; }
.reject { background: #fee2e2; color: #b91c1c; }
.calendar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.day, .date { border-radius: 16px; padding: 14px; min-height: 64px; background: #f8fafc; font-weight: 800; }
.day { min-height: auto; color: var(--muted); }
.date small { color: var(--muted); font-weight: 700; }
.date.active { background: #dbeafe; color: #1d4ed8; }
.date.approved { background: #dcfce7; color: #15803d; }
.coverage-list { display: grid; gap: 18px; }
.coverage-list > div { display: grid; grid-template-columns: 90px 1fr 48px; align-items: center; gap: 12px; font-size: 14px; }
.bar { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #38bdf8); border-radius: inherit; }
@media (max-width: 1050px) { body { display: block; } .sidebar { width: auto; height: auto; position: relative; } nav { grid-template-columns: repeat(3, 1fr); } .stats, .grid, .lower-grid { grid-template-columns: 1fr 1fr; } .form-panel { grid-column: 1 / -1; } }
@media (max-width: 720px) { .main, .sidebar { padding: 20px; } .topbar, .profile { align-items: flex-start; } .topbar { flex-direction: column; } .stats, .grid, .lower-grid, .two-col { grid-template-columns: 1fr; } nav { grid-template-columns: 1fr; } }

.hidden { display: none !important; }
.app-shell { display: flex; min-height: 100vh; width: 100%; }
.login-screen { min-height: 100vh; width: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #dbeafe, transparent 34%), var(--bg); }
.login-card { width: min(480px, 100%); background: white; border: 1px solid var(--border); border-radius: 32px; padding: 32px; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 24px; color: var(--text); }
.login-brand span { color: var(--muted); }
.muted-text { color: var(--muted); margin-top: 8px; }
.demo-users { margin-top: 18px; display: grid; gap: 8px; background: #f8fafc; border: 1px solid var(--border); border-radius: 18px; padding: 16px; font-size: 13px; color: #475569; }
.danger { color: #b91c1c; background: #fef2f2; }
.user-panel { margin-bottom: 18px; }
.user-form { grid-template-columns: repeat(6, 1fr); align-items: end; margin-bottom: 18px; }
.user-form label { min-width: 0; }
.user-form button { height: 46px; }
.role-select { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.status.inactive { background: #f1f5f9; color: #475569; }
@media (max-width: 1050px) { .app-shell { display: block; } .user-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .user-form { grid-template-columns: 1fr; } }

.full { width: 100%; margin-top: 8px; }
.auth-subform { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }
.auth-subform h2 { margin-bottom: 12px; }
.security-note { margin-top: 12px; font-size: 12px; color: var(--muted); }

.leave-type-panel { margin-bottom: 18px; }
.leave-type-form { grid-template-columns: 1.1fr 0.8fr 0.7fr 0.9fr 0.9fr 1.3fr 1fr; align-items: end; margin-bottom: 18px; }
.leave-type-form label { min-width: 0; }
.leave-type-form button { height: 46px; }
.inline-input { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; min-width: 110px; }
.inline-small { width: 88px; }
@media (max-width: 1050px) { .leave-type-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .leave-type-form { grid-template-columns: 1fr; } }

.auth-code { font-size: 22px; font-weight: 800; letter-spacing: 0.18em; background: #eff6ff; color: #1d4ed8; padding: 10px 12px; border-radius: 12px; display: inline-block; margin-top: 8px; }

.security-panel { margin-bottom: 18px; }
.security-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.compact { width: auto; padding-left: 18px; padding-right: 18px; }
.totp-setup { display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-top: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: #f8fafc; }
.qr-wrap { background: white; border-radius: 18px; padding: 12px; display: grid; place-items: center; }
.qr-wrap img { max-width: 190px; width: 100%; height: auto; }
.inline-confirm { grid-template-columns: 1fr auto; align-items: end; margin-top: 12px; }
@media (max-width: 720px) { .totp-setup, .inline-confirm { grid-template-columns: 1fr; } }

.recovery-box { margin-top: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: #fff; }
.recovery-box pre { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 14px; font-size: 14px; line-height: 1.7; }
.audit-panel { margin-bottom: 18px; }

/* Premium UI refresh: modern HR SaaS layout */
:root {
  --bg: #eef4ff;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #101827;
  --muted: #64748b;
  --primary: #3157ff;
  --primary-dark: #243fd1;
  --accent: #14b8a6;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: rgba(148, 163, 184, 0.24);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 30px;
  --radius-md: 18px;
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 5% 8%, rgba(49, 87, 255, 0.22), transparent 32%),
    radial-gradient(circle at 85% 0%, rgba(20, 184, 166, 0.18), transparent 34%),
    linear-gradient(135deg, #eef4ff 0%, #f8fbff 50%, #eefdf8 100%);
  color: var(--text);
}

.app-shell { background: transparent; }

.sidebar {
  width: 300px;
  background:
    linear-gradient(180deg, rgba(8, 13, 31, 0.98), rgba(17, 24, 39, 0.96)),
    radial-gradient(circle at top, rgba(49, 87, 255, 0.55), transparent 45%);
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 18px 0 55px rgba(15, 23, 42, 0.22);
}

.brand { padding-bottom: 4px; }
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, #5b7cfa, #18c7ad);
  box-shadow: 0 16px 32px rgba(49, 87, 255, 0.35);
}
.brand strong { font-size: 18px; letter-spacing: -0.02em; }

nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid transparent;
  color: #d5deef;
  transition: all 0.18s ease;
}
nav a::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.08);
}
nav a.active, nav a:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.12);
  transform: translateX(3px);
}
nav a.active::before, nav a:hover::before { background: #2dd4bf; box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.15); }

.sidebar-card {
  background: linear-gradient(145deg, rgba(49, 87, 255, 0.25), rgba(20, 184, 166, 0.18));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.sidebar-card h2 { letter-spacing: -0.04em; }

.main { padding: 36px; }
.topbar {
  background: rgba(255,255,255,0.58);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--soft-shadow);
}
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.02; }
h2 { font-size: 21px; }
.eyebrow { color: var(--primary); }

.profile {
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  padding: 12px;
}
.avatar {
  background: linear-gradient(145deg, #dbeafe, #ccfbf1);
  color: #1e3a8a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.85);
}

.panel, .login-card, .profile, .stat-card {
  border: 1px solid rgba(255,255,255,0.76);
}
.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.panel-title { align-items: center; }
.pill {
  background: rgba(49, 87, 255, 0.09);
  color: #2742c7;
  border: 1px solid rgba(49, 87, 255, 0.12);
}
.pill.danger { background: #fef2f2; color: #b91c1c; }

.stats { gap: 20px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  padding: 24px;
  border-radius: 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 26px 55px rgba(15, 23, 42, 0.16); }
.stat-card::after {
  content: '';
  position: absolute;
  right: -22px;
  bottom: -30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
}
.stat-card span { color: rgba(255,255,255,0.88); font-weight: 700; }
.stat-card strong { font-size: 40px; letter-spacing: -0.06em; z-index: 1; }
.blue { background: linear-gradient(145deg, #3157ff, #38bdf8); }
.green { background: linear-gradient(145deg, #059669, #2dd4bf); }
.orange { background: linear-gradient(145deg, #ea580c, #fbbf24); }
.purple { background: linear-gradient(145deg, #6d28d9, #c084fc); }

.grid { gap: 22px; }
.lower-grid { gap: 22px; }

input, select, textarea {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255,255,255,0.86);
  border-radius: 16px;
  padding: 13px 14px;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(49, 87, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(49, 87, 255, 0.12);
  background: #fff;
}
label { color: #334155; }

.primary, .ghost, .mini {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.primary {
  background: linear-gradient(145deg, var(--primary), #18a8ff);
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(49, 87, 255, 0.25);
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(49, 87, 255, 0.29); }
.ghost { border: 1px solid rgba(49, 87, 255, 0.1); border-radius: 14px; }
.ghost:hover, .mini:hover { transform: translateY(-1px); }
.danger { border-color: rgba(239,68,68,0.14); }

.table-wrap {
  border: 1px solid rgba(226, 232, 240, 0.76);
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
}
table { min-width: 760px; }
th {
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
}
th:first-child { border-top-left-radius: 22px; }
th:last-child { border-top-right-radius: 22px; }
td { color: #334155; }
tr:hover td { background: rgba(49, 87, 255, 0.025); }
.status { border: 1px solid currentColor; border-color: rgba(0,0,0,0.04); }
.status.pending { background: #fff7ed; color: #c2410c; }
.status.approved { background: #ecfdf5; color: #047857; }
.status.rejected { background: #fef2f2; color: #b91c1c; }
.status.inactive { background: #f1f5f9; color: #64748b; }

.calendar { gap: 12px; }
.day, .date {
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.72);
}
.date.active { background: linear-gradient(145deg, #dbeafe, #eff6ff); }
.date.approved { background: linear-gradient(145deg, #dcfce7, #f0fdf4); }

.login-screen {
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.55)),
    radial-gradient(circle at 18% 16%, rgba(49, 87, 255, 0.65), transparent 28%),
    radial-gradient(circle at 80% 24%, rgba(20, 184, 166, 0.48), transparent 30%),
    linear-gradient(145deg, #0f172a, #1e293b);
}
.login-card {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px);
  box-shadow: 0 36px 90px rgba(2, 6, 23, 0.36);
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: linear-gradient(90deg, #3157ff, #18c7ad, #f59e0b);
}
.login-card h1 { margin-top: 8px; }
.demo-users { background: linear-gradient(145deg, #f8fafc, #eef6ff); }

.totp-setup, .recovery-box {
  background: linear-gradient(145deg, rgba(248,250,252,0.95), rgba(239,246,255,0.9));
}
.qr-wrap { box-shadow: inset 0 0 0 1px rgba(226,232,240,0.9); }
.recovery-box pre { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }

.coverage-list > div {
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 18px;
  padding: 13px;
}
.bar { background: #e6edf7; }
.bar i { background: linear-gradient(90deg, #3157ff, #14b8a6); }

@media (max-width: 1050px) {
  .sidebar { border-radius: 0 0 30px 30px; }
  .app-shell { display: block; }
  .topbar { align-items: flex-start; }
}
@media (max-width: 720px) {
  .main { padding: 18px; }
  .topbar { border-radius: 24px; padding: 20px; }
  .profile { width: 100%; flex-wrap: wrap; }
  .panel { border-radius: 24px; padding: 20px; }
  h1 { font-size: 30px; }
  .stat-card { min-height: 118px; }
}

.balance-panel { margin-bottom: 18px; }
.balance-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.balance-card { padding: 18px; border-radius: 22px; background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(239,246,255,0.9)); border: 1px solid rgba(226,232,240,0.9); box-shadow: var(--soft-shadow); display: grid; gap: 6px; }
.balance-card span { color: var(--muted); font-weight: 800; font-size: 13px; }
.balance-card strong { font-size: 30px; letter-spacing: -0.05em; color: var(--primary); }
.balance-card small { color: var(--muted); }
@media (max-width: 900px) { .balance-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .balance-grid { grid-template-columns: 1fr; } }

.backup-panel { margin-bottom: 18px; }
.backup-panel .panel-title { align-items: center; }

.approver-panel { margin-bottom: 18px; }
.assignment-form { grid-template-columns: 1fr 1fr auto 1fr; align-items: end; margin-bottom: 18px; }
.assignment-form button { height: 46px; }
@media (max-width: 900px) { .assignment-form { grid-template-columns: 1fr; } }




.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  color: var(--primary);
  background: #eff6ff;
  display: grid;
  place-items: center;
}

.password-toggle:hover {
  background: #dbeafe;
}

.eye-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}


.balance-admin-panel { margin-bottom: 18px; }
.balance-admin-form { grid-template-columns: 1.4fr 0.7fr auto 1fr; align-items: end; margin-bottom: 18px; }
.balance-admin-form button { height: 46px; }
@media (max-width: 900px) { .balance-admin-form { grid-template-columns: 1fr; } }
