@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800&display=swap');

:root {
    --sidebar-width: 264px;
    --topbar-height: 68px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e8edf3;
    --border-strong: #d1dae6;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --warning: #d97706;
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(79, 70, 229, 0.08);
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--text);
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(79, 70, 229, 0.05), transparent),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(16, 185, 129, 0.04), transparent),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

::selection { background: #c7d2fe; color: var(--text); }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.sidebar-brand {
    padding: 1.35rem 1.25rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.sidebar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 0.975rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.sidebar-brand-sub {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.65rem 0.8rem 1rem;
}

.nav-section-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.85rem 0.7rem 0.3rem;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.58rem 0.8rem;
    border-radius: var(--radius-sm);
    margin: 2px 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }

.sidebar .nav-link:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

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

.sidebar .nav-link.nav-cta {
    margin-top: 0.4rem;
}

.sidebar .nav-link.nav-cta:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
}

.sidebar .nav-link.nav-cta.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.sidebar-footer {
    padding: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1035;
}

.sidebar-overlay.show { display: block; }

/* ── Layout ── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.12rem 0 0;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.32rem 0.8rem 0.32rem 0.32rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.user-pill:hover { box-shadow: var(--shadow-md); }

.currency-select {
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.8125rem;
    outline: none;
    cursor: pointer;
    color: var(--text);
    padding-right: 0.15rem;
}

.currency-icon {
    color: var(--primary);
    font-size: 1rem;
    line-height: 1;
}

.currency-pill { padding-left: 0.55rem; }

.currency-rate-text {
    font-size: 0.72rem;
    white-space: nowrap;
}

.currency-rate-pill { max-width: 11rem; }

#currencyRateDisplay { font-size: 0.75rem; font-weight: 700; white-space: nowrap; }

.spin-once { animation: spin-once 0.6s linear; }

@keyframes spin-once {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
}

.content-area { padding: 1.5rem 1.65rem 2rem; }

/* ── Cards ── */
.card-surface,
.table-card,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-header-clean {
    padding: 1.05rem 1.3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(180deg, #fff, var(--surface-muted));
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header-clean h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.9375rem;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.3rem;
    height: 100%;
    transition: box-shadow var(--transition);
}

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

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.chart-card-header h6 { margin: 0; font-weight: 700; font-size: 0.9375rem; }
.chart-card-header p { margin: 0.15rem 0 0; font-size: 0.8125rem; color: var(--text-muted); }
.chart-card .chart-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}
.chart-card .chart-wrap.chart-sm {
    height: 240px;
}
.chart-card .chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}

/* ── Dashboard Pro ── */
.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #312e81 0%, #4338ca 45%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.25);
    position: relative;
    overflow: hidden;
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(255,255,255,.12) 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(255,255,255,.06) 0%, transparent 40%);
    pointer-events: none;
}
.dashboard-hero-content { position: relative; z-index: 1; }
.dashboard-hero-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.35rem;
}
.dashboard-hero-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    line-height: 1.2;
}
.dashboard-hero-sub {
    margin: 0;
    opacity: 0.88;
    font-size: 0.9375rem;
    max-width: 36rem;
}
.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}
.dashboard-hero-actions .btn {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}
.dashboard-hero-actions .btn-light {
    color: #312e81;
}
.dashboard-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}
.stat-card-pro {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.15rem 1.25rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card-pro::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--primary));
}
.stat-card-pro:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card-pro .stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.stat-card-pro .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-card-pro .stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.stat-card-pro .stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
}
.stat-card-pro .stat-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}
.stat-card-pro.accent-indigo { --stat-accent: #4f46e5; }
.stat-card-pro.accent-emerald { --stat-accent: #059669; }
.stat-card-pro.accent-sky { --stat-accent: #0284c7; }
.stat-card-pro.accent-rose { --stat-accent: #e11d48; }
.stat-card-pro.accent-amber { --stat-accent: #d97706; }
.stat-card-pro.accent-violet { --stat-accent: #7c3aed; }
.stat-card-pro .stat-icon.bg-indigo { background: #eef2ff; color: #4f46e5; }
.stat-card-pro .stat-icon.bg-emerald { background: #ecfdf5; color: #059669; }
.stat-card-pro .stat-icon.bg-sky { background: #e0f2fe; color: #0284c7; }
.stat-card-pro .stat-icon.bg-rose { background: #fff1f2; color: #e11d48; }
.stat-card-pro .stat-icon.bg-amber { background: #fffbeb; color: #d97706; }
.stat-card-pro .stat-icon.bg-violet { background: #f5f3ff; color: #7c3aed; }

.profit-card-pkr { --stat-accent: #059669; }
.profit-card-cad { --stat-accent: #2563eb; }
.profit-card-total { --stat-accent: #7c3aed; }

.profit-currency-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 800;
}

.profit-total-value {
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.profit-total-plus {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
}

.profit-card .stat-value {
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}
.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}
.dashboard-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.dashboard-quick-link i { font-size: 1.25rem; color: var(--primary); }
.dashboard-quick-link:hover {
    background: var(--primary-soft);
    border-color: #c7d2fe;
    color: var(--primary);
}

.chart-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.22rem 0.6rem;
}

.chart-legend-pill .dot { width: 8px; height: 8px; border-radius: 50%; }

.stat-card { height: 100%; overflow: hidden; }
.stat-card .card-body { padding: 1.2rem 1.3rem; }

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.stat-value .currency-alt {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ── Welcome ── */
.welcome-banner {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 60%, #818cf8 100%);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.35rem;
    box-shadow: var(--shadow-md);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -60px;
    right: -40px;
    pointer-events: none;
}

.welcome-banner h5 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.welcome-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.1rem;
    position: relative;
    z-index: 1;
}

.welcome-step {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.welcome-step a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.welcome-step a:hover { text-decoration: underline; }

/* ── Tables ── */
.table-card .table { margin-bottom: 0; }

.table-card .table thead th {
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.8rem 1rem;
}

.table-card .table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.875rem;
}

.table-card .table tbody tr { transition: background var(--transition); }
.table-card .table tbody tr:hover { background: var(--primary-soft); }

.table-card code {
    background: var(--primary-soft);
    color: var(--primary-hover);
    padding: 0.18rem 0.45rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ── Forms & buttons ── */
.form-label { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.35rem; color: var(--text); }

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-strong);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control-lg { padding: 0.7rem 0.95rem; }

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.52rem 1.05rem;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover { transform: translateY(-1px); color: #fff; }

.btn-outline-primary {
    border: 1.5px solid rgba(79, 70, 229, 0.35);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-hover);
}

.btn-outline-secondary {
    border: 1.5px solid var(--border-strong);
    color: var(--text-secondary);
    background: var(--surface);
}

.btn-outline-secondary:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.btn-sm { padding: 0.38rem 0.7rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.7rem 1.3rem; }

/* ── Alerts ── */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success { background: var(--success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.badge { font-weight: 600; font-size: 0.75rem; border-radius: 7px; }

.page-link {
    border-radius: var(--radius-sm) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition);
}

.page-link:hover {
    background: var(--primary-soft) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    border-color: transparent !important;
    color: #fff !important;
}

/* ── POS ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.8rem;
}

.product-tile {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.05rem;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    text-align: left;
}

.product-tile:hover {
    border-color: #a5b4fc;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.product-tile-name { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.2rem; }
.product-tile-sku { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.product-tile-price { font-weight: 800; color: var(--primary); font-size: 0.95rem; }
.product-tile-stock { font-size: 0.75rem; color: var(--success); font-weight: 600; margin-top: 0.35rem; }
.product-tile-in-cart { border-color: var(--primary); background: var(--primary-soft); }
.product-tile-disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.search-box { position: relative; }
.search-box i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input {
    padding-left: 2.65rem;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.search-box input:focus { background: var(--surface); }

.product-select-head,
.product-select-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem;
    align-items: center;
    gap: 0.75rem;
}
.product-select-head {
    padding: 0.5rem 0.95rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.product-select-head span:not(:first-child) {
    text-align: right;
}
.product-select-panel {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}
.product-select-panel .product-select-head {
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}
.product-select-list {
    height: 520px;
    max-height: 52vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    border: none;
    border-radius: 0;
    background: var(--surface);
}
.product-select-list::-webkit-scrollbar {
    width: 8px;
}
.product-select-list::-webkit-scrollbar-track {
    background: var(--surface-muted);
}
.product-select-list::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 999px;
}
.product-select-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
.product-select-item {
    display: grid;
    width: 100%;
    text-align: left;
    padding: 0.72rem 0.95rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.35;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.product-select-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.product-select-name {
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-select-sku {
    font-size: 0.75rem;
    opacity: 0.75;
}
.product-select-price {
    text-align: right;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}
.product-select-stock {
    text-align: right;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
}
.product-select-stock.is-low { color: var(--warning); }
.product-select-stock.is-out { color: var(--danger); }
.product-select-item:last-child { border-bottom: none; }
.product-select-item:hover:not(:disabled) {
    background: var(--primary-soft);
}
.product-select-item:hover:not(:disabled) .product-select-price {
    color: var(--primary);
}
.product-select-item.is-selected {
    background: var(--primary);
    color: #fff;
}
.product-select-item.is-selected .product-select-name,
.product-select-item.is-selected .product-select-sku {
    color: #fff;
}
.product-select-item.is-selected .product-select-sku {
    opacity: 0.85;
}
.product-select-item.is-selected .product-select-price {
    color: #fff;
}
.product-select-item.is-selected .product-select-stock {
    color: #ecfdf5;
}
.product-select-item.is-selected .product-select-stock.is-low { color: #fde68a; }
.product-select-item.is-selected .product-select-stock.is-out { color: #fecaca; }
.product-select-item.is-selected:hover:not(:disabled) {
    background: var(--primary-hover);
}
.product-select-item:disabled {
    background: var(--surface-muted);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.75;
}
.product-select-item:disabled .product-select-price {
    color: var(--text-muted);
}
.product-select-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.checkout-panel { position: sticky; top: calc(var(--topbar-height) + 1rem); }

.checkout-total {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 1.1rem;
    margin-bottom: 1rem;
}

.checkout-total .total-amount {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--success);
    letter-spacing: -0.02em;
}

/* ── Reports ── */
.report-card-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    height: 100%;
    transition: all var(--transition);
}

.report-card-inner:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: #c7d2fe;
}

.report-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.9rem;
}

.report-card-inner h5 { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem; }
.report-card-inner p { color: var(--text-muted); font-size: 0.8125rem; margin: 0; }

/* ── Toolbar & action buttons ── */
.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.3rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 240px;
    min-width: 0;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 0 0 auto;
}

.toolbar-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    min-height: 40px;
    line-height: 1.2;
}

.filter-bar .btn,
.filter-bar .btn-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.85rem;
    height: 40px;
    background: var(--surface-muted);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: border-color var(--transition), background var(--transition);
}

.filter-check:hover { border-color: #a5b4fc; background: var(--primary-soft); }

.filter-check .form-check-input {
    margin: 0;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    border-color: var(--border-strong);
}

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

/* ── Sales currency filter ── */
.sales-hero-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.15rem;
    padding: 1.35rem 1.45rem;
    border-radius: calc(var(--radius) + 2px);
    background:
        radial-gradient(circle at 100% 0%, rgba(79, 70, 229, 0.12), transparent 42%),
        radial-gradient(circle at 0% 100%, rgba(16, 185, 129, 0.08), transparent 38%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(79, 70, 229, 0.12);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.08);
}

.sales-hero-copy {
    flex: 1 1 220px;
    min-width: 0;
}

.sales-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sales-hero-title {
    margin: 0.55rem 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.sales-hero-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 34rem;
}

.sales-hero-form {
    flex: 1 1 320px;
    min-width: 0;
}

.currency-filter {
    display: inline-flex;
    align-items: stretch;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    gap: 0.35rem;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.currency-filter-premium {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.currency-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 58px;
    padding: 0.65rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    text-align: left;
}

.currency-filter-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text);
}

.currency-filter-btn.active {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.currency-filter-btn.active .currency-filter-code { color: var(--text); }

.currency-filter-btn.active.currency-filter-btn-pkr {
    border-color: #86efac;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.16);
}

.currency-filter-btn.active.currency-filter-btn-cad {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
}

.currency-filter-btn.active:not(.currency-filter-btn-pkr):not(.currency-filter-btn-cad) {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.16);
}

.currency-filter-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.currency-filter-icon-all { background: #eef2ff; color: var(--primary); }
.currency-filter-icon-pkr { background: #ecfdf5; font-size: 1.15rem; }
.currency-filter-icon-cad { background: #eff6ff; font-size: 1.15rem; }

.currency-filter-text {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}

.currency-filter-code {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
}

.currency-filter-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sales-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.sales-stats-row-pkr .sales-stat-card-highlight {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.sales-stats-row-cad .sales-stat-card-highlight {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.sales-stat-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.05rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.sales-stat-card-highlight {
    color: #fff;
    border: none;
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.22);
}

.sales-stat-card-highlight .sales-stat-label,
.sales-stat-card-highlight .sales-stat-value { color: #fff; }

.sales-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sales-stat-card-highlight .sales-stat-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sales-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.sales-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-top: 0.1rem;
}

.sales-stat-value-money { font-size: 1.35rem; }

.sales-filter-toolbar {
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.sales-filter-bar {
    gap: 0.55rem;
}

.sales-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-right: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.sales-new-btn {
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.sales-table-card { overflow: hidden; }

.sales-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.sales-table-head h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sales-table-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.sales-table tbody tr {
    transition: background 0.15s ease;
}

.sales-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

.sale-invoice-link {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.sale-invoice-link:hover { color: var(--primary-hover); text-decoration: underline; }

.sale-customer-name { font-weight: 600; color: var(--text-secondary); }

.sale-amount {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.9rem;
}

.sale-amount-pkr {
    color: #047857;
    background: #ecfdf5;
}

.sale-amount-cad {
    color: #1d4ed8;
    background: #eff6ff;
}

.sale-date {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.84rem;
}

.sale-time {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.payment-badge-cash { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.payment-badge-card { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.payment-badge-transfer { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }

.sales-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.sales-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.85rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.6rem;
}

.sales-empty-state h6 {
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.sales-empty-state p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.sales-currency-summary {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, var(--primary-soft), #fff);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
}

.sales-currency-summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sales-currency-summary-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sales-currency-summary-total {
    font-size: 1.05rem;
    color: var(--text);
    margin-top: 0.1rem;
}

.currency-badge {
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
}

.currency-badge-pkr {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

.currency-badge-cad {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

@media (max-width: 991.98px) {
    .currency-filter-premium {
        grid-template-columns: 1fr;
    }

    .currency-filter-btn {
        min-height: 52px;
    }

    .sales-stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .sales-hero-panel {
        padding: 1rem;
    }

    .sales-hero-title {
        font-size: 1.15rem;
    }

    .sales-filter-label {
        width: 100%;
        padding-bottom: 0.15rem;
    }
}

.filter-check-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
}

.filter-field { width: 100%; }

.toolbar-search {
    flex: 1 1 180px;
    min-width: 140px;
    max-width: 320px;
}

.input-group-toolbar {
    display: flex;
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 360px;
}

.input-group-toolbar .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group-toolbar .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    min-height: 40px;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
}

.table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

@media (min-width: 576px) {
    .filter-field-sm { width: 160px; }
    .filter-field-md { width: 200px; }
    .filter-field-lg { width: 240px; }
}

.list-clean .list-group-item {
    border-color: var(--border);
    padding: 0.9rem 1.25rem;
    font-size: 0.875rem;
    transition: background var(--transition);
}

.list-clean .list-group-item:hover { background: var(--primary-soft); }

.low-stock-badge { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ── Login ── */
.guest-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    background: var(--bg);
}

.guest-mobile-brand {
    display: none;
    padding: 1.35rem;
    text-align: center;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
}

.guest-mobile-brand h2 { font-size: 1.15rem; font-weight: 700; margin: 0.55rem 0 0.15rem; }
.guest-mobile-brand p { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin: 0; letter-spacing: 0.06em; text-transform: uppercase; }

.guest-panel-left {
    flex: 1;
    background: linear-gradient(160deg, #1e293b 0%, #312e81 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    color: #fff;
    position: relative;
}

.guest-panel-left::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
    bottom: -80px;
    right: -60px;
    pointer-events: none;
}

.guest-brand h1 {
    font-weight: 800;
    font-size: 1.85rem;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.guest-feature {
    display: flex;
    gap: 1rem;
    margin-top: 1.35rem;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.guest-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(129, 140, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #c7d2fe;
}

.guest-panel-right {
    width: 100%;
    max-width: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79, 70, 229, 0.06), transparent),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.15rem;
    box-shadow: var(--shadow-md);
}

.login-card h3 {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.025em;
}

/* ── Mobile ── */
.btn-menu-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition);
}

.btn-menu-toggle:hover { border-color: var(--primary); color: var(--primary); }

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 0.38rem 0.3rem calc(0.38rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.42rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 600;
    min-height: 52px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.mobile-nav-item i { font-size: 1.2rem; }
.mobile-nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.mobile-nav-item.mobile-nav-cta {
    margin: 0 0.12rem;
}

.mobile-checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.mobile-checkout-total { font-size: 1.3rem; font-weight: 800; color: var(--success); }
.mobile-checkout-label { font-size: 0.6875rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.mobile-checkout-btn { font-weight: 700; border-radius: var(--radius-sm); }

.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.table-scroll-wrap.can-scroll::after {
    content: 'Swipe →';
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    pointer-events: none;
    z-index: 2;
}

.table-stack-mobile { min-width: 640px; }

@media (max-width: 767.98px) {
    .table-stack-mobile {
        min-width: 0;
        width: 100%;
    }

    .table-stack-mobile thead { display: none; }

    .table-stack-mobile tbody tr {
        display: block;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--border);
        background: var(--surface);
    }

    .table-stack-mobile tbody tr:hover { background: var(--primary-soft); }

    .table-stack-mobile tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: none;
        text-align: right !important;
    }

    .table-stack-mobile tbody td::before {
        content: attr(data-label);
        font-size: 0.6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        text-align: left;
        flex: 1 1 auto;
        min-width: 0;
    }

    .table-stack-mobile tbody td[colspan] {
        display: block;
        text-align: center !important;
        padding: 1.5rem 0.5rem;
    }

    .table-stack-mobile tbody td[colspan]::before { display: none; }

    .table-stack-mobile tbody td.text-end,
    .table-stack-mobile tbody td:last-child:not([colspan]) {
        justify-content: space-between;
    }

    .table-stack-mobile tbody td:last-child .btn {
        margin-left: auto;
    }

    .table-stack-mobile tbody td:not([data-label])::before,
    .table-stack-mobile tbody td[data-label=""]::before {
        display: none;
    }

    .table-stack-mobile tbody td:not([data-label]),
    .table-stack-mobile tbody td[data-label=""] {
        justify-content: flex-end;
    }

    #cartTable tbody td .form-control,
    #itemsTable tbody td .form-control,
    #itemsTable tbody td .form-select {
        max-width: 160px;
        margin-left: auto;
    }
}

body.sidebar-open { overflow: hidden; }

/* ── Shared responsive helpers ── */
.topbar {
    flex-wrap: wrap;
    min-height: var(--topbar-height);
    height: auto;
}

.topbar-left {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.detail-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.report-summary-table {
    width: 100%;
    max-width: 400px;
}

.mobile-checkout-items {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.invoice-table-wrap .table { min-width: 520px; }

.pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

.dash-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

.dashboard-panel { display: flex; flex-direction: column; height: 100%; }
.dash-pager-info { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.dash-pager-num,
.dash-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
}

.dash-pager-num { color: var(--text-muted); }
.dash-pager-num:hover { color: var(--primary); background: var(--surface); }
.dash-pager-num.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}

.dash-pager-btn { color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); }

.currency-alt { font-size: 0.78em; color: var(--text-muted); font-weight: 500; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.28s ease; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-area { padding-bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
    .content-area.content-pos-sale { padding-bottom: calc(5.75rem + env(safe-area-inset-bottom)); }
    .guest-body { flex-direction: column; }
    .guest-mobile-brand { display: block; }
    .guest-panel-left { display: none; }
    .guest-panel-right { max-width: 100%; flex: 1; }
    .checkout-panel { position: static; }
    .chart-card-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 767.98px) {
    .topbar { padding: 0.65rem 1rem; }
    .page-title { font-size: 1.05rem; max-width: 100%; white-space: normal; line-height: 1.25; }
    .topbar-titles { min-width: 0; }
    .user-pill { padding: 0.28rem; border-radius: 50%; }
    .currency-rate-pill { max-width: 8.5rem; }
    .currency-select-pill { padding: 0.28rem 0.45rem 0.28rem 0.28rem; }
    .currency-select { font-size: 0.75rem; }
    #currencyRateDisplay { font-size: 0.65rem; }
    .content-area { padding: 1rem 1rem 5.25rem; }
    .dashboard-hero { padding: 1.25rem 1.15rem; }
    .dashboard-hero-title { font-size: 1.25rem; }
    .dashboard-hero-actions { width: 100%; }
    .dashboard-hero-actions .btn { flex: 1 1 auto; }
    .dashboard-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-card .chart-wrap { height: 220px; }
    .chart-card .chart-wrap.chart-sm { height: 200px; }
    .welcome-steps { flex-direction: column; }
    .stat-value { font-size: 1.15rem; }
    .page-toolbar { flex-direction: column; align-items: stretch; padding: 0.9rem 1rem; }
    .filter-bar { width: 100%; }
    .filter-bar .form-control,
    .filter-bar .form-select,
    .toolbar-search,
    .input-group-toolbar {
        width: 100%;
        max-width: none;
        flex: 1 1 100%;
    }
    .filter-bar .btn-filter { width: 100%; }
    .filter-check { width: 100%; justify-content: flex-start; }
    .toolbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .toolbar-actions .btn {
        width: 100%;
        min-height: 42px;
        font-size: 0.8125rem;
        padding: 0.5rem 0.65rem;
    }
    .toolbar-actions .btn:only-child { grid-column: 1 / -1; }
    .toolbar-actions.toolbar-actions-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-actions { flex-direction: column; }
    .detail-actions .btn { width: 100%; justify-content: center; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
    .product-select-list {
        height: 360px;
        max-height: 45vh;
    }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .card-header-clean:has(.btn) { flex-direction: column; align-items: stretch; }
    .card-header-clean .btn { width: 100%; }
    .report-card-inner .d-flex.gap-2 { flex-direction: column; }
    .report-card-inner .btn { width: 100%; }
    .report-summary-table { max-width: none; }
    .login-card { padding: 1.5rem 1.25rem; }
    .login-card h3 { font-size: 1.2rem; }
    .guest-panel-right { padding: 1.25rem; }
    .table-scroll-wrap.can-scroll::after { display: none; }
}

@media (max-width: 575.98px) {
    .currency-rate-pill { display: none; }
    .topbar-actions { width: 100%; justify-content: flex-start; }
    .stat-card .card-body { flex-direction: column; align-items: flex-start !important; }
    .dash-pager { flex-direction: column; gap: 0.5rem; text-align: center; }
    .mobile-checkout-bar { flex-direction: column; align-items: stretch; }
    .mobile-checkout-bar .mobile-checkout-btn { width: 100%; min-height: 44px; }
    .chart-card { padding: 1rem; }
    .chart-card .chart-wrap { min-height: 180px; }
    .chart-card .chart-wrap.chart-sm { min-height: 160px; }
}

@media (max-width: 380px) {
    .product-grid { grid-template-columns: 1fr; }
}

@media (min-width: 992px) {
    .guest-body { flex-direction: row; }
}
