/**
 * Strobell360 Enterprise Design System
 * Corporate Brand Color Integration:
 * - Strobell Royal Deep Navy: #1e347f / #16275f (Primary Architecture & Navigation)
 * - Strobell Signature Gold / Ochre: #c8a24a / #b8913b (Action Buttons, CTA Highlights, Focus Rings)
 * - Strobell Crimson / Cardinal: #dc143c / #b41031 (Critical Alerts, Failure Flags, Destructive Actions)
 * - Strobell Charcoal / Slate: #2d2d2d / #1e293b (High-Contrast Typography)
 * - Strobell Surface & Silver: #ffffff / #f8fafc / #e2e8f0 (Pristine Cards, Subtle Frosted Layers)
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    /* Strobell Africa Corporate Brand Tokens */
    --sb-brand-navy: #1e347f;
    --sb-brand-navy-dark: #16275f;
    --sb-brand-navy-darker: #101d46;
    --sb-brand-navy-light: #4566d3;
    --sb-brand-navy-subtle: rgba(30, 52, 127, 0.08);

    --sb-brand-gold: #c8a24a;
    --sb-brand-gold-hover: #b99238;
    --sb-brand-gold-dark: #896c2a;
    --sb-brand-gold-light: #dbc389;
    --sb-brand-gold-subtle: rgba(200, 162, 74, 0.12);
    --sb-brand-gold-glow: 0 4px 16px rgba(200, 162, 74, 0.35);

    --sb-brand-crimson: #dc143c;
    --sb-brand-crimson-hover: #b41031;
    --sb-brand-crimson-subtle: rgba(220, 20, 60, 0.10);

    --sb-brand-charcoal: #2d2d2d;
    --sb-brand-slate: #475569;

    /* Surface & Background Palette */
    --sb-bg: #f8fafc;
    --sb-surface: #ffffff;
    --sb-surface-hover: #f1f5f9;
    --sb-border: #e2e8f0;
    --sb-border-subtle: #f1f5f9;
    
    --sb-text-primary: #0f172a;
    --sb-text-secondary: #475569;
    --sb-text-muted: #64748b;
    
    --sb-brand-black: #0f172a;
    --sb-brand-white: #ffffff;
    
    /* Semantic States */
    --sb-success: #16a34a;
    --sb-success-bg: #f0fdf4;
    --sb-success-border: #bbf7d0;
    --sb-success-text: #15803d;
    
    --sb-warning: #c8a24a;
    --sb-warning-bg: #fefce8;
    --sb-warning-border: #fef08a;
    --sb-warning-text: #854d0e;
    
    --sb-danger: #dc143c;
    --sb-danger-bg: #fef2f2;
    --sb-danger-border: #fecaca;
    --sb-danger-text: #991b1b;
    
    --sb-info: #0284c7;
    --sb-info-bg: #f0f9ff;
    --sb-info-border: #bae6fd;
    --sb-info-text: #0369a1;
    
    /* Elevation & Radius */
    --sb-radius: 10px;
    --sb-radius-sm: 6px;
    --sb-radius-lg: 14px;
    
    --sb-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --sb-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --sb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --sb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);

    /* Global Typography Override */
    --bs-body-font-family: 'Geist', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: 0.925rem;
    --bs-body-line-height: 1.5;
    --bs-body-color: var(--sb-text-primary);
    --bs-body-bg: var(--sb-bg);

    /* Form Controls Accent Color */
    accent-color: var(--sb-brand-gold);
}

/* Base resets & typography optimization */
body {
    font-family: var(--bs-body-font-family);
    background-color: var(--sb-bg);
    color: var(--sb-text-primary);
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    accent-color: var(--sb-brand-gold);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--bs-body-font-family);
    color: var(--sb-text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Page Layout Container & Transitions */
#page-container {
    background-color: var(--sb-bg);
}

#main-container {
    background-color: var(--sb-bg);
}

#main-container > .content {
    padding: 1.75rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Zero-flicker pre-render rule for collapsed sidebar preference */
@media (min-width: 992px) {
    html.sidebar-collapsed-pref #page-container.sidebar-o {
        padding-left: 0 !important;
    }
    html.sidebar-collapsed-pref #sidebar {
        transform: translateX(-100%) !important;
    }
    html.sidebar-collapsed-pref #page-header {
        left: 0 !important;
    }
    html.sidebar-collapsed-pref #main-container {
        margin-left: 0 !important;
    }
}

/* Header Refinement (Clean Solid White with Subtle Navy Accent Border) */
#page-header {
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid var(--sb-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    height: 64px;
}

#page-header .content-header {
    height: 64px;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

/* Header Buttons */
#page-header .btn-alt-secondary {
    background-color: #ffffff;
    border: 1px solid var(--sb-border);
    color: var(--sb-text-secondary);
    border-radius: var(--sb-radius-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#page-header .btn-alt-secondary:hover {
    background-color: var(--sb-surface-hover);
    color: var(--sb-brand-navy);
    border-color: #cbd5e1;
}

/* ============================================================
   Sidebar — Strobell Royal Navy Enterprise Theme
   ============================================================ */

#sidebar {
    background: linear-gradient(180deg, #16275f 0%, #101d46 100%) !important;
    border-right: 1px solid rgba(200, 162, 74, 0.15);
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

#sidebar .content-header {
    height: 64px;
    background: #16275f !important;
    border-bottom: 1px solid rgba(200, 162, 74, 0.2) !important;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#sidebar .content-header a {
    color: #ffffff !important;
    font-weight: 600;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: opacity 0.15s ease;
}

#sidebar .content-header a:hover {
    opacity: 0.85;
}

/* Scroll region */
#sidebar .js-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 162, 74, 0.2) transparent;
}

#sidebar .js-sidebar-scroll::-webkit-scrollbar {
    width: 3px;
}
#sidebar .js-sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
#sidebar .js-sidebar-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(200, 162, 74, 0.25);
    border-radius: 99px;
}

#sidebar .content-side {
    padding: 0.75rem 0.625rem 1.5rem;
}



/* ─── Section Headings ───────────────────────────────────── */
.nav-main {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-main-heading {
    color: rgba(200, 162, 74, 0.7) !important;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 1.25rem 0.875rem 0.4rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
}

/* Thin ruled line after heading text */
.nav-main-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(200, 162, 74, 0.2);
    margin-left: 0.35rem;
}

/* First heading needs less top padding */
.nav-main > li:first-child.nav-main-heading-item {
    padding-top: 0.5rem;
}

/* ─── Nav Items ──────────────────────────────────────────── */
.nav-main-item {
    margin-bottom: 2px;
    position: relative;
}

.nav-main-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    color: rgba(255, 255, 255, 0.65) !important;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 450;
    transition: all 0.14s ease;
    text-decoration: none !important;
    position: relative;
    gap: 0;
    line-height: 1.4;
    letter-spacing: -0.008em;
    user-select: none;
}

.nav-main-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08);
}

/* Active leaf link — Strobell Gold accent */
.nav-main-link.active {
    color: #ffffff !important;
    background-color: rgba(200, 162, 74, 0.18) !important;
    font-weight: 500;
    border-left: 3px solid var(--sb-brand-gold);
}

/* Parent link when submenu is open */
.nav-main-link-submenu[aria-expanded="true"] {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08);
    font-weight: 500;
}

/* ─── Link Icon ──────────────────────────────────────────── */
.nav-main-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    margin-right: 0.75rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.13s ease;
    flex-shrink: 0;
}

.nav-main-link:hover .nav-main-link-icon {
    color: var(--sb-brand-gold-light);
}

.nav-main-link.active .nav-main-link-icon,
.nav-main-link-submenu[aria-expanded="true"] .nav-main-link-icon {
    color: var(--sb-brand-gold);
}

/* ─── Chevron Indicator ──────────────────────────────────── */
.nav-main-link-submenu::before {
    display: none !important;
    content: none !important;
}

.nav-main-link-submenu {
    cursor: pointer;
}

.nav-submenu-chevron {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: auto;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
    opacity: 0.7;
}

.nav-main-link-submenu:hover .nav-submenu-chevron {
    opacity: 0.95;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c39d4c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.nav-main-link-submenu[aria-expanded="true"] .nav-submenu-chevron {
    transform: rotate(180deg);
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c39d4c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ─── Submenu List ───────────────────────────────────────── */
.nav-main-submenu {
    list-style: none;
    padding: 3px 0 5px 0;
    margin: 0;
    background-color: transparent !important;
}

.nav-main-submenu.show {
    height: auto !important;
    overflow: visible !important;
}

.nav-main-submenu.collapsing {
    overflow: hidden !important;
}

.nav-main-submenu .nav-main-item,
.nav-main-submenu > .nav-main-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1px;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

.nav-main-submenu > .nav-main-item::before {
    content: '';
    position: absolute;
    left: 1.375rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(200, 162, 74, 0.15);
    pointer-events: none;
}

.nav-main-submenu > .nav-main-item:last-child::before {
    height: 50%;
}

.nav-main-submenu > .nav-main-item::after {
    content: '';
    position: absolute;
    left: 1.375rem;
    top: 50%;
    width: 0.55rem;
    height: 1px;
    background: rgba(200, 162, 74, 0.25);
    pointer-events: none;
}

.nav-main-submenu .nav-main-link {
    display: flex !important;
    align-items: center;
    padding: 0.38rem 0.65rem 0.38rem 0.5rem;
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.68) !important;
    border-radius: 6px;
    font-weight: 400;
    background-color: transparent !important;
    text-decoration: none !important;
}

.nav-main-submenu .nav-main-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.nav-main-submenu .nav-main-link.active {
    color: var(--sb-brand-gold-light) !important;
    background-color: rgba(200, 162, 74, 0.2) !important;
    font-weight: 600;
}

/* Block & Card Containers (10px Radius, Clean Elevation) */
.block {
    background-color: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    box-shadow: var(--sb-shadow-xs);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.block:hover {
    box-shadow: var(--sb-shadow-sm);
}

.block-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.5rem;
    background-color: transparent;
    border-bottom: 1px solid var(--sb-border-subtle);
}

.block-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sb-text-primary);
    margin: 0;
}

.block-content {
    padding: 1.5rem;
}

/* ============================================================
   BUTTONS — Strobell Signature Gold, Navy & Semantic Buttons
   ============================================================ */
.btn {
    font-weight: 500;
    border-radius: var(--sb-radius-sm);
    padding: 0.45rem 0.95rem;
    font-size: 0.875rem;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Primary Action Buttons — STROBELL SIGNATURE GOLD */
.btn-primary, .btn-gold {
    background: linear-gradient(135deg, #c49e4d 0%, #b8913b 100%) !important;
    border: 1px solid #a8812e !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(200, 162, 74, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover, .btn-primary:focus, .btn-gold:hover, .btn-gold:focus {
    background: linear-gradient(135deg, #d4ae5c 0%, #c49e4d 100%) !important;
    border-color: #896c2a !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200, 162, 74, 0.35) !important;
}

.btn-primary:active, .btn-gold:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(200, 162, 74, 0.2) !important;
}

/* Navy Buttons — STROBELL ROYAL NAVY */
.btn-navy, .btn-alt-primary {
    background: linear-gradient(135deg, #1e347f 0%, #16275f 100%) !important;
    border: 1px solid #16275f !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(30, 52, 127, 0.2);
}

.btn-navy:hover, .btn-alt-primary:hover {
    background: linear-gradient(135deg, #4566d3 0%, #1e347f 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30, 52, 127, 0.35) !important;
}

/* Secondary & Ghost Buttons */
.btn-secondary, .btn-alt-secondary {
    background-color: #ffffff !important;
    border: 1px solid var(--sb-border) !important;
    color: var(--sb-text-primary) !important;
}

.btn-secondary:hover, .btn-alt-secondary:hover {
    background-color: var(--sb-surface-hover) !important;
    border-color: #cbd5e1 !important;
    color: var(--sb-brand-navy) !important;
}

/* Danger / Rejection Buttons — STROBELL CRIMSON */
.btn-danger {
    background: linear-gradient(135deg, #dc143c 0%, #b41031 100%) !important;
    border: 1px solid #9c1c2a !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(220, 20, 60, 0.2);
}

.btn-danger:hover, .btn-danger:focus {
    background: linear-gradient(135deg, #ed395d 0%, #dc143c 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 20, 60, 0.35) !important;
}

/* Semantic Success & Warning Buttons */
.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    border: 1px solid #14532d !important;
    color: #ffffff !important;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    border: 1px solid #92400e !important;
    color: #ffffff !important;
}

/* Form Inputs & Controls */
.form-control {
    border-radius: var(--sb-radius-sm);
    border: 1px solid var(--sb-border);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--sb-text-primary);
    background-color: var(--sb-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select {
    border-radius: var(--sb-radius-sm);
    border: 1px solid var(--sb-border);
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--sb-text-primary);
    background-color: var(--sb-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select-sm {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.65rem;
    padding-right: 2rem;
    font-size: 0.825rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sb-brand-gold) !important;
    box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.18) !important;
    outline: none;
}

.form-label {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--sb-text-secondary);
    margin-bottom: 0.35rem;
}

/* Tables & Grids */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--sb-border);
    font-size: 0.875rem;
}

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

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

.table-hover tbody tr:hover {
    background-color: var(--sb-surface-hover);
}

/* Badges (Semantic Pills) */
.badge {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.32em 0.7em;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

.bg-gold-light, .badge-gold {
    background-color: rgba(200, 162, 74, 0.14) !important;
    color: #8c6a1b !important;
    border: 1px solid rgba(200, 162, 74, 0.35) !important;
}

.bg-navy-light, .badge-navy, .bg-primary-light {
    background-color: rgba(30, 52, 127, 0.10) !important;
    color: #1e347f !important;
    border: 1px solid rgba(30, 52, 127, 0.25) !important;
}

.bg-crimson-light, .badge-crimson, .bg-danger-light {
    background-color: rgba(220, 20, 60, 0.10) !important;
    color: #dc143c !important;
    border: 1px solid rgba(220, 20, 60, 0.25) !important;
}

.bg-success-light {
    background-color: rgba(22, 163, 74, 0.10) !important;
    color: #16a34a !important;
    border: 1px solid rgba(22, 163, 74, 0.25) !important;
}

.bg-info-light {
    background-color: rgba(2, 132, 199, 0.10) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.25) !important;
}

.bg-warning-light {
    background-color: rgba(217, 119, 6, 0.10) !important;
    color: #b45309 !important;
    border: 1px solid rgba(217, 119, 6, 0.25) !important;
}

.bg-secondary, .badge-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
}

/* Footer Styling */
#page-footer {
    background-color: var(--sb-surface);
    border-top: 1px solid var(--sb-border);
    color: var(--sb-text-muted);
    font-size: 0.8rem;
}

/* Modal Enhancements */
.modal-content {
    border-radius: var(--sb-radius-lg);
    border: 1px solid var(--sb-border);
    box-shadow: var(--sb-shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--sb-border-subtle);
    padding: 1.25rem 1.5rem;
    background-color: #fafafa;
}

.modal-footer {
    border-top: 1px solid var(--sb-border-subtle);
    padding: 1rem 1.5rem;
    background-color: #fafafa;
}

/* Stat Cards with Brand Color Accent Bars */
.stat-card {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--sb-shadow-xs);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sb-shadow-sm);
}

.stat-card .stat-label {
    font-size: 0.785rem;
    font-weight: 600;
    color: var(--sb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sb-text-primary);
    margin-top: 0.35rem;
    letter-spacing: -0.03em;
}

.stat-card-gold {
    border-top: 3px solid var(--sb-brand-gold) !important;
}

.stat-card-navy {
    border-top: 3px solid var(--sb-brand-navy) !important;
}

.stat-card-crimson {
    border-top: 3px solid var(--sb-brand-crimson) !important;
}

/* ─── Sidebar Mini Mode ──────────────────────────────────── */
#page-container.sidebar-mini #sidebar {
    width: 68px !important;
}

#page-container.sidebar-mini .nav-main-link {
    justify-content: center;
    padding: 0.65rem 0;
    position: relative;
}

#page-container.sidebar-mini .nav-main-link-icon {
    margin-right: 0 !important;
    font-size: 1.15rem;
}

#page-container.sidebar-mini .nav-main-link-name,
#page-container.sidebar-mini .nav-main-heading,
#page-container.sidebar-mini .nav-main-submenu,
#page-container.sidebar-mini .nav-main-link-submenu::after {
    display: none !important;
}



/* Action column buttons styling */
.grid-table-responsive td .btn,
.table td .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.55rem;
    font-size: 0.775rem;
    line-height: 1;
    border-radius: var(--sb-radius-sm, 6px);
}

.grid-table-responsive td .btn-sm,
.table td .btn-sm {
    padding: 0.28rem 0.45rem;
}

/* Authentication Page Styling */
.auth-page {
    background: linear-gradient(135deg, #16275f 0%, #101d46 100%) !important;
    font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}

/* Full-bleed background image, fixed behind the whole page */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background-color: #101d46;
}

.auth-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.5;
    transform: scale(1.04);
}

.auth-bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(16, 29, 70, 0.72) 0%, rgba(16, 29, 70, 0.88) 55%, #101d46 100%),
        linear-gradient(115deg, rgba(30, 52, 127, 0.55) 0%, rgba(16, 29, 70, 0.25) 55%, rgba(200, 162, 74, 0.18) 100%);
}

.auth-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.32;
    animation: authBlobFlow 16s ease-in-out infinite;
    pointer-events: none;
}

.auth-bg-blob-gold {
    width: 420px;
    height: 420px;
    background: #c8a24a;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.auth-bg-blob-navy {
    width: 520px;
    height: 520px;
    background: #4566d3;
    bottom: -140px;
    left: -120px;
    animation-delay: -8s;
}

@keyframes authBlobFlow {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, -40px) scale(1.12);
    }
}

/* Foreground shell — sits above the fixed background */
.auth-shell {
    position: relative;
    z-index: 1;
}

.auth-brand-header {
    height: 34px;
}

.auth-brand-logo {
    height: 30px;
    width: auto;
}

.auth-footer-text {
    color: rgba(255, 255, 255, 0.7) !important;
}

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

.auth-card {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(200, 162, 74, 0.3);
    border-radius: 12px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.45), 0 0 20px rgba(200, 162, 74, 0.15);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2.25rem;
}

.auth-input {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.65rem 0.85rem !important;
    font-size: 0.875rem !important;
    color: #0f172a !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.auth-input:focus {
    border-color: var(--sb-brand-gold) !important;
    box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.18) !important;
    outline: none !important;
}

.btn-auth-primary {
    background: linear-gradient(135deg, #c49e4d 0%, #b8913b 100%) !important;
    color: #ffffff !important;
    border: 1px solid #a8812e !important;
    border-radius: 8px !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 4px 12px rgba(200, 162, 74, 0.3) !important;
}

.btn-auth-primary:hover {
    background: linear-gradient(135deg, #d4ae5c 0%, #c49e4d 100%) !important;
    border-color: #896c2a !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200, 162, 74, 0.45) !important;
}

.btn-auth-primary:active {
    transform: translateY(0);
}

/* Datatable Grid Header & Pager */
.grid-table thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.725rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.75rem 1rem !important;
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    white-space: nowrap;
}

.grid-table thead th a {
    color: #334155 !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.grid-table thead th a:hover {
    color: var(--sb-brand-navy) !important;
}

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

.pagination .page-link {
    background-color: #ffffff;
    color: #334155;
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.pagination .page-link:hover {
    background-color: #f1f5f9;
    color: var(--sb-brand-navy);
    border-color: #cbd5e1;
}

.pagination .active .page-link {
    background: linear-gradient(135deg, #c49e4d 0%, #b8913b 100%) !important;
    color: #ffffff !important;
    border-color: #a8812e !important;
    box-shadow: 0 2px 6px rgba(200, 162, 74, 0.3);
}

/*
 * Restore Bootstrap's opacity-aware bg- and text- color utilities.
 *
 * oneui/css/dashboard.css bundles two separate color layers back to back:
 * Bootstrap 5.1+'s auto-generated utilities (which read the --bs-bg-opacity and
 * --bs-text-opacity custom properties, so "bg-info bg-opacity-10" renders a
 * light tint) followed by OneUI's own legacy hover-state color layer, which
 * redeclares the same bg- and text- class names with a hardcoded full-opacity
 * color and !important. Same specificity plus !important means the later one
 * in the file wins, so every opacity utility in the app silently renders as a
 * solid fill instead of a tint, wherever it's used (not specific to any one
 * page). Re-declaring them here, loaded after dashboard.css, wins that same
 * tie-break for the background-color/color formula itself.
 *
 * Important: these rules must NOT also assign --bs-bg-opacity / --bs-text-opacity
 * (the way Bootstrap's own .bg-info etc. do) — that assignment is a separate
 * property write that competes with .bg-opacity-10's own "--bs-bg-opacity: 0.1"
 * for the same custom property. Since this file loads after dashboard.css
 * (where .bg-opacity-10 lives), re-asserting the variable here would always
 * win that fight and silently reset opacity back to 1, cancelling out
 * "bg-opacity-*" every time regardless of the color formula below. Reading the
 * variable with a var(..., 1) fallback avoids ever writing it, so whatever
 * value bg-opacity-* set (or its absence, defaulting to fully opaque) is left
 * alone.
 */
.bg-primary { background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important; }
/* .bg-secondary intentionally excluded: this codebase already repurposes it
   (see the .bg-secondary, .badge-secondary rule earlier in this file) as its
   own pale/neutral badge style, unlike every other color, which used a
   "-light" suffix and so never collided with these restored utilities.
   Nothing in the app pairs bg-secondary with bg-opacity-*, so restoring
   Bootstrap's literal behavior here only breaks the existing convention
   without fixing any real usage. */
.bg-success { background-color: rgba(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-info { background-color: rgba(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-warning { background-color: rgba(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-danger { background-color: rgba(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-light { background-color: rgba(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-dark { background-color: rgba(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important; }

.text-primary { color: rgba(var(--bs-primary-rgb), var(--bs-text-opacity, 1)) !important; }
.text-secondary { color: rgba(var(--bs-secondary-rgb), var(--bs-text-opacity, 1)) !important; }
.text-success { color: rgba(var(--bs-success-rgb), var(--bs-text-opacity, 1)) !important; }
.text-info { color: rgba(var(--bs-info-rgb), var(--bs-text-opacity, 1)) !important; }
.text-warning { color: rgba(var(--bs-warning-rgb), var(--bs-text-opacity, 1)) !important; }
.text-danger { color: rgba(var(--bs-danger-rgb), var(--bs-text-opacity, 1)) !important; }
.text-light { color: rgba(var(--bs-light-rgb), var(--bs-text-opacity, 1)) !important; }
.text-dark { color: rgba(var(--bs-dark-rgb), var(--bs-text-opacity, 1)) !important; }
