/* BFLDER - Apple-Style Design System */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Brand Colors */
    --primary: #4C101A;
    --primary-light: #721A2A;
    --primary-hover: #5a1320;
    --primary-alpha: rgba(76, 16, 26, 0.1);

    /* Light Theme (Default) */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fafafa;
    --bg-elevated: #ffffff;

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;

    --border-color: rgba(0, 0, 0, 0.06);
    --border-color-strong: rgba(0, 0, 0, 0.12);
    --divider: rgba(0, 0, 0, 0.05);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Status Colors */
    --success: #34c759;
    --success-hover: #2db14f;
    --success-bg: rgba(52, 199, 89, 0.12);
    --warning: #ff9f0a;
    --warning-hover: #e68f00;
    --warning-bg: rgba(255, 159, 10, 0.12);
    --warning-text: #996000;
    --danger: #4C101A;
    --danger-hover: #5a1320;
    --danger-bg: rgba(76, 16, 26, 0.12);
    --info: #007aff;
    --info-hover: #0066d6;
    --info-bg: rgba(0, 122, 255, 0.12);
    --not-started: #aeaeb2;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;

    /* Navbar */
    --navbar-bg: rgba(255, 255, 255, 0.72);
    --navbar-blur: saturate(180%) blur(20px);
}

/* ==================== DARK THEME ==================== */
[data-theme="dark"] {
    --primary: #6e1928;
    --primary-light: #8a2035;
    --primary-hover: #7d1d2e;
    --primary-alpha: rgba(110, 25, 40, 0.2);

    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-elevated: #2c2c2e;

    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #636366;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-strong: rgba(255, 255, 255, 0.15);
    --divider: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

    --success-bg: rgba(52, 199, 89, 0.2);
    --success-hover: #40d966;
    --warning-bg: rgba(255, 159, 10, 0.2);
    --warning-hover: #ffad33;
    --warning-text: #ffb830;
    --danger: #6e1928;
    --danger-bg: rgba(110, 25, 40, 0.2);
    --danger-hover: #7d1d2e;
    --info-bg: rgba(0, 122, 255, 0.2);
    --info-hover: #339dff;
    --not-started: #636366;

    --navbar-bg: rgba(28, 28, 30, 0.72);
}

/* ==================== BASE STYLES ==================== */
* {
    transition: background-color var(--transition-normal),
                border-color var(--transition-normal),
                box-shadow var(--transition-normal);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: var(--navbar-blur);
    -webkit-backdrop-filter: var(--navbar-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    height: 36px;
    width: 36px;
    border-radius: var(--radius-sm);
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px !important;
    border-radius: var(--radius-md);
    margin: 0 2px;
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--primary-alpha);
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-alpha);
}

.navbar-toggler {
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2386868b' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2398989d' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--primary-alpha);
}

.theme-toggle i {
    font-size: 18px;
}

/* User Badge in Navbar */
.user-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--divider);
    padding: 20px 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--divider);
    padding: 16px 24px;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.stat-card .stat-icon.primary {
    background: var(--primary-alpha);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card .stat-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
}

/* ==================== BUTTONS ==================== */
.btn {
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 16, 26, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color-strong);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-warning {
    background: var(--warning);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* Icon Action Buttons (borderless with hover) */
.btn-icon-action {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-icon-action:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon-action:focus {
    box-shadow: none;
}

/* ==================== FORMS ==================== */
.form-control,
.form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-secondary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-text {
    color: var(--text-tertiary);
    font-size: 13px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color-strong);
    border-radius: 6px;
    background-color: var(--bg-secondary);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--primary-alpha);
    border-color: var(--primary);
}

/* Input Groups */
.input-group .form-control {
    border-radius: var(--radius-md);
}

.input-group .btn {
    border-radius: var(--radius-md);
}

/* ==================== TABLES ==================== */
.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom: 1px solid var(--divider);
    padding: 14px 16px;
}

.table > thead {
    background: var(--bg-tertiary);
}

.table > thead > tr > th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table > tbody > tr {
    transition: background-color var(--transition-fast);
}

.table > tbody > tr:hover {
    background-color: var(--bg-tertiary);
}

.table > tbody > tr > td {
    white-space: nowrap;
}

.table-dark {
    --bs-table-bg: var(--primary);
    --bs-table-color: #ffffff;
}

.table-dark th {
    background-color: var(--primary) !important;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Sensitive Columns */
.sensitive-column {
    background-color: var(--primary-alpha) !important;
}

.table-dark .sensitive-column {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.sensitive-checkbox {
    background-color: var(--primary-alpha);
    padding: 10px;
    border-radius: var(--radius-md);
}

/* ==================== BADGES ==================== */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
}

.badge.bg-primary {
    background-color: var(--primary) !important;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: #ffffff;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
}

.badge.bg-secondary {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary);
}

.badge.bg-light {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Override Bootstrap text-dark in dark theme */
[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-warning.text-dark,
[data-theme="dark"] .bg-warning .text-dark {
    color: #000000 !important;
}

/* Force text colors in dark theme for all Bootstrap elements */
[data-theme="dark"] .table,
[data-theme="dark"] .table td,
[data-theme="dark"] .table th,
[data-theme="dark"] .table tbody,
[data-theme="dark"] .table thead,
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-header,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] label,
[data-theme="dark"] .form-label,
[data-theme="dark"] .form-check-label,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] strong,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] small.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-tertiary) !important;
}

/* Fix input backgrounds in dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color-strong);
}

[data-theme="dark"] .input-group-text {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color-strong);
    color: var(--text-secondary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.status-badge.not-started {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-badge.attempting {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.contacted {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.not-reachable {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ==================== MODALS ==================== */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--primary);
    color: #ffffff;
    border-bottom: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 18px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    color: var(--text-primary);
}

.modal-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--divider);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: 16px 24px;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Mobile Bottom Sheet for Modals */
@media (max-width: 768px) {
    .modal {
        --bs-modal-margin: 0;
    }

    /* Override Bootstrap's default fade animation */
    .modal.fade .modal-dialog {
        transform: translateY(100%) !important;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }

    .modal.show .modal-dialog {
        transform: translateY(0) !important;
    }

    .modal-dialog {
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        will-change: transform;
    }

    /* When dragging, disable transition for real-time feedback */
    .modal-dialog.dragging {
        transition: none !important;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        max-height: 90dvh;
        overflow: hidden;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    }

    .modal-header {
        position: relative;
        border-radius: 20px 20px 0 0;
        padding-top: 28px;
        cursor: grab;
        touch-action: none;
    }

    .modal-header:active {
        cursor: grabbing;
    }

    /* Drag handle indicator */
    .modal-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 3px;
    }

    .modal-body {
        max-height: calc(90vh - 140px);
        max-height: calc(90dvh - 140px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* Backdrop animation */
    .modal-backdrop {
        transition: opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }
}

/* ==================== PAGINATION ==================== */
.pagination {
    gap: 4px;
}

.pagination .page-link {
    border: none;
    color: var(--text-secondary);
    background: transparent;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.pagination .page-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: #ffffff;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-tertiary);
    background: transparent;
}

/* ==================== ALERTS ==================== */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    font-size: 14px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
}

/* ==================== PROGRESS ==================== */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* Circular Progress */
.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle .progress-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.progress-circle .progress-bar-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==================== DROPDOWNS ==================== */
.dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item.active {
    background: var(--primary);
    color: #ffffff;
}

.dropdown-divider {
    border-color: var(--divider);
    margin: 8px 0;
}

/* ==================== LOADING ==================== */
.loading-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1020;
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.9);
}

.spinner-border {
    color: var(--primary) !important;
    width: 48px;
    height: 48px;
    border-width: 3px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

@media (max-width: 576px) {
    .login-container {
        padding: 16px;
        overflow: auto;
    }

    .login-card {
        max-height: none;
    }
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.login-card .form-control {
    height: 52px;
    font-size: 16px;
}

.login-card .btn-primary {
    height: 52px;
    font-size: 16px;
    font-weight: 600;
}

/* ==================== DASHBOARD ==================== */
.welcome-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 40px;
    color: #ffffff;
    margin-bottom: 32px;
}

.welcome-section h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.welcome-section p {
    opacity: 0.9;
    font-size: 16px;
    margin-bottom: 24px;
}

.welcome-section .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.welcome-section .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== QUICK ACTIONS ==================== */
.quick-action-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.quick-action-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 16px;
}

.quick-action-card h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.quick-action-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ==================== TABLE WRAPPER ==================== */
.table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.table-wrapper .table-responsive {
    margin: 0;
}

.table-toolbar {
    padding: 20px 24px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.table-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--divider);
    background: var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* ==================== IMAGE MODAL ==================== */
.image-modal .modal-body {
    padding: 0;
    text-align: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* ==================== OCR REVIEW ==================== */
.ocr-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.ocr-card:hover {
    box-shadow: var(--shadow-md);
}

.ocr-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ocr-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.ocr-card-image:hover {
    transform: scale(1.02);
}

.ocr-card-body {
    padding: 20px;
}

.ocr-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--divider);
    background: var(--bg-tertiary);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.ocr-field {
    margin-bottom: 12px;
}

.ocr-field label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    display: block;
}

.ocr-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
}

.ocr-field input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-alpha);
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--success-bg);
    color: var(--success);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--warning-bg);
    color: var(--warning);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar-collapse {
        background: var(--bg-secondary);
        border-radius: var(--radius-lg);
        padding: 16px;
        margin-top: 12px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }

    .navbar-nav .nav-link {
        padding: 12px 16px !important;
        border-radius: var(--radius-md);
    }

    .welcome-section {
        padding: 28px;
    }

    .welcome-section h2 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .stat-card {
        padding: 20px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 20px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .table-toolbar {
        padding: 16px;
    }

    .table-footer {
        padding: 12px 16px;
        flex-direction: column;
        text-align: center;
    }

    .btn {
        padding: 10px 16px;
    }
}

@media (max-width: 576px) {
    .navbar-logo {
        height: 32px;
        width: 32px;
    }

    .navbar-brand span {
        font-size: 1rem;
    }

    .login-logo {
        width: 64px;
        height: 64px;
    }

    .login-card h1 {
        font-size: 20px;
    }

    .welcome-section {
        padding: 24px 20px;
    }

    .welcome-section h2 {
        font-size: 20px;
    }

    .table-responsive {
        font-size: 13px;
    }

    .table th, .table td {
        padding: 10px 12px;
    }

    .quick-action-card {
        padding: 20px;
    }

    .quick-action-card i {
        font-size: 28px;
    }
}

/* ==================== MODERN FILTER BAR ==================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.filter-bar .filter-group.search-group {
    flex: 2;
    min-width: 200px;
}

.filter-bar .filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.filter-bar .form-control,
.filter-bar .form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    height: auto;
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.filter-bar .input-group {
    flex: 1;
}

.filter-bar .input-group-text {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--text-tertiary);
    padding: 10px 12px;
}

.filter-bar .input-group .form-control {
    border-left: none;
}

.filter-bar .btn-filter-clear {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    white-space: nowrap;
}

.filter-bar .btn-filter-clear:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* Active filter chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-alpha);
    border: 1px solid var(--primary);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.filter-chip .chip-remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.filter-chip .chip-remove:hover {
    opacity: 1;
}

/* Mobile filter toggle */
.filter-toggle-mobile {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 12px;
}

.filter-toggle-mobile i {
    transition: transform var(--transition-fast);
}

.filter-toggle-mobile.active i {
    transform: rotate(180deg);
}

.filter-toggle-mobile .filter-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 8px;
}

/* Mobile filter styles */
@media (max-width: 768px) {
    .filter-toggle-mobile {
        display: flex;
    }

    .filter-bar {
        display: none;
        flex-direction: column;
        padding: 16px;
        margin-bottom: 12px;
    }

    .filter-bar.show {
        display: flex;
    }

    .filter-bar .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .filter-bar .filter-group.search-group {
        order: -1;
    }

    .filter-bar .filter-label {
        margin-bottom: 2px;
    }

    .filter-bar .btn-filter-clear {
        width: 100%;
        margin-top: 8px;
    }

    .active-filters {
        padding: 0 16px 12px;
    }
}

/* ==================== MOBILE CARD TABLE LAYOUT ==================== */
/* Desktop: Show mobile-card-header as regular cell, hide mobile-only elements inside */
@media (min-width: 769px) {
    /* Show only the name (card-title) on desktop, hide subtitles and status badge */
    .table-mobile-cards tbody td.mobile-card-header .card-subtitle,
    .table-mobile-cards tbody td.mobile-card-header .mobile-status-badge,
    .table-mobile-cards tbody td.mobile-card-header .mobile-header-badges {
        display: none !important;
    }
    /* Reset flexbox layout for desktop */
    .table-mobile-cards tbody td.mobile-card-header > div {
        display: block !important;
    }
    .mobile-status-badge {
        display: none !important;
    }
}

/* Hide mobile-only elements on desktop */
.mobile-only {
    display: none !important;
}

/* Hide mobile-hide header cells on desktop (they should be visible) */
.table-mobile-cards th.mobile-hide {
    display: table-cell;
}

/* Transforms table rows into cards on mobile devices */
@media (max-width: 768px) {
    /* Show mobile-only elements on mobile */
    .mobile-only {
        display: table-cell !important;
    }

    /* Years cell mobile - full width row */
    .years-cell-mobile {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* Hide desktop-only header cells on mobile */
    .table-mobile-cards th.mobile-hide {
        display: none !important;
    }
    /* Prevent horizontal scroll */
    .table-responsive {
        overflow-x: hidden;
    }

    .table-mobile-cards {
        width: 100%;
        table-layout: fixed;
    }

    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody {
        display: block;
        width: 100%;
    }

    .table-mobile-cards tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        margin: 12px 0;
        padding: 16px;
        box-shadow: var(--shadow-sm);
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .table-mobile-cards tbody tr:hover {
        box-shadow: var(--shadow-md);
    }

    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 8px 0;
        border-bottom: 1px solid var(--divider);
        white-space: normal;
        text-align: right;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .table-mobile-cards tbody td:last-child {
        border-bottom: none;
        padding-top: 12px;
        justify-content: flex-end;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        text-align: left;
        flex-shrink: 0;
        margin-right: 12px;
    }

    .table-mobile-cards tbody td:last-child::before {
        display: none;
    }

    /* Card header styling for first cell */
    .table-mobile-cards tbody td.mobile-card-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding-bottom: 12px;
        margin-bottom: 8px;
        border-bottom: 2px solid var(--primary-alpha);
        width: 100%;
        box-sizing: border-box;
    }

    .table-mobile-cards tbody td.mobile-card-header > div {
        width: 100%;
    }

    .table-mobile-cards tbody td.mobile-card-header::before {
        display: none;
    }

    .table-mobile-cards tbody td.mobile-card-header .card-title {
        font-weight: 600;
        font-size: 16px;
        color: var(--text-primary);
        display: block;
        word-break: break-word;
    }

    .table-mobile-cards tbody td.mobile-card-header .card-subtitle {
        font-size: 13px;
        color: var(--text-secondary);
        margin-top: 2px;
        display: block;
        word-break: break-word;
    }

    /* Hide specific cells on mobile if needed */
    .table-mobile-cards tbody td.mobile-hide {
        display: none;
    }

    /* Action buttons - space between for left/right alignment */
    .table-mobile-cards tbody td.mobile-actions {
        display: flex;
        gap: 8px;
        justify-content: space-between;
        flex-wrap: wrap;
        padding-top: 12px;
    }

    .table-mobile-cards tbody td.mobile-actions .btn {
        flex: none;
    }

    /* Mobile status badge in header */
    .table-mobile-cards tbody td.mobile-card-header .mobile-status-badge {
        display: inline-flex !important;
        flex-shrink: 0;
        margin-left: 8px;
    }

    /* Badge styling in cards */
    .table-mobile-cards tbody td .badge {
        font-size: 11px;
    }

    /* Status badge in mobile card */
    .table-mobile-cards tbody td .status-badge {
        padding: 4px 10px;
    }
}

/* ==================== UTILITIES ==================== */
.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary-custom {
    background-color: var(--bg-secondary) !important;
}

.border-subtle {
    border-color: var(--border-color) !important;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

/* Hide scrollbar but keep functionality */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: var(--primary);
    color: #ffffff;
}
