@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --sidebar: #1e2a3a;
    --sidebar-hover: #2d3f55;
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --fg: #1e293b;
    --fg-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --pending-bg: #fef3c7;
    --pending-fg: #92400e;
    --approved-bg: #dcfce7;
    --approved-fg: #166534;
    --rejected-bg: #fee2e2;
    --rejected-fg: #991b1b;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.6;
}

/* ── AUTH PAGE ── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2a3a 0%, #2d3f55 100%);
}
.auth-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo .icon {
    width: 52px; height: 52px;
    background: var(--accent);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}
.auth-logo h1 { font-size: 20px; font-weight: 700; }
.auth-logo p { color: var(--fg-muted); font-size: 13px; }

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo .brand { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sidebar-logo .brand span { font-size: 20px; }
.sidebar-logo .sub { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { padding: 10px 20px 4px; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: rgba(255,255,255,.35); text-transform: uppercase; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 13.5px;
    transition: background .15s, color .15s;
    border-radius: 0;
}
.nav-item:hover, .nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
}
.nav-item.active { border-left: 3px solid var(--accent); padding-left: 17px; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12px;
    color: rgba(255,255,255,.45);
}
.sidebar-footer .user-name { color: rgba(255,255,255,.8); font-weight: 600; font-size: 13px; }

.main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 17px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }

.content { padding: 28px; flex: 1; }

/* ── CARDS ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ── STAT TILES ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.stat-tile .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.stat-tile .value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-tile .sub { font-size: 11px; color: var(--fg-muted); }
.stat-tile.accent .value { color: var(--accent); }
.stat-tile.success .value { color: var(--success); }
.stat-tile.warning .value { color: var(--warning); }
.stat-tile.danger .value { color: var(--danger); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted); border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-pending { background: var(--pending-bg); color: var(--pending-fg); }
.badge-approved { background: var(--approved-bg); color: var(--approved-fg); }
.badge-rejected { background: var(--rejected-bg); color: var(--rejected-fg); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--fg);
    background: #fff;
    transition: border-color .15s;
    outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--fg-muted); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── ALERT ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 20px; }
.alert-error { background: var(--rejected-bg); color: var(--rejected-fg); }
.alert-success { background: var(--approved-bg); color: var(--approved-fg); }
.alert-info { background: #eff6ff; color: #1e40af; }

/* ── LEAVE TYPE PILL ── */
.type-annual { color: #1d4ed8; }
.type-sick { color: #dc2626; }
.type-maternity { color: #7c3aed; }
.type-paternity { color: #0891b2; }
.type-unpaid { color: #64748b; }

@media (max-width: 700px) {
    .sidebar { width: 100%; position: static; height: auto; }
    .main { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
