/* iERP v3 — Modern Purple Theme */

/* ============ CSS VARIABLES ============ */
:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --accent: #ec4899;
    --accent-light: #f472b6;
    --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, #7c3aed10 0%, #ec489910 100%);
    --bg: #f8f7fc;
    --card-shadow: 0 1px 3px rgba(124, 58, 237, 0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 8px 25px rgba(124, 58, 237, 0.12), 0 3px 6px rgba(0,0,0,0.06);
}

/* ============ GENERAL ============ */
body {
    background-color: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1e1b4b;
}

a {
    color: var(--primary);
}
a:hover {
    color: var(--primary-dark);
}

::selection {
    background: var(--primary-light);
    color: #fff;
}

/* ============ NAVBAR ============ */
.navbar.bg-dark {
    background: linear-gradient(135deg, #1e1145 0%, #2d1b69 50%, #4c1d95 100%) !important;
    border-bottom: 2px solid rgba(236, 72, 153, 0.3);
    box-shadow: 0 2px 15px rgba(30, 17, 69, 0.3);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #c4b5fd, #f9a8d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.75) !important;
    transition: color 0.2s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #f9a8d4 !important;
}

.navbar .dropdown-menu-dark {
    background: #1e1145;
    border: 1px solid rgba(124, 58, 237, 0.3);
}
.navbar .dropdown-item:hover {
    background: rgba(124, 58, 237, 0.3);
}

/* Tenant filter in navbar */
.navbar .input-group-text {
    background: rgba(124, 58, 237, 0.3) !important;
    border-color: rgba(124, 58, 237, 0.4) !important;
    color: #c4b5fd !important;
}
.navbar .form-select {
    background-color: rgba(30, 17, 69, 0.6) !important;
    border-color: rgba(124, 58, 237, 0.4) !important;
    color: #e9d5ff !important;
}

/* ============ CARDS ============ */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    overflow: visible;
}
.card:hover {
    box-shadow: var(--card-shadow-hover);
}
.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    font-weight: 600;
    color: #1e1b4b;
}

/* ============ BUTTONS ============ */
.btn-primary {
    background: var(--gradient);
    border: none;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    transition: all 0.2s;
}
.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
    color: #fff !important;
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-dark {
    background: linear-gradient(135deg, #1e1145 0%, #4c1d95 100%);
    border: none;
}
.btn-dark:hover {
    background: linear-gradient(135deg, #2d1b69 0%, #5b21b6 100%);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    color: #fff !important;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: none;
    color: #fff;
}
.btn-warning:hover {
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: none;
    color: #fff !important;
}

/* Admin create button */
.btn-admin-create {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #ef4444 100%);
    border: none;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
    transition: all 0.2s;
}
.btn-admin-create:hover,
.btn-admin-create:focus {
    background: linear-gradient(135deg, #6d28d9 0%, #db2777 50%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    transform: translateY(-1px);
    color: #fff !important;
}
.btn-admin-create:active {
    transform: translateY(0);
}

/* ============ STAT CARDS ============ */
.stat-card {
    border-left: 4px solid;
    border-radius: 0.75rem;
    background: #fff;
}
.stat-card.primary { border-left-color: var(--primary); }
.stat-card.success { border-left-color: #10b981; }
.stat-card.warning { border-left-color: #f59e0b; }
.stat-card.danger  { border-left-color: #ef4444; }
.stat-card.info    { border-left-color: #06b6d4; }
.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: #1e1b4b;
}
.stat-card .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ============ BADGES ============ */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 0.35em 0.75em;
    border-radius: 0.5rem;
}
.bg-primary { background: var(--primary) !important; }
.bg-purple {
    background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
    color: #fff;
}
.bg-success { background: #10b981 !important; }
.bg-warning { background: #f59e0b !important; }
.bg-danger { background: #ef4444 !important; }
.bg-info { background: #06b6d4 !important; }
.bg-secondary { background: #6b7280 !important; }

/* ============ ALERTS ============ */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
}
.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}
.alert-info {
    background: #f0f0ff;
    color: #3b1f8b;
    border-left: 4px solid var(--primary);
}

/* ============ FORMS ============ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.15);
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============ TABLES ============ */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 2px solid rgba(124, 58, 237, 0.1);
    padding: 0.75rem;
}
.table td {
    padding: 0.75rem;
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.03);
}

/* ============ COMMENT STYLING ============ */
.comment-item {
    border-left: 3px solid var(--primary-light);
    padding-left: 1rem;
    margin-bottom: 1rem;
}
.comment-item .comment-replies {
    margin-left: 1rem;
    margin-top: 0.75rem;
}
.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
}
.comment-avatar.admin {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}
.comment-avatar.user {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

/* Reply form */
.reply-form {
    background-color: #f8f7fc;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 0.5rem;
    display: none;
    border: 1px solid rgba(124, 58, 237, 0.1);
}
.reply-form.active { display: block; }

/* ============ DROP ZONE ============ */
.drop-zone {
    border: 2px dashed rgba(124, 58, 237, 0.25);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: #9ca3af;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: 0.5rem;
}
.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background-color: rgba(124, 58, 237, 0.04);
    color: var(--primary);
}
.drop-zone i { font-size: 1.5rem; }

/* Upload preview */
.upload-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: #f3f0ff;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin: 0.25rem;
    border: 1px solid rgba(124, 58, 237, 0.1);
}
.upload-preview img {
    max-height: 40px;
    border-radius: 0.25rem;
}
.upload-preview .remove-upload {
    color: #ef4444;
    cursor: pointer;
    font-weight: 700;
}

/* ============ TIMER ============ */
.timer-display {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #10b981;
}
.timer-display.running {
    color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Time entries table */
.time-entry-row .edit-form { display: none; }
.time-entry-row.editing .display-value { display: none; }
.time-entry-row.editing .edit-form { display: inline-flex; }

/* ============ PROPOSAL/TASK CARDS IN LIST ============ */
.item-card {
    transition: all 0.2s ease;
    border-top: 3px solid transparent;
    position: relative;
    cursor: pointer;
}
.item-card:hover {
    transform: translateY(-3px);
    border-top-color: var(--primary);
}
.item-card .card-title a {
    color: #1e1b4b;
}
.item-card .card-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
.item-card .card-footer {
    position: relative;
    z-index: 0;
}

/* ============ STATUS SELECT ============ */
.status-select {
    width: auto;
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
}

/* ============ INTERNAL BADGE ============ */
.internal-badge {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    vertical-align: middle;
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}
.breadcrumb-item a {
    color: var(--primary);
}

/* ============ TENANT SELECTOR ============ */
.tenant-selector {
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

/* ============ PAGINATION ============ */
.page-item.active .page-link {
    background: var(--gradient);
    border-color: transparent;
}
.page-link {
    color: var(--primary);
    border-radius: 0.5rem !important;
    margin: 0 2px;
    border: 1px solid rgba(124, 58, 237, 0.15);
}
.page-link:hover {
    color: var(--primary-dark);
    background: rgba(124, 58, 237, 0.06);
}

/* ============ TASK NUMBER ============ */
.task-number {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-block;
}
.task-number:hover {
    background: rgba(108, 117, 125, 0.2);
    color: #495057;
}
.task-number.copied {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}
[data-theme="dark"] .task-number {
    color: #adb5bd;
    background: rgba(173, 181, 189, 0.15);
}
[data-theme="dark"] .task-number:hover {
    background: rgba(173, 181, 189, 0.25);
    color: #dee2e6;
}
[data-theme="dark"] .task-number.copied {
    background: rgba(25, 135, 84, 0.25);
    color: #75b798;
}

/* ============ LOGIN / REGISTER PAGE ============ */
.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background: linear-gradient(135deg, #1e1145 0%, #4c1d95 30%, #7c3aed 60%, #ec4899 100%);
    padding: 2rem 1rem;
}
.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(124, 58, 237, 0.2) 0%, transparent 50%);
    animation: aurora 15s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes aurora {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-30px, 20px) rotate(3deg); }
}

.auth-card {
    max-width: 420px;
    width: 100%;
    border-radius: 1.25rem;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    margin-bottom: auto;
}
.auth-card .card-header {
    background: linear-gradient(135deg, #1e1145 0%, #4c1d95 100%) !important;
    border-bottom: 2px solid rgba(236, 72, 153, 0.4);
    padding: 1.75rem !important;
}
.auth-card .card-header h3 {
    background: linear-gradient(135deg, #c4b5fd, #f9a8d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-card .card-body {
    background: #fff;
    padding: 2rem !important;
}
.auth-card .btn-dark {
    background: linear-gradient(135deg, #4c1d95, #7c3aed, #ec4899);
    background-size: 200% 200%;
    border: none;
    transition: all 0.3s;
}
.auth-card .btn-dark:hover {
    background-position: right center;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.auth-lang {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============ PRINT ============ */
@media print {
    .navbar, .btn, .no-print, footer, .tenant-selector {
        display: none !important;
    }
    body {
        background: white;
        color: #000;
    }
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    .container-fluid {
        max-width: 100%;
        padding: 0;
    }
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
    --bg: #0f0d1a;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0,0,0,0.2);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.4), 0 3px 6px rgba(0,0,0,0.3);
    color-scheme: dark;
    /* Override Bootstrap 5 CSS variables */
    --bs-body-bg: #0f0d1a;
    --bs-body-color: #e2e0f0;
    --bs-card-bg: #1a1730;
    --bs-card-cap-bg: rgba(124, 58, 237, 0.06);
    --bs-card-border-color: rgba(124, 58, 237, 0.15);
    --bs-table-bg: transparent;
    --bs-table-color: #e2e0f0;
    --bs-table-striped-bg: rgba(124, 58, 237, 0.05);
    --bs-table-hover-bg: rgba(124, 58, 237, 0.08);
    --bs-table-hover-color: #e2e0f0;
    --bs-table-border-color: rgba(124, 58, 237, 0.08);
    --bs-border-color: rgba(124, 58, 237, 0.15);
    --bs-tertiary-bg: #1e1a35;
    --bs-secondary-bg: #1a1730;
    --bs-light-bg-subtle: #1e1a35;
}

[data-theme="dark"] body {
    background-color: #0f0d1a !important;
    color: #e2e0f0;
}

[data-theme="dark"] a {
    color: var(--primary-light);
}

[data-theme="dark"] .card {
    background-color: #1a1730 !important;
    border: 1px solid rgba(124, 58, 237, 0.15) !important;
}

[data-theme="dark"] .card-header {
    background-color: rgba(124, 58, 237, 0.06) !important;
    border-bottom-color: rgba(124, 58, 237, 0.15) !important;
    color: #e2e0f0;
}

[data-theme="dark"] .card-body {
    background-color: transparent;
    color: #e2e0f0;
}

[data-theme="dark"] .card.bg-light,
[data-theme="dark"] .bg-light {
    background-color: #1e1a35 !important;
    color: #e2e0f0;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #1a1730 !important;
    border-color: rgba(124, 58, 237, 0.25) !important;
    color: #e2e0f0 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #1e1a35 !important;
    border-color: var(--primary-light) !important;
    color: #e2e0f0 !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: #6b6589;
}

[data-theme="dark"] .form-check-input {
    background-color: #2a2545 !important;
    border-color: rgba(124, 58, 237, 0.5) !important;
}

[data-theme="dark"] .form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

[data-theme="dark"] .form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238b85a8'/%3e%3c/svg%3e") !important;
}

[data-theme="dark"] .form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

[data-theme="dark"] .table {
    color: #e2e0f0 !important;
    --bs-table-bg: transparent;
    --bs-table-color: #e2e0f0;
    --bs-table-border-color: rgba(124, 58, 237, 0.08);
    --bs-table-hover-bg: rgba(124, 58, 237, 0.08);
    --bs-table-striped-bg: rgba(124, 58, 237, 0.04);
}

[data-theme="dark"] .table th {
    color: #a09bc0 !important;
    border-bottom-color: rgba(124, 58, 237, 0.15) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .table td {
    border-color: rgba(124, 58, 237, 0.08) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.08);
}

[data-theme="dark"] .text-muted {
    color: #8b85a8 !important;
}

[data-theme="dark"] .text-dark {
    color: #e2e0f0 !important;
}

[data-theme="dark"] .alert-success {
    background: #0b2a1e;
    color: #6ee7b7;
    border-left-color: #10b981;
}

[data-theme="dark"] .alert-danger {
    background: #2a0b0b;
    color: #fca5a5;
    border-left-color: #ef4444;
}

[data-theme="dark"] .alert-warning {
    background: #2a1f0b;
    color: #fcd34d;
    border-left-color: #f59e0b;
}

[data-theme="dark"] .alert-info {
    background: #130e30;
    color: #c4b5fd;
    border-left-color: var(--primary);
}

[data-theme="dark"] .stat-card {
    background: #1a1730;
}

[data-theme="dark"] .stat-card .stat-number {
    color: #e2e0f0;
}

[data-theme="dark"] .item-card .card-title a {
    color: #e2e0f0;
}

[data-theme="dark"] .item-card .card-footer {
    border-top-color: rgba(124, 58, 237, 0.1);
}

[data-theme="dark"] .page-link {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.2);
    color: var(--primary-light);
}

[data-theme="dark"] .page-link:hover {
    background-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item.active {
    color: #8b85a8;
}

[data-theme="dark"] .comment-item {
    border-left-color: rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .reply-form {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .drop-zone,
[data-theme="dark"] #file-drop-zone,
[data-theme="dark"] #image-drop-zone {
    background-color: #1a1730 !important;
    border-color: rgba(124, 58, 237, 0.25) !important;
    color: #8b85a8;
}

[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .drop-zone.drag-over,
[data-theme="dark"] #file-drop-zone:hover,
[data-theme="dark"] #image-drop-zone:hover,
[data-theme="dark"] #image-drop-zone.drag-over {
    background-color: rgba(124, 58, 237, 0.12) !important;
    border-color: var(--primary-light) !important;
    color: var(--primary-light);
}

[data-theme="dark"] .upload-preview {
    background: #1e1a35;
    border-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .btn-light {
    background-color: #1e1a35;
    border-color: rgba(124, 58, 237, 0.2);
    color: #e2e0f0;
}

[data-theme="dark"] .btn-light:hover {
    background-color: #2a2545;
    color: #e2e0f0;
}

[data-theme="dark"] .btn-outline-secondary {
    color: #a09bc0;
    border-color: rgba(124, 58, 237, 0.25);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: rgba(124, 58, 237, 0.15);
    color: #e2e0f0;
}

[data-theme="dark"] footer {
    background-color: #1a1730 !important;
    border-top-color: rgba(124, 58, 237, 0.15) !important;
    color: #8b85a8 !important;
}

[data-theme="dark"] .modal-content {
    background-color: #1a1730;
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #e2e0f0;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .modal-footer {
    border-top-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

[data-theme="dark"] .img-thumbnail {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .border-top {
    border-color: rgba(124, 58, 237, 0.15) !important;
}

[data-theme="dark"] .border-bottom {
    border-color: rgba(124, 58, 237, 0.15) !important;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: #f0eef8;
}

/* Paragraphs, lists, general text */
[data-theme="dark"] p {
    color: #d0cde4;
}

[data-theme="dark"] li {
    color: #d0cde4;
}

[data-theme="dark"] ul, [data-theme="dark"] ol {
    color: #d0cde4;
}

[data-theme="dark"] .card-body {
    color: #e2e0f0;
}

[data-theme="dark"] .card-body p {
    color: #d0cde4;
}

[data-theme="dark"] td,
[data-theme="dark"] th {
    color: #e2e0f0;
}

/* Specific overrides for btn-group in admin tables */
[data-theme="dark"] .btn-group .btn {
    border-color: rgba(124, 58, 237, 0.2);
}

/* Status form selects in admin tables */
[data-theme="dark"] .status-form .form-select {
    background-color: #1a1730;
    color: #e2e0f0;
    border-color: rgba(124, 58, 237, 0.25);
}

/* Admin alert boxes */
[data-theme="dark"] .alert-dismissible {
    color: inherit;
}

/* Form labels & text */
[data-theme="dark"] .form-label,
[data-theme="dark"] label,
[data-theme="dark"] .form-check-label {
    color: #c4b5fd !important;
}

[data-theme="dark"] .form-text {
    color: #8b85a8 !important;
}

[data-theme="dark"] small {
    color: inherit;
}

[data-theme="dark"] .text-danger {
    color: #f87171 !important;
}

/* Card titles */
[data-theme="dark"] .card-title {
    color: #f0eef8;
}

/* Strong/bold */
[data-theme="dark"] strong,
[data-theme="dark"] b {
    color: #e2e0f0;
}

/* List group items */
[data-theme="dark"] .list-group-item {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.12);
    color: #e2e0f0;
}

/* Status selects in admin tables */
[data-theme="dark"] .form-select-sm {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.25);
    color: #e2e0f0;
}

/* Table responsive */
[data-theme="dark"] .table-responsive {
    border-color: rgba(124, 58, 237, 0.1);
}

/* Input group */
[data-theme="dark"] .input-group-text {
    background-color: #1e1a35;
    border-color: rgba(124, 58, 237, 0.25);
    color: #a09bc0;
}

/* Btn outline variants */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-dark {
    color: #fff !important;
}

[data-theme="dark"] .btn-outline-primary {
    color: var(--primary-light);
    border-color: var(--primary-light);
}

[data-theme="dark"] .btn-outline-info {
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.4);
}

[data-theme="dark"] .btn-outline-warning {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .btn-outline-danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .btn-outline-success {
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

/* Card bg-transparent footer */
[data-theme="dark"] .card-footer.bg-transparent {
    background-color: transparent !important;
    border-top-color: rgba(124, 58, 237, 0.1);
}

/* Container fluid background */
[data-theme="dark"] .container-fluid {
    background-color: transparent;
}

/* Dropdown menus outside navbar */
[data-theme="dark"] .dropdown-menu {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .dropdown-item {
    color: #e2e0f0;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: rgba(124, 58, 237, 0.15);
    color: #f0eef8;
}

[data-theme="dark"] .dropdown-divider {
    border-color: rgba(124, 58, 237, 0.15);
}

/* Nav tabs */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #8b85a8;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.2) rgba(124, 58, 237, 0.2) #1a1730;
    color: #e2e0f0;
}

/* Badge text-dark override */
[data-theme="dark"] .badge.text-dark {
    color: #1e1b4b !important;
}

/* Accordion (if used) */
[data-theme="dark"] .accordion-item {
    background-color: #1a1730;
    border-color: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .accordion-button {
    background-color: #1a1730;
    color: #e2e0f0;
}

/* Border dashed for drop zones */
[data-theme="dark"] .border-2.border-dashed {
    border-color: rgba(124, 58, 237, 0.3) !important;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f0d1a;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .stat-card .stat-number { font-size: 1.4rem; }
    .timer-display { font-size: 1.5rem; }
    .auth-card { margin: 1rem; }
}
