/* BillFlow Pro — Premium Design System v2 */

:root {
    --brand-50: #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e8eef4;
    --border: #e2e8f0;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --text: #0f172a;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 28px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.06), 0 24px 48px rgba(79, 70, 229, 0.1);
    --shadow-xl: 0 8px 32px rgba(15, 23, 42, 0.08), 0 32px 64px rgba(79, 70, 229, 0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-w: 16.5rem;
    --header-h: 4rem;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.dark {
    --surface: #0c1222;
    --surface-2: #111827;
    --surface-3: #1a2332;
    --border: #2a3548;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--surface-2);
    color: var(--text);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.dark body,
body.dark,
html.dark body {
    background: #030712;
}

::selection {
    background: rgba(99, 102, 241, 0.25);
    color: var(--text);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Layout */
.bf-main {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
        var(--surface-2);
}

.dark .bf-main {
    background:
        radial-gradient(ellipse 70% 40% at 50% -10%, rgba(99, 102, 241, 0.12), transparent),
        #030712;
}

.app-main {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.glass-card,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s var(--ease-out), border-color 0.2s;
}

.card-elevated {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
}

.dark .glass-card,
.dark .card {
    background: rgba(12, 18, 34, 0.92);
    border-color: var(--border);
    backdrop-filter: blur(12px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dark .card-footer {
    background: rgba(30, 41, 59, 0.5);
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    color: #fff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: #cbd5e1;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-ghost:hover {
    color: var(--brand-600);
    background: var(--brand-50);
}

.dark .btn-ghost:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.btn-danger {
    color: #dc2626;
}

.btn-danger:hover {
    background: #fef2f2;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 10px;
}

/* Forms */
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    outline: none;
}

.form-input:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: #cbd5e1;
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.dark .data-table thead th {
    background: rgba(30, 41, 59, 0.6);
}

.data-table tbody td {
    padding: 1.0625rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.dark .data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge-paid { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-partial { background: #dbeafe; color: #1e40af; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-ordered { background: #e0e7ff; color: #3730a3; }

.dark .badge-paid { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.dark .badge-pending { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.dark .badge-partial { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.dark .badge-overdue { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.dark .badge-draft { background: rgba(100, 116, 139, 0.3); color: #cbd5e1; }

/* Page header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.bf-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-faint);
    margin-bottom: 0.5rem;
}

.bf-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.bf-breadcrumb a:hover { color: var(--brand-600); }

.bf-breadcrumb-sep { opacity: 0.4; user-select: none; }

.bf-breadcrumb-current {
    color: var(--brand-600);
    font-weight: 600;
}

.page-header .page-title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--text);
}

.page-header .subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    max-width: 40rem;
    line-height: 1.5;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.card-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.detail-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Toolbar / filters */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.toolbar-premium {
    padding: 1.125rem 1.5rem;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    gap: 0.625rem;
}

.toolbar-premium .form-input {
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.dark .toolbar {
    background: rgba(30, 41, 59, 0.4);
}

.dark .toolbar-premium {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(12, 18, 34, 0.8) 100%);
}

/* Settings tabs */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem;
    background: var(--surface-2);
    border-radius: 14px;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.settings-tab {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s;
}

.settings-tab:hover {
    color: var(--text);
}

.settings-tab.active {
    background: var(--surface);
    color: var(--brand-600);
    box-shadow: var(--shadow);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12), inset 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.dark .settings-tab.active {
    background: var(--surface);
    color: #a5b4fc;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
    animation: fade-in 0.25s ease;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-premium {
    padding: 4rem 2rem;
}

.empty-state-premium .empty-state-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.15);
}

.empty-state-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .empty-state-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.empty-state-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 24rem;
    margin: 0 auto;
}

.empty-state-action {
    margin-top: 1.25rem;
}

/* Stat icons (dashboard) */
.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.stat-icon-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.stat-icon-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon-violet { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* List rows (categories, etc.) */
.list-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row:hover {
    background: rgba(99, 102, 241, 0.04);
}

.list-row-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.list-row-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: right;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Table footer */
.data-table tfoot td {
    padding: 1rem 1.25rem;
    font-weight: 600;
    background: var(--surface-2);
    border-top: 2px solid var(--border);
}

.dark .data-table tfoot td {
    background: rgba(30, 41, 59, 0.5);
}

/* Form controls */
.form-input[type="file"] {
    padding: 0.5rem;
    font-size: 0.8125rem;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-600);
    border-radius: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Error page */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--surface-2);
}

.error-page-card {
    text-align: center;
    max-width: 28rem;
}

.error-page-code {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    background: linear-gradient(135deg, var(--brand-600), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.dark .alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ——— Premium shell: sidebar ——— */
#sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
}

.dark #sidebar {
    background: rgba(12, 18, 34, 0.98);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.25);
}

#sidebar .bf-sidebar-brand {
    height: var(--header-h);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

#sidebar .bf-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 14px;
    background: linear-gradient(145deg, #6366f1 0%, #4338ca 50%, #312e81 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
    flex-shrink: 0;
}

#sidebar .bf-brand-name {
    font-size: 0.9375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text);
}

#sidebar .bf-brand-tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--brand-600);
}

#sidebar .nav-section {
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    padding: 1.25rem 1rem 0.5rem;
}

#sidebar .nav-link {
    position: relative;
    margin: 0 0.5rem 2px;
    border-radius: 12px;
    font-weight: 500;
}

#sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(79, 70, 229, 0.08));
    color: var(--brand-700);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

#sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
    border-radius: 0 4px 4px 0;
}

.dark #sidebar .nav-link.active {
    color: #c7d2fe;
}

#sidebar .bf-sidebar-user {
    margin: 0.5rem;
    padding: 0.75rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    transition: all 0.2s var(--ease-out);
}

#sidebar .bf-sidebar-user:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.06);
}

/* ——— Premium shell: header ——— */
.bf-header {
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px) saturate(180%);
}

.dark .bf-header {
    background: rgba(12, 18, 34, 0.88);
}

.bf-header-search .form-input {
    background: var(--surface-2);
    border-color: transparent;
    border-radius: 12px;
    padding-left: 2.5rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bf-header-search .form-input:focus {
    background: var(--surface);
    border-color: var(--brand-500);
}

.bf-header-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    cursor: pointer;
}

.bf-header-btn:hover {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.dark .bf-header-btn:hover {
    background: rgba(99, 102, 241, 0.12);
}

/* Report hub */
.report-hub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) { .report-hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .report-hub-grid { grid-template-columns: 1fr; } }

.report-hub-card {
    display: block;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.report-hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-500), #8b5cf6);
    opacity: 0;
    transition: opacity 0.2s;
}

.report-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.25);
}

.report-hub-card:hover::before { opacity: 1; }

.report-hub-card .report-hub-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: transform 0.2s var(--ease-out);
}

.report-hub-card:hover .report-hub-icon {
    transform: scale(1.05);
}

.dark .report-hub-card .report-hub-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.report-hub-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.report-hub-card .report-hub-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.45;
}

.report-hub-card .report-hub-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-600);
}

/* Auth */
.auth-layout {
    min-height: 100vh;
    display: flex;
}

.auth-hero {
    display: none;
    width: 48%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 45%, #4338ca 100%);
}

@media (min-width: 1024px) { .auth-hero { display: flex; } }

.auth-hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 56px 56px;
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.auth-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--surface-2);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    box-shadow: var(--shadow-xl);
}

.auth-card h2 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-card .auth-sub {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 0.35rem 0 2rem;
}

/* Alerts */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.dark .alert-success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.dark .alert-error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* Link */
.link {
    color: var(--brand-600);
    font-weight: 500;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* Avatar */
.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fade-in 0.35s var(--ease-out); }

/* Toasts */
.bf-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-xl);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s var(--ease-out), opacity 0.35s;
    max-width: 22rem;
}

.bf-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.bf-toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.bf-toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.bf-toast-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Reports */
.report-stats {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
    .report-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .report-stats { grid-template-columns: repeat(4, 1fr); }
}
.report-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--brand-500);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.report-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.report-stat-indigo { border-top-color: #6366f1; }
.report-stat-emerald { border-top-color: #10b981; }
.report-stat-amber { border-top-color: #f59e0b; }
.report-stat-red { border-top-color: #ef4444; }
.report-stat-violet { border-top-color: #8b5cf6; }
.report-stat-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.report-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.375rem;
    letter-spacing: -0.02em;
    color: var(--text);
}
.report-stat-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.report-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    width: 100%;
}
.report-filter-group {
    min-width: 140px;
}
.report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 2px;
}
.report-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.report-empty .empty-state-icon {
    margin-bottom: 1rem;
}

/* Payment page */
.card-header-brand {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-bottom: none;
    color: #fff;
}
.card-header-brand h3 {
    color: #fff;
}
.amount-input-lg {
    padding: 0.875rem 1rem 0.875rem 2.5rem !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}
.amount-currency-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.125rem;
    pointer-events: none;
}
.amount-field-wrap {
    position: relative;
}
.method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}
.method-btn:hover {
    border-color: #a5b4fc;
}
.method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .method-grid { grid-template-columns: repeat(4, 1fr); }
}
.payment-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 1280px) {
    .payment-layout {
        grid-template-columns: 3fr 2fr;
    }
}
.panel-preview-box {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface-2);
}
.profit-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    margin-top: 1rem;
}
.profit-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #4f46e5);
}

/* Payment method cards */
.method-btn.active {
    border-color: #6366f1 !important;
    background: #eef2ff !important;
}
.dark .method-btn.active {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: #6366f1 !important;
}

/* Invoice form */
.invoice-form-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .invoice-form-layout {
        grid-template-columns: 1fr 300px;
        align-items: start;
    }
}
@media (min-width: 1280px) {
    .invoice-form-layout {
        grid-template-columns: 1fr 340px;
    }
}
.invoice-summary-panel {
    position: sticky;
    top: 5.5rem;
}
.invoice-lines-head {
    display: none;
    grid-template-columns: 5fr 1.25fr 1.25fr 1.5fr 1.25fr 2rem;
    gap: 0.75rem;
    padding: 0 0.75rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
@media (min-width: 768px) {
    .invoice-lines-head {
        display: grid;
    }
}
.invoice-line {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
}
@media (min-width: 768px) {
    .invoice-line {
        grid-template-columns: 5fr 1.25fr 1.25fr 1.5fr 1.25fr 2rem;
        align-items: end;
        gap: 0.75rem;
        padding: 0.75rem;
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .invoice-line:last-child {
        border-bottom: none;
    }
}
.invoice-line .form-label {
    margin-bottom: 0.25rem;
}
@media (min-width: 768px) {
    .invoice-line .form-label {
        display: none;
    }
}
.invoice-line-total {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: right;
    color: var(--text);
    padding-top: 0.5rem;
}
@media (min-width: 768px) {
    .invoice-line-total {
        padding-top: 0;
        align-self: center;
    }
}
.invoice-line-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 8px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s;
}
.invoice-line-remove:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}
.dark .invoice-line-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}
.summary-row dt {
    color: var(--text-muted);
}
.summary-row dd {
    font-weight: 600;
    margin: 0;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border);
}
.summary-total dt {
    font-size: 1.125rem;
    font-weight: 700;
}
.summary-total dd {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-600);
    margin: 0;
}
.dark .summary-total dd {
    color: #a5b4fc;
}

/* ——— Executive Dashboard ——— */
.app-main:has(.dashboard-exec) {
    max-width: 1520px;
}

.dashboard-exec {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dash-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 24px rgba(79, 70, 229, 0.12), 0 24px 48px rgba(15, 23, 42, 0.08);
}

.dash-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #4338ca 100%);
}

.dash-hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, black 0%, transparent 100%);
}

.dash-hero-inner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2rem 1.25rem;
}

.dash-hero-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(199, 210, 254, 0.9);
    margin-bottom: 0.5rem;
}

.dash-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.15;
}

.dash-hero-sub {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: rgba(226, 232, 240, 0.75);
}

.dash-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.dash-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dash-hero-btn-ghost {
    color: #e0e7ff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dash-hero-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.dash-hero-btn-primary {
    color: #312e81;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dash-hero-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    color: #312e81;
}

.dash-hero-metrics {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-hero-metric {
    padding: 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
}

.dash-hero-metric-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(199, 210, 254, 0.8);
}

.dash-hero-metric-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.dash-hero-metric-value small {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.6;
}

.dash-hero-metric-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 999px;
}

.dash-hero-metric-trend {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.dash-hero-metric-trend.up { color: #6ee7b7; }
.dash-hero-metric-trend.down { color: #fca5a5; }

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1280px) {
    .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .dash-kpi-grid { grid-template-columns: 1fr; }
    .dash-hero-metrics { grid-template-columns: 1fr; }
    .dash-hero-inner { padding: 1.5rem; }
    .dash-hero-metric { padding: 1rem 1.5rem; }
}

.dash-kpi {
    position: relative;
    padding: 1.35rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: dashKpiIn 0.5s ease backwards;
    animation-delay: var(--delay, 0ms);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@keyframes dashKpiIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.dash-kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.dash-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

.dash-kpi-emerald::before { background: linear-gradient(90deg, #10b981, #34d399); }
.dash-kpi-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dash-kpi-indigo::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.dash-kpi-violet::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.dash-kpi-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dash-kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.dash-kpi-emerald .dash-kpi-icon { background: linear-gradient(135deg, #059669, #10b981); }
.dash-kpi-amber .dash-kpi-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.dash-kpi-indigo .dash-kpi-icon { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.dash-kpi-violet .dash-kpi-icon { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

.dash-kpi-icon svg { width: 1.25rem; height: 1.25rem; }

.dash-kpi-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.dash-kpi-value {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.dash-kpi-meta {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-kpi-spark {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 2rem;
    opacity: 0.35;
}

.dash-kpi-spark span {
    width: 4px;
    border-radius: 2px;
    background: var(--brand-500);
}

.dash-quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .dash-quick { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .dash-quick { grid-template-columns: 1fr; }
}

.dash-quick-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.dash-quick-item:hover {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.dash-quick-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.dash-quick-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dash-quick-text strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-quick-text small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-analytics-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 1100px) {
    .dash-analytics-grid { grid-template-columns: 1fr; }
}

.dash-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dash-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.dash-panel-title {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dash-panel-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dash-panel-body {
    padding: 1.25rem 1.5rem;
}

.dash-panel-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.dash-panel-subhead h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dash-chart-wrap {
    padding: 0.5rem 1.25rem 1.5rem;
    height: 280px;
}

.dash-chart-legend {
    display: flex;
    gap: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dash-legend-dot.collected { background: #6366f1; }
.dash-legend-dot.invoiced { background: #94a3b8; }

.dash-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
}

.dash-link:hover { text-decoration: underline; }

.dash-ops-list {
    padding: 1.25rem 1.5rem;
}

.dash-ops-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.dash-ops-ring {
    --pct: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#6366f1 calc(var(--pct) * 1%), var(--border) 0);
    position: relative;
    flex-shrink: 0;
}

.dash-ops-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--surface);
}

.dash-ops-ring span {
    position: relative;
    z-index: 1;
    font-size: 0.875rem;
    font-weight: 700;
}

.dash-ops-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.dash-ops-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dash-ops-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.dash-ops-stat {
    text-align: center;
    padding: 0.875rem 0.5rem;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.dash-ops-stat.warn {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
}

.dash-ops-stat.danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.dash-ops-stat-val {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.dash-ops-stat-lbl {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dash-pill {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.dash-pill.warn {
    color: #b45309;
    background: rgba(245, 158, 11, 0.15);
}

.dash-stock-list {
    padding: 0.75rem 1.5rem 1.25rem;
}

.dash-stock-empty {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
}

.dash-stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.dash-stock-row:hover { color: var(--brand-600); }
.dash-stock-row:last-of-type { border-bottom: none; }

.dash-stock-name { font-weight: 500; }
.dash-stock-qty {
    font-size: 0.75rem;
    font-weight: 600;
    color: #d97706;
}

.dash-stock-link {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
}

.dash-bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 1100px) {
    .dash-bottom-grid { grid-template-columns: 1fr; }
}

.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.dash-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.dash-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.dash-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.dash-invoice-link {
    display: block;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
}

.dash-invoice-link:hover { text-decoration: underline; }

.dash-table-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dash-customer {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dash-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dash-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.dash-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 0.4375rem;
    top: 1.5rem;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.dash-timeline-icon {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.2rem;
    z-index: 1;
    box-shadow: 0 0 0 4px var(--surface);
}

.dash-timeline-icon-default { background: #6366f1; }
.dash-timeline-icon-auth { background: #8b5cf6; }
.dash-timeline-icon-create { background: #10b981; }
.dash-timeline-icon-delete { background: #ef4444; }

.dash-timeline-text {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.dash-timeline-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.dark .dash-kpi,
.dark .dash-panel,
.dark .dash-quick-item {
    background: rgba(15, 23, 42, 0.9);
}

.dark .dash-ops-ring::before {
    background: #0f172a;
}

/* Print */
@media print {
    aside, header, .no-print, #sidebar-backdrop { display: none !important; }
    main { padding: 0 !important; margin: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
