/* --- Premium Dashboard Styles --- */
:root {
    --bs-primary: #5A5FE0;
    /* Deep Vibrant Purple */
    --bs-primary-rgb: 90, 95, 224;
    --bs-secondary: #6B7280;
    /* Cool Grey */
    --bs-success: #10B981;
    /* Emerald Green */
    --bs-info: #06B6D4;
    /* Cyan */
    --bs-warning: #F59E0B;
    /* Amber */
    --bs-danger: #EF4444;
    /* Red */
    --bs-body-bg: #F3F4F6;
    /* Light Grey-Blue Background */
    --bs-body-color: #374151;
    /* Dark Grey Text */
    --bs-card-bg: #ffffff;
    --bs-border-color: #E5E7EB;

    /* Sidebar Variables */
    --bs-sidebar-bg: #111827;
    /* Dark Navy/Black */
    --bs-sidebar-color: #9CA3AF;
    /* Light Grey Text */
    --bs-sidebar-active-bg: #5A5FE0;
    /* Primary Brand Color */
    --bs-sidebar-active-color: #ffffff;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Public Sans', sans-serif;
    font-size: 0.9375rem;
}

a {
    text-decoration: none;
}

/* --- Layout --- */
.layout-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.layout-container {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}

/* --- Sidebar --- */
.layout-menu {
    width: 16.25rem;
    /* 260px */
    height: 100%;
    flex: 0 0 auto;
    background-color: var(--bs-sidebar-bg);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 .125rem .25rem rgba(161, 172, 184, 0.4);
    transition: all 0.2s ease-in-out;
    overflow-y: auto;
}

.app-brand {
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #566a7f;
    text-transform: uppercase;
}

.menu-inner {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.menu-header {
    padding: 1rem 2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a1acb8;
}

.menu-item {
    margin: 0 1rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    color: var(--bs-sidebar-color);
    transition: all 0.2s;
}

.menu-link:hover {
    background-color: rgba(67, 89, 113, 0.04);
    color: #566a7f;
}

.menu-item.active .menu-link {
    color: var(--bs-sidebar-active-color);
    background-color: var(--bs-sidebar-active-bg);
    font-weight: 600;
}

.menu-icon {
    flex-shrink: 0;
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

/* --- Content --- */
.layout-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.content-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

/* --- Cards --- */
.card {
    background-clip: padding-box;
    box-shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.12);
    border: 0;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 0;
    padding: 1.5rem;
    font-weight: 600;
    color: #566a7f;
}

.card-body {
    padding: 1.5rem;
}

/* --- Authentication --- */
.authentication-wrapper {
    display: flex;
    flex-basis: 100%;
    min-height: 100vh;
    width: 100%;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-body-bg);
}

.authentication-inner {
    width: 100%;
    max-width: 400px;
    position: relative;
}

/* --- Buttons & Inputs --- */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 0.125rem 0.25rem 0 rgba(105, 108, 255, 0.4);
}

.btn-primary:hover {
    background-color: #5f61e6;
    border-color: #5f61e6;
    transform: translateY(-1px);
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.1);
}

/* --- Tables --- */
.table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 1px solid #d9dee3;
    /* Light border */
}

/* --- Badges --- */
.bg-label-primary {
    background-color: rgba(105, 108, 255, 0.16) !important;
    color: #696cff !important;
}

.bg-label-success {
    background-color: rgba(113, 221, 55, 0.16) !important;
    color: #71dd37 !important;
}

.bg-label-danger {
    background-color: rgba(255, 62, 29, 0.16) !important;
    color: #ff3e1d !important;
}

.bg-label-warning {
    background-color: rgba(255, 171, 0, 0.16) !important;
    color: #ffab00 !important;
}

.bg-label-info {
    background-color: rgba(3, 195, 236, 0.16) !important;
    color: #03c3ec !important;
}

/* Navbar placeholder for future */
.layout-navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    box-shadow: 0 .125rem .25rem rgba(161, 172, 184, 0.1);
    height: 4rem;
    margin: 1rem auto;
    width: 95%;
    /* Responsive width matching content container feel */
    border-radius: 0.5rem;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1199.98px) {
    .layout-menu {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        margin-right: 0 !important;
        margin-left: 0 !important;
        transform: translate3d(-100%, 0, 0);
        transition: all .2s ease-in-out;
        z-index: 1050;
        /* Above everything */
    }

    .layout-menu-expanded .layout-menu {
        transform: translate3d(0, 0, 0);
        box-shadow: 0 .25rem 1rem rgba(161, 172, 184, 0.45);
    }

    .layout-overlay {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        left: 0;
        z-index: 1049;
        /* Just below sidebar */
        background: rgba(43, 44, 64, 0.5);
        opacity: 0;
        transition: all 0.2s ease-in-out;
        display: none;
    }

    .layout-menu-expanded .layout-overlay {
        opacity: 1;
        display: block;
        cursor: pointer;
    }

    /* Show menu toggle */
    .layout-menu-toggle {
        display: block !important;
    }
}

@media (min-width: 1200px) {
    .layout-menu-toggle {
        display: none !important;
    }
}

/* Responsive Table Scroll */
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter {
    text-align: left;
    margin-bottom: 10px;
}

div.table-responsive>.dataTables_wrapper .row {
    margin: 0;
}

div.dataTables_wrapper div.dataTables_length select {
    width: auto;
    display: inline-block;
}