/* Modern Executive Slate & Indigo Enterprise SaaS UI Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    --bg-obsidian: #0B132B;            /* Executive Deep Slate Navy */
    --bg-obsidian-dark: #070D1F;       /* Midnight Navy Foundation */
    --bg-graphite: #152238;            /* Luminous Slate Card & Box Surface */
    --bg-graphite-light: #1E2D4A;      /* Elevated Slate Surface */
    --border-graphite: rgba(148, 163, 184, 0.16);
    --border-graphite-hover: rgba(99, 102, 241, 0.45);
    --accent-violet: #6366F1;          /* Royal Indigo */
    --accent-violet-hover: #4F46E5;
    --accent-violet-glow: 0 0 25px rgba(99, 102, 241, 0.35);
    --accent-emerald: #10B981;         /* Crisp Emerald */
    --accent-emerald-light: rgba(16, 185, 129, 0.15);
    --accent-amber: #F59E0B;
    --text-primary: #FFFFFF;           /* 100% Pure High-Contrast White */
    --text-secondary: #E2E8F0;         /* Slate-200 Crisp Readable Body */
    --text-muted: #94A3B8;             /* Slate-400 Legible Metadata */
    --text-dark: #0F172A;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --sidebar-width: 260px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-obsidian);
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}

/* Base Wrapper & App Layout */
.saas-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--bg-obsidian);
}

.saas-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

@media (min-width: 992px) {
    .saas-main {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

/* Sidebar Styles */
.saas-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1045;
    background-color: var(--bg-graphite);
    border-right: 1px solid var(--border-graphite);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbar for Sidebar */
.saas-sidebar::-webkit-scrollbar {
    width: 5px;
}
.saas-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.saas-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.saas-sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-graphite);
    background-color: rgba(9, 13, 22, 0.4);
    min-height: 70px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: var(--accent-violet-glow);
}

.saas-sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.saas-menu-header {
    font-size: 0.685rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    padding: 0.85rem 0.75rem 0.35rem 0.75rem;
}

.saas-menu-item {
    list-style: none;
    margin: 0;
}

.saas-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-md);
    color: #94A3B8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* FIX FOR SVG ICON STRETCHING IN SIDEBAR */
.saas-menu-link svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
    stroke-width: 2;
    transition: transform 0.2s ease, color 0.2s ease;
}

.saas-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
    transform: translateX(3px);
}

.saas-menu-link:hover svg {
    color: var(--accent-violet);
}

.saas-menu-link.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(99, 102, 241, 0.18));
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

.saas-menu-link.active svg {
    color: #A78BFA;
}

/* Header Navbar Styles */
.saas-navbar {
    height: 70px;
    background-color: var(--bg-graphite);
    border-bottom: 1px solid var(--border-graphite);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--accent-violet-glow);
}

/* Mobile Sidebar & Overlay Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(5, 7, 14, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991.98px) {
    .saas-sidebar {
        transform: translateX(-100%);
    }

    .saas-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
    }
}

/* Dark Command Cards & Forms */
.command-center-bg {
    background-color: var(--bg-obsidian);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.18) 0%, rgba(9, 13, 22, 0) 70%),
        radial-gradient(circle at 10% 90%, rgba(16, 185, 129, 0.12) 0%, rgba(9, 13, 22, 0) 60%),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.command-card {
    background: linear-gradient(180deg, #18263E 0%, #131E33 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(2, 6, 23, 0.45), 0 4px 10px -4px rgba(2, 6, 23, 0.3);
    padding: 1.5rem;
    width: 100%;
    position: relative;
    z-index: 10;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Constrain only when inside centered auth backdrop */
.command-center-bg .command-card {
    max-width: 460px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.2);
}

.command-center-bg .command-card.wide-card {
    max-width: 760px;
}

.command-card:hover {
    border-color: var(--border-graphite-hover);
}

.status-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 30px;
    background: var(--accent-emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.form-label {
    color: #E2E8F0;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    background-color: #0F172A !important;
    border: 1.5px solid #2B3A55 !important;
    color: #FFFFFF !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.7rem 0.95rem;
    font-size: 0.925rem;
    transition: all 0.2s ease;
    max-width: 100% !important;
}

.form-control:focus, .form-select:focus {
    background-color: #0B132B !important;
    border-color: var(--accent-violet) !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    outline: none;
}

.form-control::placeholder {
    color: #64748B !important;
    font-size: 0.875rem;
}

.password-input-group {
    position: relative;
}

.password-input-group .form-control {
    padding-right: 48px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle-btn:hover {
    color: var(--accent-violet);
}

.btn-violet {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    font-size: 0.975rem;
    box-shadow: var(--accent-violet-glow);
    transition: all 0.25s ease;
}

.btn-violet:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.logo-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    background: rgba(9, 13, 22, 0.5);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.logo-upload-zone:hover {
    border-color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.05);
}

.logo-upload-zone svg {
    color: var(--accent-violet);
    margin-bottom: 0.5rem;
}

/* Graphite Navbar Layout */
.graphite-navbar {
    height: 70px;
    background-color: var(--bg-graphite);
    border-bottom: 1px solid var(--border-graphite);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.user-avatar-dark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: var(--accent-violet-glow);
}

/* Responsive Tables & Executive Data Grids */
.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 25, 44, 0.5);
    width: 100%;
    margin-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.25) transparent;
}

@media (min-width: 1200px) {
    /* On large screens and standard monitors, prevent unnecessary horizontal scrollbars */
    .table-responsive {
        overflow-x: hidden;
    }
}
@media (max-width: 1199.98px) {
    /* Smooth horizontal scroll for tablet and mobile devices only */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.table-responsive::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.45);
}

.table-dark-saas, .saas-table, .table {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(148, 163, 184, 0.12);
    color: #F1F5F9;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    width: 100% !important;
    table-layout: auto;
}

.table-dark-saas thead th, .saas-table thead th, .table thead th {
    background: #0E182A !important;
    color: #94A3B8 !important;
    font-weight: 700 !important;
    font-size: 0.735rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.075em !important;
    padding: 0.85rem 1rem !important;
    border-bottom: 1.5px solid rgba(148, 163, 184, 0.18) !important;
    border-top: none !important;
    white-space: nowrap;
}

.table-dark-saas tbody tr, .saas-table tbody tr, .table tbody tr {
    background-color: #142137;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.table-dark-saas tbody tr:nth-child(even), .saas-table tbody tr:nth-child(even), .table tbody tr:nth-child(even) {
    background-color: #101B2E;
}

.table-dark-saas tbody tr:hover, .saas-table tbody tr:hover, .table tbody tr:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.04) 100%) !important;
}

.table-dark-saas tbody td, .saas-table tbody td, .table tbody td {
    padding: 0.85rem 1rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
    color: #E2E8F0;
    font-size: 0.875rem;
}

/* Contrast Protection for Legacy text-dark Classes */
.card .text-dark, .saas-card .text-dark, .table .text-dark, .modal-content .text-dark {
    color: #FFFFFF !important;
}

/* Polished Table Action Buttons */
.action-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.775rem;
    font-weight: 600;
    border-radius: 7px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.25;
}

.btn-action-view {
    background: rgba(14, 165, 233, 0.12);
    color: #38BDF8;
    border-color: rgba(14, 165, 233, 0.25);
}
.btn-action-view:hover {
    background: #0284C7;
    color: #FFFFFF;
    border-color: #0284C7;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
    transform: translateY(-1px);
}

.btn-action-edit {
    background: rgba(245, 158, 11, 0.12);
    color: #FBBF24;
    border-color: rgba(245, 158, 11, 0.25);
}
.btn-action-edit:hover {
    background: #D97706;
    color: #FFFFFF;
    border-color: #D97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.btn-action-status {
    background: rgba(148, 163, 184, 0.1);
    color: #CBD5E1;
    border-color: rgba(148, 163, 184, 0.22);
}
.btn-action-status:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #FFFFFF;
    border-color: rgba(148, 163, 184, 0.4);
    transform: translateY(-1px);
}

.btn-action-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-action-delete:hover {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* Company / Tenant Initial Avatar Chip */
.saas-avatar-chip {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #C7D2FE;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* Modern Filter Bar Card */
.saas-filter-card {
    background: linear-gradient(180deg, #16243D 0%, #111B2E 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 18px -4px rgba(2, 6, 23, 0.35);
}

/* Ultra-Premium SaaS Pricing Card Components */
.saas-pricing-card {
    background: linear-gradient(180deg, #172744 0%, #111D33 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(2, 6, 23, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.45);
}

.saas-pricing-featured {
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 12px 30px -5px rgba(99, 102, 241, 0.25), 0 0 20px rgba(99, 102, 241, 0.15);
}

.saas-quota-item {
    background: rgba(11, 19, 43, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.saas-quota-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(15, 26, 56, 0.7);
}

.saas-feature-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #E2E8F0;
    font-size: 0.865rem;
}

/* Modal Elevation & Styling */
.modal-content {
    background: linear-gradient(180deg, #172744 0%, #101B2E 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.15) !important;
    color: var(--text-secondary) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.14) !important;
    padding: 1rem 1.5rem !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   Ultra-Premium Executive SaaS Card & KPI Design System
   ========================================================================== */

/* Enhanced Universal Card Baseline */
.card, .saas-card {
    background: linear-gradient(180deg, #16243D 0%, #101B2E 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 25px -5px rgba(2, 6, 23, 0.45), 0 4px 10px -4px rgba(2, 6, 23, 0.3) !important;
    color: var(--text-secondary);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    overflow: hidden;
}

.card:hover, .saas-card:hover {
    border-color: rgba(99, 102, 241, 0.32) !important;
}

/* Card Header & Body Polishing */
.card-header {
    background: rgba(255, 255, 255, 0.015) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
    padding: 1rem 1.25rem;
}

.saas-header-icon-badge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Stat / KPI Cards */
.saas-stat-card {
    background: linear-gradient(165deg, #172642 0%, #111C30 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px -4px rgba(2, 6, 23, 0.45);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.saas-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-top-bar, #6366F1);
    opacity: 0.85;
    transition: opacity 0.2s ease, height 0.2s ease;
}

.saas-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 16px 32px -6px rgba(2, 6, 23, 0.65), 0 0 25px rgba(99, 102, 241, 0.15);
}

.saas-stat-card:hover::before {
    height: 4px;
    opacity: 1;
}

/* Stat Card Color Accents */
.saas-stat-primary {
    --stat-top-bar: linear-gradient(90deg, #8B5CF6, #6366F1);
}
.saas-stat-success {
    --stat-top-bar: linear-gradient(90deg, #10B981, #059669);
}
.saas-stat-warning {
    --stat-top-bar: linear-gradient(90deg, #F59E0B, #D97706);
}
.saas-stat-info {
    --stat-top-bar: linear-gradient(90deg, #0EA5E9, #0284C7);
}

/* Stat Card Components */
.saas-stat-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94A3B8;
}

.saas-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.saas-stat-card:hover .saas-stat-icon {
    transform: scale(1.08);
}

.saas-stat-icon-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.12));
    color: #A5B4FC;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.saas-stat-icon-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.12));
    color: #6EE7B7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.saas-stat-icon-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.12));
    color: #FCD34D;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.saas-stat-icon-info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(2, 132, 199, 0.12));
    color: #7DD3FC;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.saas-stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    margin: 0.4rem 0 0.65rem 0;
}

.text-success-light {
    color: #FFFFFF !important;
}
.text-warning-light {
    color: #FFFFFF !important;
}
.text-info-light {
    color: #FFFFFF !important;
}

/* Stat Meta & Status Pill */
.saas-stat-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.saas-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.6rem;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.saas-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.saas-pill-primary {
    background: rgba(99, 102, 241, 0.15);
    color: #C7D2FE;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.saas-pill-primary .saas-pill-dot {
    background: #818CF8;
    box-shadow: 0 0 6px #818CF8;
}

.saas-pill-success {
    background: rgba(16, 185, 129, 0.15);
    color: #A7F3D0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.saas-pill-success .saas-pill-dot {
    background: #34D399;
    box-shadow: 0 0 6px #34D399;
}

.saas-pill-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FDE68A;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.saas-pill-warning .saas-pill-dot {
    background: #FBBF24;
    box-shadow: 0 0 6px #FBBF24;
}

.saas-pill-info {
    background: rgba(14, 165, 233, 0.15);
    color: #BAE6FD;
    border: 1px solid rgba(14, 165, 233, 0.3);
}
.saas-pill-info .saas-pill-dot {
    background: #38BDF8;
    box-shadow: 0 0 6px #38BDF8;
}

.saas-stat-subtext {
    font-size: 0.75rem;
    color: #94A3B8;
}

/* Empty State Styling inside Cards */
.saas-empty-state {
    padding: 1.5rem 1rem;
}

.saas-empty-icon-wrap {
    display: inline-block;
}

.saas-icon-disc {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.saas-icon-disc-primary {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.12);
}

.saas-icon-disc-success, .saas-icon-disc-emerald {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.12);
}

.saas-icon-disc-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.12);
}

.saas-icon-disc-info {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.25);
    box-shadow: 0 0 16px rgba(14, 165, 233, 0.12);
}

.saas-icon-disc-slate {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Smooth Interactive List Items in Cards */
.list-group-item.hover-bg-dark,
.saas-list-item {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.list-group-item.hover-bg-dark:hover,
.saas-list-item:hover {
    background: rgba(255, 255, 255, 0.035) !important;
}

.hover-white:hover {
    color: #FFFFFF !important;
}

.bg-dark {
    background-color: #152238 !important;
}

.bg-graphite {
    background-color: #152238 !important;
}

.border-secondary {
    border-color: rgba(148, 163, 184, 0.2) !important;
}

/* High Contrast Vibrant Badges */
.badge.bg-success, .badge-active {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #34D399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    font-weight: 600;
}

.badge.bg-primary {
    background-color: rgba(99, 102, 241, 0.18) !important;
    color: #A5B4FC !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    font-weight: 600;
}

.badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #F87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    font-weight: 600;
}

.badge.bg-warning, .badge-pending {
    background-color: rgba(245, 158, 11, 0.18) !important;
    color: #FBBF24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    font-weight: 600;
}

.badge.bg-info {
    background-color: rgba(14, 165, 233, 0.18) !important;
    color: #38BDF8 !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
    font-weight: 600;
}

.badge.bg-secondary {
    background-color: rgba(148, 163, 184, 0.18) !important;
    color: #CBD5E1 !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    font-weight: 600;
}

/* Comprehensive Breakpoint Adaptations */
@media (max-width: 767.98px) {
    .saas-navbar {
        padding: 0 1rem;
    }
    
    .command-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-md);
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    main.p-4 {
        padding: 1rem !important;
    }
}

@media (max-width: 575.98px) {
    .brand-font {
        font-size: 1.1rem;
    }
    
    .btn-violet {
        width: 100%;
    }
}

/* Desktop Collapsed Sidebar State */
@media (min-width: 992px) {
    .saas-wrapper.sidebar-collapsed .saas-sidebar {
        width: 72px;
    }
    .saas-wrapper.sidebar-collapsed .saas-sidebar .brand-text-wrapper,
    .saas-wrapper.sidebar-collapsed .saas-sidebar .saas-menu-header,
    .saas-wrapper.sidebar-collapsed .saas-sidebar .saas-menu-link span {
        display: none !important;
    }
    .saas-wrapper.sidebar-collapsed .saas-sidebar .saas-sidebar-brand {
        padding: 1rem 0.85rem;
        justify-content: center;
    }
    .saas-wrapper.sidebar-collapsed .saas-sidebar .saas-sidebar-brand #desktopSidebarToggle {
        display: none !important;
    }
    .saas-wrapper.sidebar-collapsed .saas-sidebar .saas-menu-link {
        justify-content: center;
        padding: 0.75rem 0;
    }
    .saas-wrapper.sidebar-collapsed .saas-sidebar .saas-menu-link svg {
        margin: 0;
    }
    .saas-wrapper.sidebar-collapsed .saas-main {
        margin-left: 72px;
        width: calc(100% - 72px);
    }
}

/* ==========================================================================
   Comprehensive Responsive Breakpoint Adaptations (375px, 768px, 1280px)
   ========================================================================== */

/* 1. Mobile Handset Viewport (375px and down, e.g. iPhone SE, compact mobiles) */
@media (max-width: 420px) {
    .saas-content {
        padding: 0.75rem !important;
    }

    .brand-font {
        font-size: 1.15rem !important;
    }

    .command-card {
        padding: 1rem !important;
        border-radius: var(--radius-sm) !important;
    }

    .saas-navbar {
        height: 60px;
        padding: 0 0.75rem;
    }

    .saas-navbar .btn {
        padding: 0.375rem 0.6rem;
    }

    /* Stack buttons & actions on tiny screens */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-wrap: wrap;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    /* Full-width modals on 375px */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-content {
        border-radius: var(--radius-md);
    }

    .modal-body {
        padding: 1rem !important;
    }

    /* Form rows stacking */
    .row.g-3 > div,
    .row.g-2 > div {
        margin-bottom: 0.5rem;
    }

    /* Smooth table touch swipe */
    .table-responsive {
        border-radius: var(--radius-sm);
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.78rem;
    }

    .table th, .table td {
        padding: 0.5rem 0.6rem;
    }

    /* KPI Cards compact layout */
    .display-6, .fs-3, .fs-4 {
        font-size: 1.25rem !important;
    }

    .kpi-indicator {
        font-size: 0.7rem !important;
    }
}

/* 2. Tablet Viewport (around 768px, e.g. iPad portrait, small tablets) */
@media (min-width: 421px) and (max-width: 768px) {
    .saas-content {
        padding: 1.25rem !important;
    }

    .command-card {
        padding: 1.25rem;
    }

    .saas-navbar {
        height: 65px;
        padding: 0 1.25rem;
    }

    /* 2-column KPI grid on tablets */
    .row.g-3 > .col-xl-3,
    .row.g-4 > .col-xl-3 {
        width: 50%;
    }

    .table th, .table td {
        padding: 0.65rem 0.85rem;
    }
}

/* 3. Standard Desktop Viewport (1280px and up) */
@media (min-width: 1280px) {
    .saas-content {
        padding: 1.75rem 2rem !important;
        max-width: 1680px;
    }

    .command-card {
        padding: 1.5rem;
    }

    /* 4-column KPI cards on full displays */
    .row.g-3 > .col-xl-3,
    .row.g-4 > .col-xl-3 {
        width: 25%;
    }
}

/* Executive Theme Pagination & 10000+ Data Support */
.pagination {
    gap: 4px;
    margin-bottom: 0;
}

.page-item .page-link {
    background-color: #152238;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #CBD5E1;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.page-item .page-link:hover {
    background-color: #1E2D4A;
    color: #FFFFFF;
    border-color: rgba(99, 102, 241, 0.4);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border-color: #6366F1;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.page-item.disabled .page-link {
    background-color: #0E172A;
    border-color: rgba(148, 163, 184, 0.08);
    color: #64748B;
}

/* Smooth Table Container for large datasets */
.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

/* ========================================================================= */
/* SKELETON LOADERS & PULSE ANIMATIONS                                       */
/* ========================================================================= */
.skeleton-box {
    display: inline-block;
    height: 1em;
    position: relative;
    overflow: hidden;
    background-color: rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-sm);
}

.skeleton-box::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.08) 20%,
        rgba(255, 255, 255, 0.15) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: skeleton-shimmer 2s infinite;
    content: '';
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-text {
    width: 100%;
    height: 14px;
    margin-bottom: 6px;
    border-radius: 4px;
}

.skeleton-title {
    width: 60%;
    height: 22px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    width: 110px;
    height: 34px;
    border-radius: var(--radius-sm);
}

/* ========================================================================= */
/* STATUS BADGES & PILLS SYSTEM                                              */
/* ========================================================================= */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Status variants matching all API states */
.status-pill-active, .status-pill-available, .status-pill-approved, .status-pill-completed {
    background: rgba(16, 185, 129, 0.14);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-pill-active .status-dot, .status-pill-available .status-dot, .status-pill-approved .status-dot, .status-pill-completed .status-dot {
    background-color: #10B981;
    box-shadow: 0 0 6px #10B981;
}

.status-pill-pending, .status-pill-scheduled, .status-pill-in-progress, .status-pill-in_progress {
    background: rgba(245, 158, 11, 0.14);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-pill-pending .status-dot, .status-pill-scheduled .status-dot, .status-pill-in-progress .status-dot, .status-pill-in_progress .status-dot {
    background-color: #F59E0B;
    box-shadow: 0 0 6px #F59E0B;
}

.status-pill-inactive, .status-pill-disposed, .status-pill-rejected, .status-pill-cancelled, .status-pill-suspended {
    background: rgba(239, 68, 68, 0.14);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-pill-inactive .status-dot, .status-pill-disposed .status-dot, .status-pill-rejected .status-dot, .status-pill-cancelled .status-dot, .status-pill-suspended .status-dot {
    background-color: #EF4444;
    box-shadow: 0 0 6px #EF4444;
}

.status-pill-assigned, .status-pill-in-use, .status-pill-under-maintenance {
    background: rgba(99, 102, 241, 0.14);
    color: #818CF8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.status-pill-assigned .status-dot, .status-pill-in-use .status-dot, .status-pill-under-maintenance .status-dot {
    background-color: #818CF8;
    box-shadow: 0 0 6px #818CF8;
}

.status-pill-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border: 1px solid #EF4444;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================================================= */
/* DRAWER & OFFCANVAS STYLING                                                */
/* ========================================================================= */
.offcanvas.bg-dark {
    background-color: #0E172A !important;
    border-left: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.offcanvas-header {
    background-color: #152238 !important;
}

.offcanvas-footer {
    background-color: #152238 !important;
}

/* Field feedback styling */
.invalid-feedback.dynamic-feedback {
    font-size: 0.75rem;
    color: #F87171;
    margin-top: 4px;
}



