/* 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);
    --font-ar: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    --font-ar-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', monospace;
}

.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";
}

/* Arabic / RTL — professional typography */
html.rtl,
html.rtl body,
html.rtl .bf-app,
html.rtl .auth-body {
    font-family: var(--font-ar);
    line-height: 1.65;
    letter-spacing: 0;
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
}

html.rtl h1,
html.rtl h2,
html.rtl h3,
html.rtl h4,
html.rtl .card-title,
html.rtl .page-header h1,
html.rtl .bf-sidebar-brand span,
html.rtl .dash-pro-title,
html.rtl .dash-pro-toolbar-title,
html.rtl .rpt-hub-title {
    font-family: var(--font-ar);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
}

html.rtl .form-label,
html.rtl .form-input,
html.rtl .form-textarea,
html.rtl select,
html.rtl .btn-primary,
html.rtl .btn-secondary,
html.rtl .btn-ghost,
html.rtl .data-table,
html.rtl .bf-sidebar,
html.rtl .bf-header,
html.rtl .card,
html.rtl .page-header,
html.rtl .badge,
html.rtl .bf-toast,
html.rtl .settings-tab,
html.rtl .auth-card,
html.rtl .portal-header,
html.rtl .portal-main {
    font-family: inherit;
}

html.rtl .tracking-tight,
html.rtl .tracking-tighter,
html.rtl [class*="tracking-"] {
    letter-spacing: 0 !important;
}

html.rtl .auth-otp-input,
html.rtl code,
html.rtl .font-mono {
    font-family: var(--font-ar-mono);
    direction: ltr;
    unicode-bidi: embed;
}

html.rtl .data-table th {
    font-weight: 600;
    letter-spacing: 0;
}

html.rtl .bf-lang-btn {
    font-family: var(--font-ar);
    font-weight: 600;
}

.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-whatsapp {
    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, #25d366, #128c7e);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
    text-decoration: none;
}

.btn-whatsapp:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 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;
}

/* Inventory tables — fit date column inside card layout */
.inventory-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table-compact thead th,
.data-table-compact tbody td {
    padding: 0.75rem 0.65rem;
}

.data-table-compact .col-num {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.data-table-compact .col-date {
    width: 1%;
    white-space: nowrap;
    text-align: end;
    padding-right: 1rem;
    padding-left: 0.5rem;
}

.data-table-compact .col-type {
    width: 1%;
    white-space: nowrap;
}

.inventory-movement-table .col-product {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-movement-table .col-warehouse {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 1280px) {
    .inventory-movement-table {
        table-layout: fixed;
        width: 100%;
    }

    .inventory-movement-table .col-product {
        width: 22%;
    }

    .inventory-movement-table .col-warehouse {
        width: 16%;
    }

    .inventory-movement-table .col-type {
        width: 12%;
    }

    .inventory-movement-table .col-num {
        width: 8%;
    }

    .inventory-movement-table .col-date {
        width: 14%;
        min-width: 7.5rem;
    }
}

/* 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-action {
    opacity: 0;
    transition: opacity 0.15s;
}

.list-row:hover .list-row-action {
    opacity: 1;
}

.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-logo.bf-logo-img {
    object-fit: contain;
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.dark #sidebar .bf-logo.bf-logo-img {
    background: rgba(30, 41, 59, 0.8);
}

#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-pinned {
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.dark #sidebar .nav-pinned {
    border-bottom-color: rgba(51, 65, 85, 0.65);
}

#sidebar .nav-link-pinned {
    font-weight: 600;
}

#sidebar .nav-group {
    margin-bottom: 0.25rem;
}

#sidebar .nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 1rem);
    margin: 0.75rem 0.5rem 0.25rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

#sidebar .nav-group-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--brand-600);
}

#sidebar .nav-group.is-open .nav-group-toggle {
    color: var(--brand-600);
}

#sidebar .nav-group-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.2s var(--ease-out);
}

#sidebar .nav-group.is-open .nav-group-chevron {
    transform: rotate(180deg);
}

#sidebar .nav-group-items {
    display: none;
    overflow: hidden;
}

#sidebar .nav-group.is-open .nav-group-items {
    display: block;
}

#sidebar .nav-group-items .nav-link {
    padding-left: 2.25rem;
}

#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 — professional sign-in */
.auth-body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
    background: #f8fafc;
    background-image:
        radial-gradient(ellipse 100% 80% at 0% 0%, rgba(99, 102, 241, 0.07), transparent 50%),
        radial-gradient(ellipse 80% 60% at 100% 100%, rgba(139, 92, 246, 0.06), transparent 45%);
}

.dark .auth-body {
    background: #0f172a;
    background-image:
        radial-gradient(ellipse 100% 80% at 0% 0%, rgba(99, 102, 241, 0.12), transparent 50%),
        radial-gradient(ellipse 80% 60% at 100% 100%, rgba(79, 70, 229, 0.08), transparent 45%);
}

html.rtl .auth-body {
    font-family: var(--font-ar);
}

.auth-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.auth-hero {
    display: none;
    flex: 0 0 min(50%, 760px);
    width: min(50%, 760px);
    max-width: 760px;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    background: #0f172a;
}

@media (min-width: 1024px) {
    .auth-hero { display: flex; }
}

.auth-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.auth-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transform: scale(1.02);
}

.auth-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.72) 55%, rgba(30, 27, 75, 0.92) 100%),
        linear-gradient(135deg, rgba(67, 56, 202, 0.45) 0%, transparent 55%);
}

.auth-hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 3rem 3.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.auth-hero-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.auth-hero-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    padding: 6px;
    backdrop-filter: blur(8px);
}

.auth-hero-logo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.auth-hero-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(199, 210, 254, 0.9);
    margin-bottom: 0.25rem;
}

.auth-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-hero-lead {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: rgba(224, 231, 255, 0.88);
    max-width: 28rem;
    margin-bottom: 2.5rem;
}

.auth-hero-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.auth-hero-features li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.9375rem;
    color: rgba(238, 242, 255, 0.92);
}

.auth-hero-features li > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-hero-features li strong {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #fff;
}

.auth-hero-features li span {
    font-size: 0.8125rem;
    color: rgba(199, 210, 254, 0.8);
    line-height: 1.45;
}

.auth-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.auth-feature-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    opacity: 0.95;
}

.auth-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.auth-hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.auth-hero-stats strong {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-hero-stats span {
    font-size: 0.6875rem;
    color: rgba(199, 210, 254, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-hero-copy {
    position: relative;
    z-index: 1;
    padding: 1.25rem 3.25rem;
    font-size: 0.75rem;
    color: rgba(199, 210, 254, 0.55);
}

/* Mobile hero banner */
.auth-mobile-hero {
    position: relative;
    display: block;
    flex-shrink: 0;
    height: clamp(10rem, 32vw, 13.5rem);
    overflow: hidden;
    background: #0f172a;
}

@media (min-width: 1024px) {
    .auth-mobile-hero {
        display: none;
    }
}

.auth-mobile-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

.auth-mobile-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.82) 100%),
        linear-gradient(135deg, rgba(79, 70, 229, 0.35) 0%, transparent 60%);
}

.auth-mobile-hero-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 0.85rem;
    padding: max(0.85rem, env(safe-area-inset-top)) 1rem 1rem;
    color: #fff;
}

.auth-mobile-hero-logo,
.auth-mobile-hero-logo-fallback {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 0.85rem;
}

.auth-mobile-hero-logo {
    object-fit: contain;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.35rem;
    backdrop-filter: blur(8px);
}

.auth-mobile-hero-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.auth-mobile-hero-eyebrow {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(199, 210, 254, 0.9);
    margin-bottom: 0.15rem;
}

.auth-mobile-hero-title {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.98) 100%);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dark .auth-panel {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 1) 100%);
}

.auth-panel-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: max(0.65rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
}

/* Mobile header brand (hidden when hero banner shows) */
.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

@media (min-width: 1024px) {
    .auth-panel-top {
        justify-content: flex-end;
        max-width: 32rem;
        padding-top: 1.25rem;
    }

    .auth-mobile-brand {
        display: none !important;
    }
}

.auth-panel-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

html.rtl .auth-panel-tools {
    margin-left: 0;
    margin-right: auto;
}

.auth-mobile-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
}

.auth-mobile-logo-fallback {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-mobile-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-theme-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-theme-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}

.auth-panel-inner {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 0.5rem max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.auth-panel-inner > .alert {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.auth-panel-inner > .auth-card,
.auth-panel-inner > .auth-card-pro {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .auth-panel-inner {
        padding: 1.5rem 1.5rem 2rem;
        max-width: 32rem;
    }

    .auth-panel-inner > .alert {
        margin-bottom: 1.25rem;
    }

    .auth-card-pro {
        padding: 2.25rem 2rem 2rem;
    }
}

.auth-panel-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

.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-pro {
    width: 100%;
    max-width: 100%;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 1.25rem;
    animation: auth-card-in 0.5s ease-out;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.03),
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 16px 40px -12px rgba(15, 23, 42, 0.12),
        0 32px 64px -24px rgba(79, 70, 229, 0.14);
}

.dark .auth-card-pro {
    background: rgba(30, 41, 59, 0.88);
    backdrop-filter: blur(16px);
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.08),
        0 32px 64px -16px rgba(0, 0, 0, 0.5);
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-card-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.auth-card-logo-fallback {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.45);
}

/* Desktop: logo in hero only — hide card logo */
@media (min-width: 1024px) {
    .auth-card-brand { display: none; }
    .auth-card-head { margin-top: 0; }
}

/* Mobile/tablet: logo in hero banner — hide duplicate in card */
@media (max-width: 1023px) {
    .auth-card-brand { display: none; }
    .auth-card-head {
        margin-bottom: 1.25rem;
        text-align: center;
    }
    .auth-card .auth-sub {
        margin-left: auto;
        margin-right: auto;
        max-width: 22rem;
    }
}

.auth-card-head {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-600);
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    margin-bottom: 0.875rem;
}

.dark .auth-badge {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(129, 140, 248, 0.25);
    color: var(--brand-300);
}

.auth-badge-amber {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}

.dark .auth-badge-amber {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

.auth-card h2 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.25;
    color: var(--text);
}

.auth-card .auth-sub {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0.5rem auto 0;
    max-width: 20rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field {
    margin-bottom: 0 !important;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}

.auth-input-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.auth-input {
    padding-left: 2.75rem !important;
    padding-top: 0.8125rem !important;
    padding-bottom: 0.8125rem !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    border-color: var(--border) !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 3rem;
    width: 100%;
}

.auth-input:focus {
    border-color: var(--brand-400) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

html.rtl .auth-input {
    padding-left: 0.875rem !important;
    padding-right: 2.75rem !important;
}

html.rtl .auth-input-icon {
    left: auto;
    right: 0.875rem;
}

html.rtl .auth-input-password {
    padding-right: 2.75rem !important;
    padding-left: 2.75rem !important;
}

html.rtl .auth-password-toggle {
    right: auto;
    left: 0.5rem;
}

.auth-input-password {
    padding-right: 2.75rem !important;
}

.auth-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.375rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
}

.auth-password-toggle:hover {
    color: var(--text);
    background: var(--surface-2);
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: -0.25rem;
}

.auth-remember span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-link-forgot {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
}

.auth-link-forgot:hover {
    color: var(--brand-700);
    text-decoration: underline;
}

.auth-link-back {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.auth-link-back:hover {
    color: var(--brand-600);
}

.auth-submit {
    padding-top: 0.9375rem !important;
    padding-bottom: 0.9375rem !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    margin-top: 0.25rem;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700)) !important;
    border: none !important;
    box-shadow: 0 4px 14px -2px rgba(79, 70, 229, 0.45);
    transition: transform 0.15s, box-shadow 0.15s;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.5);
}

.auth-form-footer {
    text-align: center;
    margin: 0;
}

.auth-otp-wrap {
    margin-top: 0.25rem;
}

.auth-otp-input {
    text-align: center;
    font-size: 1.75rem !important;
    letter-spacing: 0.35em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 1rem !important;
    border-radius: 12px !important;
}

.auth-demo-card {
    padding: 1rem 1.125rem 1.125rem;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
}

.auth-demo-body {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

.auth-demo-icon {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .auth-demo-icon {
    background: rgba(79, 70, 229, 0.2);
    color: var(--brand-300);
}

.auth-demo-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.auth-demo-text {
    min-width: 0;
    flex: 1;
}

.auth-demo-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.auth-demo-creds-line {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.auth-demo-creds-line code {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.auth-demo-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--brand-200);
    background: var(--surface);
    color: var(--brand-700);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.dark .auth-demo-btn {
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(79, 70, 229, 0.12);
    color: var(--brand-300);
}

.auth-demo-btn:hover {
    background: var(--brand-50);
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.dark .auth-demo-btn:hover {
    background: rgba(79, 70, 229, 0.22);
}

.auth-demo-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin: 0.625rem 0 0;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.alert span {
    flex: 1;
    min-width: 0;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.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;
    line-height: 1;
}
.amount-currency-prefix .bf-aed-symbol {
    font-size: 1.35rem;
    margin-inline-end: 0;
}
.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: minmax(0, 5fr) minmax(4.75rem, 1.35fr) minmax(5.25rem, 1.35fr) minmax(0, 1.5fr) minmax(5rem, 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: minmax(0, 5fr) minmax(4.75rem, 1.35fr) minmax(5.25rem, 1.35fr) minmax(0, 1.5fr) minmax(5rem, 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);
}

@media (min-width: 768px) {
    .invoice-line .line-field-qty,
    .invoice-line .line-field-price {
        min-width: 0;
    }

    .invoice-line .item-qty,
    .invoice-line .item-price {
        width: 100%;
        min-width: 0;
        padding-inline: 0.5rem;
        text-align: center;
    }

    .invoice-line .item-qty {
        min-width: 4.75rem;
    }

    .invoice-line .item-price {
        min-width: 5.25rem;
    }
}

html.rtl .invoice-line .item-qty,
html.rtl .invoice-line .item-price {
    text-align: center;
}

/* Purchase order lines — 5 columns (no line-total slot) */
@media (min-width: 768px) {
    .po-lines-head,
    #po-line-items > .invoice-line.po-line {
        grid-template-columns:
            minmax(0, 2.2fr)
            minmax(5.5rem, 5.5rem)
            minmax(6.5rem, 6.5rem)
            minmax(0, 2fr)
            2rem;
        column-gap: 0.75rem;
    }
    .po-line .line-field-qty,
    .po-line .line-field-price {
        min-width: 0;
    }
    .po-line-qty,
    .po-line-price {
        width: 100%;
        min-width: 0;
        padding-inline: 0.5rem;
        text-align: center;
    }
    .po-line-qty {
        min-width: 5.5rem;
    }
    .po-line-price {
        min-width: 6.5rem;
    }
}
html.rtl .po-line-qty,
html.rtl .po-line-price {
    text-align: center;
}

/* Offline POS */
.pos-offline-banner {
    border-radius: var(--radius-lg);
    border: 1px solid #fcd34d;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}
.dark .pos-offline-banner {
    border-color: #b45309;
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.2) 0%, rgba(146, 64, 14, 0.15) 100%);
    color: #fcd34d;
}
.pos-offline-banner.is-offline .pos-offline-icon {
    color: #f59e0b;
    animation: pos-pulse 1.5s ease infinite;
}
.pos-offline-banner.has-pending:not(.is-offline) {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
}
.pos-offline-banner-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
}
.pos-offline-icon {
    font-size: 0.75rem;
    line-height: 1;
}
.pos-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
@keyframes pos-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}
.summary-row dt {
    color: var(--text-muted);
}
.summary-row dd {
    font-weight: 600;
    margin: 0;
}
.bf-money {
    white-space: nowrap;
}
.bf-money .bf-money-amount {
    margin-inline-start: 0.2em;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    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;
}

/* ——— Report print ——— */
.report-print-header {
    display: none;
}

.report-print-footnote {
    display: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 1.5rem 1rem;
}

.report-pl-summary {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.report-pl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.report-pl-row dt {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.report-pl-row dd {
    font-weight: 600;
    margin: 0;
}

.report-pl-total {
    background: var(--surface-2);
}

.report-pl-total dt {
    font-weight: 700;
    color: var(--text);
}

.report-pl-total dd {
    font-size: 1.25rem;
    font-weight: 800;
}

.report-pl-margin dd {
    color: var(--brand-600);
}

@media print {
    @page {
        size: A4;
        margin: 14mm 12mm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }

    #app,
    main,
    .app-main,
    .bf-main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    aside,
    #sidebar,
    #sidebar-backdrop,
    .bf-header,
    header,
    .page-header,
    .no-print,
    .toolbar,
    .alert,
    #toast-container,
    #loading-overlay,
    .empty-state-action,
    a.link {
        display: none !important;
    }

    .report-print-header {
        display: block !important;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #0f172a;
    }

    .report-print-header-inner {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
    }

    .report-print-company {
        font-size: 9pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #64748b;
        margin: 0 0 0.25rem;
    }

    .report-print-title {
        font-size: 18pt;
        font-weight: 800;
        margin: 0;
        color: #0f172a;
    }

    .report-print-period {
        font-size: 10pt;
        color: #475569;
        margin: 0.35rem 0 0;
    }

    .report-print-meta {
        text-align: right;
        font-size: 9pt;
        color: #64748b;
    }

    .report-print-meta p {
        margin: 0;
    }

    .report-print-date {
        font-weight: 600;
        color: #0f172a;
    }

    .report-stats {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.25rem !important;
        page-break-inside: avoid;
    }

    .report-stat {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        padding: 0.75rem 1rem !important;
        break-inside: avoid;
    }

    .report-stat-label {
        color: #64748b !important;
    }

    .report-stat-value {
        color: #0f172a !important;
        font-size: 14pt !important;
    }

    .report-print-area,
    .card {
        box-shadow: none !important;
        border: none !important;
        background: #fff !important;
    }

    .report-print-table,
    .data-table {
        width: 100% !important;
        font-size: 9pt !important;
        border-collapse: collapse !important;
    }

    .report-print-table thead th,
    .data-table thead th {
        background: #f1f5f9 !important;
        color: #334155 !important;
        border: 1px solid #cbd5e1 !important;
        padding: 0.5rem 0.65rem !important;
    }

    .report-print-table tbody td,
    .report-print-table tfoot td,
    .data-table tbody td,
    .data-table tfoot td {
        border: 1px solid #e2e8f0 !important;
        padding: 0.45rem 0.65rem !important;
        color: #0f172a !important;
    }

    .report-print-table tfoot td,
    .data-table tfoot td {
        background: #f8fafc !important;
        font-weight: 700 !important;
    }

    .badge {
        border: 1px solid #cbd5e1 !important;
        background: #f8fafc !important;
        color: #334155 !important;
    }

    .report-print-footnote {
        display: block !important;
    }

    .report-pl-summary {
        border: 1px solid #cbd5e1 !important;
    }

    .report-pl-row {
        border-color: #e2e8f0 !important;
    }

    .table-wrap {
        overflow: visible !important;
    }

    tr {
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }
}

/* Product image upload */
.product-image-upload {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-image-current {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.product-image-preview {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.product-image-dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 16px;
    background: var(--surface-2);
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    min-height: 160px;
}

.product-image-dropzone.dragover {
    border-color: var(--brand-500);
    background: rgba(99, 102, 241, 0.06);
}

.product-image-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.product-image-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
    pointer-events: none;
}

.product-image-dropzone-text {
    margin: 0.75rem 0 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.product-image-dropzone-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-faint);
}

.product-image-preview-new {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    padding: 1rem;
}

.product-image-preview-new.hidden {
    display: none;
}

.product-image-remove {
    font-size: 0.8125rem;
}

.product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.product-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 1.125rem;
}

.product-thumb-md {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.product-thumb-lg,
.product-thumb-letter.product-thumb-lg {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 0;
    border: none;
    display: block;
}

.product-thumb-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--brand-100), var(--brand-200));
    color: var(--brand-700);
    font-weight: 700;
    font-size: 1.5rem;
}

.dark .product-thumb-letter {
    background: linear-gradient(145deg, var(--brand-900), var(--brand-800));
    color: var(--brand-200);
}

.product-thumb-md.product-thumb-letter {
    font-size: 1.125rem;
}

.product-thumb-lg.product-thumb-letter {
    height: 140px;
    font-size: 3rem;
}

.products-view-toggle .active {
    background: var(--brand-100);
    color: var(--brand-700);
}

.dark .products-view-toggle .active {
    background: rgba(79, 70, 229, 0.25);
    color: var(--brand-300);
}

.products-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.product-catalog-card {
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-catalog-card:hover {
    transform: translateY(-2px);
    color: inherit;
}

.product-catalog-image-wrap {
    position: relative;
    background: var(--surface-2);
    overflow: hidden;
}

.product-catalog-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
}

.product-catalog-body {
    padding: 0.75rem 1rem 1rem;
}

.product-catalog-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-catalog-sku {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
    margin-top: 0.25rem;
}

.product-catalog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.pos-categories-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
}
.pos-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: min-content;
}
.pos-cat-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pos-cat-btn:hover {
    border-color: var(--brand-400, #818cf8);
    color: var(--brand-600, #4f46e5);
}
.pos-cat-btn.active {
    background: var(--brand-600, #4f46e5);
    border-color: var(--brand-600, #4f46e5);
    color: #fff;
}
.dark .pos-cat-btn {
    background: var(--surface-elevated, #1e293b);
    border-color: #334155;
}
.dark .pos-cat-btn.active {
    background: #6366f1;
    border-color: #6366f1;
}
.pos-product-cat {
    color: var(--brand-500, #6366f1);
    font-weight: 500;
}

.pos-product-image {
    aspect-ratio: 1;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pos-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-product-letter {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-500);
    opacity: 0.5;
}

.pos-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface);
}

.pos-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pos-qty-btn:hover:not(:disabled) {
    background: var(--brand-500);
    color: #fff;
}

.pos-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pos-qty-input {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.25rem 0.125rem;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: 0;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
    box-sizing: border-box;
}

.pos-qty-input::-webkit-outer-spin-button,
.pos-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-qty-input:focus {
    outline: none;
    box-shadow: none;
}

/* General print (invoices, etc.) */
@media print {
    .no-print { display: none !important; }
}

/* Loading overlay — avoid Tailwind hidden+flex conflict */
.bf-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
}
.bf-loading-overlay.is-visible {
    display: flex;
}
.bf-loading-overlay.hidden {
    display: none !important;
}

/* Command palette */
.bf-cmd {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 1rem 1rem;
}
.bf-cmd.hidden { display: none !important; }
.bf-cmd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}
.bf-cmd-panel {
    position: relative;
    width: 100%;
    max-width: 32rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: cmdIn 0.2s var(--ease-out);
}
@keyframes cmdIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.bf-cmd-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.bf-cmd-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text);
    outline: none;
}
.bf-cmd-kbd, .bf-header-kbd {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: inherit;
}
.bf-cmd-results {
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.5rem;
}
.bf-cmd-group {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 0.5rem 0.75rem 0.25rem;
}
.bf-cmd-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s;
}
.bf-cmd-item:hover, .bf-cmd-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--brand-600);
}
.bf-cmd-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }
.bf-cmd-footer {
    display: flex;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-faint);
}
.bf-cmd-footer kbd { margin: 0 0.15rem; }

/* Quick create menu */
.bf-quick-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    overflow: hidden;
}
.bf-quick-item {
    display: block;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s;
}
.bf-quick-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--brand-600);
}

.bf-header-btn-primary {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700)) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.bf-header-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

/* Sidebar nav badges */
.nav-badge {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
}
.nav-badge.hidden { display: none !important; }

.badge-received { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-cancelled { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.badge-draft { background: rgba(148, 163, 184, 0.2); color: #64748b; }
.badge-ordered { background: rgba(99, 102, 241, 0.15); color: #4f46e5; }

/* ═══════════════════════════════════════════════════════════
   Dashboard Pro — Detailed executive dashboard
   ═══════════════════════════════════════════════════════════ */
.dashboard-pro {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2.5rem;
    max-width: 1480px;
    margin-inline: auto;
}

.app-main:has(.dashboard-pro) {
    max-width: 1520px;
    padding-top: 0.25rem;
}

.bf-main:has(.dashboard-pro) {
    background:
        radial-gradient(ellipse 90% 60% at 50% -30%, rgba(99, 102, 241, 0.07), transparent),
        var(--surface-2);
}

.dark .bf-main:has(.dashboard-pro) {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.14), transparent),
        #030712;
}

/* Dashboard toolbar & customize */
.dash-pro-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.5rem;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}
.dash-pro-toolbar-eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-600);
    margin: 0 0 0.2rem;
}
.dash-pro-toolbar-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0;
}
.dash-pro-toolbar-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    max-width: 36rem;
    line-height: 1.45;
}
.dash-pro-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.dash-pro-toolbar-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.45rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.dash-pro-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: dashLivePulse 2s ease-in-out infinite;
}
@keyframes dashLivePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.dash-pro-customize-btn,
.dash-pro-toolbar-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.dash-pro-canvas {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.dash-widget { transition: opacity 0.2s; }

.dash-customize-drawer { position: fixed; inset: 0; z-index: 80; }
.dash-customize-drawer.hidden { display: none !important; }
.dash-customize-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}
.dash-customize-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(24rem, 100vw);
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 40px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    animation: dashDrawerIn 0.25s ease-out;
}
html.rtl .dash-customize-panel {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 40px rgba(15, 23, 42, 0.15);
    animation-name: dashDrawerInRtl;
}
@keyframes dashDrawerIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes dashDrawerInRtl {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
.dash-customize-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}
.dash-customize-head h3 {
    font-size: 1.0625rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}
.dash-customize-head p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}
.dash-customize-close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--surface-2);
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}
.dash-customize-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.dash-customize-section { margin-bottom: 1.5rem; }
.dash-customize-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.35rem;
}
.dash-customize-help {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin: 0 0 0.75rem;
}
.dash-customize-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dash-customize-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    cursor: grab;
}
.dash-customize-item.is-dragging { opacity: 0.5; }
.dash-customize-item.is-drop-target { border-color: var(--brand-400); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }
.dash-customize-drag { color: var(--text-faint); font-size: 0.75rem; user-select: none; }
.dash-customize-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.dash-customize-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.dash-customize-item-text strong {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}
.dash-customize-item-text span {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.dash-customize-toggle { flex-shrink: 0; cursor: pointer; }
.dash-customize-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.dash-customize-switch {
    display: block;
    width: 2.5rem;
    height: 1.375rem;
    border-radius: 99px;
    background: var(--border);
    position: relative;
    transition: background 0.2s;
}
.dash-customize-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.dash-customize-toggle input:checked + .dash-customize-switch {
    background: var(--brand-600);
}
.dash-customize-toggle input:checked + .dash-customize-switch::after {
    transform: translateX(1.125rem);
}
.dash-customize-kpis {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.dash-customize-kpi-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--surface-2);
}
.dash-customize-kpi-label:has(input:checked) {
    border-color: var(--brand-400);
    background: rgba(99, 102, 241, 0.08);
    color: var(--brand-700);
}
.dash-customize-foot {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}
.dash-customize-foot .btn-primary { flex: 1; }

.dash-pro-hero {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px -12px rgba(49, 46, 129, 0.45);
}
.dash-pro-hero-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem 0;
}
.dash-pro-hero-topbar .dash-pro-toolbar-live {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
}
.dash-pro-hero-customize {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.15s, transform 0.15s;
}
.dash-pro-hero-customize:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}
.dash-pro-action-strip {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}
.dash-pro-action-strip-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.65);
    margin-right: 0.25rem;
}
.dash-pro-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.15s, background 0.15s;
}
.dash-pro-action-chip:hover { transform: translateY(-1px); }
.dash-pro-action-chip-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.22);
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.dash-pro-action-chip-warn {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.35);
}
.dash-pro-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, #1e1b4b 0%, #3730a3 35%, #4f46e5 55%, #6366f1 78%, #7c3aed 100%);
}
.dark .dash-pro-hero-bg {
    background: linear-gradient(125deg, #020617 0%, #0f172a 30%, #1e1b4b 60%, #312e81 100%);
}
.dash-pro-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 45%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 40%),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: auto, auto, 24px 24px, 24px 24px;
}
.dash-pro-hero-content {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 0.75rem 1.75rem 1.25rem;
    color: #fff;
}
.dash-pro-hero-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-pro-avatar {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}
.dash-pro-eyebrow { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.8; margin: 0; }
.dash-pro-title { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin: 0.15rem 0 0; }
.dash-pro-sub { font-size: 0.875rem; opacity: 0.82; margin: 0.35rem 0 0; }
.dash-pro-hero-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.dash-pro-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.dash-pro-btn .dash-icon { width: 1.1rem; height: 1.1rem; }
.dash-pro-btn-ghost { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.22); backdrop-filter: blur(6px); }
.dash-pro-btn-ghost:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.dash-pro-btn-primary { background: #fff; color: #3730a3; box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.dash-pro-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
.dash-pro-btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; background: var(--brand-600); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600; }

.dash-pro-hero-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.dash-pro-hero-stat {
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(12px);
    padding: 1rem 1.15rem;
    color: #fff;
    min-width: 0;
}
.dash-pro-hero-stat-health {
    display: flex;
    align-items: center;
    gap: 1rem;
    grid-column: span 1;
}
.dash-pro-stat-label { display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; opacity: 0.72; margin-bottom: 0.3rem; }
.dash-pro-stat-value { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.dash-pro-stat-warn { color: #fde68a; }
.dash-pro-stat-meta { display: block; font-size: 0.68rem; opacity: 0.68; margin-top: 0.2rem; }
.dash-pro-trend { font-size: 0.68rem; font-weight: 600; margin-top: 0.25rem; display: block; }
.dash-pro-trend.up { color: #6ee7b7; }
.dash-pro-trend.down { color: #fca5a5; }
.dash-pro-health-ring {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
}
.dash-pro-health-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.dash-pro-health-track {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 2.8;
}
.dash-pro-health-fill {
    fill: none;
    stroke: #6ee7b7;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--health, 0));
    transition: stroke-dashoffset 0.6s ease;
}
.dash-pro-health-excellent .dash-pro-health-fill { stroke: #6ee7b7; }
.dash-pro-health-good .dash-pro-health-fill { stroke: #93c5fd; }
.dash-pro-health-fair .dash-pro-health-fill { stroke: #fcd34d; }
.dash-pro-health-low .dash-pro-health-fill { stroke: #fca5a5; }
.dash-pro-health-ring .dash-pro-health-score {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
}
.dash-pro-health-badge {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    background: rgba(255,255,255,0.14);
    border-radius: 6px;
}

.dash-pro-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.dash-pro-section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin: 0; }
.dash-pro-section-date { font-size: 0.75rem; font-weight: 600; color: var(--text-faint); }
.dash-pro-today-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 1200px) {
    .dash-pro-today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .dash-pro-today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-pro-mini-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dash-pro-mini-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-200);
}
.dash-pro-mini-link:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}
.dash-pro-mini {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem 1rem 1.1rem;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.dash-pro-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-500);
    opacity: 0.85;
}
.dash-pro-mini-indigo::before { background: #6366f1; }
.dash-pro-mini-emerald::before { background: #10b981; }
.dash-pro-mini-sky::before { background: #0ea5e9; }
.dash-pro-mini-violet::before { background: #8b5cf6; }
.dash-pro-mini-warn::before { background: #f59e0b; }
.dash-pro-mini-warn { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.04); }
.dash-pro-mini-danger::before { background: #ef4444; }
.dash-pro-mini-danger { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.04); }
.dash-pro-mini-icon {
    display: flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--brand-600);
    margin-bottom: 0.5rem;
}
.dash-pro-mini-icon .dash-icon { width: 1.1rem; height: 1.1rem; }
.dash-pro-mini-val { display: block; font-size: 1.2rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.dash-pro-mini-lbl { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.15rem; font-weight: 500; line-height: 1.35; }

.dash-pro-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 0.85rem;
}
.dash-pro-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1.2rem 1.25rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}
.dash-pro-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-500);
}
.dash-pro-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.12);
    border-color: var(--brand-200);
}
.dash-pro-kpi:hover .dash-pro-kpi-arrow { opacity: 1; transform: translateX(2px); }
.dash-pro-kpi-emerald::before { background: #10b981; }
.dash-pro-kpi-amber::before { background: #f59e0b; }
.dash-pro-kpi-indigo::before { background: #6366f1; }
.dash-pro-kpi-violet::before { background: #8b5cf6; }
.dash-pro-kpi-sky::before { background: #0ea5e9; }
.dash-pro-kpi-rose::before { background: #f43f5e; }
.dash-pro-kpi-teal::before { background: #14b8a6; }
.dash-pro-kpi-slate::before { background: #64748b; }
.dash-pro-kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.dash-pro-kpi-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--brand-600);
}
.dash-pro-kpi-emerald .dash-pro-kpi-icon { color: #059669; background: rgba(16,185,129,0.1); }
.dash-pro-kpi-amber .dash-pro-kpi-icon { color: #d97706; background: rgba(245,158,11,0.1); }
.dash-pro-kpi-indigo .dash-pro-kpi-icon { color: #4f46e5; background: rgba(99,102,241,0.1); }
.dash-pro-kpi-violet .dash-pro-kpi-icon { color: #7c3aed; background: rgba(139,92,246,0.1); }
.dash-pro-kpi-sky .dash-pro-kpi-icon { color: #0284c7; background: rgba(14,165,233,0.1); }
.dash-pro-kpi-rose .dash-pro-kpi-icon { color: #e11d48; background: rgba(244,63,94,0.1); }
.dash-pro-kpi-teal .dash-pro-kpi-icon { color: #0d9488; background: rgba(20,184,166,0.1); }
.dash-pro-kpi-slate .dash-pro-kpi-icon { color: #475569; background: rgba(100,116,139,0.12); }
.dash-pro-kpi-icon .dash-icon { width: 1.15rem; height: 1.15rem; }
.dash-pro-kpi-spark {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 1.75rem;
}
.dash-pro-kpi-spark i {
    display: block;
    width: 4px;
    min-height: 4px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(180deg, #6366f1, #a5b4fc);
    opacity: 0.85;
}
.dash-pro-kpi-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.dash-pro-kpi-value { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1.15; }
.dash-pro-kpi-detail { font-size: 0.72rem; color: var(--text-faint); line-height: 1.4; padding-right: 1rem; }
.dash-pro-kpi-arrow {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-faint);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}
html.rtl .dash-pro-kpi-arrow { right: auto; left: 1rem; }
html.rtl .dash-pro-kpi:hover .dash-pro-kpi-arrow { transform: translateX(-2px); }
.dash-icon { flex-shrink: 0; }

.dash-pro-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.dash-pro-charts-3 { grid-template-columns: repeat(3, 1fr); }
.dash-pro-charts-2x2 { grid-template-columns: repeat(2, 1fr); }
.dash-pro-panel-empty {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}
@media (max-width: 1100px) {
    .dash-pro-charts, .dash-pro-charts-3, .dash-pro-charts-2x2 { grid-template-columns: 1fr; }
}
.dash-pro-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.dash-pro-panel:hover { box-shadow: var(--shadow); }
.dash-pro-panel-lg { min-height: 340px; }
.dash-pro-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.5rem;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.dash-pro-panel-head h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.dash-pro-panel-head p { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.dash-pro-link { font-size: 0.8rem; font-weight: 600; color: var(--brand-600); text-decoration: none; }
.dash-pro-link:hover { text-decoration: underline; }
.dash-pro-legend { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-muted); }
.dash-pro-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; vertical-align: middle; }
.dash-pro-legend .dot.indigo { background: #6366f1; }
.dash-pro-legend .dot.slate { background: #94a3b8; }
.dash-pro-chart-h { height: 240px; padding: 1rem 1.25rem 1.25rem; }
.dash-pro-chart-sm { height: 180px; }

.dash-pro-status-list { list-style: none; padding: 0 1.25rem 1rem; margin: 0; }
.dash-pro-status-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-subtle);
}
.dash-pro-status-list li:last-child { border-bottom: none; }
.dash-pro-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-pro-status-list .text-muted { color: var(--text-muted); font-size: 0.75rem; }

.dash-pro-dl { padding: 0.5rem 1.25rem 1.25rem; }
.dash-pro-dl div {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
}
.dash-pro-dl div:last-child { border-bottom: none; }
.dash-pro-dl dt { color: var(--text-muted); font-weight: 500; }
.dash-pro-dl dd { font-weight: 700; color: var(--text); margin: 0; }
.dash-pro-dl .text-amber { color: #d97706; }
.dash-pro-dl .text-red { color: #dc2626; }
.dash-pro-dl .text-emerald { color: #059669; }

.dash-pro-alert {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.dash-pro-alert-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    flex-wrap: wrap;
}
.dash-pro-alert-icon { font-size: 1.5rem; }
.dash-pro-alert-head h3 { font-size: 1rem; font-weight: 700; color: #b91c1c; }
.dark .dash-pro-alert-head h3 { color: #fca5a5; }
.dash-pro-alert-head p { font-size: 0.8rem; color: var(--text-muted); }
.dash-pro-alert-head .dash-pro-btn-ghost { margin-left: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.dash-pro-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-pro-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dash-pro-panel-span-2 { grid-column: span 2; }
@media (max-width: 1024px) {
    .dash-pro-grid-2, .dash-pro-grid-3 { grid-template-columns: 1fr; }
    .dash-pro-panel-span-2 { grid-column: span 1; }
}

.dash-pro-table-wrap { overflow-x: auto; }
.dash-pro-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.dash-pro-table th {
    text-align: left;
    padding: 0.65rem 1.25rem;
    font-size: 0.65rem;
    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-pro-table td { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.dash-pro-table tr:last-child td { border-bottom: none; }
.dash-pro-table tr:hover td { background: var(--surface-2); }

.dash-pro-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}
.dash-pro-pill.danger { background: rgba(239,68,68,0.15); color: #dc2626; }
.dash-pro-pill.warn { background: rgba(245,158,11,0.15); color: #d97706; }

.dash-pro-rank-list, .dash-pro-stock-list, .dash-pro-po-list { list-style: none; padding: 0 1.25rem 1.25rem; margin: 0; }
.dash-pro-rank-list li, .dash-pro-po-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.dash-pro-rank-list li:last-child, .dash-pro-po-list li:last-child { border-bottom: none; }
.dash-pro-rank {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-600);
    flex-shrink: 0;
}
.dash-pro-rank-body { flex: 1; min-width: 0; }
.dash-pro-rank-name { display: block; font-weight: 600; font-size: 0.875rem; color: var(--text); text-decoration: none; }
.dash-pro-rank-name:hover { color: var(--brand-600); }
.dash-pro-rank-meta { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.dash-pro-rank-val { font-weight: 700; font-size: 0.875rem; color: var(--text); white-space: nowrap; }

.dash-pro-stock-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
}
.dash-pro-stock-list a { color: var(--text); text-decoration: none; font-weight: 500; }
.dash-pro-stock-list a:hover { color: var(--brand-600); }

.dash-pro-po-list { font-size: 0.8125rem; }
.dash-pro-po-list a { color: var(--brand-600); text-decoration: none; }
.dash-pro-po-list .text-muted { flex: 1; }

.dash-pro-empty { padding: 1.5rem 1.25rem; font-size: 0.875rem; color: var(--text-muted); text-align: center; }
.dash-pro-empty.success { color: #059669; }

.dash-pro-timeline { list-style: none; padding: 0 1.25rem 1.25rem; margin: 0; max-height: 360px; overflow-y: auto; }
.dash-pro-timeline li {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.dash-pro-timeline li:last-child { border-bottom: none; }
.dash-pro-tl-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
    background: var(--brand-500);
}
.dash-pro-tl-auth { background: #8b5cf6; }
.dash-pro-tl-create { background: #10b981; }
.dash-pro-tl-delete { background: #ef4444; }
.dash-pro-timeline p { font-size: 0.8125rem; font-weight: 500; color: var(--text); margin: 0; }
.dash-pro-timeline span { font-size: 0.7rem; color: var(--text-muted); }

.dash-pro-today,
.dash-pro-quick {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-sm);
}
.dash-pro-quick-head { margin-bottom: 1rem; }
.dash-pro-quick-head h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.2rem;
    letter-spacing: -0.02em;
}
.dash-pro-quick-head p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}
.dash-pro-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.75rem;
}
.dash-pro-quick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 1rem 0.65rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: center;
}
.dash-pro-quick-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-200);
}
.dash-pro-quick-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dash-pro-quick-icon .dash-icon { width: 1.25rem; height: 1.25rem; }
.dash-pro-quick-icon-indigo { background: rgba(99,102,241,0.12); color: #4f46e5; }
.dash-pro-quick-icon-emerald { background: rgba(16,185,129,0.12); color: #059669; }
.dash-pro-quick-icon-violet { background: rgba(139,92,246,0.12); color: #7c3aed; }
.dash-pro-quick-icon-sky { background: rgba(14,165,233,0.12); color: #0284c7; }
.dash-pro-quick-icon-amber { background: rgba(245,158,11,0.12); color: #d97706; }
.dash-pro-quick-icon-rose { background: rgba(244,63,94,0.12); color: #e11d48; }
.dash-pro-quick-icon-slate { background: rgba(100,116,139,0.12); color: #475569; }
.dash-pro-quick-label {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

@media (max-width: 768px) {
    .dash-pro-hero-content { padding: 0.65rem 1.15rem 1rem; }
    .dash-pro-hero-actions { width: 100%; }
    .dash-pro-hero-actions .dash-pro-btn { flex: 1 1 calc(50% - 0.35rem); justify-content: center; min-height: 2.5rem; }
    .dash-pro-hero-stat-health { flex-direction: column; align-items: flex-start; }
    .dash-pro-hero-stats {
        grid-template-columns: repeat(5, minmax(9.5rem, 1fr));
    }
    .dash-pro-charts { gap: 0.85rem; }
    .dash-pro-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-pro-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-pro-stat-value { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .dash-pro-hero-topbar .dash-pro-toolbar-live { display: none; }
    .dash-pro-kpis { grid-template-columns: 1fr; }
    .dash-pro-hero-actions .dash-pro-btn { flex: 1 1 100%; }
}

/* ═══════════════════════════════════════════════════════════
   Reports Pro — Professional reporting UI
   ═══════════════════════════════════════════════════════════ */
.rpt-hub {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1280px;
}

.rpt-hub-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2.25rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 42%, #4338ca 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px -20px rgba(49, 46, 129, 0.45);
    position: relative;
    overflow: hidden;
}
.rpt-hub-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 255, 255, 0.12), transparent 55%);
    pointer-events: none;
}
.rpt-hub-hero-main,
.rpt-hub-hero-aside {
    position: relative;
    z-index: 1;
}
.dark .rpt-hub-hero {
    background: linear-gradient(145deg, #020617 0%, #0f172a 50%, #312e81 100%);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.5);
}
.rpt-hub-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.75;
}
.rpt-hub-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 0.35rem;
    line-height: 1.15;
}
.rpt-hub-sub {
    font-size: 0.9375rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    max-width: 36rem;
    line-height: 1.55;
}
.rpt-hub-hero-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}
.rpt-hub-period-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8125rem;
    font-weight: 600;
}
.rpt-hub-hero-stat {
    text-align: right;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.rpt-hub-hero-stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}
.rpt-hub-hero-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.rpt-hub-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 1024px) {
    .rpt-hub-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .rpt-hub-summary { grid-template-columns: 1fr; }
}
.rpt-hub-sum-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rpt-hub-sum-card:hover {
    box-shadow: var(--shadow-md);
}
.rpt-hub-sum-card--indigo { border-left: 3px solid #6366f1; }
.rpt-hub-sum-card--emerald { border-left: 3px solid #10b981; }
.rpt-hub-sum-card--amber { border-left: 3px solid #f59e0b; }
.rpt-hub-sum-card--violet { border-left: 3px solid #8b5cf6; }
.rpt-hub-sum-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}
.rpt-hub-sum-card--emerald .rpt-hub-sum-icon { background: rgba(16, 185, 129, 0.1); color: #059669; }
.rpt-hub-sum-card--amber .rpt-hub-sum-icon { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.rpt-hub-sum-card--violet .rpt-hub-sum-icon { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.rpt-hub-sum-icon svg { width: 1.25rem; height: 1.25rem; }
.rpt-hub-sum-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.rpt-hub-sum-value {
    display: block;
    font-size: 1.375rem;
    font-weight: 800;
    margin-top: 0.25rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.rpt-hub-sum-value.text-emerald { color: #059669; }
.rpt-hub-sum-value.text-amber { color: #d97706; }
.rpt-hub-sum-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 0.15rem;
}

.rpt-hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.rpt-hub-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: min(100%, 280px);
    max-width: 420px;
    padding: 0.55rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.rpt-hub-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    outline: none;
    color: inherit;
}
.rpt-hub-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.rpt-hub-group { display: flex; flex-direction: column; gap: 1rem; }
.rpt-hub-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.rpt-hub-group-title {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.rpt-hub-group-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.rpt-hub-group-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-faint);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.rpt-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.rpt-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 11rem;
    padding: 1.35rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}
.rpt-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.18);
    border-color: rgba(99, 102, 241, 0.25);
}
.rpt-hub-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.rpt-hub-card-tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.rpt-hub-card-indigo .rpt-hub-card-icon { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.rpt-hub-card-emerald .rpt-hub-card-icon { background: rgba(16, 185, 129, 0.12); color: #059669; }
.rpt-hub-card-violet .rpt-hub-card-icon { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.rpt-hub-card-amber .rpt-hub-card-icon { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.rpt-hub-card-red .rpt-hub-card-icon { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.rpt-hub-card-sky .rpt-hub-card-icon { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.rpt-hub-card-rose .rpt-hub-card-icon { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.rpt-hub-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rpt-hub-card-icon svg { width: 1.35rem; height: 1.35rem; }
.rpt-hub-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.rpt-hub-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
}
.rpt-hub-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-600);
    margin-top: auto;
    padding-top: 0.35rem;
}
.rpt-hub-card-cta svg { transition: transform 0.15s; }
.rpt-hub-card:hover .rpt-hub-card-cta svg { transform: translateX(3px); }
html.rtl .rpt-hub-card:hover .rpt-hub-card-cta svg { transform: translateX(-3px); }

.rpt-hub-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}
.rpt-hub-empty.hidden { display: none; }

.rpt-export-center {
    padding: 0 !important;
    overflow: hidden;
    border-radius: var(--radius-xl);
}
.rpt-export-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.rpt-export-head-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rpt-export-head-icon svg { width: 1.35rem; height: 1.35rem; }
.rpt-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1px;
    background: var(--border);
}
.rpt-export-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.15rem 1.25rem;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    min-height: 5.5rem;
}
.rpt-export-item:hover {
    background: rgba(99, 102, 241, 0.06);
}
.rpt-export-fmt {
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-600);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    margin-bottom: 0.5rem;
}
.rpt-export-label {
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.35;
}
.rpt-export-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 0.35rem;
}
html.rtl .rpt-export-item { text-align: right; align-items: flex-end; }
html.rtl .rpt-hub-hero-aside { align-items: flex-start; }
html.rtl .rpt-hub-hero-stat { text-align: left; }

/* Report detail pages */
.rpt-report-wrap { margin-top: 0.5rem; }
.rpt-report-card { overflow: hidden; }
.rpt-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.rpt-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-left: 4px solid #6366f1;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.rpt-stat-indigo { border-left-color: #6366f1; }
.rpt-stat-emerald { border-left-color: #10b981; }
.rpt-stat-amber { border-left-color: #f59e0b; }
.rpt-stat-red { border-left-color: #ef4444; }
.rpt-stat-violet { border-left-color: #8b5cf6; }
.rpt-stat-inner { padding: 1.15rem 1.25rem; }
.rpt-stat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.rpt-stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0.25rem; color: var(--text); }
.rpt-stat-hint { font-size: 0.75rem; color: var(--text-faint); margin-top: 0.25rem; }

.rpt-toolbar {
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.rpt-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.rpt-presets-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-right: 0.5rem; }
.rpt-preset {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem; font-weight: 600;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}
.rpt-preset:hover { border-color: var(--brand-500); color: var(--brand-600); background: rgba(99,102,241,0.06); }
.rpt-filter-form { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.rpt-filter-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.rpt-filter-group { min-width: 140px; }
.rpt-filter-actions, .rpt-filter-actions-only { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.rpt-print-header {
    display: none;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1rem;
}
.rpt-print-header-inner { display: flex; justify-content: space-between; gap: 2rem; }
.rpt-print-brand { display: flex; gap: 1rem; align-items: flex-start; }
.rpt-print-logo { max-height: 48px; max-width: 120px; object-fit: contain; }
.rpt-print-company { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; }
.rpt-print-title { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin-top: 0.25rem; }
.rpt-print-period { font-size: 0.875rem; color: #64748b; margin-top: 0.25rem; }
.rpt-print-meta { text-align: right; font-size: 0.8rem; color: #64748b; }
.rpt-print-meta-label { font-size: 0.65rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.rpt-print-date, .rpt-print-user { font-weight: 600; color: #0f172a; }

.rpt-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0 1.35rem;
    margin: 1.25rem 0 0.75rem;
}
.rpt-chart-section { padding: 0 1.35rem 1.25rem; }
.rpt-chart-box { height: 220px; position: relative; }
.rpt-chart-donut { height: 180px; }
.rpt-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-bottom: 0.5rem; }
.rpt-chart-half { padding: 0 1.35rem 1rem; }
@media (max-width: 900px) { .rpt-charts-row { grid-template-columns: 1fr; } }

.rpt-breakdown { padding-bottom: 0.5rem; }
.rpt-status-pills { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0 1.35rem 1rem; }
.rpt-status-pill {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.8125rem;
}
.rpt-status-count { color: var(--text-muted); }
.rpt-status-amt { font-weight: 700; }
.rpt-status-bal { font-size: 0.75rem; color: #d97706; }

.rpt-method-list { list-style: none; padding: 0 1rem 1rem; margin: 0; }
.rpt-method-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
}
.rpt-method-list strong { color: var(--text); }

.rpt-table-section { padding-bottom: 1.25rem; }
.rpt-table .rpt-tfoot td { background: var(--surface-2); font-size: 0.9rem; }
.rpt-row-warn { background: rgba(245,158,11,0.04); }
.rpt-row-danger { background: rgba(239,68,68,0.05); }
.rpt-flag { font-size: 0.6rem; font-weight: 800; padding: 0.1rem 0.35rem; border-radius: 4px; background: #fef3c7; color: #92400e; vertical-align: middle; }
.rpt-flag.out { background: #fee2e2; color: #991b1b; }
.rpt-footnote { font-size: 0.75rem; color: var(--text-muted); padding: 0.75rem 1.35rem; }

.rpt-inventory-summary {
    display: flex; flex-wrap: wrap; gap: 1.5rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--border);
}
.rpt-inv-metric span { display: block; font-size: 0.75rem; color: var(--text-muted); }
.rpt-inv-metric strong { font-size: 1.25rem; font-weight: 800; }

.rpt-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; padding: 0 1.35rem 1rem; }
.rpt-cat-card {
    padding: 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.rpt-cat-name { display: block; font-weight: 700; font-size: 0.875rem; }
.rpt-cat-meta { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.rpt-cat-val { display: block; font-size: 1rem; font-weight: 800; margin-top: 0.5rem; color: var(--brand-600); }

.rpt-pl-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1rem 1.35rem 1.5rem;
}
@media (max-width: 900px) { .rpt-pl-layout { grid-template-columns: 1fr; } }
.rpt-pl-visual { display: flex; flex-direction: column; gap: 1.5rem; }
.rpt-gauge-ring {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: conic-gradient(#6366f1 calc(var(--pct) * 1%), var(--surface-2) 0);
    display: flex; align-items: center; justify-content: center;
    margin: 1rem auto;
    position: relative;
}
.rpt-gauge-ring::before {
    content: '';
    position: absolute;
    inset: 12px;
    background: var(--surface);
    border-radius: 50%;
}
.rpt-gauge-ring span { position: relative; font-size: 1.75rem; font-weight: 800; z-index: 1; }
.rpt-gauge-caption { text-align: center; font-size: 0.8rem; color: var(--text-muted); }

.rpt-pl-rows { margin: 0; padding: 0; }
.rpt-pl-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}
.rpt-pl-row dt { color: var(--text-muted); font-weight: 500; margin: 0; }
.rpt-pl-row dd { font-weight: 700; margin: 0; color: var(--text); }
.rpt-pl-row.text-red dd, .rpt-pl-row dd.text-red { color: #dc2626; }
.rpt-pl-row dd.text-emerald { color: #059669; }
.rpt-pl-section-head { border-bottom: none; padding-top: 1rem; }
.rpt-pl-section-head dt { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); }
.rpt-pl-sub dt { padding-left: 1rem; font-size: 0.8125rem; }
.rpt-pl-sub dd { font-weight: 600; font-size: 0.875rem; }
.rpt-pl-total { border-top: 2px solid var(--border); margin-top: 0.5rem; padding-top: 1rem; }
.rpt-pl-total dt { font-size: 1rem; font-weight: 800; color: var(--text); }
.rpt-pl-total dd { font-size: 1.25rem; }
.rpt-pl-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 1.25rem; line-height: 1.6; padding: 1rem; background: var(--surface-2); border-radius: 10px; }

.print-only { display: none; }
@media print {
    .rpt-print-header { display: block !important; }
    .no-print-link { display: none !important; }
    .print-only { display: inline !important; }
    .rpt-stats { grid-template-columns: repeat(4, 1fr); }
    .rpt-chart-section, .rpt-breakdown, .rpt-pl-visual { display: none !important; }
}

/* Searchable product picker */
.bf-product-picker {
    position: relative;
    width: 100%;
}
.bf-product-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    cursor: pointer;
    background: var(--surface);
}
.bf-product-picker-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}
.bf-product-picker-label.is-placeholder {
    color: var(--text-muted);
}
.bf-product-picker-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}
.bf-product-picker.is-open .bf-product-picker-chevron {
    transform: rotate(180deg);
}
.bf-product-picker-menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.bf-product-picker-search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.bf-product-picker-search {
    font-size: 0.875rem;
}
.bf-product-picker-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    max-height: 240px;
    overflow-y: auto;
}
.bf-product-picker-option {
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text);
}
.bf-product-picker-option:hover,
.bf-product-picker-option:focus {
    background: var(--surface-2);
}
.bf-product-picker-option.is-clear {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.15rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.bf-product-picker-empty {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}
.line-field-product .bf-product-picker-menu {
    min-width: 280px;
}
@media (max-width: 767px) {
    .line-field-product .bf-product-picker-menu {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
        max-height: 50vh;
    }
}

/* Language switcher */
.bf-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
}
.bf-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.bf-lang-btn:hover {
    color: var(--text);
    background: var(--surface);
}
.bf-lang-btn.is-active {
    background: var(--brand-600, #4f46e5);
    color: #fff;
}
html.rtl .bf-header-search .form-input {
    padding-inline-start: 2.5rem;
    padding-inline-end: 0.75rem;
}

/* ——— Mobile & responsive (app shell + pages) ——— */
body.bf-app {
    overflow-x: hidden;
}

body.bf-sidebar-open {
    overflow: hidden;
}

#app {
    overflow-x: hidden;
    max-width: 100vw;
}

.bf-app-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 1024px) {
    html:not(.rtl) .bf-app-shell {
        margin-left: var(--sidebar-w);
    }
    html.rtl .bf-app-shell {
        margin-right: var(--sidebar-w);
        margin-left: 0;
    }
}

/* Sidebar RTL */
html.rtl #sidebar.bf-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.04);
}

html.rtl.dark #sidebar.bf-sidebar {
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.25);
}

/* Arabic sidebar — Cairo font + dark panel + blue active (reference-style) */
html.rtl #sidebar.bf-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 50%, #0f172a 100%);
    border-left-color: rgba(255, 255, 255, 0.06);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.25);
}

html.rtl #sidebar .bf-sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.rtl #sidebar .bf-brand-name {
    color: #f8fafc;
    font-weight: 700;
    letter-spacing: 0;
}

html.rtl #sidebar .bf-brand-tag {
    color: #94a3b8;
    letter-spacing: 0.06em;
}

html.rtl #sidebar .nav-section {
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.04em;
}

html.rtl #sidebar .nav-group-toggle {
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.04em;
}

html.rtl #sidebar .nav-group-toggle:hover,
html.rtl #sidebar .nav-group.is-open .nav-group-toggle {
    color: #93c5fd;
}

html.rtl #sidebar .nav-group-items .nav-link {
    padding-left: 0.75rem;
    padding-right: 2.25rem;
}

html.rtl #sidebar .nav-link {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.875rem;
    margin: 0 0.625rem 3px;
    border-radius: 10px;
}

html.rtl #sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

html.rtl #sidebar .nav-link.active {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

html.rtl #sidebar .nav-link.active::before {
    display: none;
}

html.rtl #sidebar .nav-link svg {
    opacity: 1;
}

html.rtl #sidebar .bf-sidebar-user {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

html.rtl #sidebar .bf-sidebar-user:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

html.rtl #sidebar .bf-sidebar-user p {
    color: #e2e8f0;
}

html.rtl #sidebar .bf-sidebar-user .text-slate-500 {
    color: #94a3b8 !important;
}

html.rtl #sidebar .border-t {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html.rtl #sidebar .text-slate-400 {
    color: #64748b !important;
}

html.rtl.dark #sidebar.bf-sidebar {
    background: linear-gradient(180deg, #0a0f1a 0%, #0f172a 100%);
}

.bf-main {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1023px) {
    .bf-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 639px) {
    .bf-main {
        padding: 1rem;
    }

    .bf-app-footer {
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 0.6875rem;
    }
}

/* Header */
.bf-header {
    min-height: var(--header-h);
    gap: 0.5rem;
}

@media (max-width: 639px) {
    .bf-header {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .bf-header-tools .bf-lang-switch {
        transform: scale(0.92);
        transform-origin: center;
    }

    .bf-header-btn {
        width: 2.25rem;
        height: 2.25rem;
    }

    #notif-dropdown {
        width: min(20rem, calc(100vw - 1.5rem));
        max-width: calc(100vw - 1.5rem);
    }

    html:not(.rtl) #notif-dropdown {
        right: 0;
        left: auto;
    }

    html.rtl #notif-dropdown {
        left: 0;
        right: auto;
    }
}

/* Page header & actions */
@media (max-width: 767px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .page-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .page-actions > a,
    .page-actions > form,
    .page-actions > button {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    .page-actions .btn-primary,
    .page-actions .btn-secondary,
    .page-actions .btn-whatsapp {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .page-actions form.inline {
        display: flex;
        flex: 1 1 calc(50% - 0.25rem);
    }

    .page-actions form.inline button {
        width: 100%;
    }
}

/* Tables */
@media (max-width: 639px) {
    .table-wrap,
    .dash-pro-table-wrap,
    .dash-table-wrap {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        border-radius: var(--radius);
    }

    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
    }
}

/* Toolbar / filters */
@media (max-width: 639px) {
    .toolbar,
    .toolbar-premium {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .form-input,
    .toolbar select,
    .toolbar-premium .form-input {
        width: 100%;
        max-width: none;
    }
}

/* List rows (categories, etc.) */
@media (max-width: 767px) {
    .list-row {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .list-row .opacity-0,
    .list-row .group-hover\:opacity-100,
    .list-row .list-row-action {
        opacity: 1 !important;
    }

    .list-row form.flex {
        flex-wrap: wrap;
        width: 100%;
    }

    .list-row form.flex .form-input {
        min-width: 0;
        flex: 1 1 100%;
    }
}

/* POS */
.pos-cart-panel {
    position: relative;
}

@media (min-width: 1280px) {
    .pos-cart-panel {
        position: sticky;
        top: 1rem;
    }
}

@media (max-width: 639px) {
    .pos-offline-banner-inner {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pos-product-btn .p-3 {
        padding: 0.5rem 0.625rem;
    }

    .pos-product-letter {
        font-size: 1.5rem;
    }

    #pos-cart li {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #pos-cart .pos-qty-stepper {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

/* Auth — mobile */
@media (max-width: 767px) {
    .auth-panel-inner > .alert {
        padding: 0.75rem 0.9rem;
        font-size: 0.8125rem;
        margin-bottom: 0.85rem;
        border-radius: 12px;
    }

    .auth-panel-inner > .alert svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    .auth-card-pro {
        padding: 1.5rem 1.125rem 1.25rem;
        border-radius: 1.125rem;
        box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.05),
            0 8px 20px -6px rgba(15, 23, 42, 0.1);
    }

    .auth-card h2 {
        font-size: 1.375rem;
    }

    .auth-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }

    .auth-link-forgot {
        text-align: center;
        padding: 0.25rem 0;
    }

    .auth-submit {
        min-height: 3rem;
        font-size: 1rem !important;
    }

    .auth-demo-body {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }

    .auth-demo-creds-line {
        font-size: 0.6875rem;
        line-height: 1.6;
        word-break: break-word;
    }

    .auth-demo-creds-line code {
        display: inline;
        font-size: 0.625rem;
        padding: 0.15rem 0.3rem;
    }

    .auth-panel-tools {
        flex-shrink: 0;
    }

    .auth-otp-input {
        font-size: 1.5rem !important;
        letter-spacing: 0.25em;
    }
}

@media (max-width: 380px) {
    .auth-card-pro {
        padding: 1.25rem 1rem 1rem;
    }

    .auth-mobile-logo,
    .auth-mobile-logo-fallback {
        width: 32px;
        height: 32px;
    }

    .auth-mobile-name {
        font-size: 0.8125rem;
    }

    .bf-lang-btn {
        min-width: 2.25rem;
        padding: 0.35rem 0.45rem;
        font-size: 0.65rem;
    }
}

/* Portal */
.portal-header,
.portal-main {
    max-width: 100%;
}

/* Toast */
@media (max-width: 639px) {
    #toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    html:not(.rtl) #toast-container {
        right: 1rem;
        left: 1rem;
    }

    html.rtl #toast-container {
        left: 1rem;
        right: 1rem;
    }

    .bf-toast {
        max-width: 100%;
    }
}

/* Cards & forms */
@media (max-width: 639px) {
    .card-body {
        padding: 1rem;
    }

    .card-header,
    .card-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .form-row {
        gap: 0.75rem;
    }
}

/* Command palette */
@media (max-width: 639px) {
    #cmd-palette .cmd-dialog {
        width: calc(100vw - 2rem);
        max-width: none;
        margin: 1rem;
    }
}

/* Expenses */
.expense-submit-btn svg {
    flex-shrink: 0;
}

.expense-delete-btn {
    white-space: nowrap;
}

.expense-delete-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.expense-actions-col {
    width: 1%;
    white-space: nowrap;
}

.expenses-mobile-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.expenses-mobile-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.expenses-mobile-item:last-child {
    border-bottom: none;
}

.expenses-mobile-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.expenses-mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.expenses-mobile-actions .expense-edit-btn,
.expenses-mobile-delete .expense-delete-btn {
    width: 100%;
    justify-content: center;
}

.expenses-mobile-item-active {
    background: rgba(99, 102, 241, 0.06);
}

.expense-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.expense-edit-btn:hover {
    border-color: var(--brand-300);
    color: var(--brand-700);
    background: rgba(99, 102, 241, 0.06);
}

.expenses-row-active td {
    background: rgba(99, 102, 241, 0.06);
}

.expenses-row-active td:first-child {
    box-shadow: inset 3px 0 0 var(--brand-500);
}

html.rtl .expenses-row-active td:first-child {
    box-shadow: inset -3px 0 0 var(--brand-500);
}

.expenses-filter .form-group {
    margin-bottom: 0;
}

/* ── Integrations hub ── */
.int-hub { display: flex; flex-direction: column; gap: 1.5rem; max-width: 72rem; }
.int-hub-hero {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.25rem;
    padding: 1.75rem 2rem; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 50%, transparent 100%);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.dark .int-hub-hero { background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(30, 27, 75, 0.4) 100%); }
.int-hub-eyebrow { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand-600); }
.int-hub-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); margin-top: 0.25rem; }
.int-hub-sub { font-size: 0.9375rem; color: var(--text-muted); margin-top: 0.35rem; max-width: 36rem; }
.int-hub-hero-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.int-hub-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.int-hub-badge {
    font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.85rem; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.int-hub-badge--on { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); color: #059669; }
.int-hub-summary {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
@media (max-width: 1024px) { .int-hub-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .int-hub-summary { grid-template-columns: 1fr; } }
.int-hub-sum-card {
    display: flex; align-items: flex-start; gap: 1rem; padding: 1.15rem 1.25rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.int-hub-sum-card:hover { box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.12); }
.int-hub-sum-card--indigo { border-left: 3px solid #6366f1; }
.int-hub-sum-card--emerald { border-left: 3px solid #10b981; }
.int-hub-sum-card--violet { border-left: 3px solid #8b5cf6; }
.int-hub-sum-card--amber { border-left: 3px solid #f59e0b; }
.int-hub-sum-icon {
    width: 2.5rem; height: 2.5rem; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, 0.1); color: #4f46e5; flex-shrink: 0;
}
.int-hub-sum-card--emerald .int-hub-sum-icon { background: rgba(16, 185, 129, 0.1); color: #059669; }
.int-hub-sum-card--violet .int-hub-sum-icon { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.int-hub-sum-card--amber .int-hub-sum-icon { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.int-hub-sum-icon svg { width: 1.25rem; height: 1.25rem; }
.int-hub-sum-label { display: block; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.int-hub-sum-value { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-top: 0.15rem; }

.int-api-reveal { padding: 1.25rem 1.5rem; border-left: 4px solid #f59e0b; margin-bottom: 0; }
.int-api-reveal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.int-api-reveal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .int-api-reveal-grid { grid-template-columns: 1fr; } }
.int-mono { display: block; font-family: ui-monospace, monospace; font-size: 0.75rem; word-break: break-all; padding: 0.5rem; background: var(--surface-2); border-radius: 6px; margin: 0.35rem 0; }
.int-copy-btn { font-size: 0.6875rem; padding: 0.2rem 0.5rem; margin-top: 0.25rem; }

.int-ping-result {
    padding: 0.85rem 1.1rem; border-radius: var(--radius); font-size: 0.875rem;
    border: 1px solid var(--border); background: var(--surface-2);
}
.int-ping-result--ok { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); color: #047857; }
.int-ping-result--err { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); color: #b91c1c; }

.int-tabs { margin-bottom: 0; }
.int-section-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-faint); margin-bottom: 0.75rem;
}
.int-provider-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
}
.int-provider-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.int-provider-card--on { border-color: rgba(16, 185, 129, 0.35); box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08); }
.int-provider-card--pending { border-color: rgba(99, 102, 241, 0.4); }
.int-provider-card--compact .int-provider-head { margin-bottom: 0.65rem; }
.int-provider-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.int-provider-head h4 { font-size: 0.9375rem; font-weight: 700; margin: 0; color: var(--text); }
.int-provider-body { display: flex; flex-direction: column; gap: 0.5rem; }
.int-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.int-status--on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
.int-status--off { background: var(--text-faint); opacity: 0.5; }

.int-url-list { display: flex; flex-direction: column; gap: 0.75rem; }
.int-url-row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.int-url-row:last-child { border-bottom: none; }
.int-url-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); min-width: 5rem; }
.int-url-code { font-size: 0.65rem; margin: 0; padding: 0.35rem 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.int-save-bar {
    position: sticky; bottom: 1rem; z-index: 20;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
    margin-top: 2rem; padding: 1rem 1.25rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px -12px rgba(15, 23, 42, 0.2);
}
.int-test-form { margin-top: -0.5rem; margin-bottom: 1.5rem; padding-left: 0.25rem; }

.int-inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.int-inline-form .form-input { flex: 1; min-width: 140px; }

.int-event-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.int-event-chip {
    display: inline-flex; align-items: center; cursor: pointer;
    font-size: 0.6875rem; padding: 0.25rem 0.55rem; border-radius: 6px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
}
.int-event-chip:has(input:checked) { border-color: var(--brand-400); background: rgba(99, 102, 241, 0.1); color: var(--brand-700); }
.int-event-chip input { margin-right: 0.25rem; }

.int-webhook-item {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    padding: 0.85rem 1rem; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--surface-2);
}

html.rtl .int-hub-sum-card--indigo,
html.rtl .int-hub-sum-card--emerald,
html.rtl .int-hub-sum-card--violet,
html.rtl .int-hub-sum-card--amber { border-left: none; border-right-width: 3px; border-right-style: solid; }
html.rtl .int-hub-sum-card--indigo { border-right-color: #6366f1; }
html.rtl .int-hub-sum-card--emerald { border-right-color: #10b981; }
html.rtl .int-hub-sum-card--violet { border-right-color: #8b5cf6; }
html.rtl .int-hub-sum-card--amber { border-right-color: #f59e0b; }
html.rtl .int-api-reveal { border-left: none; border-right: 4px solid #f59e0b; }

/* POS tables & held bills */
.pos-section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.pos-section-toggle:hover { color: var(--brand-600); }
.pos-collapse-chevron {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
    margin-top: -0.15rem;
}
.pos-section-toggle.is-open .pos-collapse-chevron {
    transform: rotate(-135deg);
    margin-top: 0.15rem;
}
.pos-collapsible-panel.hidden { display: none; }

.pos-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.5rem;
}
.pos-table-cell {
    position: relative;
}
.pos-table-del {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0.15rem;
    inset-inline-end: 0.15rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: #ef4444;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}
.pos-held-item--active {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--brand-500);
}
html.rtl .pos-held-item--active {
    border-left: none;
    border-right: 3px solid var(--brand-500);
}
.pos-table-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.5rem 0.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.pos-table-btn:hover { border-color: var(--brand-400); background: var(--surface); }
.pos-table-btn.active {
    border-color: var(--brand-500);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.pos-table-held-dot {
    position: absolute;
    top: 0.35rem;
    inset-inline-start: 0.35rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 2px var(--surface);
}
.pos-held-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #f59e0b;
    color: #fff;
}
.pos-held-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.pos-held-modal.hidden { display: none; }
.pos-held-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.pos-held-modal-panel {
    position: relative;
    width: 100%;
    max-width: 28rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}
.pos-held-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
}
.pos-held-item-meta { font-size: 0.75rem; color: var(--text-muted); }
.pos-held-item-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
