:root {
    --sidebar-width: 264px;
    --sidebar-bg: #162238;
    --sidebar-deep: #101a2c;
    --sidebar-text: #c7d0df;
    --sidebar-active: #2f6fed;
    --page-bg: #f3f5f8;
    --border: #d9dee7;
    --text: #202938;
    --muted: #687386;
    --topbar-height: 64px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: .925rem;
}

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

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: var(--sidebar-text);
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-deep));
    transition: transform .22s ease;
}

.sidebar-brand {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--sidebar-active);
    border-radius: 10px;
    font-size: 1.2rem;
    box-shadow: 0 5px 14px rgba(47, 111, 237, .3);
}

.sidebar-brand strong, .auth-brand strong {
    display: block;
    font-size: 1rem;
    letter-spacing: .01em;
}

.sidebar-brand small, .auth-brand small {
    display: block;
    color: #9eabc0;
    font-size: .72rem;
}

.sidebar-nav {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: .75rem;
}

.sidebar-menu, .sidebar-submenu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-heading {
    padding: 1.1rem .75rem .45rem;
    color: #738198;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    width: 100%;
    align-items: center;
    gap: .8rem;
    margin: .14rem 0;
    padding: .68rem .75rem;
    color: var(--sidebar-text);
    background: transparent;
    border: 0;
    border-radius: 8px;
    text-align: left;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.sidebar-link>i:first-child {
    width: 1.2rem;
    font-size: 1rem;
    text-align: center;
}

.sidebar-link:hover, .sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .09);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .17);
}

.sidebar-link.disabled {
    cursor: default;
    opacity: .48;
}

.sidebar-link.disabled small {
    margin-left: auto;
    font-size: .65rem;
    text-transform: uppercase;
}

.sidebar-chevron {
    margin-left: auto;
    font-size: .75rem;
    transition: transform .2s;
}

.sidebar-link[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu a {
    display: block;
    padding: .55rem .75rem .55rem 2.75rem;
    color: #aab6c9;
    border-radius: 7px;
    font-size: .85rem;
    text-decoration: none;
}

.sidebar-submenu a:hover, .sidebar-submenu a.active {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.sidebar-submenu-disabled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .75rem .55rem 2.75rem;
    color: #718097;
    border-radius: 7px;
    font-size: .85rem;
    opacity: .65;
}

.sidebar-submenu-disabled small {
    font-size: .58rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.sidebar-footer {
    padding: .9rem 1.25rem;
    color: #8795aa;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .75rem;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: .4rem;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, .12);
}

.app-main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex: 1;
    flex-direction: column;
    margin-left: var(--sidebar-width);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    padding: 0 1.35rem;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.topbar-toggle, .topbar-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #586579;
    background: transparent;
    border: 0;
    border-radius: 8px;
}

.topbar-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
}

.topbar-toggle:hover, .topbar-menu:hover {
    background: #eef1f6;
    color: var(--text);
}

.topbar-context {
    margin-left: .75rem;
    padding-left: .9rem;
    border-left: 1px solid var(--border);
}

.topbar-context span, .topbar-context small, .user-details strong, .user-details small {
    display: block;
}

.topbar-context span {
    font-weight: 600;
}

.topbar-context small, .user-details small {
    color: var(--muted);
    font-size: .75rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.user-avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #596b87;
    border-radius: 50%;
    font-size: .76rem;
    font-weight: 700;
}

.user-details {
    line-height: 1.15;
}

.user-details strong {
    font-size: .84rem;
}

.topbar-menu {
    width: 30px;
    height: 30px;
    font-size: .72rem;
}

.app-content {
    width: 100%;
    max-width: 1600px;
    flex: 1;
    padding: 1.5rem;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-subtitle {
    margin: .25rem 0 0;
    color: var(--muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.5rem;
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--border);
    font-size: .75rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(28, 39, 60, .04);
}

.card-header {
    padding: .85rem 1.1rem;
    background: #fafbfc;
    border-bottom-color: var(--border);
}

.card-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.form-card {
    max-width: 900px;
}

.form-control, .form-select {
    min-height: 42px;
    border-color: #8d98aa;
}

.form-control:focus, .form-select:focus {
    border-color: #2f6fed;
    box-shadow: 0 0 0 .2rem rgba(47, 111, 237, .15);
}

.form-label {
    color: #344054;
    font-weight: 600;
}

.btn {
    border-radius: 7px;
}

.btn-primary {
    background: #2f6fed;
    border-color: #2f6fed;
}

.btn-primary:hover {
    background: #245ed0;
    border-color: #245ed0;
}

.table thead th {
    padding: .75rem;
    color: #536075;
    background: #f7f8fa;
    border-bottom-width: 1px;
    font-size: .74rem;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: .8rem .75rem;
}

.empty-state {
    padding: 3rem !important;
    text-align: center;
    color: var(--muted) !important;
}

.empty-state i, .empty-state span {
    display: block;
}

.empty-state i {
    margin-bottom: .5rem;
    font-size: 2rem;
}

.feature-icon {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 1.3rem;
}

.quick-link {
    color: inherit;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

.quick-link:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(28, 39, 60, .09);
}

.quick-link-action {
    display: block;
    margin-top: 1.25rem;
    color: #2f6fed;
    font-weight: 600;
}

.employee-lookup {
    position: relative;
}

.employee-results {
    position: absolute;
    z-index: 1050;
    top: calc(100% - 1.4rem);
    right: 0;
    left: 0;
    max-height: 18rem;
    overflow-y: auto;
}

.auth-body {
    min-height: 100vh;
    background: radial-gradient(circle at 20% 10%, rgba(47, 111, 237, .13), transparent 32%), linear-gradient(135deg, #eef2f8, #f8fafc);
}

.auth-shell {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-panel {
    width: min(100%, var(--auth-width));
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.auth-brand strong {
    color: #172238;
}

.auth-brand small {
    color: var(--muted);
}

.auth-card {
    width: 100%;
    box-shadow: 0 15px 45px rgba(31, 47, 78, .11);
}

.auth-copyright {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: .75rem;
    text-align: center;
}

.sidebar-backdrop {
    display: none;
}

@media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    body.sidebar-collapsed .app-main {
        margin-left: 0;
    }

    .app-main {
        transition: margin-left .22s ease;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-backdrop.show {
        position: fixed;
        inset: 0;
        z-index: 1030;
        display: block;
        background: rgba(15, 23, 42, .48);
    }

    .app-content {
        padding: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        padding: 0 .75rem;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions .btn {
        flex: 1;
    }

    .app-footer {
        align-items: center;
        flex-direction: column;
        gap: .25rem;
    }

    .app-content {
        padding: 1rem .75rem;
    }

    .table {
        font-size: .82rem;
    }
}