/* TradeQuoteAI - Modern Dark Theme (Zinc/Indigo) */

:root {
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-card: #18181b;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-secondary: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #f43f5e;
    --accent-info: #06b6d4;
    --accent-purple: #a78bfa;
    --border-color: #27272a;
    --sidebar-width: 280px;
    --sidebar-bg: linear-gradient(180deg, #09090b 0%, #18181b 100%);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Bootstrap variable overrides for dark theme */
    --bs-body-color: #fafafa;
    --bs-body-bg: #09090b;
    --bs-heading-color: #fafafa;
    --bs-secondary-color: #a1a1aa;
    --bs-tertiary-color: #71717a;
    --bs-border-color: #27272a;
    --bs-card-bg: #18181b;
    --bs-card-color: #fafafa;
    --bs-card-cap-color: #fafafa;
    --bs-card-title-color: #fafafa;
    --bs-emphasis-color: #fafafa;
    --bs-link-color: #6366f1;
    --bs-link-hover-color: #4f46e5;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--accent-hover);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.sidebar-brand small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 16px 8px;
}

.sidebar-nav .nav-item {
    margin-bottom: 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(167, 139, 250, 0.08));
    color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav .nav-link svg,
.sidebar-nav .nav-link i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav .nav-link.active svg,
.sidebar-nav .nav-link.active i {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Top Navbar */
.top-navbar {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-navbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top-navbar .navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.user-dropdown:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.page-content {
    padding: 32px;
}

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

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

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

.card-header h5,
.card-header .card-title {
    color: var(--text-primary);
}

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

/* Ensure all headings, labels, and text are visible on dark bg */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

label {
    color: var(--text-secondary);
}

p {
    color: var(--text-secondary);
}

.fw-bold, .fw-600, strong, b {
    color: var(--text-primary);
}

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

.form-check-label {
    color: var(--text-secondary);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

hr {
    border-color: var(--border-color);
    opacity: 0.5;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}

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

.stat-card.blue::after { background: var(--accent-primary); }
.stat-card.green::after { background: var(--accent-secondary); }
.stat-card.amber::after { background: var(--accent-warning); }
.stat-card.red::after { background: var(--accent-danger); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.25rem;
}

.stat-card.blue .stat-icon { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.stat-card.green .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-secondary); }
.stat-card.amber .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.stat-card.red .stat-icon { background: rgba(244, 63, 94, 0.15); color: var(--accent-danger); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

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

/* ========== TABLES ========== */
.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(24, 24, 27, 0.5);
    --bs-table-hover-bg: rgba(39, 39, 42, 0.3);
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(39, 39, 42, 0.5);
    vertical-align: middle;
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.table td, .table th {
    color: var(--text-primary);
}

.table-borderless td, .table-borderless th {
    color: var(--text-primary);
}

/* ========== FORMS ========== */
.form-control,
.form-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

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

.input-group-text {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-secondary), #059669);
    color: #fff;
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #e11d48);
    color: #fff;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #e11d48, #be123c);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-warning), #d97706);
    color: #fff;
}

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

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ========== BADGES ========== */
.badge {
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge.bg-secondary { background: var(--bg-tertiary) !important; color: var(--text-secondary); }
.badge.bg-info { background: rgba(6, 182, 212, 0.15) !important; color: var(--accent-info); }
.badge.bg-success { background: rgba(16, 185, 129, 0.15) !important; color: var(--accent-secondary); }
.badge.bg-danger { background: rgba(244, 63, 94, 0.15) !important; color: var(--accent-danger); }
.badge.bg-warning { background: rgba(245, 158, 11, 0.15) !important; color: var(--accent-warning); }
.badge.bg-primary { background: rgba(99, 102, 241, 0.15) !important; color: var(--accent-primary); }
.badge.bg-dark { background: var(--bg-tertiary) !important; color: var(--text-muted); }

/* ========== MODAL ========== */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* ========== ALERT ========== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 14px 20px;
}

.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--accent-secondary); border-left: 4px solid var(--accent-secondary); }
.alert-danger { background: rgba(244, 63, 94, 0.1); color: var(--accent-danger); border-left: 4px solid var(--accent-danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); border-left: 4px solid var(--accent-warning); }
.alert-info { background: rgba(6, 182, 212, 0.1); color: var(--accent-info); border-left: 4px solid var(--accent-info); }

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

/* ========== PAGINATION ========== */
.page-link {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

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

.page-item.active .page-link {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ========== DROPDOWN ========== */
.dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow-hover);
    padding: 8px;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

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

.empty-state .empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

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

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========== DOCUMENT VIEW (Quote/Invoice) ========== */
.document-view {
    background: #fff;
    color: #18181b;
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--card-shadow-hover);
}

.document-view .doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e4e4e7;
}

.document-view .doc-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.document-view .doc-number {
    color: #71717a;
    font-size: 0.9rem;
}

.document-view .doc-table th {
    background: #f4f4f5;
    color: #52525b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.document-view .doc-table td {
    color: #3f3f46;
    padding: 12px 16px;
    border-color: #e4e4e7;
}

.document-view .doc-totals {
    text-align: right;
}

.document-view .doc-totals .total-row {
    display: flex;
    justify-content: flex-end;
    gap: 40px;
    padding: 8px 0;
    border-bottom: 1px solid #e4e4e7;
}

.document-view .doc-totals .grand-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
    border-bottom: 3px solid var(--accent-primary);
}

/* ========== MOBILE TOGGLE ========== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: flex;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .top-navbar {
        padding-left: 64px;
    }
    .page-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
    .document-view {
        padding: 20px 16px;
    }
    .document-view .doc-header {
        flex-direction: column;
        gap: 16px;
    }
    .document-view .doc-title {
        font-size: 1.4rem;
    }
    .top-navbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-title {
        font-size: 1.1rem;
    }
    .page-content {
        padding: 16px 12px;
    }
    /* Make tables scrollable on mobile */
    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .card {
        border-radius: 10px;
    }
    .card-body {
        padding: 16px;
    }
    /* Stack action buttons on mobile */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .btn-group-mobile .btn {
        width: 100%;
        justify-content: center;
    }
    /* Adjust form layouts for mobile */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 12px 8px;
    }
    .card-body {
        padding: 12px;
    }
    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    .btn-lg {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
}

/* ========== AUTH PAGES ========== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.06) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--card-shadow-hover);
    position: relative;
    z-index: 1;
}

.auth-card .auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-card .auth-logo .logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.auth-card .auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.auth-card .auth-title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 600;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== UTILITIES ========== */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-secondary-custom { color: var(--text-secondary); }
.bg-dark-card { background: var(--bg-card); }
.border-custom { border-color: var(--border-color) !important; }

/* Bootstrap text color overrides for dark theme */
.text-dark { color: var(--text-primary) !important; }
.text-body { color: var(--text-primary) !important; }
.card-text { color: var(--text-secondary); }
small, .small { color: var(--text-muted); }
.text-danger { color: var(--accent-danger) !important; }
.text-success { color: var(--accent-secondary) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-info { color: var(--accent-info) !important; }
.text-primary { color: var(--accent-primary) !important; }

.glow-blue { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
.glow-green { box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }

/* Pulse animation for overdue badges */
@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.pulse-danger {
    animation: pulse-danger 2s ease-in-out infinite;
}

/* ========== LINE ITEMS - Card Layout (Quote Builder) ========== */
.line-item-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.line-item-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.line-item-card:last-child {
    margin-bottom: 0;
}

.line-item-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 28px;
}

.line-item-fields {
    flex: 1;
    min-width: 0;
}

.line-item-card > .remove-item {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.line-item-card:hover > .remove-item {
    opacity: 1;
}

/* Line total display box */
.line-total-display {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-total-display .line-total {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-secondary);
}

/* Summary card accent */
.quote-summary-card {
    border-color: rgba(99, 102, 241, 0.25);
}

.quote-summary-card .card-header {
    background: rgba(99, 102, 241, 0.05);
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
    .line-item-card {
        padding: 16px;
        gap: 12px;
    }

    .line-item-number {
        margin-top: 24px;
    }

    .line-item-card > .remove-item {
        opacity: 1;
    }
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Nav tabs override for dark theme */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: transparent;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--accent-primary);
    background: transparent;
    border-bottom: 2px solid var(--accent-primary);
}
