/* =========================================
   ELEOS - MODERN PREMIUM SAAS DESIGN SYSTEM
   ========================================= */

:root {
    /* --- COLOR PALETTE (Deep Indigo & Violet) --- */
    --primary: #081A41;
    /* Navy Blue - Main Action */
    --primary-hover: #071739;
    /* Darker Navy */
    --primary-light: #e6e8ed;
    /* Navy Tint */

    --accent: #4f46e5;
    /* Indigo 600 - Secondary */

    --bg-body: #f8fafc;
    /* Slate 50 - Global Background */
    --bg-surface: #ffffff;
    /* White - Cards/Surfaces */

    --text-main: #0f172a;
    /* Slate 900 - Headings */
    --text-body: #334155;
    /* Slate 700 - Body text */
    --text-muted: #64748b;
    /* Slate 500 - Secondary text */
    --text-on-primary: #ffffff;

    --border-color: #e2e8f0;
    /* Slate 200 - Borders */
    --border-focus: #081A41;
    /* Navy - Focus ring */

    /* --- SIDEBAR --- */
    --sidebar-bg: #001855;
    --sidebar-width: 280px;
    --sidebar-border: #1e293b;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #ffffff;

    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg-primary: 0 10px 25px -5px rgba(8, 26, 65, 0.4);
    --shadow-sm-primary: 0 4px 10px -2px rgba(8, 26, 65, 0.2);

    /* --- RADIUS --- */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* --- UTILS --- */
.letter-spacing-2 {
    letter-spacing: 0.2em;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-bg-light:hover {
    background-color: var(--bg-body) !important;
    transition: background 0.2s;
}

.glass-header {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.9) !important;
}

/* --- COMPONENTS --- */

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg-primary);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-check:checked+.btn-outline-primary {
    background-color: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-check:active+.btn-outline-primary,
.btn-outline-primary:active,
.btn-outline-primary.active,
.show>.btn-outline-primary.dropdown-toggle {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-on-primary);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-body);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-surface);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-body);
    margin-bottom: 0.35rem;
}

/* Tables */
.table-responsive {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-body);
}

.table tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* --- BADGES --- */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.bg-success-subtle {
    background-color: #dcfce7;
    color: #166534;
}

.bg-danger-subtle {
    background-color: #fee2e2;
    color: #991b1b;
}

.bg-warning-subtle {
    background-color: #fef9c3;
    color: #854d0e;
}

.bg-info-subtle {
    background-color: #e0f2fe;
    color: #075985;
}

.bg-primary-subtle {
    background-color: #eef2ff;
    color: #4338ca;
}

/* --- SIDEBAR & LAYOUT --- */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #e2e8f0;
    /* Force light text */
    transition: all 0.3s;
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    height: 100vh;
    z-index: 999;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand span {
    color: #ffffff;
}

#sidebar ul.components {
    padding: 1rem;
}

#sidebar ul li {
    margin-bottom: 0.25rem;
}

#sidebar ul li a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: #cbd5e1;
    /* Text muted but light */
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

#sidebar ul li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

#sidebar ul li.active>a {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#sidebar ul li a i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
    color: #cbd5e1;
    /* Icon color */
}

#sidebar ul li.active>a i,
#sidebar ul li a:hover i {
    color: #ffffff;
}

/* Logout Button Specifics */
#sidebar ul li a.text-danger {
    color: #ef4444 !important;
    /* Bright Red */
}

#sidebar ul li a.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171 !important;
}

#content {
    width: 100%;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    transition: all 0.3s;
}

/* User Profile in Header */
.header-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* --- MOBILE & RESPONSIVE --- */
.mobile-header {
    display: none;
}

@media (max-width: 991.98px) {
    #content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
    }

    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
        z-index: 2000;
    }

    #sidebar.active {
        margin-left: 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 0 1rem;
        z-index: 1040;
    }

    .mobile-brand {
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 1.25rem;
        color: var(--text-main);
    }

    .mobile-brand span {
        color: var(--primary);
    }

    /* Overlay */
    #sidebarOverlay {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.4);
        z-index: 1045;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    #sidebarOverlay.active {
        display: block;
        opacity: 1;
        backdrop-filter: blur(2px);
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}