*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
--bg: #f7f6f3;
--surface: #ffffff;
--surface2: #f0efe9;
--border: #e5e3dc;
--border2: #d4d1c8;
--text: #1a1916;
--text2: #6b6860;
--text3: #a09d96;
--accent: #2d6a4f;
--accent-light: #e8f4ef;
--accent-mid: #52b788;
--warn: #e76f51;
--warn-light: #fdeee9;
--info: #3a86ff;
--info-light: #eef3ff;
--yellow: #f4a261;
--yellow-light: #fef5ec;
--shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
--shadow-lg: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
--radius: 14px;
--radius-sm: 8px;
--sans: 'Plus Jakarta Sans', sans-serif;
--display: 'Syne', sans-serif;
--transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }
body {
font-family: var(--sans);
background: var(--bg);
color: var(--text);
font-size: 14px;
line-height: 1.6;
min-height: 100vh;
}

/* ─── PAGES ─── */
.page {  min-height: 100vh; }
.page.active { display: flex; }

/* ══════════════════════════════════════
    LOGIN PAGE
══════════════════════════════════════ */
#page-login {
align-items: center;
justify-content: center;
background: var(--bg);
position: relative;
overflow: hidden;
}

/* Decorative background grid */
#page-login::before {
content: '';
position: absolute;
inset: 0;
background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
background-size: 40px 40px;
opacity: 0.6;
}

#page-login::after {
content: '';
position: absolute;
top: -200px; right: -200px;
width: 600px; height: 600px;
background: radial-gradient(circle, rgba(45,106,79,0.08) 0%, transparent 70%);
pointer-events: none;
}

.login-card {
position: relative;
z-index: 1;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 24px;
padding: 48px;
width: 100%;
max-width: 460px;
box-shadow: var(--shadow-lg);
}

.login-brand {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 32px;
}

.brand-icon {
width: 40px; height: 40px;
background: var(--accent);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}

.brand-icon svg { width: 20px; height: 20px; stroke: white; fill: none; }

.brand-name {
font-family: var(--display);
font-size: 22px;
font-weight: 800;
color: var(--text);
letter-spacing: -0.02em;
}

.brand-name span { color: var(--accent); }

.login-title {
font-family: var(--display);
font-size: 30px;
font-weight: 700;
color: var(--text);
letter-spacing: -0.02em;
margin-bottom: 6px;
}

.login-sub {
font-size: 14px;
color: var(--text2);
margin-bottom: 32px;
}

/* Quick login pills */
.quick-logins {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 28px;
}

.quick-login-label {
font-size: 11px;
font-weight: 600;
color: var(--text3);
text-transform: uppercase;
letter-spacing: 0.08em;
margin-bottom: 4px;
}

.quick-login-pill {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition);
background: var(--surface);
}

.quick-login-pill:hover {
border-color: var(--accent);
background: var(--accent-light);
transform: translateX(3px);
}

.qlp-avatar {
width: 32px; height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 700;
flex-shrink: 0;
}

.qlp-info { flex: 1; }
.qlp-name { font-size: 13px; font-weight: 600; color: var(--text); }
.qlp-role { font-size: 11px; color: var(--text3); }

.qlp-arrow {
color: var(--text3);
font-size: 16px;
transition: transform var(--transition);
}

.quick-login-pill:hover .qlp-arrow { transform: translateX(3px); color: var(--accent); }

/* OR divider */
.divider {
display: flex;
align-items: center;
gap: 12px;
color: var(--text3);
font-size: 12px;
margin: 20px 0;
}

.divider::before, .divider::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}

/* Form */
.form-group { margin-bottom: 16px; }
.form-label {
display: block;
font-size: 12px;
font-weight: 600;
color: var(--text2);
text-transform: uppercase;
letter-spacing: 0.06em;
margin-bottom: 6px;
}

.form-input {
width: 100%;
padding: 11px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-family: var(--sans);
font-size: 14px;
color: var(--text);
background: var(--surface);
outline: none;
transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,106,79,0.1); }

.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 20px;
border-radius: var(--radius-sm);
font-family: var(--sans);
font-size: 14px;
font-weight: 600;
cursor: pointer;
border: none;
transition: all var(--transition);
text-decoration: none;
}

.btn-primary {
background: var(--accent);
color: white;
width: 100%;
}

.btn-primary:hover { background: #245a42; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,106,79,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
background: var(--surface2);
color: var(--text);
border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ══════════════════════════════════════
    APP SHELL (shared sidebar + topbar)
══════════════════════════════════════ */
#page-dashboard, #page-apply {
flex-direction: row;
}

/* SIDEBAR */
.sidebar {
width: 240px;
background: var(--text);
flex-shrink: 0;
display: flex;
flex-direction: column;
padding: 24px 0;
position: sticky;
top: 0;
height: 100vh;
overflow-y: auto;
}

.sidebar-brand {
display: flex;
align-items: center;
gap: 10px;
padding: 0 20px 28px;
border-bottom: 1px solid rgba(255,255,255,0.08);
margin-bottom: 8px;
}

.sidebar-brand .brand-icon { background: var(--accent); }

.sidebar-brand .brand-name {
font-family: var(--display);
font-size: 18px;
font-weight: 800;
color: white;
}

.sidebar-brand .brand-name span { color: var(--accent-mid); }

.nav-section-label {
font-size: 10px;
font-weight: 700;
color: rgba(255,255,255,0.25);
letter-spacing: 0.12em;
text-transform: uppercase;
padding: 16px 20px 6px;
}

.nav-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 20px;
cursor: pointer;
transition: all var(--transition);
border-left: 3px solid transparent;
color: rgba(255,255,255,0.5);
font-size: 13px;
font-weight: 500;
text-decoration: none;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); }

.nav-item.active {
background: rgba(82,183,136,0.12);
border-left-color: var(--accent-mid);
color: white;
}

.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; flex-shrink: 0; }

.nav-item .badge {
margin-left: auto;
background: var(--warn);
color: white;
font-size: 10px;
font-weight: 700;
padding: 2px 6px;
border-radius: 10px;
line-height: 1.4;
}

.sidebar-user {
margin-top: auto;
padding: 16px 20px;
border-top: 1px solid rgba(255,255,255,0.08);
display: flex;
align-items: center;
gap: 10px;
}

.user-avatar {
width: 34px; height: 34px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 700;
flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dept { font-size: 11px; color: rgba(255,255,255,0.35); }

.logout-btn {
background: none;
border: none;
cursor: pointer;
color: rgba(255,255,255,0.3);
padding: 4px;
transition: color var(--transition);
display: flex;
}

.logout-btn:hover { color: var(--warn); }
.logout-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* MAIN CONTENT */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--bg);
}

/* TOP BAR */
.topbar {
background: var(--surface);
border-bottom: 1px solid var(--border);
padding: 0 32px;
height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
}

.topbar-title {
font-family: var(--display);
font-size: 20px;
font-weight: 800;
color: var(--text);
letter-spacing: -0.02em;
}

.topbar-right {
display: flex;
align-items: center;
gap: 12px;
}

.topbar-date {
font-size: 12px;
color: var(--text3);
background: var(--surface2);
padding: 6px 12px;
border-radius: 20px;
border: 1px solid var(--border);
}

/* SCROLLABLE BODY */
.page-body {
flex: 1;
overflow-y: auto;
padding: 28px 32px;
}

/* ══════════════════════════════════════
    DASHBOARD
══════════════════════════════════════ */

/* Welcome banner */
.welcome-banner {
background: linear-gradient(135deg, var(--accent) 0%, #1e4d38 100%);
border-radius: var(--radius);
padding: 28px 32px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
overflow: hidden;
position: relative;
}

.welcome-banner::before {
content: '';
position: absolute;
top: -60px; right: -60px;
width: 200px; height: 200px;
border: 1px solid rgba(255,255,255,0.08);
border-radius: 50%;
}

.welcome-banner::after {
content: '';
position: absolute;
bottom: -80px; right: 60px;
width: 200px; height: 200px;
border: 1px solid rgba(255,255,255,0.06);
border-radius: 50%;
}

.welcome-text { position: relative; z-index: 1; }
.welcome-greeting { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.welcome-name { font-family: var(--display); font-size: 26px; font-weight: 800; color: white; letter-spacing: -0.02em; }
.welcome-sub { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 4px; }

.welcome-action { position: relative; z-index: 1; }
.btn-white {
background: white;
color: var(--accent);
font-weight: 700;
padding: 12px 24px;
border-radius: var(--radius-sm);
font-size: 13px;
border: none;
cursor: pointer;
transition: all var(--transition);
font-family: var(--sans);
display: inline-flex;
align-items: center;
gap: 8px;
text-decoration: none;
}

.btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

/* STATS ROW */
.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px;
margin-bottom: 24px;
}

.stat-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
transition: all var(--transition);
position: relative;
overflow: hidden;
}

.stat-card::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 3px;
border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.green::before { background: var(--accent); }
.stat-card.orange::before { background: var(--warn); }
.stat-card.blue::before { background: var(--info); }
.stat-card.yellow::before { background: var(--yellow); }

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
width: 36px; height: 36px;
border-radius: var(--radius-sm);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 14px;
}

.stat-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.stat-icon.green { background: var(--accent-light); color: var(--accent); }
.stat-icon.orange { background: var(--warn-light); color: var(--warn); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.yellow { background: var(--yellow-light); color: var(--yellow); }

.stat-num {
font-family: var(--display);
font-size: 32px;
font-weight: 800;
color: var(--text);
letter-spacing: -0.03em;
line-height: 1;
margin-bottom: 4px;
}

.stat-label { font-size: 12px; color: var(--text2); font-weight: 500; }

.stat-progress {
margin-top: 12px;
height: 4px;
background: var(--surface2);
border-radius: 2px;
overflow: hidden;
}

.stat-progress-bar {
height: 100%;
border-radius: 2px;
transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.stat-progress-bar.green { background: var(--accent); }
.stat-progress-bar.orange { background: var(--warn); }
.stat-progress-bar.blue { background: var(--info); }
.stat-progress-bar.yellow { background: var(--yellow); }

/* CONTENT GRID */
.content-grid {
display: grid;
grid-template-columns: 1fr;
gap: 20px;
}

.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}

.card-header {
padding: 18px 20px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}

.card-title {
font-size: 14px;
font-weight: 700;
color: var(--text);
letter-spacing: -0.01em;
}

.card-subtitle { font-size: 12px; color: var(--text3); margin-top: 1px; }

.card-body { padding: 20px; }

/* Leave history table */
.leave-table { width: 100%; border-collapse: collapse; }
.leave-table th {
font-size: 11px;
font-weight: 700;
color: var(--text3);
text-transform: uppercase;
letter-spacing: 0.07em;
padding: 0 12px 12px;
text-align: left;
border-bottom: 1px solid var(--border);
}

.leave-table td {
padding: 13px 12px;
font-size: 13px;
color: var(--text);
border-bottom: 1px solid var(--surface2);
vertical-align: middle;
}

.leave-table tr:last-child td { border-bottom: none; }
.leave-table tr:hover td { background: var(--bg); }

.leave-type-dot {
display: inline-flex;
align-items: center;
gap: 6px;
}

.leave-type-dot::before {
content: '';
width: 6px; height: 6px;
border-radius: 50%;
flex-shrink: 0;
}

.leave-type-dot.annual::before { background: var(--accent); }
.leave-type-dot.sick::before { background: var(--warn); }
.leave-type-dot.casual::before { background: var(--info); }
.leave-type-dot.comp::before { background: var(--yellow); }

.status-pill {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 4px 10px;
border-radius: 20px;
font-size: 11px;
font-weight: 600;
}

.status-pill::before {
content: '';
width: 5px; height: 5px;
border-radius: 50%;
flex-shrink: 0;
}

.status-pill.approved { background: var(--accent-light); color: var(--accent); }
.status-pill.approved::before { background: var(--accent); }
.status-pill.pending { background: var(--yellow-light); color: #c87941; }
.status-pill.pending::before { background: var(--yellow); }
.status-pill.rejected { background: var(--warn-light); color: var(--warn); }
.status-pill.rejected::before { background: var(--warn); }

/* Leave balance donut area */
.balance-grid {
display: flex;
flex-direction: column;
gap: 14px;
padding: 4px 0;
}

.balance-item {
display: flex;
align-items: center;
gap: 12px;
}

.balance-bar-wrap { flex: 1; }
.balance-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; display: flex; justify-content: space-between; }
.balance-label span { color: var(--text3); font-weight: 400; }

.balance-bar {
height: 8px;
background: var(--surface2);
border-radius: 4px;
overflow: hidden;
}

.balance-bar-fill {
height: 100%;
border-radius: 4px;
transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* Calendar mini */
.mini-calendar { padding: 4px 0; }
.cal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 14px;
}

.cal-month { font-size: 14px; font-weight: 700; color: var(--text); }

.cal-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 2px;
}

.cal-day-name {
text-align: center;
font-size: 10px;
font-weight: 700;
color: var(--text3);
text-transform: uppercase;
letter-spacing: 0.05em;
padding: 4px 0 8px;
}

.cal-day {
text-align: center;
font-size: 12px;
color: var(--text2);
padding: 6px 2px;
border-radius: 6px;
cursor: default;
transition: background var(--transition);
}

.cal-day.today { background: var(--accent); color: white; font-weight: 700; }
.cal-day.leave { background: var(--warn-light); color: var(--warn); font-weight: 600; }
.cal-day.pending { background: var(--yellow-light); color: #c87941; }
.cal-day.other-month { color: var(--border2); }

/* Upcoming leaves */
.upcoming-list { display: flex; flex-direction: column; gap: 10px; }

.upcoming-item {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 14px;
background: var(--bg);
border-radius: var(--radius-sm);
border: 1px solid var(--border);
transition: all var(--transition);
}

.upcoming-item:hover { border-color: var(--border2); box-shadow: var(--shadow); }

.upcoming-date {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 6px 10px;
text-align: center;
flex-shrink: 0;
min-width: 50px;
}

.upcoming-date-day { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; }
.upcoming-date-month { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }

.upcoming-info { flex: 1; }
.upcoming-type { font-size: 13px; font-weight: 600; color: var(--text); }
.upcoming-days { font-size: 12px; color: var(--text3); }

/* ══════════════════════════════════════
    APPLY LEAVE PAGE
══════════════════════════════════════ */
.apply-layout {
display: grid;
grid-template-columns: 1fr;
gap: 20px;
align-items: start;
}

.form-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}

.form-card-header {
padding: 22px 28px;
border-bottom: 1px solid var(--border);
background: linear-gradient(to right, var(--accent-light), var(--surface));
}

.form-card-title {
font-family: var(--display);
font-size: 20px;
font-weight: 800;
color: var(--text);
letter-spacing: -0.02em;
}

.form-card-sub { font-size: 13px; color: var(--text2); margin-top: 2px; }

.form-card-body { padding: 28px; }

/* Leave type selector */
.leave-type-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin-bottom: 24px;
}

.leave-type-option {
padding: 14px 16px;
border: 1.5px solid var(--border);
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition);
position: relative;
}

.leave-type-option:hover { border-color: var(--border2); background: var(--bg); }

.leave-type-option.selected {
border-color: var(--accent);
background: var(--accent-light);
}

.leave-type-option input[type="radio"] {
position: absolute;
opacity: 0;
width: 0; height: 0;
}

.lto-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lto-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lto-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lto-balance { font-size: 12px; color: var(--text3); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
display: block;
font-size: 12px;
font-weight: 600;
color: var(--text2);
text-transform: uppercase;
letter-spacing: 0.06em;
margin-bottom: 7px;
}

.form-input, .form-select, .form-textarea {
width: 100%;
padding: 11px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-family: var(--sans);
font-size: 14px;
color: var(--text);
background: var(--surface);
outline: none;
transition: border-color var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.form-select { cursor: pointer; }

.form-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

.char-count {
font-size: 11px;
color: var(--text3);
text-align: right;
margin-top: 4px;
}

.form-hint { font-size: 12px; color: var(--text3); margin-top: 5px; }

/* Duration preview */
.duration-preview {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 16px;
background: var(--accent-light);
border: 1px solid rgba(45,106,79,0.2);
border-radius: var(--radius-sm);
margin-bottom: 20px;
}

.duration-preview svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; flex-shrink: 0; }
.duration-preview span { font-size: 13px; color: var(--accent); font-weight: 600; }

/* Upload area */
.upload-area {
border: 1.5px dashed var(--border2);
border-radius: var(--radius-sm);
padding: 20px;
text-align: center;
cursor: pointer;
transition: all var(--transition);
}

.upload-area:hover { border-color: var(--accent); background: var(--accent-light); }
.upload-icon { font-size: 24px; margin-bottom: 6px; }
.upload-text { font-size: 13px; color: var(--text2); }
.upload-hint { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Form actions */
.form-actions {
display: flex;
gap: 10px;
padding-top: 24px;
border-top: 1px solid var(--border);
margin-top: 24px;
}

.btn-submit {
flex: 1;
background: var(--accent);
color: white;
padding: 13px;
border-radius: var(--radius-sm);
font-family: var(--sans);
font-size: 14px;
font-weight: 700;
border: none;
cursor: pointer;
transition: all var(--transition);
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}

.btn-submit:hover { background: #245a42; box-shadow: 0 4px 14px rgba(45,106,79,0.3); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

/* Side panel */
.side-panel { display: flex; flex-direction: column; gap: 16px; }

.info-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}

.info-card-header {
padding: 14px 18px;
border-bottom: 1px solid var(--border);
font-size: 13px;
font-weight: 700;
color: var(--text);
}

.info-card-body { padding: 16px 18px; }

.balance-summary { display: flex; flex-direction: column; gap: 10px; }

.bs-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
}

.bs-left { display: flex; align-items: center; gap: 8px; }
.bs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bs-name { font-size: 13px; font-weight: 500; color: var(--text); }
.bs-nums { text-align: right; }
.bs-avail { font-family: var(--display); font-size: 18px; font-weight: 800; line-height: 1; }
.bs-total { font-size: 10px; color: var(--text3); }

/* Policy card */
.policy-list { display: flex; flex-direction: column; gap: 8px; }

.policy-item {
display: flex;
align-items: flex-start;
gap: 10px;
font-size: 12px;
color: var(--text2);
line-height: 1.5;
}

.policy-item::before {
content: '';
width: 5px; height: 5px;
border-radius: 50%;
background: var(--accent-mid);
flex-shrink: 0;
margin-top: 6px;
}

/* Toast */
.toast {
position: fixed;
bottom: 24px;
right: 24px;
background: var(--text);
color: white;
padding: 14px 20px;
border-radius: var(--radius-sm);
font-size: 13px;
font-weight: 500;
display: flex;
align-items: center;
gap: 10px;
transform: translateY(80px);
opacity: 0;
transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
z-index: 1000;
box-shadow: var(--shadow-lg);
max-width: 340px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--accent); }
.toast.error { background: var(--warn); }
.toast svg { width: 18px; height: 18px; stroke: white; fill: none; flex-shrink: 0; }

/* Animations */
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(16px); }
to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

/* Empty state */
.empty-state {
padding: 40px 20px;
text-align: center;
color: var(--text3);
font-size: 13px;
}

.empty-state-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.5; }

/* ══════════════════════════════════════
    RESPONSIVE — MOBILE & TABLET
══════════════════════════════════════ */

/* ── Hamburger toggle button (hidden on desktop) ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

/* Overlay behind open sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible { display: block; }

/* ── Tablet (≤ 1024px): narrow sidebar ── */
@media (max-width: 1024px) {
  .sidebar { width: 200px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { padding: 20px 20px; }
  .topbar { padding: 0 20px; }
}

/* ── Mobile (≤ 768px): slide-out drawer sidebar ── */
@media (max-width: 768px) {

  /* Show hamburger */
  .sidebar-toggle { display: flex; }

  /* Sidebar becomes a fixed drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }

  /* Page layout: single column */
  #page-dashboard,
  #page-apply {
    flex-direction: column;
  }

  .main-content { width: 100%; }

  /* Topbar: shift title right to clear hamburger */
  .topbar {
    padding: 0 16px 0 64px;
    height: 56px;
  }

  .topbar-title { font-size: 16px; }

  .topbar-date {
    font-size: 11px;
    padding: 4px 9px;
  }

  /* Page body */
  .page-body { padding: 16px; }

  /* Welcome banner: stack vertically */
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }

  .welcome-name { font-size: 20px; }
  .welcome-action { width: 100%; }
  .btn-white { width: 100%; justify-content: center; }

  /* Stats: 1 column on very small, 2 on normal mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card { padding: 16px; }
  .stat-num { font-size: 26px; }

  /* Content grid full width */
  .content-grid { gap: 14px; }

  /* Apply page form row: single column */
  .form-row { grid-template-columns: 1fr; }

  /* Leave type grid: single column */
  .leave-type-grid { grid-template-columns: 1fr; }

  /* Apply page layout: no side panel gap */
  .apply-layout { gap: 14px; }

  /* Toast: full width on mobile */
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 100%;
  }

  /* Nav badge spacing */
  .nav-item { font-size: 14px; padding: 12px 20px; }
}

/* ── Small phones (≤ 420px): single column stats ── */
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
}