:root {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --accent-blue-dim: rgba(37, 99, 235, 0.1);
    --accent-green: #059669;
    --accent-green-dim: rgba(5, 150, 105, 0.1);
    --accent-red: #dc2626;
    --accent-red-dim: rgba(220, 38, 38, 0.1);

    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --glow: 0 0 15px rgba(37, 99, 235, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* ==========================================================================
   Global Custom Scrollbars (PWA / Modern Style)
   ========================================================================== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background: radial-gradient(circle at top right, #e2e8f0, #f8fafc 40%, #ffffff);
    background-attachment: fixed;
}

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 64px;
    /* Increased padding since sidebar is gone */
    max-width: 1440px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 25.6px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Page Switcher Style (Pill Buttons) */
.page-switcher {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 999px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.switch-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 10px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-btn:hover {
    color: var(--text-primary);
}

.switch-btn.active {
    background: #ffffff;
    color: var(--accent-blue);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* User Menu Dropdown */
.user-menu-container {
    position: relative;
    z-index: 9998;
}

.user-profile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    box-shadow: var(--glow);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s ease;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.user-initials {
    font-size: 14.4px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile:hover,
.user-profile[aria-expanded="true"] {
    transform: scale(1.05);
    border-color: var(--accent-blue);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.3s;
    will-change: transform, opacity;
    z-index: 9999;
    padding: 8px 0;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-size: 12.8px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-role {
    font-size: 10.4px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.dropdown-item {
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11.2px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--accent-blue);
}

/* Specific styling for the upload buttons to make them pop */
#upload-stock-btn:hover,
#upload-sales-btn:hover {
    background: var(--accent-blue-dim);
}

.badge {
    font-size: 8.8px;
    font-weight: 700;
    padding: 3px 8px;
    background: #f1f5f9;
    color: var(--text-secondary);
    border-radius: 12px;
}

#upload-stock-btn:hover .badge,
#upload-sales-btn:hover .badge {
    background: #ffffff;
    color: var(--accent-blue);
}

.hidden-file-input {
    display: none;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* slightly wider cards since no sidebar */
    gap: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    will-change: transform, box-shadow;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 10;
    overflow: hidden;
    cursor: pointer;
}

.card-info {
    pointer-events: none;
    /* Passes all clicks directly to the stat-card background */
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(248, 250, 252, 0.5), transparent 60%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--card-shadow-hover), var(--glow);
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 11.2px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info .value {
    font-size: 28.8px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.2px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
}

.trend.positive {
    color: var(--accent-green);
    background: var(--accent-green-dim);
}

.trend.negative {
    color: var(--accent-red);
    background: var(--accent-red-dim);
}

/* Page Transitions */
.page {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-content {
        padding: 24px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Legacy Modal Code Removed to prevent conflicts */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.modal-title h2 {
    font-size: 19.2px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-title p {
    font-size: 11.2px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.premium-view-switcher {
    display: flex;
    align-items: center;
}

.single-view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    /* No gap needed since text is gone */
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    width: 36px;
    /* Fixed size for perfect circle/pill */
    height: 36px;
    padding: 0;
    /* Remove padding since width/height are fixed */
    font-size: 11.2px;
    font-weight: 600;
    color: #475569;
    border-radius: 50%;
    /* Make it a circle like the back button */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.single-view-toggle-btn:hover {
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.single-view-toggle-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toggle-icon {
    display: flex;
    align-items: center;
    color: #3b82f6;
    /* Blue tint for the icon */
}

.close-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-red);
}

/* High-Performance Layout Toggling */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8fafc;
    position: relative;
    /* Contain the absolute children */
}

/*
   We DO NOT use display:none to switch views to prevent Reflow lag.
   Instead we fade them in and set pointer-events: none.
*/
.data-view-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 32px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    overflow-y: auto;
}

.data-view-layer.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
    /* Allows it to dictate the scroll height */
    padding: 0;
}

/* ==========================================================================
   Datatable Global Search Bar Styling
   ========================================================================== */
.datatable-search-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    gap: 12px;
}

.datatable-search-container:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px var(--accent-blue-dim), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.datatable-search-container .search-icon {
    color: var(--text-secondary);
    min-width: 18px;
}

.datatable-search-container:focus-within .search-icon {
    color: var(--accent-blue);
}

#datatable-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    min-width: 0; /* Prevents input flex breakout */
}

#datatable-search-input::placeholder {
    color: #94a3b8; /* Tailwind slate-400 */
    font-weight: 400;
}

.search-clear-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9; /* Tailwind slate-100 */
}

/* Table View Styles */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.data-table th {
    background: #f1f5f9;
    padding: 10px 16px;
    text-align: left;
    font-size: 8.8px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    font-size: 10.4px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10.4px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.instock {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.status-badge.lowstock {
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
}

.status-badge.outofstock {
    background: var(--accent-red-dim);
    color: var(--accent-red);
}

/* Grid View Styles */
.data-grid,
.data-cards-grid,
/* Portrait Grid Layout */
.portrait-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    width: 100%;
}

/* We reuse .model-card but add specific tweaks for modal contexts */
.data-viewer-grid-card {
    height: auto;
    /* Allow height to stretch for data rows */
    min-height: 280px;
    width: 100%;
    box-sizing: border-box;
}

.grid-modal-img {
    aspect-ratio: 16/9;
    /* Slightly shorter image area to leave room for data */
}

.grid-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.grid-modal-badge {
    margin-bottom: 12px;
}

.grid-modal-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.compact-row {
    padding-bottom: 0 !important;
    border-bottom: none !important;
    font-size: 10.5px;
}

.compact-row .grid-item-label {
    font-size: 10px;
}

.compact-row .grid-item-value {
    font-size: 10.5px;
    text-align: right;
    max-width: 65%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-grid-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(37, 99, 235, 0.2);
}

.grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.grid-item-title {
    font-size: 12.6px;
    font-weight: 700;
    color: var(--text-primary);
}

.grid-item-category {
    font-size: 11.7px;
    color: var(--accent-blue);
    font-weight: 600;
}

.grid-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.grid-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.grid-item-label {
    font-size: 11.7px;
    color: var(--text-secondary);
}

.grid-item-value {
    font-size: 10.935px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   Modern Dashboard Cards & Card Grids (Per User Requirements)
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Soft, elegant shadow */
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Micro-interaction Hover Effects */
.dashboard-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Subtle gradient flair on hover */
.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.dashboard-card:hover::before {
    transform: scaleX(1);
}

.card-title {
    font-size: 0.84rem;
    color: #64748b;
    /* Sleek Slate Gray */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.card-value {
    font-size: 1.8225rem;
    color: #0f172a;
    /* Deep, rich black */
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

/* ==========================================================================
   Full Window Data Viewer Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Solves "added it to home webpage" bug via viewport bleed */
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    /* Modern dark blur overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-container {
    background: #ffffff;
    width: 100%;
    height: 100%;
    /* Completely Maximized Full Screen */
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal-container {
    transform: scale(0.95);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h2 {
    font-size: 1.44rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Custom premium pill toggle switch */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #e2e8f0;
    padding: 4px 16px;
    border-radius: 30px;
}

.toggle-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #475569;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #94a3b8;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: \"\";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked+.slider {
    background-color: #2563eb;
    /* Active Blue */
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: #ef4444;
    /* Alert red on hover */
}

.modal-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: #f1f5f9;
}

/* Display Toggling logic via CSS */
.view-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-panel.active {
    display: block;
}

/* ==========================================================================
   Datatable Styles (Clean & Professional)
   ========================================================================== */
.table-responsive {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #e2e8f0;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Modern Hover Scrollbar for Data Viewers */
.table-responsive::-webkit-scrollbar {
    height: 8px;
    /* Sleek horizontal scrollbar */
    width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
    border: 2px solid #f8fafc;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}


.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background-color: #f8fafc;
    padding: 16px 20px;
    font-size: 0.69rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 16px 20px;
    font-size: 0.75rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Data Cards Grid (Alternative View)
   ========================================================================== */
.data-cards-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    /* Custom Scrollbar for Cards Grid */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Modern Hover Scrollbar for Cards Grid */
.data-cards-grid::-webkit-scrollbar {
    height: 8px;
    /* Sleek horizontal scrollbar */
    width: 8px;
}

.data-cards-grid::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 12px;
}

.data-cards-grid::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
    border: 2px solid #f8fafc;
}

.data-cards-grid::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.data-card-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    min-width: 320px;
    /* Force minimum width to enable scrolling */
    flex-shrink: 0;
    /* Prevent cards from squishing */
}

.data-card-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.data-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.data-card-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.data-label {
    font-size: 0.69rem;
    color: #64748b;
    font-weight: 500;
}

.data-value {
    font-size: 0.75rem;
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Refined Phase 3 UI Updates
   ========================================================================== */

/* Circular Icon-Only Premium Back Button */
.modal-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    /* Reduced from 44px */
    height: 36px;
    /* Reduced from 44px */
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 50%;
    /* Perfect circle */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 16px;
}

.modal-back-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.modal-header-left {
    display: flex;
    align-items: center;
}

/* Premium Custom Styled Dropdown Filters */
.filter-container {
    position: relative;
    margin-top: 10px;
    width: 100%;
}

.column-filter-select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    /* Space for the right chevron */
    font-size: 0.69rem;
    font-weight: 500;
    color: #1e293b;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    appearance: none;
    /* Hide default browser arrow */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.column-filter-select:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.column-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Custom SVG Chevron for the Select Dropdown */
.filter-container::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
    /* Let clicks pass through to the select */
}

/* ==========================================================================
   Premium Bottom-Sheet PWA Filter
   ========================================================================== */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet-content {
    width: 100%;
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.bottom-sheet-overlay:not(.hidden) .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    position: relative;
}

.drag-handle {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 5px;
}

.bottom-sheet-header h3 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bottom-sheet-close {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    padding: 8px;
    transition: background 0.2s ease;
    display: flex;
}

.bottom-sheet-close:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.filter-search-container {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.filter-search-container:focus-within {
    background: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-search-icon {
    color: #94a3b8;
    margin-right: 10px;
}

.filter-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    font-family: 'Inter', sans-serif;
}

.filter-search-input::placeholder {
    color: #94a3b8;
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Custom Scrollbar for Filter Popover */
.bottom-sheet-body::-webkit-scrollbar {
    width: 4px;
}

.bottom-sheet-body::-webkit-scrollbar-track {
    background: transparent;
}

.bottom-sheet-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.bottom-sheet-body::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.filter-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-size: 0.98rem;
    color: var(--text-secondary);
}

.check-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.filter-option-item.selected .check-circle {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.filter-option-item.selected .check-circle::after {
    content: '';
    width: 5px;
    height: 10px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.filter-option-item:hover {
    background: #f8fafc;
}

.filter-option-item.selected {
    background: var(--accent-blue-dim);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--accent-blue);
    font-weight: 600;
}

.bottom-sheet-footer {
    display: flex;
    gap: 16px;
}

.sheet-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.sheet-btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-secondary);
}

.sheet-btn-outline:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.sheet-btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sheet-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* Modifying standard filter container in header to just be an SVG icon button */
.header-filter-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 50%;
    padding: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    margin-left: 8px;
    vertical-align: middle;
}

.header-filter-btn:hover,
.header-filter-btn.active {
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   Desktop Overrides for standard Filter Popover
   ========================================================================== */
@media (min-width: 768px) {
    .bottom-sheet-overlay {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        align-items: flex-start;
    }

    .bottom-sheet-content {
        width: 320px;
        border-radius: 16px;
        position: absolute;
        transform: translateY(-10px);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid #e2e8f0;
        max-height: 60vh;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    }

    .bottom-sheet-overlay:not(.hidden) .bottom-sheet-content {
        transform: translateY(0);
    }

    .drag-handle {
        display: none;
    }

    .bottom-sheet-header {
        padding-top: 4px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .filter-search-container {
        padding: 8px 12px;
        margin-bottom: 12px;
    }

    .filter-search-input {
        font-size: 0.9rem;
    }

    .filter-option-item {
        padding: 8px 12px;
        font-size: 0.92rem;
    }

    .check-circle {
        width: 18px;
        height: 18px;
    }

    .sheet-btn {
        padding: 10px;
        font-size: 0.92rem;
    }
}

/*
 * FREEDOM BOX AESTHETICS (Per User Request)
 * Off-white background, separate light border, inner image container
 */
.model-card {
    background: #f8fafc;
    /* Separate background color clearly defining the box */
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    /* Light distinct border */
    padding: 8px;
    /* Creates the freedom edge spacing */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.model-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    /* Accentuate border on hover */
}

/* The Image Area */
.model-image-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    /* Curve inner image separate from box */
}

/* High-resolution image styling */
.model-car-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.model-card:hover .model-car-img {
    transform: scale(1.05);
}

/* Fallback SVG styling for missing images */
.model-car-svg {
    width: 60%;
    height: 60%;
    color: #94a3b8;
    opacity: 0.7;
    transition: transform 0.6s ease, color 0.3s ease;
}

.model-card:hover .model-car-svg {
    transform: scale(1.1);
    color: var(--accent-blue);
}

/* High-res overlay gradient for premium feel */
.model-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.05), transparent);
    pointer-events: none;
}

/* Card Content Area - completely transparent background nested in freedom box */
.model-card-content {
    padding: 16px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    z-index: 2;
}

.model-name {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Separated model stock badge matching the freedom box design */
.model-stock-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    background: transparent;
    border: none;
    color: #64748b;
    /* Lighter slate grey */
    font-size: 0.9rem;
    font-weight: 700;
}

.model-stock-count {
    color: var(--accent-blue);
    /* Blue number */
    font-size: 1rem;
    font-weight: 800;
}

/* Active State Styles for Modern Filter Buttons */
.header-filter-btn.active {
    background: #e0e7ff !important;
    color: #4f46e5 !important;
}

/* ==========================================================================
   Sales Consultant Performance Cards (Professional/Premium Styling)
   ========================================================================== */
.consultant-gallery-section {
    width: 100%;
}

.consultant-card {
    background: #f4f9ff; /* Very light 5% blue */
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #e0f2fe;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-align: center;
    min-width: 260px;
    flex: 1;
}

.consultant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: #bae6fd;
}

/* Glassmorphism subtle overlay */
.consultant-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
}

.consultant-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f1f5f9;
    margin: 0 auto 16px auto;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.consultant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    z-index: 2;
    background: #f1f5f9;
}

.consultant-name {
    color: #0f172a;
    font-size: 1.3rem; /* Slightly larger for clarity */
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.consultant-role {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

.consultant-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consultant-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}
.consultant-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.consultant-stat-label {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

.consultant-stat-value {
    color: #10b981; /* Premium Green */
    font-size: 1rem;
    font-weight: 700;
}
.consultant-stat-value.highlight {
    color: #3b82f6; /* Vibrant blue */
}

/* TOP 3 HIGHLIGHTING */
.consultant-rank-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Rank 1: Gold */
.consultant-card.rank-1 {
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
    border-color: #fbbf24;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15);
}
.consultant-card.rank-1 .consultant-avatar {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    border-color: #fef3c7;
}
.consultant-card.rank-1 .consultant-rank-badge {
    background: linear-gradient(135deg, #d97706, #fbbf24);
}

/* Rank 2: Platinum / Silver */
.consultant-card.rank-2 {
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border-color: #94a3b8;
    box-shadow: 0 10px 25px rgba(100, 116, 139, 0.15);
}
.consultant-card.rank-2 .consultant-avatar {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    color: white;
    border-color: #f1f5f9;
}
.consultant-card.rank-2 .consultant-rank-badge {
    background: linear-gradient(135deg, #475569, #94a3b8);
}

/* Rank 3: Bronze */
.consultant-card.rank-3 {
    background: linear-gradient(145deg, #fff7ed, #ffedd5);
    border-color: #d97706;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.15);
}
.consultant-card.rank-3 .consultant-avatar {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: white;
    border-color: #ffedd5;
}
.consultant-card.rank-3 .consultant-rank-badge {
    background: linear-gradient(135deg, #92400e, #d97706);
}

/* ==========================================================================
   Premium Upload Progress Overlay
   ========================================================================== */
.upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.upload-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.upload-modal {
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-overlay.hidden .upload-modal {
    transform: translateY(20px) scale(0.95);
}

.upload-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
    width: 100%;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.processing {
    animation: gradientMove 2s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.upload-details {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.upload-percentage {
    font-weight: 700;
    color: var(--accent-blue);
}

.upload-status-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.status-icon {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.status-icon.hidden {
    display: none;
}

.success-icon {
    color: var(--accent-green);
    background: var(--accent-green-dim);
    border-radius: 50%;
    padding: 12px;
}

.error-icon {
    color: var(--accent-red);
    background: var(--accent-red-dim);
    border-radius: 50%;
    padding: 12px;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   High-End Split-Screen Login View
   ========================================================================== */
.login-view {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #ffffff;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

.login-view.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-split {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Left Half (Interaction) */
.login-left {
    flex: 1;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 64px 80px;
    background: #ffffff;
    z-index: 2;
    box-shadow: 20px 0 50px rgba(0,0,0,0.03);
}

.brand-logo-mock {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0f172a, #334155);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-mock::after {
    content: 'A';
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
}

.brand-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #0f172a;
    margin-bottom: 8px;
}

.brand-header p {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.welcome-text {
    font-size: 40px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -1.5px;
}

.instruction-text {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Access Denied Error Box */
.login-error-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #f87171;
    border-radius: 12px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-error-box.hidden {
    display: none;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Premium MS Button */
.ms-btn-premium {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 18px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ms-btn-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border-color: #cbd5e1;
    background: #f8fafc;
}

.login-footer p {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}

/* Right Half (Visual Anchor) */
.login-right {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated Mesh Gradient */
.mesh-gradient {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.85) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.85) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(5, 150, 105, 0.65) 0%, transparent 50%);
    background-color: #0f172a;
    filter: blur(80px);
    animation: meshFlow 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

@keyframes meshFlow {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50% { transform: translate(-10%, 10%) rotate(15deg) scale(1.1); }
    100% { transform: translate(10%, -10%) rotate(-15deg) scale(1); }
}

.glass-slogan {
    z-index: 2;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 64px 80px;
    border-radius: 40px;
    transform: translateY(30px);
    opacity: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeUp 1.2s 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-slogan h2 {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: -2.5px;
}

@keyframes fadeUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness for Login */
@media (max-width: 992px) {
    .login-split { flex-direction: column-reverse; }
    .login-left { max-width: 100%; padding: 48px 24px; min-height: 60vh; }
    .login-right { min-height: 40vh; }
    .glass-slogan { padding: 32px; }
    .glass-slogan h2 { font-size: 40px; }
}

/* ==========================================================================
   Offline Status Banner
   ========================================================================== */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    padding: 0 24px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.35);
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 1;
}

.offline-banner.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.offline-banner-content svg {
    flex-shrink: 0;
    animation: offlinePulse 2s ease-in-out infinite;
}

.offline-banner-content strong {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

@keyframes offlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Push content down when banner is visible */
.offline-banner:not(.hidden) ~ .app-container {
    margin-top: 44px;
}

@media (max-width: 768px) {
    .offline-banner {
        padding: 0 16px;
        height: 40px;
    }

    .offline-banner-content {
        font-size: 11px;
        gap: 8px;
    }

    .offline-banner:not(.hidden) ~ .app-container {
        margin-top: 40px;
    }
}