:root {
    /* Brand Colors - New Scheme */
    --primary: #30284E;
    --primary-hover: #1e1a32;
    --secondary: #4F486D;
    --accent: #78789A;
    --background: #F6F4F2;
    --surface: #FFFFFF;
    --surface-light: rgba(48, 40, 78, 0.05);
    --text-main: #30284E;
    --text-muted: #78789A;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(48, 40, 78, 0.1);
    --glass-shadow: 0 8px 32px rgba(48, 40, 78, 0.08);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
    display: none !important;
}

/* Company Theme - Matching New Palette */
.theme-company {
    --primary: #1e293b;
    --primary-hover: #1e1a32;
    --background: #F6F4F2;
    --surface: #FFFFFF;
    --text-main: #30284E;
    --text-muted: #78789A;
    --glass-bg: #FFFFFF;
    --glass-border: rgba(48, 40, 78, 0.1);
    --glass-shadow: 0 8px 32px rgba(48, 40, 78, 0.05);
}

/* Super Admin Theme - Premium Indigo */
.theme-admin {
    --primary: #312e81; /* Indigo 900 */
    --primary-hover: #1e1b4b;
    --background: #f1f5f9;
    --surface: #FFFFFF;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #4f46e5; /* Vibrant Indigo for better visibility */
    --glass-bg: #FFFFFF;
    --glass-border: rgba(99, 102, 241, 0.1);
    --glass-shadow: 0 10px 30px rgba(99, 102, 241, 0.05);
}

.theme-admin .app-content,
.theme-admin .main-content {
    background: transparent !important;
}

.theme-admin .page-header h1 {
    color: var(--text-main) !important;
    font-weight: 800 !important;
}

.theme-admin .page-header .text-muted {
    color: var(--text-muted) !important;
    font-weight: 500 !important;
}

.theme-admin .sidebar {
    background: #1e1b4b !important; /* Midnight Indigo Sidebar */
}

.theme-admin .sidebar .nav-link:hover,
.theme-admin .sidebar .nav-link.active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #ffffff !important;
}

.theme-admin .glass-card {
    background: var(--surface) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    color: var(--text-main) !important;
    border-radius: 24px !important;
}

/* Admin Form Grid & Groups */
.theme-admin .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.theme-admin .form-group {
    margin-bottom: 1.25rem;
}

.theme-admin .form-group.full-width {
    grid-column: span 2;
}

/* Stepper Utility */
.theme-admin .stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.theme-admin .stepper::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.theme-admin .step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.theme-admin .step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-admin .step-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}

.theme-admin .step-item.active .step-number {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
    transform: scale(1.1);
}

.theme-admin .step-item.active .step-label {
    color: var(--accent);
}

.theme-admin .step-item.completed .step-number {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Feature/Package Selection Cards (Used in Subscriptions) */
.theme-admin .feature-card {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.theme-admin .feature-card:hover {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.theme-admin .package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    padding-left: 2.25rem;
}

/* Buttons */
.theme-admin .btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    font-weight: 700 !important;
    padding: 0.75rem 1.75rem !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15) !important;
}

.theme-admin .btn-secondary,
.theme-admin .btn-prev {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border: 1px solid #e2e8f0 !important;
    font-weight: 600 !important;
    padding: 0.75rem 1.75rem !important;
    border-radius: 12px !important;
}

.theme-admin .btn-primary:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.2) !important;
}

.theme-admin .custom-table th {
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    font-weight: 700 !important;
}

.theme-admin .custom-table td {
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--glass-border) !important;
}

.theme-admin .text-muted {
    color: var(--text-muted) !important;
}

.theme-admin .form-label {
    color: var(--text-main) !important;
    font-weight: 600 !important;
}

.theme-admin .form-control, 
.theme-admin .form-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-main) !important;
}

.theme-admin .form-control:focus, 
.theme-admin .form-select:focus,
.theme-admin input:focus,
.theme-admin select:focus,
.theme-admin textarea:focus {
    background-color: #ffffff !important;
    color: var(--text-main) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

/* Fix for dark autofill backgrounds */
.theme-admin input:-webkit-autofill,
.theme-admin input:-webkit-autofill:hover, 
.theme-admin input:-webkit-autofill:focus, 
.theme-admin input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.theme-admin .form-check-input {
    width: 1.25em;
    height: 1.25em;
    background-color: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    vertical-align: middle;
}

.theme-admin .form-check-input:checked {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 0.8rem !important;
}

.theme-admin .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
    border-color: var(--accent) !important;
    outline: none !important;
}

.theme-admin .package-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-left: 2.25rem;
}

.theme-admin .package-selection-item {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.theme-admin .package-selection-item:hover {
    border-color: var(--accent);
    background: var(--surface-light);
    transform: translateY(-2px);
}

.theme-admin .package-selection-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-admin .package-selection-item input[type="checkbox"]:checked ~ .package-card-content {
    /* Style content when checked if needed */
    color: var(--accent);
}

.theme-admin .package-selection-item:has(input[type="checkbox"]:checked) {
    border-color: var(--accent);
    background: rgba(79, 70, 229, 0.05);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}

.theme-admin .package-selection-item .package-name {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    display: block;
}

.theme-admin .package-selection-item .package-price {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    display: block;
}

.theme-admin .package-selection-item .selection-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
    z-index: 1;
}

.theme-admin .package-selection-item:has(input[type="checkbox"]:checked) .selection-badge {
    opacity: 1;
    transform: scale(1);
}

.theme-admin .chosen-container-single .chosen-single {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-main) !important;
    border-radius: 10px !important;
    height: 42px !important;
    line-height: 40px !important;
}

.theme-admin .chosen-container .chosen-drop {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border: 1px solid #cbd5e1 !important;
}

.theme-admin .chosen-container .chosen-results {
    color: var(--text-main) !important;
}

.theme-admin .btn-page {
    background: #f1f5f9 !important;
    color: var(--text-main) !important;
    border: 1px solid #e2e8f0 !important;
}

.theme-admin .btn-page.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.theme-admin .pagination-info {
    color: var(--text-muted) !important;
}

.theme-company .sidebar {
    background: #1e293b !important; /* Themed Sidebar */
}

.theme-company .sidebar .nav-link,
.theme-company .sidebar .logo-text,
.theme-company .sidebar .nav-link i,
.theme-company .sidebar .nav-link [data-lucide] {
    color: rgba(255, 255, 255, 0.7) !important;
}

.theme-company .sidebar .nav-link:hover,
.theme-company .sidebar .nav-link.active {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-left: 4px solid #78789A;
    border-radius: 0 12px 12px 0;
    padding-left: calc(1rem - 4px);
    font-weight: 600;
}

.theme-company .glass-card {
    background: #FFFFFF !important;
    color: #30284E !important;
    border: 1px solid rgba(48, 40, 78, 0.1) !important;
    box-shadow: 0 10px 30px rgba(48, 40, 78, 0.05) !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.theme-company .glass-card:hover {
    transform: translateY(-6px);
    background: #FFFFFF !important;
    box-shadow: 0 20px 40px rgba(48, 40, 78, 0.1) !important;
    border-color: #78789A !important;
}

.theme-company .glass-card .section-title {
    color: #30284E !important;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    border-bottom: 2px solid rgba(48, 40, 78, 0.1);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-company .glass-card .form-label {
    color: #4F486D !important;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.theme-company .glass-card .form-control,
.theme-company .glass-card .form-select {
    background: #F6F4F2 !important;
    border: 1px solid rgba(48, 40, 78, 0.2) !important;
    color: #30284E !important;
    border-radius: 10px !important;
    padding: 0.6rem 1rem !important;
    transition: all 0.3s ease;
}

.theme-company .glass-card .form-control::placeholder {
    color: rgba(69, 26, 3, 0.5) !important; /* Semi-transparent brown placeholder */
}

.theme-company .glass-card .form-control:focus {
    background: #ffffff !important;
    border-color: #30284E !important;
    box-shadow: 0 0 0 4px rgba(48, 40, 78, 0.15) !important;
}

.theme-company select option {
    background: #FFFFFF !important;
    color: #30284E !important;
}

.theme-company .btn-primary {
    background: linear-gradient(135deg, #30284E, #4F486D) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    padding: 0.75rem 1.5rem !important;
    border-radius: 10px !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(48, 40, 78, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.theme-company .btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(48, 40, 78, 0.3) !important;
}

.theme-company .custom-table {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
}

.theme-company .custom-table th {
    color: #30284E !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(48, 40, 78, 0.1) !important;
    padding: 1rem !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
}

.theme-company .custom-table td {
    background: transparent !important; 
    color: #4F486D !important;
    border-bottom: 1px solid rgba(48, 40, 78, 0.05) !important;
    padding: 1.1rem 1rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.theme-company .custom-table td a,
.theme-company .custom-table td span,
.theme-company .custom-table td div {
    color: #30284E !important;
    background: transparent !important;
    border: none !important;
}

.theme-company .custom-table tr td:first-child {
    border-top-left-radius: 16px !important;
    border-bottom-left-radius: 16px !important;
}

.theme-company .custom-table tr td:last-child {
    border-top-right-radius: 16px !important;
    border-bottom-right-radius: 16px !important;
}


/* Staff Theme - New Palette */
.theme-staff {
    --primary: #30284E;
    --primary-hover: #1e1a32;
    --secondary: #4F486D;
    --accent: #78789A;
    --background: #F6F4F2;
    --surface: #FFFFFF;
    --surface-light: rgba(48, 40, 78, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(48, 40, 78, 0.1);
}

/* Light Theme - Consistently using the new palette */
.theme-light {
    --primary: #30284E;
    --primary-hover: #1e1a32;
    --secondary: #4F486D;
    --accent: #78789A;
    --background: #F6F4F2;
    --surface: #FFFFFF;
    --surface-light: rgba(48, 40, 78, 0.05);
    --text-main: #30284E;
    --text-muted: #78789A;
    --glass-bg: #FFFFFF;
    --glass-border: rgba(48, 40, 78, 0.1);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.theme-light body {
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
}

.theme-light .sidebar {
    background: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-light .sidebar .nav-link {
    color: #64748b !important;
}

.theme-light .sidebar .logo-text {
    color: #0f172a !important;
}

.theme-light .sidebar .nav-link:hover, 
.theme-light .sidebar .nav-link.active {
    background: rgba(79, 70, 229, 0.08) !important;
    color: #4f46e5 !important;
}

.theme-light .glass-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

/* Dashboard Specific Light Theme Overrides */
.theme-light .insight-content h2 { color: #0f172a !important; }
.theme-light .insight-content p { color: #64748b !important; }
.theme-light .glass-card div[style*="color: rgba(255, 255, 255, 0.6)"] { color: #64748b !important; }
.theme-light .glass-card div[style*="color: #fff"] { color: #0f172a !important; }
.theme-light .glass-card select, 
.theme-light .glass-card input {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

.theme-light .form-label,
.theme-light .glass-card .form-label {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.theme-light .form-control,
.theme-light .form-select,
.theme-light .glass-card .form-control,
.theme-light .glass-card .form-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.theme-light .form-control:focus,
.theme-light .form-select:focus,
.theme-light .glass-card .form-control:focus,
.theme-light .glass-card .form-select:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

.theme-light .custom-table td {
    color: #1e293b !important;
    border-bottom-color: rgba(0, 0, 0, 0.05) !important;
}

.theme-light .section-title,
.theme-light .glass-card .section-title {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 0.5rem !important;
}

.theme-light .section-title i,
.theme-light .glass-card .section-title i {
    color: #4f46e5 !important;
}

.theme-light .page-title h1 {
    color: #0f172a !important;
}

.theme-light .text-muted {
    color: #64748b !important;
}

.theme-light input[type="file"]::file-selector-button {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    margin-right: 1rem !important;
    transition: all 0.2s ease !important;
}

.theme-light input[type="file"]::file-selector-button:hover {
    background: #e2e8f0 !important;
}

.theme-light .btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2) !important;
}

.theme-light .btn-primary:hover {
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none !important;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
    letter-spacing: -0.011em;
    background-color: #F4F3F7;
    background-image:
        radial-gradient(1100px circle at 0% -10%, rgba(99, 102, 241, 0.10), transparent 45%),
        radial-gradient(900px circle at 100% 0%, rgba(168, 85, 247, 0.07), transparent 42%),
        radial-gradient(1000px circle at 50% 115%, rgba(48, 40, 78, 0.05), transparent 50%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* ──────────────────────────────────────────────────────────
   Unified app background — one consistent backdrop on every
   logged-in page. High specificity (html body.theme-*) so it
   overrides legacy per-page `body { background: ... !important }`
   rules without needing to edit each template.
   ────────────────────────────────────────────────────────── */
html body.theme-company,
html body.theme-admin,
html body.theme-staff,
html body.theme-light {
    background-color: #F4F3F7 !important;
    background-image:
        radial-gradient(1100px circle at 0% -10%, rgba(99, 102, 241, 0.10), transparent 45%),
        radial-gradient(900px circle at 100% 0%, rgba(168, 85, 247, 0.07), transparent 42%),
        radial-gradient(1000px circle at 50% 115%, rgba(48, 40, 78, 0.05), transparent 50%) !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
}

/* Let the unified background show through the content area */
.main-content,
.theme-company .main-content,
.theme-staff .main-content,
.theme-light .main-content {
    background: transparent !important;
}

/* Headings use Outfit as a display face for a bit more character */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

/* Numeric data (tables, stats) — aligned, tabular figures */
.custom-table td, .custom-table th,
table td, table th,
.stat-value, .metric-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum', 'cv02', 'cv03';
}

.text-muted {
    color: var(--text-muted) !important;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.main-content {
    flex: 1;
    min-width: 0; /* Critical for flexbox to allow children to shrink/scroll */
    padding: 1.25rem;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
}

.sidebar-collapsed .main-content {
    margin-left: 0;
}

.main-content.full-width {
    padding: 0;
    width: 100%;
    min-width: 100%;
    margin: 0;
    max-width: 100vw;
    flex: 1 0 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 273px; /* Optimized width for high-density displays */
    flex-shrink: 0;
    background: #30284E !important; /* New Primary Color for Sidebar */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    padding: 1.5rem 1rem;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0.25rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff !important;
}

.plan-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
    width: fit-content;
    margin-top: -2px;
    display: block;
}


.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: #94a3b8 !important; /* Cool Slate */
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    margin: 0.2rem 0;
    width: 100%;
}

.nav-link span {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    flex: 1; /* Allows text to take available space but no longer trims */
}

.nav-link:hover, .nav-link.active {
    background: rgba(109, 40, 217, 0.1) !important;
    color: #ffffff !important;
}

.nav-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-link:hover .nav-icon-wrapper,
.nav-link.active .nav-icon-wrapper {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.nav-link.text-danger:hover .nav-icon-wrapper {
    background: var(--danger) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.nav-link i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* Submenu Styling */
.nav-item-submenu {
    display: flex;
    flex-direction: column;
}

.submenu-toggle {
    cursor: pointer;
    justify-content: space-between !important;
}

.submenu-toggle:hover, .nav-item.open .submenu-toggle {
    background: rgba(255, 255, 255, 0.03) !important;
}

.submenu-toggle .toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-item.open .submenu-toggle .toggle-icon {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding-left: 2.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 10px 10px;
}

.nav-item.open .submenu {
    max-height: 500px;
    padding-bottom: 0.5rem;
    padding-top: 0.25rem;
}

.submenu .nav-link {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.submenu .nav-link:hover, .submenu .nav-link.active {
    background: transparent !important;
    color: var(--accent) !important;
}

/* Common Table Styling */
.custom-table {
    width: 100%;
    border-collapse: collapse;
}



.custom-table td {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    color: #d1d5db;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-active, .status-completed { background: rgba(16, 185, 129, 0.1); color: #4ade80; }
.status-inactive, .status-failed { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.status-pending { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }

/* Soft Badges (for Roles, Types, etc) */
.badge-soft {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

/* Menu Indication */
@keyframes indication-pulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { transform: scale(1.05); opacity: 0.9; box-shadow: 0 0 10px 2px rgba(99, 102, 241, 0.2); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
}

.menu-indication {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white !important;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 50px;
    margin-left: auto;
    font-weight: 800;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: indication-pulse 2s infinite ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

/* Action Buttons */
.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.action-btn.edit {
    color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
}

.action-btn.deactivate {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.action-btn.activate {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

/* Global Form Styling */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #d1d5db;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(15, 7, 32, 0.6) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: rgba(15, 7, 32, 0.8) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.1) !important;
    outline: none;
}

/* Chosen.js Global Dark Theme */
.chosen-container-single .chosen-single {
    background: rgba(15, 7, 32, 0.6) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    height: 48px !important;
    line-height: 48px !important;
    box-shadow: none !important;
}
.chosen-container-single .chosen-single div b {
    background-position: 0 14px !important;
}
.chosen-container .chosen-drop {
    background: #1a1035 !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 0 0 12px 12px !important;
    color: #ffffff !important;
}
.chosen-container .chosen-results {
    color: #ffffff !important;
}
.chosen-container .chosen-results li.highlighted {
    background: var(--primary) !important;
}
.chosen-container-active .chosen-single {
    border-color: var(--accent) !important;
}

/* Theme Company Specific Chosen.js Styles */
.theme-company .chosen-container {
    font-size: 0.9rem;
}

.theme-company .chosen-container-single .chosen-single {
    background: #FFFFFF !important;
    border: 1px solid rgba(48, 40, 78, 0.2) !important;
    color: #30284E !important;
    border-radius: 10px !important;
    height: 42px !important;
    line-height: 40px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

.theme-company .chosen-container-single .chosen-single div b {
    background-position: 0 11px !important;
    filter: none;
}

.theme-company .chosen-container .chosen-drop {
    background: #FFFFFF !important;
    border: 1px solid rgba(48, 40, 78, 0.2) !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    margin-top: -1px;
    z-index: 9999 !important;
}

.theme-company .chosen-container .chosen-results {
    color: #30284E !important;
    padding: 0 4px 4px 4px !important;
}

.theme-company .chosen-container .chosen-results li {
    padding: 8px 12px !important;
    border-radius: 6px !important;
    line-height: 1.4 !important;
}

.theme-company .chosen-container .chosen-results li.highlighted {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    color: #ffffff !important;
}

.theme-company .chosen-container-single .chosen-search input[type="text"] {
    background: #ffffff !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    color: #451a03 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin: 8px 10px !important;
    width: calc(100% - 20px) !important;
}

.theme-company .chosen-container .chosen-results li.no-results {
    background: transparent !important;
    color: #78350f !important;
    padding: 10px !important;
    font-style: italic;
}

.chosen-container-multi .chosen-choices {
    background: rgba(15, 7, 32, 0.6) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 12px !important;
    padding: 5px !important;
}

.chosen-container-multi .chosen-choices li.search-choice {
    background: var(--primary) !important;
    border: 1px solid var(--accent) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
}

.theme-company .chosen-container-multi .chosen-choices li.search-choice {
    background: #30284E !important;
    color: #FFFFFF !important;
    border: 1px solid #4F486D !important;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    text-decoration: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

.btn-secondary {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-muted) !important;
}

.theme-company .btn-secondary {
    background: transparent !important;
    border: 2px solid #fbbf24 !important; /* Golden Outline */
    color: #451a03 !important; /* Deep Brown Text */
    font-weight: 700;
}

.theme-company .btn-secondary:hover {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #d97706 !important;
    color: #000000 !important;
    transform: translateY(-2px);
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--glass-shadow);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(100px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Pagination Styling for Company Theme */
.theme-company .btn-page {
    background: rgba(251, 191, 36, 0.2) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    color: #000000 !important; /* Force Black text */
    font-weight: 700 !important;
}

.theme-company .btn-page.active {
    background: #fbbf24 !important;
    border-color: #fbbf24 !important;
    color: #000000 !important;
}

.theme-company .btn-page:hover {
    background: rgba(251, 191, 36, 0.4) !important;
    color: #000000 !important;
}

.theme-company .pagination-info {
    color: #000000 !important; /* Force Black text for info */
    font-weight: 600;
}

/* File Input Styling for Company Theme */
.theme-company input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    color: #1c1917 !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    margin-right: 1rem !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

.theme-company input[type="file"]::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

/* Custom Scrollbar Global Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Company Theme - Premium Amber Scrollbar */
.theme-company ::-webkit-scrollbar-track,
.theme-company::-webkit-scrollbar-track {
    background: #fff8f0; /* Light Amber Track */
}

.theme-company ::-webkit-scrollbar-thumb,
.theme-company::-webkit-scrollbar-thumb {
    background: #ffe2c5; /* Amber Handle */
    border: 2px solid #fff8f0;
}

.theme-company ::-webkit-scrollbar-thumb:hover,
.theme-company::-webkit-scrollbar-thumb:hover {
    background: #fb923c;
}

/* Sidebar Specific - Dark Context Scrollbar */
.sidebar::-webkit-scrollbar-track {
    background: #1c1917 !important;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid #1c1917 !important;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Firefox Support */
.theme-company {
    scrollbar-width: thin;
    scrollbar-color: #ffe2c5 #fff8f0;
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) #1c1917;
}


/* Increase breathable area below graphs in reports - Ultra Spacing */
.analytics-grid {
    margin-top: 6rem !important;
    margin-bottom: 1rem !important; /* Doubled from 10rem */
    gap: 1rem !important; /* Even wider gap */
}



.main-report-content {
    padding-bottom: 2rem !important; /* Doubled from 10rem */
}



/* Report Stats Grid & Cards */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 1400px) {
    .report-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .report-stats-grid {
        grid-template-columns: 1fr;
    }
}

.report-stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

.report-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border-color: #3b82f6 !important;
}

.report-stat-card .stat-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.report-stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.report-stat-card .stat-description {
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.report-stat-indicator {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.indicator-up { background: #ecfdf5; color: #059669; }
.indicator-down { background: #fef2f2; color: #dc2626; }
.indicator-neutral { background: #f8fafc; color: #64748b; }

.report-stat-card .stat-icon {
    position: absolute;
    right: -5px;
    top: -5px;
    font-size: 4.5rem;
    opacity: 0.04;
    color: #2563eb;
    transform: rotate(-10deg);
    pointer-events: none;
}

.insight-highlight-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.insight-highlight-box i {
    font-size: 1.75rem;
    color: #2563eb;
    background: #ffffff;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.insight-highlight-box .insight-text {
    flex: 1;
}

.insight-highlight-box h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.insight-highlight-box p {
    font-size: 0.95rem;
    color: #1e3a8a;
    margin-bottom: 0;
    font-weight: 500;
}

/* AI Insight Loader Styles */
.ai-loading-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9d174d;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #fce7f3 25%, #fbcfe8 50%, #fce7f3 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spinner Border */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: 0.75s linear infinite spinner-border;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* AX Loader (Premium Spinner) */
.ax-loader {
    width: 48px;
    height: 48px;
    border: 4px solid #fbcfe8;
    border-bottom-color: #db2777;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ax-loader-container {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 2rem;
    width: 100%;
}
