:root {
    --surface: #f6f8fb;
    --line: #dbe3ee;
}

body {
    background: var(--surface);
}

.app-body {
    min-height: 100vh;
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: #102033;
    color: #fff;
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: block;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    padding: .35rem .5rem 1rem;
}

.sidebar-user {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: #dbeafe;
    padding: .75rem;
    margin-bottom: 1rem;
}

.sidebar-nav {
    display: grid;
    gap: .25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    color: #d7e3f4;
    text-decoration: none;
    border-radius: 8px;
    padding: .72rem .8rem;
    font-weight: 600;
}

.sidebar-toggle {
    border: 0;
    background: transparent;
    text-align: left;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #2563eb;
    color: #fff;
}

.sidebar-caret {
    font-size: .8rem;
    line-height: 1;
}

.sidebar-subnav {
    display: grid;
    gap: .15rem;
    margin: .2rem 0 .35rem;
    padding-left: .75rem;
}

.sidebar-sublink {
    color: #c9d8ec;
    text-decoration: none;
    border-left: 2px solid rgba(255, 255, 255, .16);
    border-radius: 0 8px 8px 0;
    padding: .55rem .7rem;
    font-size: .92rem;
    font-weight: 600;
}

.sidebar-sublink:hover,
.sidebar-sublink.active {
    background: rgba(37, 99, 235, .25);
    border-left-color: #7fb0ff;
    color: #fff;
}

.app-content {
    min-width: 0;
    flex: 1;
}

.app-topbar {
    min-height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-mobile-sidebar {
    background: #102033;
    color: #fff;
}

.app-mobile-sidebar .btn-close {
    filter: invert(1);
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef4ff 0%, #f7fafc 45%, #edf7f1 100%);
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: 8px;
}

.table-card,
.form-card,
.calendar-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    overflow-x: auto;
}

.calendar-day,
.calendar-head {
    min-height: 118px;
    background: #fff;
    padding: .6rem;
}

.calendar-head {
    min-height: auto;
    background: #edf3fb;
    font-weight: 700;
    text-align: center;
}

.calendar-date {
    font-weight: 700;
    color: #26364d;
}

.leave-pill {
    display: block;
    border-radius: 6px;
    padding: .25rem .4rem;
    margin-top: .35rem;
    font-size: .78rem;
    line-height: 1.2;
    background: #e7f1ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

.leave-pill.approved {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.leave-pill.rejected {
    background: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

.badge-soft {
    background: #eef2f7;
    color: #38465a;
}

@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 120px);
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        display: none;
    }
}
