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

        body {
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: #f5f5f7;
            color: #1d1d1f;
        .container {
            max-width: calc(100% - 20px);
            margin: 0 auto;
            padding: 5px 8px;
        }
            padding: 5px 8px;
        }

        header {
            background: white;
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        h1 {
            font-size: 32px;
            font-weight: 600;
            color: #1d1d1f;
        }
        body.dark-mode h1 {
            color: #ffffff !important;
        }
        body.dark-mode h1 {
            color: #ffffff !important;
        }
        body.dark-mode .subtitle {
            color: #ffffff !important;
        }

        .subtitle {
            color: #86868b;
            font-size: 14px;
        }

        .account-switcher {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .account-switcher label {
            font-size: 14px;
            font-weight: 500;
            color: #86868b;
        }

        .account-switcher select {
            padding: 8px 16px;
            border: 1px solid #d2d2d7;
            border-radius: 8px;
            font-size: 14px;
            background: white;
            cursor: pointer;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat-card {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .stat-label {
            color: #86868b;
            font-size: 13px;
            margin-bottom: 5px;
        }

        .stat-value {
            font-size: 28px;
            font-weight: 600;
            color: #1d1d1f;
        }

        .filter-bar {
            background: white;
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .filter-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: #1d1d1f;
        }

        .filter-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            margin-bottom: 15px;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
        }

        .filter-label {
            font-size: 12px;
            font-weight: 500;
            color: #86868b;
            margin-bottom: 5px;
        }

        .filter-input {
            padding: 8px 12px;
            border: 1px solid #d2d2d7;
            border-radius: 6px;
            font-size: 14px;
            font-family: inherit;
        }

        .filter-input:focus {
            outline: none;
            border-color: #007aff;
        }

        .filter-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .filter-btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-btn-apply {
            background: #007aff;
            color: white;
        }

        .filter-btn-apply:hover {
            background: #0051d5;
        }

        .filter-btn-clear {
            background: #f5f5f7;
            color: #1d1d1f;
        }

        .filter-btn-clear:hover {
            background: #e5e5e7;
        }

        .filter-btn-reload {
            background: #34c759;
            color: white;
        }

        .filter-btn-reload:hover {
            background: #2da94a;
        }

        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            background: white;
            padding: 10px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .tab {
            padding: 10px 20px;
            border: none;
            background: transparent;
            cursor: pointer;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s;
            color: #1d1d1f;
        }

        .tab:hover {
            background: #dbeafe;
            color: #1e3a8a;
        }

        .tab.active {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
        }

        .content {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .table-container {
            overflow-x: auto;
            overflow-y: visible;
            max-width: 100%;
        }

        .table-container::-webkit-scrollbar {
            height: 12px;
        }

        .table-container::-webkit-scrollbar-track {
            background: #f5f5f7;
            border-radius: 6px;
        }

        .table-container::-webkit-scrollbar-thumb {
            background: #d2d2d7;
            border-radius: 6px;
        }

        .table-container::-webkit-scrollbar-thumb:hover {
            background: #b8b8bd;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        table {
            border-collapse: collapse;
            font-size: 12px;
            table-layout: auto;
            width: 100%;
        }

        th, td {
            text-align: left;
            padding: 8px 6px;
            border-bottom: 1px solid #e5e5e7;
            position: relative;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        th {
            font-weight: 600;
            color: #86868b;
            font-size: 11px;
            text-transform: uppercase;
            background: #f5f5f7;
            position: sticky;
            top: 0;
            z-index: 5;
        }

        th .resize-handle {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 8px;
            cursor: col-resize;
            background: transparent;
            z-index: 20;
            transition: all 0.2s ease;
            border-right: 2px solid transparent;
        }

        th .resize-handle:hover {
            background: rgba(0, 122, 255, 0.1);
            border-right: 2px solid #007aff;
        }

        th .resize-handle:active {
            background: rgba(0, 122, 255, 0.3);
            border-right: 2px solid #007aff;
        }
        
        /* Add visual indicator on header hover */
        th:hover .resize-handle {
            border-right: 2px solid rgba(0, 122, 255, 0.3);
        }

        th .sort-indicator {
            margin-left: 5px;
            font-size: 10px;
            color: #007aff;
        }

        th.sortable, th.sortable-header {
            cursor: pointer;
            transition: background-color 0.15s ease;
        }

        th.sortable:hover, th.sortable-header:hover {
            background: #e8e8ed;
        }
        
        th.sortable-header.sort-asc .sort-indicator::after {
            content: ' ▲';
        }
        
        th.sortable-header.sort-desc .sort-indicator::after {
            content: ' ▼';
        }
        
        th.sortable-header:not(.sort-asc):not(.sort-desc):hover .sort-indicator::after {
            content: ' ⇅';
            opacity: 0.5;
        }

        tr:hover {
            background: #f9f9fb;
        }

        /* Column drag affordance */
        th.draggable {
            cursor: grab;
            user-select: none;
        }

        th.dragging {
            opacity: 0.6;
        }

        th.drag-over {
            outline: 2px dashed #007aff;
        }

        .drag-hint {
            color: #c1c1c6;
            font-size: 10px;
            margin-left: 6px;
        }

        .status-badge {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
        }

        .editable-cell {
            cursor: pointer;
            min-width: 100px;
        }

        .editable-cell:hover {
            background: #f5f5f7;
        }

        .editable-input {
            width: 100%;
            padding: 4px 8px;
            border: 1px solid #007aff;
            border-radius: 4px;
            font-size: 12px;
        }

        .checkbox-cell {
            text-align: center;
        }

        .checkbox-cell input {
            cursor: pointer;
        }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-primary {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
            transform: translateY(-1px);
        }

        /* Template category buttons */
        .template-category-btn {
            padding: 8px 16px;
            border: 1px solid #e5e5e7;
            border-radius: 20px;
            background: white;
            color: #1d1d1f;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .template-category-btn:hover {
            background: #f5f5f7;
            border-color: #007aff;
        }

        .template-category-btn.active {
            background: #007aff;
            color: white;
            border-color: #007aff;
        }

        .btn-secondary {
            background: #f5f5f7;
            color: #1d1d1f;
        }

        .btn-secondary:hover {
            background: #e5e5e7;
        }

        .form-group {
            margin-bottom: 15px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-size: 14px;
            font-weight: 500;
        }

        input, select, textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #e5e5e7;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
        }

        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: #007aff;
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #86868b;
        }

        .empty-state-icon {
            font-size: 48px;
            margin-bottom: 15px;
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: #86868b;
        }

        .results-count {
            font-size: 13px;
            color: #86868b;
            margin-bottom: 10px;
            font-weight: 500;
        }

        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 20px;
            padding: 20px;
        }

        .pagination button {
            padding: 8px 16px;
            border: 1px solid #d2d2d7;
            border-radius: 6px;
            background: white;
            cursor: pointer;
            font-size: 13px;
        }

        .pagination button:hover:not(:disabled) {
            background: #f5f5f7;
        }

        .pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination .page-info {
            font-size: 13px;
            color: #86868b;
        }

        .link-cell {
            color: #3b82f6;
            cursor: pointer;
            text-decoration: underline;
        }

        .link-cell:hover {
            color: #1d4ed8;
        }

        .item-row {
            border: 1px solid #e5e5e7;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 12px;
            max-width: 500px;
            width: 90%;
        }

        .modal-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
        }

        .column-manager-list {
            max-height: 400px;
            overflow-y: auto;
        }

        .column-item {
            display: flex;
            align-items: center;
            padding: 10px;
            border: 1px solid #e5e5e7;
            border-radius: 6px;
            margin-bottom: 8px;
            background: white;
        }

        .column-item:hover {
            background: #f9f9fb;
        }

        .column-item input[type="checkbox"] {
            margin-right: 12px;
            width: 18px;
            height: 18px;
        }

        .column-item label {
            flex: 1;
            margin: 0;
            cursor: pointer;
        }

        /* Pulse animation for message alerts */
        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.8; transform: scale(1.05); }
        }
        
        /* Spin animation for loading */
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* Notification animations */
        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

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

        /* Sync success animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        @keyframes fadeOut {
            from {
                opacity: 1;
            }
            to {
                opacity: 0;
            }
        }

        @keyframes scaleIn {
            from {
                transform: scale(0.5);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        @keyframes bounce {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-20px);
            }
        }

        @keyframes confettiFall {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }

/* Dashboard Specific Styles */
                    /* Dashboard Specific Styles */
                    .dash-header {
                        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
                        padding: 30px;
                        border-radius: 16px;
                        margin-bottom: 25px;
                        position: relative;
                        overflow: hidden;
                    }
                    .dash-header::before {
                        content: '';
                        position: absolute;
                        top: -50%;
                        right: -20%;
                        width: 400px;
                        height: 400px;
                        background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
                        pointer-events: none;
                    }
                    .dash-header::after {
                        content: '';
                        position: absolute;
                        bottom: -30%;
                        left: 10%;
                        width: 300px;
                        height: 300px;
                        background: radial-gradient(circle, rgba(233, 69, 96, 0.1) 0%, transparent 70%);
                        pointer-events: none;
                    }
                    .dash-title-row {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 25px;
                        position: relative;
                        z-index: 1;
                    }
                    .dash-title {
                        color: #fff;
                        font-size: 28px;
                        font-weight: 700;
                        font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
                        letter-spacing: -0.5px;
                    }
                    .dash-subtitle {
                        color: rgba(255,255,255,0.6);
                        font-size: 14px;
                        margin-top: 5px;
                    }
                    .period-selector {
                        display: flex;
                        background: #f5f5f7;
                        border-radius: 10px;
                        padding: 4px;
                        gap: 4px;
                        border: 1px solid #e5e5e7;
                    }
                    
                    /* Period selector on dark backgrounds (Analytics Dashboard header) */
                    .dash-header .period-selector {
                        background: rgba(255, 255, 255, 0.12);
                        border: 1px solid rgba(255, 255, 255, 0.15);
                    }
                    
                    .period-btn {
                        padding: 8px 16px;
                        border: none;
                        background: transparent;
                        color: #6c757d;
                        font-size: 13px;
                        font-weight: 600;
                        border-radius: 7px;
                        cursor: pointer;
                        transition: all 0.2s ease;
                        white-space: nowrap;
                    }
                    
                    /* Period buttons on dark backgrounds */
                    .dash-header .period-btn {
                        color: rgba(255, 255, 255, 0.75);
                    }
                    
                    .period-btn:hover {
                        background: rgba(0, 122, 255, 0.08);
                        color: #007aff;
                    }
                    
                    .dash-header .period-btn:hover {
                        background: rgba(255, 255, 255, 0.15);
                        color: #ffffff;
                    }
                    
                    .period-btn.active {
                        background: #ffffff;
                        color: #007aff;
                        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
                        font-weight: 700;
                    }
                    
                    .dash-header .period-btn.active {
                        background: #ffffff;
                        color: #007aff;
                        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
                    }
                    
                    /* Trend Period Buttons */
                    .trend-period-btn {
                        padding: 6px 14px;
                        border: 1px solid #e0e0e0;
                        background: #fff;
                        color: #6c757d;
                        font-size: 12px;
                        font-weight: 600;
                        border-radius: 6px;
                        cursor: pointer;
                        transition: all 0.2s ease;
                    }
                    .trend-period-btn:hover {
                        border-color: #00d4ff;
                        color: #00d4ff;
                    }
                    .trend-period-btn.active {
                        background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
                        color: #fff;
                        border-color: transparent;
                        box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
                    }
                    
                    .dash-stats-grid {
                        display: grid;
                        grid-template-columns: repeat(4, 1fr);
                        gap: 20px;
                        position: relative;
                        z-index: 1;
                    }
                    @media (max-width: 1200px) {
                        .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
                    }
                    @media (max-width: 600px) {
                        .dash-stats-grid { grid-template-columns: 1fr; }
                    }
                    .dash-stat-card {
                        background: rgba(255,255,255,0.08);
                        backdrop-filter: blur(10px);
                        border: 1px solid rgba(255,255,255,0.1);
                        padding: 22px;
                        border-radius: 14px;
                        transition: transform 0.2s ease, box-shadow 0.2s ease;
                    }
                    .dash-stat-card:hover {
                        transform: translateY(-3px);
                        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
                    }
                    .dash-stat-icon {
                        font-size: 24px;
                        margin-bottom: 12px;
                    }
                    .dash-stat-value {
                        font-size: 32px;
                        font-weight: 700;
                        color: #fff;
                        font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
                        line-height: 1;
                        margin-bottom: 6px;
                    }
                    .dash-stat-label {
                        color: rgba(255,255,255,0.6);
                        font-size: 13px;
                        font-weight: 500;
                        text-transform: uppercase;
                        letter-spacing: 0.5px;
                    }
                    .dash-stat-card.highlight-green .dash-stat-value { color: #34c759; }
                    .dash-stat-card.highlight-blue .dash-stat-value { color: #5ac8fa; }
                    .dash-stat-card.highlight-purple .dash-stat-value { color: #bf5af2; }
                    .dash-stat-card.highlight-teal .dash-stat-value { color: #30d5c8; }
                    .dash-stat-card.highlight-orange .dash-stat-value { color: #ff9500; }
                    .dash-stat-card.highlight-pink .dash-stat-value { color: #ff2d55; }
                    .dash-stat-card.highlight-red .dash-stat-value { color: #ff3b30; }
                    
                    /* Section Cards */
                    .dash-section {
                        background: #fff;
                        border-radius: 16px;
                        padding: 25px;
                        margin-bottom: 25px;
                        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
                        border: 1px solid rgba(0,0,0,0.04);
                    }
                    .dash-section-header {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 20px;
                    }
                    .dash-section-title {
                        font-size: 18px;
                        font-weight: 700;
                        color: #1a1a2e;
                        display: flex;
                        align-items: center;
                        gap: 10px;
                    }
                    .dash-section-title-icon {
                        width: 36px;
                        height: 36px;
                        border-radius: 10px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        font-size: 18px;
                    }
                    
                    /* Account Cards */
                    .account-cards-grid {
                        display: grid;
                        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
                        gap: 15px;
                    }
                    .account-card {
                        background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
                        border: 1px solid #e9ecef;
                        border-radius: 12px;
                        padding: 20px;
                        transition: all 0.2s ease;
                    }
                    .account-card:hover {
                        border-color: #007aff;
                        box-shadow: 0 4px 15px rgba(0, 122, 255, 0.15);
                        transform: translateY(-2px);
                    }
                    .account-card-name {
                        font-size: 15px;
                        font-weight: 600;
                        color: #1a1a2e;
                        margin-bottom: 15px;
                        display: flex;
                        align-items: center;
                        gap: 8px;
                    }
                    .account-card-stats {
                        display: grid;
                        grid-template-columns: repeat(3, 1fr);
                        gap: 10px;
                    }
                    .account-stat {
                        text-align: center;
                    }
                    .account-stat-value {
                        font-size: 20px;
                        font-weight: 700;
                        color: #1a1a2e;
                    }
                    .account-stat-label {
                        font-size: 11px;
                        color: #6c757d;
                        text-transform: uppercase;
                    }
                    .account-stat-value.money { color: #00a86b; }
                    
                    /* Model Analytics */
                    .model-chart-container {
                        height: 300px;
                        margin-bottom: 25px;
                        position: relative;
                        background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
                        border-radius: 12px;
                        padding: 20px;
                        border: 1px solid #e9ecef;
                    }
                    .model-bar-chart {
                        display: flex;
                        align-items: flex-end;
                        justify-content: space-around;
                        height: 220px;
                        padding: 0 10px;
                        gap: 8px;
                    }
                    .model-bar-group {
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        flex: 1;
                        max-width: 80px;
                    }
                    .model-bar-wrapper {
                        display: flex;
                        gap: 4px;
                        align-items: flex-end;
                        height: 180px;
                    }
                    .model-bar {
                        width: 28px;
                        border-radius: 6px 6px 0 0;
                        transition: all 0.3s ease;
                        position: relative;
                        min-height: 4px;
                    }
                    .model-bar.current {
                        background: linear-gradient(180deg, #00d4ff 0%, #0099cc 100%);
                    }
                    .model-bar.previous {
                        background: linear-gradient(180deg, #e0e0e0 0%, #bdbdbd 100%);
                    }
                    .model-bar:hover {
                        transform: scaleY(1.02);
                        filter: brightness(1.1);
                    }
                    .model-bar-label {
                        font-size: 10px;
                        color: #6c757d;
                        margin-top: 10px;
                        text-align: center;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        max-width: 80px;
                        font-weight: 600;
                    }
                    .chart-legend {
                        display: flex;
                        justify-content: center;
                        gap: 25px;
                        margin-top: 15px;
                    }
                    .legend-item {
                        display: flex;
                        align-items: center;
                        gap: 8px;
                        font-size: 12px;
                        color: #6c757d;
                    }
                    .legend-dot {
                        width: 12px;
                        height: 12px;
                        border-radius: 3px;
                    }
                    .legend-dot.current { background: linear-gradient(180deg, #00d4ff 0%, #0099cc 100%); }
                    .legend-dot.previous { background: linear-gradient(180deg, #e0e0e0 0%, #bdbdbd 100%); }
                    
                    /* Model Table */
                    .model-table {
                        width: 100%;
                        border-collapse: collapse;
                        table-layout: auto;
                    }
                    .model-table th {
                        text-align: left;
                        padding: 14px 16px;
                        background: #f8f9fa;
                        font-size: 11px;
                        font-weight: 700;
                        color: #6c757d;
                        text-transform: uppercase;
                        letter-spacing: 0.5px;
                        border-bottom: 2px solid #e9ecef;
                        position: relative;
                        resize: horizontal;
                        overflow: auto;
                    }
                    .model-table th .resizer {
                        position: absolute;
                        top: 0;
                        right: 0;
                        width: 5px;
                        cursor: col-resize;
                        user-select: none;
                        height: 100%;
                        z-index: 1;
                    }
                    .model-table th .resizer:hover {
                        background: #007aff;
                        opacity: 0.5;
                    }
                    .model-table thead {
                        position: sticky;
                        top: 0;
                        z-index: 100;
                        background: #f8f9fa;
                    }
                    .model-table thead th {
                        background: #f8f9fa;
                    }
                    .model-table td {
                        padding: 14px 16px;
                        border-bottom: 1px solid #f1f3f4;
                        font-size: 14px;
                    }
                    .model-table tr:hover {
                        background: #f8f9fa;
                    }
                    .model-badge {
                        display: inline-flex;
                        align-items: center;
                        gap: 6px;
                        padding: 6px 12px;
                        border-radius: 8px;
                        font-size: 12px;
                        font-weight: 600;
                    }
                    .model-qty {
                        font-size: 18px;
                        font-weight: 700;
                        color: #1a1a2e;
                    }
                    .model-spent {
                        font-weight: 600;
                        color: #00a86b;
                    }
                    
                    /* Collapsible Section */
                    .collapsible-header {
                        cursor: pointer;
                        display: flex;
                        align-items: center;
                        gap: 10px;
                    }
                    .collapsible-icon {
                        transition: transform 0.2s ease;
                    }
                    .collapsible-header.collapsed .collapsible-icon {
                        transform: rotate(-90deg);
                    }
                    .collapsible-content {
                        overflow: hidden;
                        transition: max-height 0.3s ease;
                    }
                    .collapsible-content.collapsed {
                        max-height: 0 !important;
                    }
                    
                    /* Period Badge */
                    .period-badge {
                        display: inline-flex;
                        align-items: center;
                        gap: 6px;
                        padding: 6px 14px;
                        background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
                        color: #fff;
                        border-radius: 20px;
                        font-size: 12px;
                        font-weight: 600;
                    }

/* Status dropdown with colored options */
.status-dropdown {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important;
    color: white !important;
    overflow: hidden;
}

.status-dropdown:hover {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.status-dropdown option {
    padding: 10px 12px !important;
    font-weight: 600 !important;
    color: white !important;
}

/* Drag and drop status items */
.status-item {
    transition: all 0.2s ease;
}

.status-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status-item[draggable="true"]:active {
    cursor: grabbing !important;
}

/* Flatpickr Custom Styling */
.flatpickr-calendar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px !important;
    border: 1px solid #e5e5e7 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.flatpickr-months {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%) !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 12px 0 !important;
}

.flatpickr-month,
.flatpickr-current-month {
    color: white !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    fill: white !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    fill: rgba(255, 255, 255, 0.8) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: #007aff !important;
    color: white !important;
    padding: 8px !important;
}

.flatpickr-current-month .numInputWrapper {
    background: transparent !important;
    border-radius: 6px !important;
    padding: 4px !important;
}

.flatpickr-current-month .numInputWrapper:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.flatpickr-current-month input.cur-year {
    color: white !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    background: transparent !important;
}

.flatpickr-current-month .numInput:hover {
    background: transparent !important;
}

.flatpickr-weekdays {
    background: #f9f9fb !important;
    padding: 8px 0 !important;
}

.flatpickr-weekday {
    color: #86868b !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

.flatpickr-day {
    border-radius: 8px !important;
    font-weight: 500 !important;
    color: #1d1d1f !important;
    margin: 2px !important;
}

.flatpickr-day:hover:not(.flatpickr-disabled):not(.selected) {
    background: #f0f0f5 !important;
    border-color: #f0f0f5 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #007aff !important;
    border-color: #007aff !important;
    color: white !important;
    font-weight: 600 !important;
}

.flatpickr-day.inRange {
    background: rgba(0, 122, 255, 0.1) !important;
    border-color: rgba(0, 122, 255, 0.1) !important;
    box-shadow: none !important;
}

.flatpickr-day.today {
    border-color: #007aff !important;
    font-weight: 600 !important;
}

.flatpickr-day.today:not(.selected) {
    color: #007aff !important;
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: #d2d2d7 !important;
}

/* Fade out days from previous/next month */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    opacity: 0.25 !important;
    color: #d2d2d7 !important;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    opacity: 0.4 !important;
    background: #f0f0f5 !important;
}

.flatpickr-input {
    cursor: pointer !important;
}

.flatpickr-input:focus {
    border-color: #007aff !important;
    outline: none !important;
}

/* DARK MODE OVERRIDES - MUST BE AT END */
body.dark-mode h1 {
    color: #ffffff !important;
}

body.dark-mode .subtitle {
    color: #ffffff !important;
}

body.dark-mode header h1,
body.dark-mode header .subtitle,
body.dark-mode header p {
    color: #ffffff !important;
}

/* ==================== HEADER TEXT FIX ==================== */

/* Light mode - dark text on light background */
header h1 {
    color: #1d1d1f !important;
}

header .subtitle {
    color: #86868b !important;
}

/* Dark mode - white text on dark background */
body.dark-mode header h1 {
    color: #ffffff !important;
}

body.dark-mode header .subtitle {
    color: #ffffff !important;
    opacity: 0.9;
}

