:root {
    --hrms-bg: #fef5f7;
    --hrms-sidebar: #bc1440;
    --hrms-card: #ffffff;
    --hrms-text: #1e293b;
    --hrms-accent: #e6194d;
    --hrms-border: rgba(230, 25, 77, 0.18);
}

body.hrms-body {
    background: var(--hrms-bg);
    color: var(--hrms-text);
    overflow: hidden;
}

.hrms-shell {
    --hrms-sidebar-width: 260px;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.hrms-shell.sidebar-collapsed {
    --hrms-sidebar-width: 68px;
}

.hrms-body-row {
    flex: 1;
    min-height: 0;
    position: relative;
}

@media (min-width: 992px) {
    .hrms-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1020;
        width: var(--hrms-sidebar-width);
        max-width: var(--hrms-sidebar-width);
        height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        flex-shrink: 0;
        background: var(--hrms-sidebar);
        transition: width .2s ease, max-width .2s ease;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .35) transparent;
    }

    .hrms-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .hrms-sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .35);
        border-radius: 999px;
    }

    .hrms-main {
        margin-left: var(--hrms-sidebar-width);
        width: calc(100% - var(--hrms-sidebar-width));
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        transition: margin-left .2s ease, width .2s ease;
    }
}

.hrms-sidebar {
    background: var(--hrms-sidebar);
}

.hrms-sidebar-header .hrms-sidebar-brand {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.hrms-sidebar-toggle {
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
}

.hrms-sidebar-toggle:hover,
.hrms-sidebar-toggle:focus {
    color: #fff;
}

.hrms-sidebar-profile {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .75rem;
    color: inherit;
}

.hrms-sidebar-profile:hover {
    color: #fff;
}

.hrms-profile-photo,
img.hrms-profile-photo {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, .35);
    display: block;
}

.hrms-profile-photo-lg,
img.hrms-profile-photo-lg {
    width: 120px;
    height: 120px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--hrms-border, #dee2e6);
    display: block;
}

.hrms-profile-photo-frame {
    overflow: hidden;
    flex-shrink: 0;
}

.hrms-profile-photo-frame-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.hrms-profile-photo-frame-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.hrms-profile-photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .85);
    font-size: 1.1rem;
}

.hrms-profile-photo-lg.hrms-profile-photo-placeholder {
    width: 120px;
    height: 120px;
    font-size: 2.5rem;
    background: #e9ecef;
    color: #6c757d;
}

.hrms-menu .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    white-space: nowrap;
}

.hrms-menu .nav-link i {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.hrms-menu-group-label {
    pointer-events: none;
    padding-top: .35rem;
    padding-bottom: .15rem;
}

.hrms-submenu {
    margin-left: .35rem;
}

.hrms-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

@media (min-width: 992px) {
    .hrms-shell.sidebar-collapsed .hrms-sidebar {
        padding-left: .45rem !important;
        padding-right: .45rem !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-menu-label,
    .hrms-shell.sidebar-collapsed .hrms-menu-group-label,
    .hrms-shell.sidebar-collapsed .hrms-sidebar-user {
        display: none !important;
        width: 0 !important;
        overflow: hidden !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-sidebar-brand .hrms-menu-label {
        display: none !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-sidebar-brand .bi {
        margin: 0 !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-sidebar-header {
        text-align: center;
        margin-bottom: .75rem !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-sidebar-header .d-flex {
        flex-direction: column;
        justify-content: center !important;
        gap: .35rem !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-sidebar-profile {
        justify-content: center;
    }

    .hrms-shell.sidebar-collapsed .hrms-sidebar-brand {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .hrms-shell.sidebar-collapsed .hrms-menu .nav-link {
        justify-content: center;
        padding: .55rem .35rem;
        gap: 0;
        min-width: 0;
    }

    .hrms-shell.sidebar-collapsed .hrms-menu-group {
        margin-bottom: 0 !important;
    }

    .hrms-shell.sidebar-collapsed .hrms-submenu {
        margin-left: 0;
    }

    .hrms-shell.sidebar-collapsed .hrms-logout-btn {
        padding-left: .45rem;
        padding-right: .45rem;
    }

    .hrms-shell.sidebar-collapsed .hrms-logout-btn .hrms-menu-label {
        display: none !important;
    }
}

.hrms-nav-drawer {
    width: min(300px, 88vw);
    background: var(--hrms-sidebar);
}

.hrms-nav-drawer .offcanvas-header {
    background: var(--hrms-sidebar);
}

.hrms-mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 .75rem;
    align-items: center;
    padding: .5rem .75rem;
    background: var(--hrms-sidebar);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.hrms-menu-toggle {
    grid-row: 1 / span 2;
    text-decoration: none;
    line-height: 1;
}

.hrms-menu-toggle:hover,
.hrms-menu-toggle:focus {
    color: #fff;
}

.hrms-mobile-topbar-title {
    grid-column: 2;
    grid-row: 1;
    font-size: .95rem;
}

.hrms-mobile-topbar-user {
    grid-column: 2;
    grid-row: 2;
}

.hrms-main {
    background: var(--hrms-bg);
    min-width: 0;
}

@media (max-width: 991.98px) {
    body.hrms-body {
        overflow: auto;
    }

    .hrms-shell {
        height: auto;
        min-height: 100vh;
    }

    .hrms-main {
        min-height: auto;
        width: 100%;
        height: auto;
        overflow: visible;
        margin-left: 0;
    }

    .hrms-card {
        padding: 1rem !important;
    }

    .hrms-card .row > [class*="col-md-"],
    .hrms-card .row > [class*="col-lg-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

.hrms-card {
    background: var(--hrms-card);
    border: 1px solid var(--hrms-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.hrms-menu .nav-link:hover {
    background: rgba(255,255,255,.1);
    border-radius: 8px;
}

.btn-primary {
    background: var(--hrms-accent);
    border-color: var(--hrms-accent);
}

.theme-preview {
    border: 2px solid var(--hrms-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: .2s;
}

.theme-preview.selected,
.theme-preview:hover {
    border-color: var(--hrms-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb, 230, 25, 77), .15);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hrms-sidebar), var(--hrms-accent));
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
}

.table {
    color: var(--hrms-text);
}

.card, .table {
    background: var(--hrms-card);
}
