/**
 * Enterprise HRMS - Corporate Theme Stylesheet
 * Brand Color: #2E6FA0 | Gold Accent: #C59B27
 */

:root {
    --hrms-primary: #2E6FA0;
    --hrms-primary-hover: #245880;
    --hrms-primary-light: #e8f1f7;
    --hrms-gold: #C59B27;
    --hrms-gold-light: #fbf6ea;
    --hrms-sidebar-bg: #1e3a5f;
    --hrms-sidebar-hover: #284c79;
    --hrms-sidebar-active: #2E6FA0;
    --hrms-sidebar-text: #cbd5e1;
    --hrms-body-bg: #f5f7fa;
    --hrms-card-border: #e2e8f0;
    --hrms-dark: #1e293b;
}

body {
    background-color: var(--hrms-body-bg);
    color: var(--hrms-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.925rem;
    line-height: 1.55;
    min-height: 100vh;
}

/* Typography & Links */
a {
    color: var(--hrms-primary);
    text-decoration: none;
}
a:hover {
    color: var(--hrms-primary-hover);
}

/* Corporate Buttons */
.btn-primary {
    background-color: var(--hrms-primary);
    border-color: var(--hrms-primary);
    color: #ffffff;
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--hrms-primary-hover) !important;
    border-color: var(--hrms-primary-hover) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--hrms-primary);
    border-color: var(--hrms-primary);
}
.btn-outline-primary:hover {
    background-color: var(--hrms-primary);
    border-color: var(--hrms-primary);
    color: #ffffff;
}

.badge-gold {
    background-color: var(--hrms-gold-light);
    color: var(--hrms-gold);
    border: 1px solid rgba(197, 155, 39, 0.3);
}

/* Application Layout Structure */
.hrms-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar Styling */
#hrms-sidebar {
    min-width: 275px;
    max-width: 275px;
    width: 275px;
    background-color: var(--hrms-sidebar-bg);
    color: var(--hrms-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    margin-left: 0;
    z-index: 1040;
}

@media (min-width: 992px) {
    #hrms-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
    }
    body:not(.sidebar-collapsed) .hrms-wrapper .hrms-content-wrapper {
        margin-left: 275px !important;
        width: calc(100% - 275px) !important;
        max-width: calc(100% - 275px) !important;
        flex: 1 1 auto;
        min-width: 0;
    }
    body.sidebar-collapsed .hrms-wrapper .hrms-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Single source of truth for collapsed sidebar */
body.sidebar-collapsed #hrms-sidebar,
#hrms-sidebar.collapsed {
    display: none !important;
}

/* Cross-browser scrollbar suppression for sidebar - hidden scrollbar while fully scrollable */
.sidebar-scroll-container,
#hrms-sidebar,
.sidebar,
.sidebar-menu {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    overscroll-behavior: contain;
}

.sidebar-scroll-container::-webkit-scrollbar,
#hrms-sidebar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.sidebar-header {
    padding: 1.25rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-brand svg {
    color: var(--hrms-gold);
}

.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    padding: 0.85rem 1.25rem 0.35rem 1.25rem;
    font-weight: 600;
}

.sidebar-menu-item {
    margin: 2px 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.85rem;
    color: var(--hrms-sidebar-text);
    border-radius: 6px;
    font-size: 0.885rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    opacity: 0.85;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: var(--hrms-sidebar-hover);
}

.sidebar-link.active {
    color: #ffffff;
    background-color: var(--hrms-sidebar-active);
    font-weight: 600;
}

.sidebar-link.disabled-module {
    opacity: 0.48;
    cursor: not-allowed;
    pointer-events: none;
}

.badge-coming-soon {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    margin-left: auto;
    font-weight: 500;
}

/* Content Area */
.hrms-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.hrms-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--hrms-card-border);
    padding: 0.65rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1045;
}

#sidebarToggle {
    position: relative;
    z-index: 1046;
    cursor: pointer;
}

/* Cards & Layout */
.card-hrms {
    border: 1px solid var(--hrms-card-border);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.25rem;
}

.card-hrms .card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--hrms-card-border);
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: var(--hrms-dark);
}

/* Dashboard Statistics Cards */
.stat-card {
    border: 1px solid var(--hrms-card-border);
    border-radius: 8px;
    background: #ffffff;
    padding: 1.25rem;
    transition: transform 0.15s, box-shadow 0.15s;
    height: 100%;
}
.stat-card:hover, .hover-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}
.hover-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--hrms-dark);
    line-height: 1.2;
}
.stat-label {
    font-size: 0.825rem;
    color: #64748b;
    font-weight: 500;
}

/* Responsive Tables */
.table-hrms {
    margin-bottom: 0;
}
.table-hrms thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--hrms-card-border);
    padding: 0.75rem 1rem;
}
.table-hrms tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--hrms-card-border);
    font-size: 0.885rem;
}
.table-hrms tbody tr:hover {
    background-color: #f8fafc;
}

/* Form Controls */
.form-control:focus, .form-select:focus {
    border-color: var(--hrms-primary);
    box-shadow: 0 0 0 0.2rem rgba(46, 111, 160, 0.18);
}

/* Responsive Media Queries */
@media (max-width: 991.98px) {
    #hrms-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        margin-left: -275px !important;
        z-index: 1055 !important;
        width: 275px !important;
        min-width: 275px !important;
        max-width: 275px !important;
        display: flex !important;
    }
    body.sidebar-mobile-open #hrms-sidebar,
    #hrms-sidebar.show-mobile {
        margin-left: 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35) !important;
    }
    .hrms-content-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
    }
    .hrms-sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.45);
        z-index: 1050;
        backdrop-filter: blur(2px);
    }
}
