/* Brand theming on top of Bootstrap 5.3 (with dark mode support) */

body {
    background: var(--bs-body-bg);
}

/* Override Bootstrap primary where needed */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-primary:hover {
    background-color: color-mix(in srgb, var(--brand-primary) 85%, black);
    border-color: color-mix(in srgb, var(--brand-primary) 85%, black);
}
.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

a { color: var(--brand-primary); }
a:hover { color: color-mix(in srgb, var(--brand-primary) 75%, black); }

.navbar-brand { font-weight: 700; color: var(--brand-primary) !important; }

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    font-weight: 600;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Badge overrides for membership statuses */
.badge-active, .badge-completed, .badge-paid {
    background-color: #198754 !important;
    color: #fff !important;
}
.badge-pending, .badge-draft, .badge-initiated {
    background-color: #ffc107 !important;
    color: #000 !important;
}
.badge-expired, .badge-failed, .badge-overdue {
    background-color: #dc3545 !important;
    color: #fff !important;
}
.badge-cancelled {
    background-color: #6c757d !important;
    color: #fff !important;
}
.badge-sent {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Invoice line items */
.line-items-table input,
.line-items-table select {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
}

/* Public page */
.public-hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.public-hero img {
    max-height: 80px;
    margin-bottom: 1rem;
}

/* Invoice preview — always light background for readability */
.invoice-preview {
    background: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 2.5rem;
}

.invoice-preview .text-muted {
    color: #6c757d !important;
}

.invoice-preview .table {
    --bs-table-bg: transparent;
    --bs-table-color: #212529;
    --bs-table-border-color: #dee2e6;
}

.invoice-preview .badge {
    color: #fff !important;
}

/* Dark mode: lighten brand-primary for links */
[data-bs-theme="dark"] a {
    color: color-mix(in srgb, var(--brand-primary) 70%, white);
}
[data-bs-theme="dark"] a:hover {
    color: color-mix(in srgb, var(--brand-primary) 50%, white);
}

[data-bs-theme="dark"] .navbar-brand {
    color: color-mix(in srgb, var(--brand-primary) 70%, white) !important;
}

[data-bs-theme="dark"] .stat-card .stat-value {
    color: color-mix(in srgb, var(--brand-primary) 65%, white);
}

/* Dark mode: btn-primary needs lighter shade to remain visible */
[data-bs-theme="dark"] .btn-primary {
    background-color: color-mix(in srgb, var(--brand-primary) 80%, white);
    border-color: color-mix(in srgb, var(--brand-primary) 80%, white);
    color: #000;
}
[data-bs-theme="dark"] .btn-primary:hover {
    background-color: color-mix(in srgb, var(--brand-primary) 65%, white);
    border-color: color-mix(in srgb, var(--brand-primary) 65%, white);
    color: #000;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: color-mix(in srgb, var(--brand-primary) 70%, white);
    border-color: color-mix(in srgb, var(--brand-primary) 70%, white);
}

/* Print */
@media print {
    .no-print { display: none !important; }
    .navbar { display: none !important; }
    footer { display: none !important; }
}
