/* ==================================================
   FARD CRM — Design System
   هویت بصری: Dark Premium Navy با لهجه فولادی/صنعتی مناسب فروشگاه لوازم یدکی
   ================================================== */

:root {
    /* رنگ پایه — تم تیره (پیش‌فرض) */
    --bg: #0A0E17;
    --bg-elevated: #10141F;
    --surface: #141928;
    --surface-2: #1B2133;
    --border: #262E44;
    --border-soft: #1E2536;

    --text-primary: #ECEFF7;
    --text-secondary: #9AA4BF;
    --text-muted: #6B7591;

    --accent: #3D6FF2;
    --accent-hover: #5580F5;
    --accent-soft: rgba(61, 111, 242, 0.14);
    --accent-cyan: #22D3EE;

    --success: #22C55E;
    --success-soft: rgba(34, 197, 94, 0.14);
    --warning: #F5A623;
    --warning-soft: rgba(245, 166, 35, 0.14);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.14);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 8px 24px -8px rgba(0,0,0,.45);
    --shadow-lg: 0 20px 48px -16px rgba(0,0,0,.55);

    --font-body: 'Vazirmatn', -apple-system, sans-serif;
    --sidebar-w: 264px;
}

[data-theme="light"] {
    --bg: #F3F5FA;
    --bg-elevated: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F7F8FC;
    --border: #E4E7F0;
    --border-soft: #ECEEF5;

    --text-primary: #171B2C;
    --text-secondary: #5B6480;
    --text-muted: #8990A8;

    --accent: #2F5FE0;
    --accent-hover: #2650C4;
    --accent-soft: rgba(47, 95, 224, 0.08);

    --shadow-sm: 0 1px 2px rgba(20,25,50,.06);
    --shadow-md: 0 8px 24px -8px rgba(20,25,50,.12);
    --shadow-lg: 0 20px 48px -16px rgba(20,25,50,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------- ساختار کلی ---------- */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
    border-left: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px; color: #fff;
    box-shadow: 0 6px 16px -4px rgba(61,111,242,.55);
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .3px; }
.brand-sub { font-size: 11.5px; color: var(--text-muted); }

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.8px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav-item i { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.sidebar-footer { padding: 14px; border-top: 1px solid var(--border-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.user-avatar {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--surface-2); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; border: 1px solid var(--border);
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.sidebar-overlay { display: none; }

/* ---------- Topbar ---------- */
.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 17px; font-weight: 800; margin: 0; flex: 1; }
.menu-toggle { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all .15s ease;
    position: relative;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.icon-btn i { width: 17px; height: 17px; }

.notif-wrap { position: relative; }
.notif-dot {
    position: absolute; top: 7px; left: 7px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); border: 2px solid var(--bg);
}
.notif-panel {
    position: absolute; top: 48px; left: 0;
    width: 300px; max-height: 360px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    z-index: 50;
}
.notif-panel-header { padding: 12px 16px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border-soft); }
.notif-panel-body { padding: 8px; }
.empty-mini { padding: 20px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

.page-content { padding: 24px; flex: 1; }

/* ---------- Grid & Cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
}
.stat-icon i { width: 19px; height: 19px; }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.orange { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-trend { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.stat-trend.up { color: var(--success); background: var(--success-soft); }
.stat-trend.down { color: var(--danger); background: var(--danger-soft); }
.stat-value { font-size: 23px; font-weight: 800; margin: 2px 0 4px; letter-spacing: -.3px; }
.stat-label { font-size: 12.5px; color: var(--text-secondary); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 700; }
.card-body { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13.5px; font-weight: 700;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(61,111,242,.6); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.form-control {
    width: 100%;
    padding: 10px 13px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13.8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
select.form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: left 14px top 50%, left 9px top 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.2px; min-width: 640px; }
.data-table th {
    text-align: right; padding: 12px 14px;
    color: var(--text-muted); font-weight: 700; font-size: 11.8px;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tfoot td { font-weight: 700; }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11.3px; font-weight: 700; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-orange { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-gray { background: var(--surface-2); color: var(--text-secondary); }

/* ---------- Toast ---------- */
.toast-container { position: fixed; bottom: 22px; left: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    min-width: 260px; max-width: 360px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: 13px 16px; display: flex; gap: 10px; align-items: flex-start;
    animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast.success { border-right: 3px solid var(--success); }
.toast.error { border-right: 3px solid var(--danger); }
.toast-msg { font-size: 13px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5,8,16,.62); backdrop-filter: blur(2px); z-index: 90; }
.modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: min(560px, 92vw); max-height: 88vh; overflow-y: auto;
    z-index: 100; animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 15px; font-weight: 800; }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Empty / Error state ---------- */
.empty-state, .error-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state i, .error-state i { width: 40px; height: 40px; margin-bottom: 12px; opacity: .6; }
.empty-state-title { font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }

/* ---------- Loading skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border-soft) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 30% 20%, #16203A, var(--bg) 60%); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 34px 30px; }
.login-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.login-brand .brand-mark { width: 56px; height: 56px; font-size: 26px; border-radius: 16px; margin-bottom: 14px; }
.login-brand h2 { margin: 0; font-size: 19px; font-weight: 800; }
.login-brand p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.login-error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.8px; margin-bottom: 14px; display: none; }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.pos-search-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 62vh; overflow-y: auto; padding-left: 4px; }
.product-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; cursor: pointer; transition: all .12s ease; }
.product-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-tile .p-name { font-size: 12.8px; font-weight: 700; margin-bottom: 6px; min-height: 32px; }
.product-tile .p-price { color: var(--accent); font-weight: 800; font-size: 13.5px; }
.product-tile .p-stock { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.cart-panel { position: sticky; top: 80px; }
.cart-items { max-height: 40vh; overflow-y: auto; margin-bottom: 12px; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.cart-item .ci-name { flex: 1; font-size: 12.6px; font-weight: 600; }
.cart-item .ci-qty { display: flex; align-items: center; gap: 4px; }
.qty-btn { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--text-secondary); }
.cart-summary-row.total { font-size: 16px; font-weight: 800; color: var(--text-primary); border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 20px; }
.page-btn { min-width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .pos-layout { grid-template-columns: 1fr; }
    .cart-panel { position: static; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; right: 0; top: 0; height: 100vh; width: 264px;
        transform: translateX(100%);
        transition: transform .22s ease;
    }
    [dir="rtl"] .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0; background: rgba(5,8,16,.55); z-index: 39;
    }
    .sidebar-overlay.show { display: block; }
    .menu-toggle { display: flex; }
    .page-content { padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (min-width: 1600px) {
    .page-content { max-width: 1500px; margin: 0 auto; width: 100%; }
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ==================================================
   V2 — PREMIUM UPGRADE
   Command Palette, FAB, Glass Effect, Timeline, Micro Interactions
   ================================================== */

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Glass / Depth (Dark Mode 2.0) ---------- */
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .modal,
[data-theme="dark"] .notif-panel {
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, white 4%), var(--surface));
    backdrop-filter: blur(6px);
}
[data-theme="dark"] .stat-card {
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .stat-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(120px 80px at 90% -10%, rgba(61,111,242,.12), transparent 70%);
    pointer-events: none;
}

/* ---------- Micro Interactions ---------- */
.btn { transition: transform .12s ease, box-shadow .12s ease, background .15s ease, border-color .15s ease; }
.btn:active { transform: scale(.97); }
.icon-btn:active { transform: scale(.92); }
.nav-item { position: relative; overflow: hidden; }
.nav-item::after {
    content: ''; position: absolute; inset: 0; background: var(--accent);
    opacity: 0; transition: opacity .15s ease; border-radius: inherit; pointer-events: none;
}
.nav-item:active::after { opacity: .08; }
.product-tile:active { transform: scale(.97); }
.stat-card, .card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }

/* افزودن به سبد: پالس کوتاه */
@keyframes cart-pulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.03); box-shadow: 0 0 0 4px var(--accent-soft); }
    100% { transform: scale(1); }
}
.cart-panel.pulse { animation: cart-pulse .35s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.shake { animation: shake .35s ease; }

/* ---------- Form Validation States ---------- */
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-control.is-valid { border-color: var(--success); }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* ---------- Command Palette ---------- */
.cmdk-backdrop {
    position: fixed; inset: 0; background: rgba(5,8,16,.65); backdrop-filter: blur(3px);
    z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
    animation: cmdk-fade .15s ease;
}
@keyframes cmdk-fade { from { opacity: 0; } to { opacity: 1; } }
.cmdk-box {
    width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
    animation: cmdk-scale .16s ease;
}
@keyframes cmdk-scale { from { opacity: 0; transform: scale(.96) translateY(-6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.cmdk-input-wrap i { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.cmdk-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-size: 14.5px; font-family: inherit; }
.cmdk-hint { font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; }
.cmdk-list { max-height: 360px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.3px; }
.cmdk-item i { width: 17px; height: 17px; color: var(--text-muted); }
.cmdk-item.active { background: var(--accent-soft); color: var(--accent); }
.cmdk-item.active i { color: var(--accent); }
.cmdk-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.cmdk-trigger-mobile {
    position: fixed; bottom: 88px; left: 22px; z-index: 60;
    width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
    display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-md); color: var(--text-secondary);
}
@media (max-width: 860px) { .cmdk-trigger-mobile { display: flex; } }

/* ---------- Floating Action Button (FAB) ---------- */
.fab-wrap { position: fixed; bottom: 22px; left: 22px; z-index: 60; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
.fab-main {
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px -8px rgba(61,111,242,.65);
    transition: transform .2s ease;
    border: none;
}
.fab-main.open { transform: rotate(45deg); }
.fab-main i { width: 24px; height: 24px; }
.fab-menu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.fab-menu-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 30px;
    padding: 8px 16px 8px 8px; box-shadow: var(--shadow-md); font-size: 12.6px; font-weight: 700;
    animation: fab-in .16s ease;
    white-space: nowrap;
}
@keyframes fab-in { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
.fab-menu-item .fab-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.fab-menu-item .fab-icon i { width: 15px; height: 15px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-right: 26px; }
[dir="ltr"] .timeline { padding-right: 0; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; right: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
[dir="ltr"] .timeline::before { right: auto; left: 9px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-dot {
    position: absolute; right: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
}
[dir="ltr"] .timeline-dot { right: auto; left: 0; }
.timeline-dot.green { border-color: var(--success); }
.timeline-dot.red { border-color: var(--danger); }
.timeline-dot i { width: 10px; height: 10px; color: var(--accent); }
.timeline-content { margin-right: 32px; }
[dir="ltr"] .timeline-content { margin-right: 0; margin-left: 32px; }
.timeline-title { font-size: 13px; font-weight: 700; }
.timeline-meta { font-size: 11.3px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 360 Stat Mini Grid ---------- */
.mini-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mini-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; }
.mini-stat-value { font-size: 16px; font-weight: 800; }
.mini-stat-label { font-size: 10.8px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Insight Cards ---------- */
.insight-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); align-items: flex-start; }
.insight-item:last-child { border-bottom: none; }
.insight-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.insight-icon.success { background: var(--success-soft); color: var(--success); }
.insight-icon.warning { background: var(--warning-soft); color: var(--warning); }
.insight-icon.danger { background: var(--danger-soft); color: var(--danger); }
.insight-icon.info { background: var(--accent-soft); color: var(--accent); }
.insight-icon i { width: 16px; height: 16px; }
.insight-text { font-size: 12.8px; line-height: 1.6; }

/* ---------- Smart Inventory Status Badges ---------- */
.badge-out { background: var(--danger); color: #fff; }
.badge-critical { background: var(--danger-soft); color: var(--danger); }
.badge-low { background: var(--warning-soft); color: var(--warning); }
.badge-normal { background: var(--success-soft); color: var(--success); }
.badge-overstock { background: var(--accent-soft); color: var(--accent); }

/* ---------- Held invoices (POS multi-cart tabs) ---------- */
.held-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.held-tab {
    display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600;
    white-space: nowrap; cursor: pointer; flex-shrink: 0;
}
.held-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Vehicle Finder ---------- */
.vehicle-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vehicle-model-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 12px 14px; cursor: pointer; transition: border-color .15s ease;
}
.vehicle-model-card:hover { border-color: var(--accent); }
.vehicle-model-card.active { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Notification categories ---------- */
.notif-item-v2 { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); align-items: flex-start; }
.notif-cat-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-cat-icon i { width: 15px; height: 15px; }

/* ---------- Skeleton variants ---------- */
.skeleton-text { height: 12px; border-radius: 4px; margin-bottom: 6px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card { padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
