/* =====================================================================
   TOPTANCI B2B — DESIGN SYSTEM v3.0
   Sidebar · Split-POS · Toast · Inline-Edit · Dark/Light
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────── */
:root {
    --sidebar-w: 256px;
    --sidebar-cw: 72px;
    --topbar-h: 56px;

    --app-bg: #f1f5f9;
    --app-bg-2: #e2e8f0;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --card-bg: #ffffff;
    --border-soft: rgba(15, 23, 42, .08);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-glow: rgba(37, 99, 235, .16);
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -2px rgba(0, 0, 0, .04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 8px 10px -5px rgba(0, 0, 0, .03);
    --radius-sm: .5rem;
    --radius-md: .75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 999px;
}

[data-bs-theme="dark"] {
    --app-bg: #0f172a;
    --app-bg-2: #1e293b;
    --panel: #1e293b;
    --panel-strong: #1e293b;
    --card-bg: #1e293b;
    --border-soft: rgba(148, 163, 184, .12);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-dark: #60a5fa;
    --accent-light: rgba(59, 130, 246, .15);
    --accent-glow: rgba(59, 130, 246, .22);
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, .15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, .15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, .15);
}

/* ── Base ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-main);
    background: var(--app-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: var(--radius-full);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    background: var(--accent-light);
    color: var(--accent-dark);
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: #0f172a;
    color: #94a3b8;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width .25s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
    border-right: 1px solid rgba(148, 163, 184, .08);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(148, 163, 184, .08);
    flex-shrink: 0;
}

.sidebar-logo {
    display: inline-grid;
    place-items: center;
    width: 47px;
    height: 36px;
    border-radius: .65rem;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: .95rem;
    color: #f1f5f9;
    white-space: nowrap;
    opacity: 1;
    transition: opacity .2s;
}

.sidebar-section-label {
    display: block;
    padding: 1.25rem 1.25rem .5rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .2);
    border-radius: 3px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    margin: 1px .5rem;
    border-radius: var(--radius-md);
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: .8125rem;
    white-space: nowrap;
    transition: all .15s;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(148, 163, 184, .08);
    color: #e2e8f0;
}

.sidebar-link.active {
    background: rgba(59, 130, 246, .12);
    color: #60a5fa;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -.5rem;
    top: .4rem;
    bottom: .4rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #3b82f6;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link span {
    opacity: 1;
    transition: opacity .2s;
}

/* ── Hero Aksiyon Butonları (Hızlı Satış, FındıkPOS, Fındığım Nerede) ── */
.sidebar-hizlisatis-highlight,
.sidebar-findikpos-highlight,
.sidebar-findik-highlight {
    margin-top: 3px !important;
    margin-bottom: 3px !important;
    position: relative;
    font-weight: 600;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-pos-highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .12));
    border: 1px solid rgba(59, 130, 246, .2);
}

/* 1. HIZLI SATIŞ — Elektrik Cyan / Mavi Şimşek Teması */
.sidebar-hizlisatis-highlight {
    background: linear-gradient(135deg, rgba(14, 165, 233, .16) 0%, rgba(59, 130, 246, .10) 100%);
    border: 1px solid rgba(56, 189, 248, .32);
    color: #bae6fd !important;
}

.sidebar-hizlisatis-highlight i {
    color: #38bdf8 !important;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, .65));
    transition: transform .2s ease;
}

.sidebar-hizlisatis-highlight:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, .30) 0%, rgba(59, 130, 246, .22) 100%) !important;
    border-color: rgba(56, 189, 248, .7) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(14, 165, 233, .28);
    transform: translateX(3px);
}

.sidebar-hizlisatis-highlight:hover i {
    transform: scale(1.18) rotate(12deg);
}

.badge-hizlisatis {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 0.68rem !important;
    padding: 0.22em 0.55em !important;
    letter-spacing: 0.4px;
    box-shadow: 0 0 10px rgba(14, 165, 233, .55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: hizliSatisPulse 2.2s infinite ease-in-out;
}

@keyframes hizliSatisPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(14, 165, 233, .55);
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 18px rgba(56, 189, 248, .85);
        transform: scale(1.05);
    }
}

/* 2. FINDIKPOS — Zümrüt Yeşili / Mint Bereket Teması */
.sidebar-findikpos-highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, .16) 0%, rgba(5, 150, 105, .10) 100%);
    border: 1px solid rgba(16, 185, 129, .32);
    color: #a7f3d0 !important;
}

.sidebar-findikpos-highlight i {
    color: #10b981 !important;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, .65));
    transition: transform .2s ease;
}

.sidebar-findikpos-highlight:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, .30) 0%, rgba(5, 150, 105, .22) 100%) !important;
    border-color: rgba(16, 185, 129, .7) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, .28);
    transform: translateX(3px);
}

.sidebar-findikpos-highlight:hover i {
    transform: scale(1.18) rotate(-6deg);
}

.badge-findikpos {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 0.68rem !important;
    padding: 0.22em 0.55em !important;
    letter-spacing: 0.4px;
    box-shadow: 0 0 10px rgba(16, 185, 129, .55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: findikPosPulse 2.2s infinite ease-in-out;
}

@keyframes findikPosPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(16, 185, 129, .55);
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 18px rgba(52, 211, 153, .85);
        transform: scale(1.05);
    }
}

/* 3. FINDIĞIM NEREDE — Canlı Altın Sarısı / Kehribar Takip Teması */
.sidebar-findik-highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, .16) 0%, rgba(217, 119, 6, .10) 100%);
    border: 1px solid rgba(245, 158, 11, .32);
    color: #fde68a !important;
}

.sidebar-findik-highlight i {
    color: #f59e0b !important;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, .55));
    transition: transform .2s ease;
}

.sidebar-findik-highlight:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, .28) 0%, rgba(217, 119, 6, .22) 100%) !important;
    border-color: rgba(245, 158, 11, .65) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(245, 158, 11, .25);
    transform: translateX(3px);
}

.sidebar-findik-highlight:hover i {
    transform: scale(1.15) rotate(-6deg);
}

.badge-findik-live {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 0.68rem !important;
    padding: 0.22em 0.55em !important;
    letter-spacing: 0.4px;
    box-shadow: 0 0 10px rgba(245, 158, 11, .6);
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: findikLivePulse 2s infinite ease-in-out;
}

@keyframes findikLivePulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(245, 158, 11, .6);
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 18px rgba(245, 158, 11, .85);
        transform: scale(1.05);
    }
}


.sidebar-footer {
    padding: .75rem;
    border-top: 1px solid rgba(148, 163, 184, .08);
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .55rem;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: var(--radius-md);
    background: rgba(148, 163, 184, .05);
    color: #94a3b8;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 500;
    transition: all .15s;
    white-space: nowrap;
}

.sidebar-toggle-btn:hover {
    background: rgba(148, 163, 184, .1);
    color: #e2e8f0;
}

.sidebar-toggle-btn i {
    transition: transform .25s;
}

/* Collapsed state */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-cw);
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-toggle-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: .65rem;
    margin: 1px .35rem;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 1rem .5rem;
}

body.sidebar-collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-footer {
    padding: .75rem .35rem;
}

/* POS mode: auto-collapse sidebar */
body.pos-active-mode .sidebar {
    width: var(--sidebar-cw);
}

body.pos-active-mode .sidebar-brand-text,
body.pos-active-mode .sidebar-link span,
body.pos-active-mode .sidebar-section-label,
body.pos-active-mode .sidebar-toggle-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
}

body.pos-active-mode .sidebar-link {
    justify-content: center;
    padding: .65rem;
    margin: 1px .35rem;
}

body.pos-active-mode .sidebar-header {
    justify-content: center;
    padding: 1rem .5rem;
}

body.pos-active-mode .main-wrapper {
    margin-left: var(--sidebar-cw);
    width: calc(100% - var(--sidebar-cw));
}

/* ── Main Wrapper ────────────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s cubic-bezier(.4, 0, .2, 1), width .25s cubic-bezier(.4, 0, .2, 1);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-cw);
    width: calc(100% - var(--sidebar-cw));
}

.main-wrapper.no-sidebar {
    margin-left: 0;
    width: 100%;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--topbar-h);
    padding: 0 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.topbar-mobile-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
}

.topbar-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
}

.topbar-back-btn:hover {
    color: var(--text-main);
    background: var(--hover-bg, rgba(0, 0, 0, .04));
    border-color: var(--text-muted);
}

.topbar-breadcrumb {
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-spacer {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .75rem;
    border-radius: var(--radius-full);
    background: var(--app-bg);
    font-size: .8rem;
    font-weight: 600;
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: .7rem;
    font-weight: 700;
}

/* ── Content Area ────────────────────────────────────────────────────── */
.content-area {
    flex: 1;
    padding: 1.5rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.content-area-full {
    max-width: 100%;
    padding: 1rem;
}

/* ── Cards & Panels ──────────────────────────────────────────────────── */
.card,
.metric-card,
.hero-panel {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.metric-card {
    padding: 1.25rem;
}

.hero-panel {
    position: relative;
    overflow: hidden;
}

.hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, .04), transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, .04), transparent 50%);
    pointer-events: none;
}

.metric-stack {
    display: grid;
    gap: .75rem;
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    min-height: 2.75rem;
    padding: .5rem .875rem;
    font-size: .875rem;
    color: var(--text-main);
    transition: border-color .15s, box-shadow .15s;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: rgba(255, 255, 255, .04);
    color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: .7;
}

.form-select option {
    background: var(--panel);
    color: var(--text-main);
}

.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: .35rem;
}

.form-text {
    font-size: .75rem;
    color: var(--text-muted) !important;
}

.code-input {
    font-family: 'SF Mono', Consolas, monospace;
    letter-spacing: .4rem;
    text-align: center;
    font-size: 1.2rem;
}

.soft-code {
    font-family: 'SF Mono', Consolas, monospace;
    letter-spacing: .03em;
}

.invalid-inline {
    margin-top: .3rem;
    color: var(--danger);
    font-size: .8rem;
}

/* Large search input */
.search-input-lg {
    min-height: 3.25rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    padding: .625rem 1rem .625rem 2.15rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3e%3cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: .875rem center;
    background-size: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: .8125rem;
    transition: all .15s;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, .3);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 8px rgba(37, 99, 235, .25);
}

.btn-outline-secondary {
    border-color: var(--border-soft);
    color: var(--text-main);
}

.btn-outline-secondary:hover {
    background: var(--app-bg);
    border-color: var(--border-soft);
    color: var(--text-main);
}

.btn-outline-danger {
    border-color: var(--border-soft);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-ghost {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    padding: .35rem .5rem;
    min-height: auto;
}

.btn-ghost:hover {
    color: var(--text-main);
    background: var(--app-bg);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-lg {
    min-height: 3rem;
    font-size: .9375rem;
    border-radius: var(--radius-lg);
    padding: .625rem 1.5rem;
}

.danger-soft-btn {
    box-shadow: 0 2px 6px rgba(220, 38, 38, .15);
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-soft);
    margin-bottom: 0;
}

.table thead th {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    padding: .75rem 1rem;
}

.table> :not(caption)>*>* {
    background: transparent;
    border-bottom-color: var(--border-soft);
    color: var(--text-main);
    padding: .75rem 1rem;
}

.table-responsive {
    border-radius: var(--radius-lg);
}

/* ── Search Results ──────────────────────────────────────────────────── */
.search-results {
    display: grid;
    gap: .35rem;
}

.search-result-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border-soft);
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: .65rem .875rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all .12s;
}

.search-result-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: var(--shadow-sm);
}

/* ── POS Layout ──────────────────────────────────────────────────────── */
.pos-wrapper {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1rem;
    min-height: calc(100vh - var(--topbar-h) - 2rem);
}

.pos-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.pos-right {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
    height: calc(100vh - var(--topbar-h) - 2rem);
    border-radius: var(--radius-xl);
    background: var(--panel);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* POS Customer Bar */
.pos-customer-bar {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--panel);
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.pos-customer-bar .customer-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.pos-customer-bar .customer-balance {
    font-size: .85rem;
    color: var(--text-muted);
}

.pos-customer-bar .customer-balance strong {
    color: var(--accent);
    font-size: 1rem;
}

.pos-customer-select-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    color: var(--text-muted);
}

.pos-customer-select-prompt i {
    font-size: 1.5rem;
    opacity: .5;
}

/* POS Cart */
.pos-cart-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.pos-cart-area::-webkit-scrollbar {
    width: 4px;
}

.pos-cart-area::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: 4px;
}

.pos-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.pos-cart-empty i {
    font-size: 2.5rem;
    opacity: .3;
}

/* POS Empty State Cards */
.pos-empty-grid-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--card-bg, var(--panel, #ffffff));
    border: 1px dashed var(--border-soft, rgba(148, 163, 184, 0.25));
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin: 0.5rem 0;
    transition: transform 0.2s, border-color 0.2s;
}

.pos-empty-grid-card:hover {
    border-color: var(--accent, #2563eb);
    transform: translateY(-2px);
}

.pos-empty-grid-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-light, rgba(59, 130, 246, 0.12));
    color: var(--accent, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
}

.pos-empty-grid-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #1e293b);
    margin-bottom: 0.35rem;
}

.pos-empty-grid-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    max-width: 340px;
    line-height: 1.4;
}

.pos-empty-recent {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg, var(--panel, #ffffff));
    border: 1px dashed var(--border-soft, rgba(148, 163, 184, 0.25));
    border-radius: 12px;
}

.pos-empty-recent-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-light, rgba(59, 130, 246, 0.12));
    color: var(--accent, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pos-empty-recent-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #1e293b);
}

.pos-empty-recent-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

/* Dark theme explicit overrides for POS empty cards */
[data-bs-theme="dark"] .pos-empty-grid-card,
[data-bs-theme="dark"] .pos-empty-recent {
    background: var(--panel, #1e293b) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .pos-empty-grid-title,
[data-bs-theme="dark"] .pos-empty-recent-title {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .pos-empty-grid-desc,
[data-bs-theme="dark"] .pos-empty-recent-desc {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .pos-empty-grid-icon,
[data-bs-theme="dark"] .pos-empty-recent-icon {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

.pos-cart-item {
    display: grid;
    grid-template-columns: 1.4rem 1fr auto;
    gap: .25rem .5rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
    transition: background .12s;
}

.pos-cart-item:hover {
    background: var(--accent-light);
}

/* Sequential number badge */
.pos-cart-item-seq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: var(--radius-full);
    background: var(--surface-raised);
    border: 1.5px solid var(--border-soft);
    color: var(--text-muted);
    font-size: .62rem;
    font-weight: 700;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pos-cart-item:hover .pos-cart-item-seq {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pos-cart-item-name {
    font-weight: 600;
    font-size: .8125rem;
    grid-column: 2;
}

.pos-cart-item-meta {
    font-size: .72rem;
    color: var(--text-muted);
    grid-column: 2;
}

.pos-cart-item-total {
    font-weight: 700;
    font-size: .875rem;
    text-align: right;
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.pos-cart-item-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .12s;
    padding: 0;
    font-size: .85rem;
}

.pos-cart-item-remove:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Inline editable cells */
.inline-editable {
    cursor: pointer;
    padding: .15rem .35rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all .12s;
    display: inline-block;
    min-width: 3rem;
    text-align: center;
}

.inline-editable:hover {
    border-color: var(--border-soft);
    background: rgba(37, 99, 235, .04);
}

.inline-editable-input {
    width: 4.5rem;
    padding: .15rem .35rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-main);
    font-size: inherit;
    font-weight: inherit;
    text-align: center;
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

/* POS Checkout Bar */
.pos-checkout-bar {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-soft);
    background: var(--panel);
    flex-shrink: 0;
}

.pos-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--accent-light);
    margin-bottom: .75rem;
}

.pos-grand-total-label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--accent-dark);
}

.pos-grand-total-value {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent-dark);
    font-variant-numeric: tabular-nums;
}

.pos-complete-btn {
    width: 100%;
    min-height: 3.25rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    border: 0;
    color: #fff;
    cursor: pointer;
    transition: all .15s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.pos-complete-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .4);
}

.pos-complete-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.pos-discount-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.pos-discount-row label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.pos-discount-row input {
    max-width: 120px;
    min-height: 2.25rem;
    text-align: right;
}

.pos-note-row {
    margin-bottom: .75rem;
}

.pos-note-row textarea {
    min-height: 2.5rem;
    font-size: .8rem;
    resize: none;
}

.pos-subtotal-row {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

/* POS Search Zone */
.pos-search-zone {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.pos-search-zone .search-group {
    display: flex;
    gap: .5rem;
}

.pos-search-zone .search-group .form-control {
    flex: 1;
}

/* ── POS Search Input Wrap + Inline Clear X ──────────────────────── */
.pos-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.pos-search-input-wrap .form-control {
    padding-right: 2.2rem;
}

.pos-search-clear-x {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--danger, #dc3545);
    opacity: .55;
    font-size: .95rem;
    padding: .2rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity .15s;
    z-index: 2;
}

.pos-search-clear-x:hover,
.pos-search-clear-x:active {
    opacity: 1;
}

.pos-search-tabs {
    display: flex;
    gap: .35rem;
    margin-bottom: .75rem;
}

.pos-search-tab {
    padding: .4rem .75rem;
    border-radius: var(--radius-full);
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .12s;
}

.pos-search-tab.active,
.pos-search-tab:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* POS Customer Search Dropdown */
.pos-customer-search-dropdown {
    position: static;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: .75rem;
    margin-top: .6rem;
    box-shadow: var(--shadow-sm);
    max-height: 300px;
    overflow-y: auto;
}

/* POS Favorites / Quick Access */
.pos-favorites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
}

.pos-fav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1rem .5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: var(--panel);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    min-height: 100px;
    position: relative;
}

.pos-fav-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pos-fav-star {
    position: absolute;
    top: .35rem;
    right: .35rem;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-muted);
    opacity: .4;
    transition: all .15s;
    line-height: 1;
}

.pos-fav-star:hover,
.pos-fav-star.is-fav {
    opacity: 1;
    color: var(--warning);
}

.pos-fav-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: inline-grid;
    place-items: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.pos-fav-name {
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-fav-price {
    font-size: .7rem;
    color: var(--accent);
    font-weight: 700;
}

/* POS Qty Preset Bar */
.pos-qty-bar {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-top: .65rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.pos-qty-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-right: .15rem;
}

.pos-qty-btn {
    min-width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-soft);
    background: var(--panel);
    color: var(--text-main);
    font-weight: 700;
    font-size: .75rem;
    cursor: pointer;
    transition: all .12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .4rem;
    flex-shrink: 0;
}

.pos-qty-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.pos-qty-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
}

.pos-qty-custom {
    display: flex;
    align-items: center;
}

.pos-qty-custom input {
    height: 2rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: .75rem;
    border: 1px solid var(--border-soft);
    background: var(--panel);
    color: var(--text-main);
    width: 44px;
    flex-shrink: 0;
}

.pos-qty-custom input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* POS Favorite Tabs */
.pos-fav-tabs {
    display: flex;
    gap: .25rem;
}

.pos-fav-tab {
    padding: .35rem .75rem;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .12s;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.pos-fav-tab:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.pos-fav-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* POS Cancel Button */
.pos-cancel-btn {
    min-height: 3.25rem;
    font-size: .85rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: 0 1rem;
    flex-shrink: 0;
}

.pos-cancel-btn:hover {
    background: var(--danger);
    color: #fff;
}

/* POS Cart Item — improved inline controls */
.pos-cart-item-controls {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.pos-cart-qty-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--panel);
    color: var(--text-main);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
    padding: 0;
    flex-shrink: 0;
}

.pos-cart-qty-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-dark);
}

.pos-cart-qty-btn.danger:hover {
    border-color: var(--danger);
    background: var(--danger-light);
    color: var(--danger);
}

.pos-cart-qty-input {
    width: 3.5rem;
    height: 1.75rem;
    text-align: center;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--app-bg);
    color: var(--text-main);
    font-weight: 700;
    font-size: .75rem;
    padding: 0 .2rem;
    outline: none;
    transition: border-color .12s;
}

.pos-cart-qty-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.pos-cart-price-input {
    width: 5rem;
    height: 1.75rem;
    text-align: right;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .72rem;
    padding: 0 .25rem;
    outline: none;
    transition: all .12s;
}

.pos-cart-price-input:focus {
    border-color: var(--accent);
    background: var(--app-bg);
    box-shadow: 0 0 0 2px var(--accent-glow);
    color: var(--text-main);
}

/* POS Cart Header */
.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.pos-cart-header-title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    display: flex;
    align-items: center;
    gap: .4rem;
}

@media (max-width: 991.98px) {
    .pos-cart-header-title {
        display: none !important;
    }
}

.pos-cart-header-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 0 .3rem;
}

/* Pieces badge */
.pos-cart-pieces-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    border-radius: var(--radius-full);
    background: var(--success, #16a34a);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 0 .3rem;
}

.pos-cart-pieces-label {
    font-size: .6rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.pos-cart-header-actions {
    display: flex;
    gap: .25rem;
}

.pos-cart-mode-btn,
.pos-cart-expand-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    transition: all .12s;
    padding: 0;
}

.pos-cart-mode-btn:hover,
.pos-cart-expand-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.pos-cart-mode-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* POS Cart Compact Mode */
.pos-cart-item.compact {
    grid-template-columns: 1.4rem 1fr auto auto;
    grid-template-rows: 1fr;
    padding: .45rem 1rem;
    gap: .5rem;
    align-items: center;
    cursor: pointer;
}

.pos-cart-item.compact .pos-cart-item-seq {
    grid-row: 1;
    width: 1.2rem;
    height: 1.2rem;
    font-size: .58rem;
}

.pos-cart-item.compact .pos-cart-item-name {
    grid-column: 2;
    grid-row: 1;
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-cart-item.compact .pos-cart-item-compact-qty {
    grid-column: 3;
    grid-row: 1;
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pos-cart-item.compact .pos-cart-item-total {
    grid-column: 4;
    grid-row: 1;
    font-size: .8rem;
}

.pos-cart-item.compact .pos-cart-item-meta {
    display: none;
}

/* POS Cart Edit Modal */
.pos-cart-edit-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity .2s;
}

.pos-cart-edit-overlay.show {
    opacity: 1;
}

.pos-cart-edit-modal {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    width: 100%;
    max-width: 340px;
    box-shadow: var(--shadow-xl);
}

.pos-cart-edit-modal h6 {
    margin: 0 0 1rem;
    font-size: .9rem;
    font-weight: 700;
}

.pos-cart-edit-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.pos-cart-edit-row label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 3.5rem;
}

.pos-cart-edit-row .pos-cart-item-controls {
    flex: 1;
}

.pos-cart-edit-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
}

.pos-cart-edit-actions button {
    flex: 1;
    min-height: 2.5rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: .8rem;
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: all .12s;
}

.pos-cart-edit-actions .btn-edit-save {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pos-cart-edit-actions .btn-edit-delete {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* POS Favorite Search Modal */
.pos-fav-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem 1rem;
}

.pos-fav-search-modal {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 1rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
}

.pos-fav-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.pos-fav-search-close {
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: .25rem;
    line-height: 1;
}

.pos-fav-search-close:hover {
    color: var(--danger);
}

/* POS Status Panel */
.pos-status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 0;
}

.pos-status-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .65rem;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
    background: var(--app-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
}

.pos-status-chip i {
    font-size: .8rem;
}

/* Keyboard shortcuts hint */
.pos-shortcuts-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .5rem 0;
}

.shortcut-hint {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    color: var(--text-muted);
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.4rem;
    padding: 0 .35rem;
    border-radius: .3rem;
    background: var(--app-bg);
    border: 1px solid var(--border-soft);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 1px 0 var(--border-soft);
}

/* POS Recent Orders */
.pos-recent-list {
    display: grid;
    gap: .35rem;
}

.pos-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem .875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--panel);
    text-decoration: none;
    color: inherit;
    transition: all .12s;
}

.pos-recent-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.pos-recent-pay {
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .01em;
}

/* Nakit para üstü kutusu — koyu modalda okunaklı */
.cash-change-box {
    background: #166534;
    border: 1px solid #22c55e;
    color: #ecfdf5;
}

.cash-change-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #bbf7d0;
    margin-bottom: .25rem;
}

.cash-change-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
}

/* ── Toast Notifications ─────────────────────────────────────────────── */
.toast-stack {
    position: fixed;
    top: calc(var(--topbar-h) + .75rem);
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 380px;
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(1rem) scale(.96);
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    font-size: .8125rem;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.app-toast-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-sm);
    display: inline-grid;
    place-items: center;
    font-size: .8rem;
}

.app-toast-success .app-toast-icon {
    background: var(--success-light);
    color: var(--success);
}

.app-toast-danger .app-toast-icon,
.app-toast-error .app-toast-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.app-toast-warning .app-toast-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.app-toast-info .app-toast-icon {
    background: var(--accent-light);
    color: var(--accent);
}

.app-toast-body {
    flex: 1;
    line-height: 1.4;
}

.app-toast-body strong {
    display: block;
    font-size: .8125rem;
    margin-bottom: .1rem;
}

.app-toast-close {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: .15rem;
    font-size: 1rem;
    line-height: 1;
    opacity: .5;
    transition: opacity .12s;
}

.app-toast-close:hover {
    opacity: 1;
}

/* ── Scanner Modal ───────────────────────────────────────────────────── */
.scanner-modal-content {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--panel);
    box-shadow: var(--shadow-xl);
}

.scanner-preview-shell {
    position: relative;
    min-height: 20rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0f172a;
}

.scanner-preview {
    width: 100%;
    height: 100%;
    min-height: 20rem;
    object-fit: cover;
    display: block;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(0, 0, 0, .3), transparent 20%, transparent 80%, rgba(0, 0, 0, .3)),
        linear-gradient(to bottom, rgba(0, 0, 0, .3), transparent 20%, transparent 80%, rgba(0, 0, 0, .3));
}

.scanner-overlay::after {
    content: '';
    position: absolute;
    left: 15%;
    right: 15%;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 14px var(--accent-glow);
    animation: scan-pulse 2s ease-in-out infinite;
}

@keyframes scan-pulse {

    0%,
    100% {
        opacity: .4;
    }

    50% {
        opacity: 1;
    }
}

.scanner-status-pill {
    display: inline-flex;
    align-items: center;
    padding: .5rem .75rem;
    border-radius: var(--radius-full);
    background: var(--app-bg);
    font-weight: 600;
    font-size: .8rem;
    transition: background .3s, color .3s;
}

.scanner-status-pill.scan-success-flash {
    background: var(--success-light, #dcfce7);
    color: var(--success, #16a34a);
}

.scanner-focus-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84%;
    height: 160px;
    max-height: 55%;
    border: 2px dashed rgba(59, 130, 246, 0.65);
    border-radius: 14px;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
    z-index: 5;
}

.scanner-focus-box::before,
.scanner-focus-box::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: #3b82f6;
    border-style: solid;
}

.scanner-focus-box::before {
    top: -2px;
    left: -2px;
    border-width: 3.5px 0 0 3.5px;
    border-top-left-radius: 12px;
}

.scanner-focus-box::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 3.5px 3.5px 0;
    border-bottom-right-radius: 12px;
}

/* ── Scan Speed Settings Panel ───────────────────────────────────────── */
.scan-speed-panel {
    background: var(--app-bg, #f8f9fa);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: var(--radius-lg, .75rem);
    padding: .75rem 1rem;
}

.scan-speed-panel .form-range {
    height: 6px;
}

#barcode-scan-settings-toggle {
    border-radius: var(--radius-full, 50%);
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    margin-top: 20px;
}

/* ── Status Colors ───────────────────────────────────────────────────── */
.status-soft-danger {
    color: var(--danger);
}

.status-soft-success {
    color: var(--success);
}

.status-soft-warning {
    color: var(--warning);
}

.badge-soft-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-soft-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-soft-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ── Section Toolbar ─────────────────────────────────────────────────── */
.section-toolbar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ── Pagination ──────────────────────────────────────────────────────── */
.pagination {
    --bs-pagination-bg: var(--panel);
    --bs-pagination-border-color: var(--border-soft);
    --bs-pagination-color: var(--text-main);
    --bs-pagination-hover-bg: var(--accent-light);
    --bs-pagination-hover-color: var(--text-main);
    --bs-pagination-active-bg: var(--accent);
    --bs-pagination-active-border-color: var(--accent);
    --bs-pagination-border-radius: var(--radius-md);
}

/* ── Receipt ─────────────────────────────────────────────────────────── */
.receipt-card {
    max-width: 960px;
    margin: 0 auto;
}

/* ── Text Overrides ──────────────────────────────────────────────────── */
.text-secondary {
    color: var(--text-muted) !important;
}

/* ── Auth Pages (no sidebar) ─────────────────────────────────────────── */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background:
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, .06), transparent 50%),
        var(--app-bg);
}

.auth-layout>.row {
    width: min(100%, 34rem);
    margin: 0;
}

.auth-layout>.row>[class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0;
}

.auth-layout .auth-card {
    width: 100%;
    max-width: none;
}

/* ── Sidebar Overlay (mobile) ────────────────────────────────────────── */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1049;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Quick Sale Banner ───────────────────────────────────────────────── */
.quick-sale-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-light), rgba(99, 102, 241, .08));
    border: 1px solid rgba(37, 99, 235, .12);
}

.quick-sale-steps {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.quick-sale-step {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .75rem;
    border-radius: var(--radius-full);
    background: var(--panel);
    border: 1px solid var(--border-soft);
    font-weight: 600;
    font-size: .8rem;
}

.quick-sale-step-number {
    display: inline-grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

/* ── Responsive: Tablet ──────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .pos-wrapper {
        grid-template-columns: 1fr 360px;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: clip !important;
    }

    .topbar-mobile-trigger {
        display: flex;
    }

    .pos-wrapper {
        grid-template-columns: 1fr;
    }

    .pos-right {
        position: static;
        height: auto;
    }
}

/* ── Responsive: Mobile ──────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .content-area {
        padding: .875rem;
        max-width: 100vw;
        overflow-x: clip;
    }

    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .metric-card,
    .card,
    .hero-panel,
    .auth-card {
        border-radius: var(--radius-lg);
    }

    .metric-card.rounded-4.p-4,
    .metric-card.rounded-4.p-lg-5,
    .receipt-card.metric-card.rounded-4.p-4,
    .receipt-card.metric-card.rounded-4.p-lg-5 {
        padding: 1rem !important;
    }

    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .section-toolbar {
        width: 100%;
    }

    .section-toolbar>a,
    .section-toolbar>button,
    .section-toolbar>form {
        flex: 1 1 calc(50% - .5rem);
    }

    .section-toolbar>form .btn,
    .section-toolbar>form button {
        width: 100%;
    }

    .pos-favorites {
        grid-template-columns: repeat(3, 1fr);
    }

    .pos-fav-card {
        min-height: 80px;
        padding: .75rem .35rem;
    }

    .pos-search-zone {
        border-radius: var(--radius-lg);
    }

    .pos-search-zone .search-group {
        flex-direction: row;
    }

    .table-responsive .table thead {
        display: none;
    }

    .table-responsive .table,
    .table-responsive .table tbody,
    .table-responsive .table tr,
    .table-responsive .table td {
        display: block;
        width: 100%;
    }

    .table-responsive {
        padding: .5rem;
    }

    .table-responsive .table {
        border-collapse: separate;
        border-spacing: 0 .5rem;
        margin-bottom: -.5rem;
    }

    .table-responsive .table tr {
        padding: .9rem 1rem;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-lg);
        background: var(--panel);
        box-shadow: var(--shadow-xs);
        overflow: hidden;
    }

    .table-responsive .table td {
        border: 0;
        padding: .35rem 0;
    }

    .table-responsive .table td.text-end,
    .table-responsive .table td .text-end,
    .table-responsive .table .d-flex.justify-content-end {
        text-align: left !important;
        justify-content: flex-start !important;
    }

    .table-responsive .table td:last-child {
        padding-bottom: 0;
    }

    .table-responsive .table td>.row {
        margin-left: 0;
        margin-right: 0;
    }

    .table-responsive .table td>.row>[class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }

    .table-responsive .table td .btn-sm,
    .table-responsive .table td .btn {
        min-height: 2.5rem;
    }

    .table-responsive .table td::before {
        content: attr(data-label);
        display: block;
        font-size: .65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--text-muted);
        margin-bottom: .25rem;
    }

    .scanner-preview-shell,
    .scanner-preview {
        min-height: 15rem;
    }
}

@media (max-width: 575.98px) {
    .pos-favorites {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Mobile Bottom Nav (Fallback for logged-in mobile) ───────────────── */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: none;
    justify-content: space-evenly;
    align-items: flex-end;
    width: 100%;
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    background: var(--panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .content-area {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    body.pos-active-mode .content-area {
        padding-bottom: 0;
    }
}

.mobile-bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    min-height: 2.75rem;
    padding: .4rem .15rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-size: .62rem;
    font-weight: 600;
    text-align: center;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
    flex: 1;
    min-width: 0;
}

.mobile-bottom-link i {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-bottom-link span {
    display: block;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-bottom-link:hover,
.mobile-bottom-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

.mobile-bottom-link.nav-highlight-blue,
.mobile-bottom-link.nav-highlight-green {
    border-radius: 12px;
    margin: 0 0.15rem;
    padding: .4rem .15rem;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-bottom-link.nav-highlight-blue {
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd), #4f46e5);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.mobile-bottom-link.nav-highlight-green {
    background: linear-gradient(135deg, var(--bs-teal, #20c997), var(--bs-success, #198754));
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(32, 201, 151, 0.35);
}

.mobile-bottom-link.nav-highlight-blue i,
.mobile-bottom-link.nav-highlight-green i {
    color: #fff !important;
}

.mobile-bottom-link.nav-highlight-blue:hover,
.mobile-bottom-link.nav-highlight-blue:active {
    background: linear-gradient(135deg, #4f46e5, var(--bs-primary, #0d6efd));
    color: #fff !important;
    transform: translateY(-6px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.mobile-bottom-link.nav-highlight-green:hover,
.mobile-bottom-link.nav-highlight-green:active {
    background: linear-gradient(135deg, var(--bs-success, #198754), var(--bs-teal, #20c997));
    color: #fff !important;
    transform: translateY(-6px);
    box-shadow: 0 6px 16px rgba(32, 201, 151, 0.45);
}

/* ── FAB (Floating Action Button) — Ortadaki Satış/Barkod Butonu ─── */
.mobile-bottom-fab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto;
    margin-top: -22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(37, 99, 235, .4), 0 0 0 4px var(--panel);
    transition: transform .2s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

.mobile-bottom-fab:hover,
.mobile-bottom-fab:active {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 99, 235, .5), 0 0 0 4px var(--panel);
    color: #fff;
}

.mobile-bottom-fab.active {
    background: linear-gradient(135deg, #16a34a, #059669);
    box-shadow: 0 4px 16px rgba(22, 163, 74, .4), 0 0 0 4px var(--panel);
}

.mobile-bottom-fab-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, .15);
    animation: fab-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fab-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: .6;
    }

    50% {
        transform: scale(1.12);
        opacity: 0;
    }
}

/* ── Print ────────────────────────────────────────────────────────────── */
@media print {

    .sidebar,
    .topbar,
    .mobile-bottom-nav,
    .toast-stack,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body {
        background: #fff !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .metric-card,
    .receipt-card,
    .hero-panel,
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
    }
}

/* ── Barcode field styles (product form) ─────────────────────────────── */
.barcode-field-stack,
.barcode-inline-group {
    display: grid;
    gap: .5rem;
}

.barcode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.barcode-actions>* {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .barcode-actions>* {
        flex: 1 1 calc(50% - .25rem);
    }
}

/* ── Barcode celebration ─────────────────────────────────────────────── */
@keyframes barcodeGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
    }

    40% {
        box-shadow: 0 0 20px 6px rgba(16, 185, 129, .35);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes fieldFlash {
    0% {
        background-color: rgba(16, 185, 129, .18);
    }

    100% {
        background-color: transparent;
    }
}

@keyframes confettiPop {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.barcode-found-glow {
    animation: barcodeGlow .9s ease-out;
}

.field-flash {
    animation: fieldFlash .8s ease-out;
    border-radius: var(--bs-border-radius, .375rem);
}

.barcode-confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 10;
}

.barcode-confetti {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: confettiPop var(--dur) ease-out forwards;
}

/* ── Misc ─────────────────────────────────────────────────────────────── */
.auth-help-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--accent-light);
    padding: .75rem 1rem;
}

/* Theme toggle */
.theme-toggle {
    min-width: 4rem;
}

/* Fav color palette for product cards */
.fav-bg-1 {
    background: #dbeafe;
    color: #1d4ed8;
}

.fav-bg-2 {
    background: #dcfce7;
    color: #16a34a;
}

.fav-bg-3 {
    background: #fef3c7;
    color: #d97706;
}

.fav-bg-4 {
    background: #fee2e2;
    color: #dc2626;
}

.fav-bg-5 {
    background: #f3e8ff;
    color: #7c3aed;
}

.fav-bg-6 {
    background: #e0f2fe;
    color: #0284c7;
}

.fav-bg-7 {
    background: #fce7f3;
    color: #db2777;
}

.fav-bg-8 {
    background: #ecfdf5;
    color: #059669;
}

/* ── Alert Override ──────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE-FIRST: Dokunmatik & PWA Eklemeleri
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Touch Friendly Targets (minimum 44×44px) ────────────────────────── */
.btn-touch {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-touch-sm {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* Search result items — larger touch target on mobile */
@media (max-width: 991.98px) {
    .search-result-item {
        padding: .875rem 1rem;
        min-height: 3.25rem;
    }

    .pos-search-tab {
        padding: .55rem 1rem;
        font-size: .8rem;
        min-height: 44px;
    }

    .pos-fav-card {
        min-height: 90px;
        padding: .875rem .5rem;
    }
}

/* ── PWA Standalone Mode (adres çubuğu yok) ─────────────────────────── */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}

/* ── Barcode Flash Effect (Yeşil flaş) ──────────────────────────────── */
.barcode-flash {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}

.barcode-flash.flash-success {
    background: radial-gradient(circle at center, rgba(22, 163, 74, .25), rgba(22, 163, 74, .08) 60%, transparent 80%);
    animation: flash-pop .45s ease-out forwards;
}

.barcode-flash.flash-warning {
    background: radial-gradient(circle at center, rgba(217, 119, 6, .2), rgba(217, 119, 6, .06) 60%, transparent 80%);
    animation: flash-pop .45s ease-out forwards;
}

@keyframes flash-pop {
    0% {
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ── Swipe to Delete ─────────────────────────────────────────────────── */
.pos-cart-item-swipe {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.pos-cart-item-swipe-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    transform: translateX(100%);
    transition: transform .2s;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.pos-cart-item-swipe.swiping .pos-cart-item-swipe-bg {
    transform: translateX(0);
}

.pos-cart-item-swipe .pos-cart-item {
    position: relative;
    z-index: 1;
    background: var(--panel);
    transition: transform .2s;
}

.pos-cart-item-swipe.swiping .pos-cart-item {
    transform: translateX(-80px);
}

/* ── Mobile POS Layout ───────────────────────────────────────────────── */
@media (max-width: 991.98px) {

    /* POS sayfasında alt menü gizle, kendi sticky footerı var */
    body.pos-active-mode .mobile-bottom-nav {
        display: none !important;
    }

    body.pos-active-mode .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.pos-active-mode .sidebar {
        transform: translateX(-100%);
    }

    body.pos-active-mode .topbar {
        display: none;
    }

    .pos-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: calc(100vh - env(safe-area-inset-top));
        min-height: 100dvh;
    }

    .pos-left {
        flex: 1;
        padding: .75rem;
        padding-bottom: 6rem;
        overflow-y: auto;
    }

    .pos-right {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: auto;
        max-height: 80dvh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .12);
        z-index: 1035;
        transform: translateY(calc(100% - 4.5rem));
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        display: flex;
        flex-direction: column;
    }

    .pos-right.cart-expanded {
        transform: translateY(0);
    }

    /* Sepet kaydırma tutamacı */
    .pos-right::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--border-soft);
        margin: .5rem auto;
        flex-shrink: 0;
    }

    /* Mobilde checkout bar daima görünür */
    .pos-checkout-bar {
        position: relative;
        border-radius: 0;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    }

    .pos-cart-area {
        max-height: 50dvh;
        transition: max-height .3s ease;
    }

    .pos-right.cart-fullscreen {
        max-height: 100dvh;
        transform: translateY(0) !important;
        top: 0;
        bottom: 0;
        border-radius: 0;
    }

    .pos-right.cart-fullscreen .pos-cart-area {
        max-height: calc(100dvh - 10rem);
        flex: 1;
    }

    .pos-right.cart-fullscreen .pos-cart-mini-bar {
        display: none;
    }

    .pos-right.cart-fullscreen::before {
        display: none;
    }

    .pos-customer-bar {
        padding: .75rem 1rem;
    }

    /* Favoriler küçük grid telefonda */
    .pos-favorites {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .pos-fav-card {
        min-height: 80px;
    }

    /* POS sayfasında content padding ayarı */
    body.pos-active-mode .content-area {
        padding: 0;
        max-width: 100%;
    }

    body.pos-active-mode .content-area-full {
        padding: 0;
    }
}

/* ── Tablet Kiosk Modu (Yatay Bölünmüş Ekran) ──────────────────────── */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .pos-wrapper {
        grid-template-columns: 1fr 340px;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .pos-wrapper {
        grid-template-columns: 1fr 400px;
    }
}

/* Tablet yatay mod (landscape) */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: landscape) {
    .pos-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 340px !important;
        gap: .75rem;
        min-height: calc(100vh - env(safe-area-inset-top));
    }

    .pos-left {
        overflow-y: auto;
    }

    .pos-right {
        position: sticky !important;
        top: .5rem;
        height: calc(100vh - 1rem) !important;
        max-height: none !important;
        transform: none !important;
        border-radius: var(--radius-xl) !important;
    }

    .pos-right::before {
        display: none;
    }

    body.pos-active-mode .mobile-bottom-nav {
        display: none !important;
    }
}

/* ── Mobil Sepet Mini-Bar (kapalıyken toplam göster) ─────────────────── */
.pos-cart-mini-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 991.98px) {
    .pos-cart-mini-bar {
        display: flex;
    }

    .pos-right.cart-expanded .pos-cart-mini-bar {
        border-bottom: 1px solid var(--border-soft);
    }
}

.pos-cart-mini-bar .cart-mini-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: .875rem;
}

.pos-cart-mini-bar .cart-mini-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 .35rem;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

.pos-cart-mini-bar .cart-mini-total {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-dark);
    font-variant-numeric: tabular-nums;
}

/* ── Mobile: Topbar gizleme POS dışında değil ────────────────────────── */
@media (max-width: 991.98px) {
    .topbar {
        padding: 0 .75rem;
        height: 48px;
    }

    .topbar-left {
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
    }

    .topbar-breadcrumb {
        font-size: .8rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: min(180px, 45vw);
    }
}

@media (max-width: 576px) {
    .topbar-breadcrumb {
        max-width: min(140px, 38vw);
        font-size: .78rem;
    }
}

/* ── iOS notch / ortam güvenli alan ──────────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: calc(.35rem + env(safe-area-inset-bottom));
    }
}

/* ── Genel dokunmatik iyileştirmeler ─────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {

    /* Hover efektlerini kaldır dokunmatik cihazlarda */
    .sidebar-link:hover,
    .pos-fav-card:hover,
    .pos-recent-item:hover,
    .search-result-item:hover,
    .pos-cart-item:hover {
        background: unset;
        border-color: unset;
        transform: none;
        box-shadow: none;
    }

    /* Aktif dokunuş geri bildirimi */
    .pos-fav-card:active {
        transform: scale(.96);
        background: var(--accent-light);
    }

    .search-result-item:active {
        background: var(--accent-light);
    }

    .mobile-bottom-link:active {
        transform: scale(.92);
    }

    .pos-complete-btn:active {
        transform: scale(.97);
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   POS MOBILE HEADER
   ═══════════════════════════════════════════════════════════════════════ */
.pos-mobile-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem .75rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 1040;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.pos-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1.1rem;
    transition: background .12s;
    -webkit-tap-highlight-color: transparent;
}

.pos-mobile-back:active {
    background: var(--accent-light);
}

.pos-mobile-header-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-main);
}

.pos-mobile-header-title i {
    color: var(--accent);
    font-size: 1rem;
}

.pos-mobile-header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pos-mobile-header-action:active {
    background: var(--danger-light);
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════
   POS COMPACT EXTRAS ROW (Indirim + NotV)
   ═══════════════════════════════════════════════════════════════════════ */
.pos-extras-row {
    display: flex;
    gap: .5rem;
    margin-bottom: .5rem;
}

.pos-extras-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: 0 .5rem;
    background: var(--app-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    min-height: 2.25rem;
}

.pos-extras-field i {
    font-size: .75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pos-extras-field .form-control {
    border: 0;
    padding: .25rem 0;
    background: transparent;
    font-size: .78rem;
    box-shadow: none;
    min-height: unset;
    height: auto;
}

.pos-extras-field .form-control:focus {
    box-shadow: none;
}

/* First child (discount) — narrower */
.pos-extras-row .pos-extras-field:first-child {
    flex: 0 0 110px;
}

.pos-extras-row .pos-extras-field:first-child .form-control {
    text-align: right;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════
   POS RECEIPT PROMPT (after sale)
   ═══════════════════════════════════════════════════════════════════════ */
.pos-receipt-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s;
    padding: 1rem;
}

.pos-receipt-prompt.show {
    opacity: 1;
}

.pos-receipt-prompt-inner {
    background: var(--panel);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 380px;
    width: 100%;
    transform: translateY(20px) scale(.95);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.pos-receipt-prompt.show .pos-receipt-prompt-inner {
    transform: translateY(0) scale(1);
}

.pos-receipt-prompt-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: .75rem;
    line-height: 1;
}

.pos-receipt-prompt-text {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.pos-receipt-prompt-actions {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pos-receipt-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-md);
    font-size: .8rem;
    font-weight: 600;
    border: 1px solid var(--border-soft);
    cursor: pointer;
    text-decoration: none;
    transition: all .12s;
    line-height: 1.4;
}

.pos-receipt-prompt-btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pos-receipt-prompt-btn.primary:hover {
    background: var(--accent-dark);
}

.pos-receipt-prompt-btn.secondary {
    background: var(--panel);
    color: var(--text-main);
}

.pos-receipt-prompt-btn.secondary:hover {
    background: var(--app-bg);
}

.pos-receipt-prompt-btn.share {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.pos-receipt-prompt-btn.share:hover {
    background: #15803d;
}

.pos-receipt-prompt-btn.whatsapp {
    background: #25d366;
    color: #fff;
    border-color: #25d366;
}

.pos-receipt-prompt-btn.whatsapp:hover {
    background: #1da851;
}

.pos-receipt-prompt-btn.ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    padding: .5rem;
}

.pos-receipt-prompt-btn.payment {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

.pos-receipt-prompt-btn.payment:hover {
    background: #d97706;
}

.pos-receipt-prompt-info {
    margin-bottom: .75rem;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════
   POS HELD CARTS (Müşteri Beklet)
   ═══════════════════════════════════════════════════════════════════════ */
.pos-hold-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .65rem .75rem;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pos-hold-btn:hover {
    background: var(--accent);
    color: #fff;
}

.pos-held-carts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
    position: relative;
}

.pos-held-carts-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.held-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 50px;
    background: var(--accent);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pos-held-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .15s;
}

.pos-held-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp .2s;
}

.pos-held-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.pos-held-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: .25rem;
}

.pos-held-close:hover {
    color: var(--text-primary);
}

.pos-held-body {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
}

.pos-held-card {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    margin-bottom: .4rem;
    transition: border-color .15s;
}

.pos-held-card:hover {
    border-color: var(--accent);
}

.pos-held-card-name {
    font-weight: 600;
    font-size: .82rem;
}

.pos-held-card-meta {
    font-size: .72rem;
    color: var(--text-secondary);
}

.pos-held-card-time {
    font-size: .65rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

.pos-held-label {
    display: inline-block;
    background: var(--accent-bg-subtle, rgba(99, 102, 241, .1));
    color: var(--accent);
    font-size: .65rem;
    font-weight: 600;
    padding: .1rem .4rem;
    border-radius: 50px;
    margin-left: .3rem;
}

.pos-held-card-actions {
    display: flex;
    gap: .4rem;
    justify-content: flex-end;
    margin-top: .2rem;
}

.pos-held-resume-btn {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .65rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.pos-held-resume-btn:hover {
    filter: brightness(1.1);
}

.pos-held-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--danger, #ef4444);
    cursor: pointer;
    font-size: .8rem;
    transition: all .15s;
}

.pos-held-delete-btn:hover {
    background: var(--danger, #ef4444);
    color: #fff;
    border-color: var(--danger, #ef4444);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   RECEIPT DESIGNER
   ═══════════════════════════════════════════════════════════════════════ */
.receipt-designer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .receipt-designer-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Settings Panel ──────────────────────────────────────────────── */
.receipt-designer-settings {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.rd-section {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.rd-section-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1rem;
    border: 0;
    background: transparent;
    font-weight: 600;
    font-size: .825rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background .12s;
    text-align: left;
}

.rd-section-toggle:hover {
    background: var(--app-bg);
}

.rd-section-toggle .rd-chevron {
    margin-left: auto;
    transition: transform .2s;
    font-size: .7rem;
    color: var(--text-muted);
}

.rd-section-toggle.active .rd-chevron {
    transform: rotate(180deg);
}

.rd-section-body {
    display: none;
    padding: .75rem 1rem 1rem;
    border-top: 1px solid var(--border-soft);
}

.rd-section-body.open {
    display: block;
}

.rd-field {
    margin-bottom: .625rem;
}

.rd-field label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}

.rd-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

/* Toggle switches */
.rd-switch {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 0;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 500;
}

.rd-switch input {
    display: none;
}

.rd-switch-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--app-bg-2);
    border-radius: 20px;
    transition: background .2s;
    flex-shrink: 0;
}

.rd-switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.rd-switch input:checked+.rd-switch-slider {
    background: var(--accent);
}

.rd-switch input:checked+.rd-switch-slider::after {
    transform: translateX(16px);
}

/* Button groups */
.rd-btn-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.rd-btn {
    flex: 1;
    padding: .4rem .5rem;
    border: 0;
    background: var(--panel);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .12s;
    color: var(--text-muted);
}

.rd-btn:not(:last-child) {
    border-right: 1px solid var(--border-soft);
}

.rd-btn.active {
    background: var(--accent);
    color: #fff;
}

.rd-btn:hover:not(.active) {
    background: var(--accent-light);
}

.rd-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-top: .25rem;
}

/* ── Logo Upload Widget ──────────────────────────────────────────── */
.rd-logo-upload {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.rd-logo-preview-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md, .5rem);
    background: var(--panel);
}

.rd-logo-preview-wrap img {
    max-width: 120px;
    max-height: 48px;
    object-fit: contain;
    border-radius: .25rem;
}

.rd-logo-remove-btn {
    position: absolute;
    top: -.375rem;
    right: -.375rem;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    font-size: .6rem;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rd-logo-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .5rem .75rem;
    border: 2px dashed var(--border-soft);
    border-radius: var(--radius-md, .5rem);
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.rd-logo-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.rd-logo-upload-progress {
    display: inline-flex;
    align-items: center;
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── Infinite Scroll ─────────────────────────────────────────────── */
.infinite-scroll-spinner {
    display: flex;
    justify-content: center;
}

/* ── Preview Panel ───────────────────────────────────────────────── */
.receipt-designer-preview {
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--topbar-h) - 3rem);
}

.rd-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .625rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.rd-preview-label {
    font-weight: 600;
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.rd-preview-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #e5e5e5;
}

[data-bs-theme="dark"] .rd-preview-scroll {
    background: #111827;
}

.rd-preview-paper {
    margin: 0 auto;
}

/* ── Receipt Preview Styles ──────────────────────────────────────── */
.rd-receipt {
    font-family: 'Courier New', Courier, monospace;
    color: #000;
    background: #fff;
    padding: 6mm 4mm;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    margin: 0 auto;
}

.rd-paper-58mm {
    max-width: 58mm;
}

.rd-paper-80mm {
    max-width: 80mm;
}

.rd-paper-a4 {
    max-width: 210mm;
    font-family: 'Inter', Arial, sans-serif;
}

.rd-receipt-center {
    text-align: center;
}

.rd-receipt-company {
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: .5px;
}

.rd-receipt-info {
    font-size: .82em;
    color: #666;
    margin-top: 1mm;
}

.rd-receipt-logo {
    max-width: 40mm;
    max-height: 12mm;
    display: block;
    margin: 0 auto 3mm;
}

.rd-divider {
    border: none;
    border-top: 1px dashed #000;
    margin: 3mm 0;
}

.rd-divider-double {
    border: none;
    border-top: 2px solid #000;
    margin: 3mm 0;
}

.rd-meta {
    font-size: .92em;
}

.rd-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 2mm;
}

.rd-meta-label {
    color: #666;
}

.rd-items {
    width: 100%;
    border-collapse: collapse;
}

.rd-items th {
    font-size: .8em;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    padding: 1mm 0 2mm;
    text-align: left;
}

.rd-items td {
    padding: 1.5mm 0;
    vertical-align: top;
}

.rd-items tbody tr {
    border-bottom: 1px dotted #ccc;
}

.rd-right {
    text-align: right !important;
}

.rd-bold {
    font-weight: 700;
}

.rd-item-name {
    font-weight: 700;
    font-size: .92em;
}

.rd-item-detail {
    font-size: .8em;
    color: #555;
}

.rd-totals {
    margin-top: 2mm;
}

.rd-total-row {
    display: flex;
    justify-content: space-between;
    padding: 1mm 0;
    font-size: .92em;
}

.rd-grand-total {
    font-size: 1.3em;
    font-weight: 700;
    border-top: 2px solid #000;
    padding-top: 2mm;
    margin-top: 1mm;
}

.rd-note {
    font-size: .82em;
    color: #555;
}

.rd-barcode {
    text-align: center;
    margin-top: 3mm;
}

.rd-barcode-text {
    font-family: 'Libre Barcode 128', monospace;
    font-size: 36px;
    line-height: 1;
}

.rd-barcode-num {
    font-size: .7em;
    color: #666;
}

.rd-footer {
    text-align: center;
    font-size: .82em;
    color: #666;
}

.rd-footer-note {
    text-align: center;
    font-size: .75em;
    color: #999;
    margin-top: 1mm;
}

.rd-thank-you {
    text-align: center;
    font-size: 1em;
    font-weight: 700;
    margin-top: 3mm;
    letter-spacing: .5px;
}

/* ── Receipt Designer Mobile ─────────────────────────────────────── */
@media (max-width: 991.98px) {
    .receipt-designer-preview {
        position: relative;
        top: 0;
        max-height: 60vh;
    }

    .rd-preview-scroll {
        padding: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   CUSTOMER CODE BADGE
   ═══════════════════════════════════════════════════════════════════════ */
.customer-code-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: .72rem;
    font-weight: 600;
    font-family: 'Inter', monospace;
    letter-spacing: .02em;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   CUSTOMER SEARCH (Payment form AJAX search)
   ═══════════════════════════════════════════════════════════════════════ */
.customer-search-wrapper {
    position: relative;
}

.customer-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.customer-search-results.open {
    display: block;
}

.cs-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    padding: .625rem .875rem;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    background: transparent;
    cursor: pointer;
    transition: background .1s;
    text-align: left;
    color: var(--text-main);
}

.cs-result-item:last-child {
    border-bottom: 0;
}

.cs-result-item:hover {
    background: var(--accent-light);
}

.cs-result-main {
    min-width: 0;
    flex: 1;
}

.cs-result-balance {
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cs-no-result {
    padding: .75rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .8rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   CUSTOMER QUICK ACTIONS MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(0, 0, 0, .45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    display: none;
}

/* ══════════════════════════════════════════════
   IMAGE UPLOAD WIDGET
   ══════════════════════════════════════════════ */
.image-upload-area {
    position: relative;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    transition: border-color .2s, box-shadow .2s;
}

.image-upload-area.drag-over {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), .18);
}

/* Preview */
.image-upload-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    max-height: 260px;
    padding: .5rem;
}

.image-upload-img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 8px;
}

.image-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .2s;
    border-radius: var(--radius-lg, 12px);
}

.image-upload-preview:hover .image-upload-overlay,
.image-upload-preview:focus-within .image-upload-overlay {
    opacity: 1;
}

/* Product Image Lightbox */
.product-img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}

.product-img-lightbox.is-visible {
    opacity: 1;
}

.product-img-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    cursor: pointer;
}

.product-img-lightbox-body {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img-lightbox-body img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}

.product-img-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-card, #fff);
    color: var(--text-primary, #333);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    transition: transform .15s;
}

.product-img-lightbox-close:hover {
    transform: scale(1.1);
}

/* Dropzone */
.image-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1.5rem 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color .2s;
    min-height: 140px;
}

.image-upload-dropzone i {
    font-size: 1.75rem;
    opacity: .6;
}

.image-upload-dropzone-text {
    font-size: .82rem;
    font-weight: 600;
}

.image-upload-dropzone-hint {
    font-size: .72rem;
    opacity: .55;
}

.image-upload-dropzone:hover {
    color: var(--primary);
}

/* Progress */
.image-upload-progress {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--card-bg);
    font-size: .82rem;
    font-weight: 600;
    z-index: 5;
}

/* ── Lightbox ── */
.app-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .25s ease;
    cursor: zoom-out;
}

.app-lightbox.active {
    opacity: 1;
}

.app-lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    transform: scale(.92);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.app-lightbox.active img {
    transform: scale(1);
}

.app-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, .15);
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s;
}

.app-lightbox-close:hover {
    background: rgba(255, 255, 255, .3);
}

/* POS product image in fav cards — full background design */
.pos-fav-card.has-img {
    padding: 0;
    overflow: hidden;
    background: #000;
    border-color: rgba(255, 255, 255, .06);
}

.pos-fav-card.has-img .pos-fav-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform .3s ease;
}

.pos-fav-card.has-img:hover .pos-fav-bg {
    transform: scale(1.08);
}

.pos-fav-card.has-img .pos-fav-overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    min-height: 100px;
    padding: .5rem .6rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .35) 50%, rgba(0, 0, 0, .08) 100%);
}

.pos-fav-card.has-img .pos-fav-name {
    color: #fff;
    font-size: .73rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-fav-card.has-img .pos-fav-price {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.pos-fav-card.has-img .pos-fav-star {
    z-index: 2;
    color: rgba(255, 255, 255, .7);
    opacity: .7;
}

.pos-fav-card.has-img .pos-fav-star:hover,
.pos-fav-card.has-img .pos-fav-star.is-fav {
    color: var(--warning);
    opacity: 1;
}

/* Search result product image */
.search-result-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--card-bg);
}

.modal-backdrop-custom.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.customer-quick-modal {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    z-index: 1071;
    width: min(100%, 400px);
    background: var(--panel);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .15);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility .3s;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
}

.customer-quick-modal.open {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    visibility: visible;
}

@media (min-width: 768px) {
    .customer-quick-modal {
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%) scale(.92);
        opacity: 0;
        border-radius: var(--radius-xl);
        transition: transform .25s, opacity .25s, visibility .25s;
    }

    .customer-quick-modal.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }
}

.cqm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
}

.cqm-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.cqm-sub {
    font-size: .75rem;
    color: var(--text-muted);
    font-family: 'Inter', monospace;
}

.cqm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background .1s;
}

.cqm-close:hover {
    background: var(--app-bg-2);
}

.cqm-balance-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .625rem 1.25rem;
    background: var(--accent-light);
}

.cqm-balance-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.cqm-balance-value {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-dark);
    font-variant-numeric: tabular-nums;
}

.cqm-info {
    padding: .625rem 1.25rem;
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}

.cqm-info-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: var(--text-muted);
}

.cqm-info-row i {
    font-size: .7rem;
}

.cqm-actions {
    padding: .75rem 1rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.cqm-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem .5rem;
    border-radius: var(--radius-md);
    font-size: .8rem;
    font-weight: 600;
    border: 1px solid var(--border-soft);
    cursor: pointer;
    text-decoration: none;
    transition: all .12s;
    text-align: center;
    line-height: 1.3;
    background: var(--panel);
    color: var(--text-main);
}

.cqm-action-btn:hover {
    background: var(--app-bg);
}

.cqm-action-btn.cqm-primary {
    background: var(--accent-light);
    color: var(--accent-dark);
    border-color: rgba(37, 99, 235, .2);
}

.cqm-action-btn.cqm-primary:hover {
    background: var(--accent);
    color: #fff;
}

.cqm-action-btn.cqm-success {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(22, 163, 74, .15);
}

.cqm-action-btn.cqm-success:hover {
    background: var(--success);
    color: #fff;
}

.cqm-action-btn.cqm-accent {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: rgba(124, 58, 237, .15);
}

.cqm-action-btn.cqm-accent:hover {
    background: #7c3aed;
    color: #fff;
}

.cqm-action-btn.cqm-secondary {
    background: var(--app-bg);
    color: var(--text-muted);
}

.cqm-action-btn.cqm-secondary:hover {
    background: var(--app-bg-2);
    color: var(--text-main);
}

.cqm-action-btn.cqm-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(220, 38, 38, .15);
}

.cqm-action-btn.cqm-danger:hover {
    background: var(--danger);
    color: #fff;
}

.cqm-action-form {
    grid-column: 1 / -1;
}

/* Ledger row clickable */
tr.cursor-pointer {
    cursor: pointer;
}

tr.cursor-pointer:hover td {
    background: var(--accent-light);
}

/* ===== Category Cards ===== */
.category-card {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: var(--card-bg);
    transition: box-shadow .2s, border-color .2s;
}

.category-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}

.category-card .category-header {
    padding: 1.25rem 1.25rem 0;
}

.category-card .category-body {
    padding: .75rem 1.25rem;
}

.category-card-actions {
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--app-border);
    display: flex;
    gap: .5rem;
    align-items: center;
}

.category-edit-panel {
    border-top: 1px solid var(--app-border);
    padding: 1.25rem;
    background: var(--app-bg);
    border-radius: 0 0 1rem 1rem;
}

/* ===== Report Page ===== */
.report-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.chart-container {
    position: relative;
    height: 280px;
}

@media (max-width: 767.98px) {
    .chart-container {
        height: 220px;
    }
}

/* ===== Category Search Dropdown (Product Form) ===== */
.category-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--card-bg);
    border: 1px solid var(--app-border);
    border-radius: .5rem;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    margin-top: 4px;
}

.category-search-item {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .875rem;
    transition: background .15s;
}

.category-search-item:hover,
.category-search-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.category-search-item[data-id]:hover {
    font-weight: 600;
}

.category-tag {
    font-size: .8rem;
    padding: .25rem .5rem;
    border-radius: .375rem;
    line-height: 1.4;
}

/* ===== Quick Operations Grid (Dashboard) ===== */
.quick-ops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: .45rem;
}

@media (min-width: 992px) {
    .quick-ops-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: .35rem;
    }

    .quick-ops-card {
        flex: 1 1 0;
        min-width: 0;
        padding: .75rem .15rem .6rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .quick-ops-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: .45rem;
    }
}

.quick-ops-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .3rem;
    padding: .8rem .2rem .65rem;
    border-radius: .9rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, .08));
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    cursor: pointer;
    text-align: center;
}

.quick-ops-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    border-color: transparent;
}

.quick-ops-card:active {
    transform: translateY(0);
}

.quick-ops-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.quick-ops-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.quick-ops-icon-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.quick-ops-icon-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.quick-ops-icon-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.quick-ops-icon-teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.quick-ops-icon-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.quick-ops-icon-indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.quick-ops-icon-amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.quick-ops-icon-rose {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.quick-ops-icon-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.quick-ops-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    text-align: center;
    min-height: 1.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.quick-ops-desc {
    font-size: .65rem;
    color: var(--text-muted);
    line-height: 1.2;
    text-align: center;
    min-height: 1.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    margin-top: -1px;
}

@media (max-width: 575.98px) {
    .quick-ops-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: .35rem;
    }

    .quick-ops-card {
        padding: .65rem .15rem .5rem;
        border-radius: .75rem;
        gap: .2rem;
    }

    .quick-ops-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        border-radius: 9px;
        margin-bottom: 0;
    }

    .quick-ops-label {
        font-size: .68rem;
        min-height: 1.7rem;
    }

    .quick-ops-desc {
        display: none;
    }
}

.quick-op-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1rem .5rem;
    border-radius: .75rem;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.quick-op-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    color: #fff;
}

.quick-op-card i {
    font-size: 1.5rem;
}

.quick-op-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.quick-op-orange {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.quick-op-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.quick-op-red {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.quick-op-teal {
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

.quick-op-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.quick-op-indigo {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.quick-op-amber {
    background: linear-gradient(135deg, #d97706, #b45309);
}

/* ===== Quick Operations Pill (Compact) ===== */
.quick-op-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border-radius: 2rem;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.quick-op-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
    color: #fff;
}

.quick-op-pill i {
    font-size: .85rem;
}

/* ===== Quick Operations Bar (Dashboard Top) ===== */
.quick-ops-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: .25rem 0;
}

.quick-ops-bar::-webkit-scrollbar {
    display: none;
}

@media (max-width: 575.98px) {
    .quick-ops-bar {
        gap: .35rem;
    }

    .quick-op-pill {
        padding: .3rem .55rem;
        font-size: .72rem;
    }

    .quick-op-pill i {
        font-size: .78rem;
    }
}

/* ===== Main Menu Grid (launcher) ===== */
.launcher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 680px;
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    .launcher-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.launcher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 1.75rem 1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease;
    text-align: center;
}

.launcher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    color: #fff;
}

.launcher-card i {
    font-size: 2.5rem;
}

@media (max-width: 767.98px) {
    .launcher-card i {
        font-size: 2rem;
    }

    .launcher-card {
        padding: 1.25rem .75rem;
        font-size: .8rem;
    }
}

/* ===== Phone Input Group ===== */
.phone-input-group .input-group-text {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    border-color: var(--border-soft);
}

/* ===== Calendar ===== */
.calendar-grid {
    width: 100%;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 4px;
}

.calendar-day-header {
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 6px 0;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-cell {
    min-height: 90px;
    padding: 6px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

.calendar-cell:hover {
    background: var(--accent-light);
    box-shadow: 0 0 0 2px var(--accent);
}

.calendar-cell-empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.calendar-cell-empty:hover {
    background: transparent;
    box-shadow: none;
}

.calendar-cell-today {
    border-color: var(--accent);
    background: var(--accent-light);
}

.calendar-cell-today .calendar-cell-day {
    color: var(--accent);
    font-weight: 700;
}

.calendar-cell-day {
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.calendar-cell-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-cell-sales {
    margin-bottom: 2px;
    padding: 1px 2px;
    border-radius: 3px;
    background: rgba(var(--bs-success-rgb), .06);
}

.calendar-cell-event {
    font-size: .65rem;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-cell-event-task {
    background: rgba(var(--bs-primary-rgb), .15);
    color: var(--bs-primary);
}

.calendar-cell-event-reminder {
    background: rgba(var(--bs-warning-rgb), .15);
    color: var(--bs-warning);
}

.calendar-cell-event-note {
    background: rgba(var(--bs-info-rgb), .15);
    color: var(--bs-info);
}

.calendar-cell-event-report {
    background: rgba(var(--bs-secondary-rgb), .15);
    color: var(--bs-secondary);
}

.calendar-cell-event.completed {
    opacity: .5;
    text-decoration: line-through;
}

.calendar-cell-more {
    font-size: .6rem;
    color: var(--text-secondary);
    text-align: center;
}

.calendar-task-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}

.calendar-task-item:last-child {
    border-bottom: none;
}

.calendar-task-item.completed {
    opacity: .6;
}

.calendar-task-title {
    font-size: .85rem;
    line-height: 1.3;
}

.calendar-task-check {
    margin-top: 2px;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .calendar-cell {
        min-height: 55px;
        padding: 3px;
    }

    .calendar-cell-day {
        font-size: .75rem;
    }

    .calendar-cell-event {
        font-size: .55rem;
    }

    .calendar-cell-events {
        display: none;
    }

    .calendar-cell-sales {
        display: none;
    }

    .calendar-cell-has-events::after {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--accent);
        margin: 4px auto 0;
    }
}

/* ═══ Inline Fiyat Duzenleme ═══ */
.inline-price-input {
    width: 90px;
    text-align: right;
    font-size: .82rem;
    padding: .2rem .4rem;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    transition: all .2s;
}

.inline-price-input:focus {
    border-color: var(--accent);
    background: #fff;
    color: #1a1a2e;
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 59, 130, 246), .15);
}

.inline-price-input.is-changed {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #1a1a2e;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .15);
}

.inline-price-input.is-saving {
    opacity: .5;
    pointer-events: none;
}

.inline-price-input.is-saved {
    border-color: #10b981;
    background: #ecfdf5;
}

/* ═══ Barkod Yazdir Sayfasi ═══ */
.barcode-product-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.barcode-product-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}

.barcode-product-item:last-child {
    border-bottom: 0;
}

.barcode-product-item:hover {
    background: rgba(var(--accent-rgb, 59, 130, 246), .04);
}

.barcode-product-item.selected {
    background: rgba(var(--accent-rgb, 59, 130, 246), .08);
}

.barcode-product-item .form-check-input {
    flex-shrink: 0;
}

.barcode-product-item-info {
    min-width: 0;
    flex: 1;
}

.barcode-product-item-name {
    font-weight: 600;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barcode-product-item-meta {
    font-size: .75rem;
    color: var(--text-secondary);
}

.barcode-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
}

.barcode-label {
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    background: #fff;
    break-inside: avoid;
}

.barcode-label-name {
    font-size: .7rem;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barcode-label-price {
    font-size: .7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.barcode-label svg {
    max-width: 100%;
}

@media print {
    .barcode-preview-grid {
        padding: 0;
        gap: 4px;
    }

    .barcode-label {
        border: 1px solid #ccc;
        padding: 4px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   POS CONFIRM MODALS
   ═══════════════════════════════════════════════════════════════════════ */
.pos-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.pos-confirm-overlay.show {
    opacity: 1;
}

.pos-confirm-modal {
    background: var(--panel, #fff);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    max-width: 460px;
    width: 90%;
    padding: 2rem;
    text-align: center;
    transform: scale(.9) translateY(10px);
    transition: transform .25s;
}

.pos-confirm-overlay.show .pos-confirm-modal {
    transform: scale(1) translateY(0);
}

.pos-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.pos-confirm-icon.warning {
    background: var(--warning-light, #fef3c7);
    color: var(--warning, #d97706);
}

.pos-confirm-icon.danger {
    background: var(--danger-light, #fee2e2);
    color: var(--danger, #dc2626);
}

.pos-confirm-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: .5rem;
}

.pos-confirm-text {
    color: var(--text-muted, #64748b);
    font-size: .875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.pos-confirm-comparison {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.pos-confirm-arrow {
    color: var(--text-muted, #64748b);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.pos-confirm-card {
    flex: 1;
    padding: .75rem;
    border-radius: .75rem;
    border: 1px solid var(--border-soft, #e2e8f0);
    text-align: left;
    max-width: 170px;
}

.pos-confirm-card.current {
    background: var(--danger-light, #fee2e2);
    border-color: var(--danger, #dc2626);
}

.pos-confirm-card.incoming {
    background: var(--success-light, #dcfce7);
    border-color: var(--success, #16a34a);
}

.pos-confirm-card-label {
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    margin-bottom: .35rem;
    letter-spacing: .02em;
}

.pos-confirm-card.current .pos-confirm-card-label {
    color: var(--danger, #dc2626);
}

.pos-confirm-card.incoming .pos-confirm-card-label {
    color: var(--success, #16a34a);
}

.pos-confirm-card-detail {
    font-size: .78rem;
    color: var(--text-main, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-confirm-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
}

.pos-confirm-btn {
    padding: .6rem 1.25rem;
    border-radius: .5rem;
    font-weight: 600;
    font-size: .875rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all .15s;
}

.pos-confirm-btn.cancel {
    background: var(--app-bg-2, #e2e8f0);
    color: var(--text-main, #0f172a);
}

.pos-confirm-btn.cancel:hover {
    background: #cbd5e1;
}

.pos-confirm-btn.confirm {
    background: var(--accent, #2563eb);
    color: #fff;
}

.pos-confirm-btn.confirm:hover {
    background: var(--accent-dark, #1d4ed8);
}

.pos-confirm-btn.danger {
    background: var(--danger, #dc2626);
    color: #fff;
}

.pos-confirm-btn.danger:hover {
    background: #b91c1c;
}

@media (max-width: 480px) {
    .pos-confirm-comparison {
        flex-direction: column;
    }

    .pos-confirm-arrow {
        transform: rotate(90deg);
    }

    .pos-confirm-card {
        max-width: 100%;
    }
}

/* ── View Mode Toggle (List/Grid) ────────────────────────────────────── */
.view-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--app-bg-2, #f1f5f9);
    border-radius: var(--radius-sm, 6px);
    padding: 2px;
    border: 1px solid var(--border-soft, #e2e8f0);
}

.view-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius-sm, 6px) - 2px);
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    font-size: .85rem;
    transition: all .15s;
}

.view-mode-btn:hover {
    color: var(--text-main, #0f172a);
    background: var(--app-bg-3, #e2e8f0);
}

.view-mode-btn.active {
    background: var(--accent, #2563eb);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* Grid view cards */
.list-grid-view {
    display: none;
}

.list-grid-view.active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.list-table-view.active {
    display: block;
}

.list-table-view {
    display: none;
}

.list-grid-card {
    background: var(--panel, #fff);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: var(--radius-lg, 14px);
    padding: 0;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s, border-color .2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.list-grid-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent, #2563eb);
    box-shadow: 0 8px 24px rgba(37, 99, 235, .12), 0 2px 6px rgba(0, 0, 0, .06);
}

.list-grid-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1rem .625rem;
}

.list-grid-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-light, #dbeafe), var(--app-bg-2, #f1f5f9));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, #2563eb);
    font-size: 1.1rem;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, .08);
}

.list-grid-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.list-grid-card-title {
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.3;
    color: var(--text-main);
}

.list-grid-card-sub {
    font-size: .72rem;
    color: var(--text-muted, #94a3b8);
    margin-top: .1rem;
    letter-spacing: .01em;
}

.list-grid-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    padding: 0 1rem .625rem;
    flex: 1;
}

.list-grid-card-field {
    font-size: .76rem;
    color: var(--text-muted, #64748b);
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.list-grid-card-field i {
    font-size: .72rem;
    opacity: .6;
}

.list-grid-card-field strong {
    color: var(--text-main, #0f172a);
    font-weight: 600;
}

/* Label-value pairs in card fields (other listing pages) */
.list-grid-card-field>span:first-child {
    color: var(--text-muted, #94a3b8);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.list-grid-card-field>span:last-child {
    color: var(--text-main, #0f172a);
    font-weight: 500;
}

/* Card bottom action row */
.list-grid-card .d-flex.justify-content-between {
    padding: .5rem 1rem;
    border-top: 1px solid var(--border-soft, #e2e8f0);
    background: var(--app-bg, #f8fafc);
    margin-top: auto;
}

.list-grid-card-badge {
    position: absolute;
    top: .75rem;
    right: .75rem;
    display: flex;
    gap: .3rem;
    z-index: 1;
}

.list-grid-card-badge .badge {
    font-size: .6rem;
    font-weight: 700;
    padding: .25rem .5rem;
    border-radius: var(--radius-full, 20px);
    letter-spacing: .02em;
}

.list-grid-card-amount {
    font-size: .88rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* When amount is a direct child div of card → footer bar */
div.list-grid-card-amount {
    padding: .625rem 1rem;
    margin: 0;
    background: var(--app-bg, #f8fafc);
    border-top: 1px solid var(--border-soft, #e2e8f0);
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    font-size: .82rem;
    font-weight: 600;
    margin-top: auto;
}

div.list-grid-card-amount .text-secondary {
    font-weight: 500;
}

/* Dark theme overrides for card footer bar */
[data-bs-theme="dark"] div.list-grid-card-amount,
[data-bs-theme="dark"] .list-grid-card .d-flex.justify-content-between {

    border-top-color: rgba(255, 255, 255, .06);
}

[data-bs-theme="dark"] .list-grid-card-avatar {
    background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(255, 255, 255, .04));
    border-color: rgba(255, 255, 255, .06);
}

@media (max-width: 576px) {
    .list-grid-view.active {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 577px) and (max-width: 767.98px) {
    .list-grid-view.active {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3rd mode: compact table (compressed rows ~27px) */
.list-table-view.compact-mode {
    display: block !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.list-table-view.compact-mode .table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg, 8px);
}

.list-table-view.compact-mode .table {
    font-size: .73rem;
    margin-bottom: 0;
}

.list-table-view.compact-mode .table thead th {
    font-size: .62rem;
    padding: .2rem .5rem;
    height: 24px;
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: .06em;
}

.list-table-view.compact-mode .table> :not(caption)>*>* {
    padding: .15rem .5rem;
    height: 27px;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: middle;
}

.list-table-view.compact-mode .table img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.list-table-view.compact-mode .table .badge {
    font-size: .62rem;
    padding: .15rem .4rem;
    line-height: 1;
}

.list-table-view.compact-mode .table code {
    font-size: .68rem;
}

.list-table-view.compact-mode .table .btn,
.list-table-view.compact-mode .table .btn-sm {
    min-height: 22px;
    padding: .1rem .4rem;
    font-size: .68rem;
}

.list-table-view.compact-mode .table .form-control-sm,
.list-table-view.compact-mode .table .inline-price-input {
    min-height: 22px;
    height: 22px;
    padding: .1rem .3rem;
    font-size: .72rem;
}

/* On compact mode, override mobile card-style table back to real table */
@media (max-width: 767.98px) {
    .list-table-view.compact-mode .table-responsive .table thead {
        display: table-header-group;
    }

    .list-table-view.compact-mode .table-responsive .table,
    .list-table-view.compact-mode .table-responsive .table tbody,
    .list-table-view.compact-mode .table-responsive .table tr,
    .list-table-view.compact-mode .table-responsive .table td {
        display: revert;
        width: revert;
    }

    .list-table-view.compact-mode .table-responsive {
        padding: 0;
    }

    .list-table-view.compact-mode .table-responsive .table {
        border-collapse: collapse;
        border-spacing: 0;
    }

    .list-table-view.compact-mode .table-responsive .table tr {
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .list-table-view.compact-mode .table-responsive .table td {
        border-bottom: 1px solid var(--border-soft);
        padding: .15rem .5rem;
    }

    .list-table-view.compact-mode .table-responsive .table td::before {
        display: none;
    }

    .list-table-view.compact-mode .table-responsive .table td.text-end,
    .list-table-view.compact-mode .table-responsive .table td .text-end,
    .list-table-view.compact-mode .table-responsive .table .d-flex.justify-content-end {
        text-align: right !important;
        justify-content: flex-end !important;
    }
}

/* ===== Dashboard Hero Strip ===== */
.dash-hero-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.25rem;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #2b94a5 100%);
    color: #fff;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.dash-hero-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .08) 0%, transparent 60%);
    pointer-events: none;
}

.dash-hero-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.dash-hero-icon {
    font-size: 1.5rem;
    opacity: .9;
    flex-shrink: 0;
}

.dash-hero-greeting {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.dash-hero-sub {
    font-size: .78rem;
    opacity: .82;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-hero-right {
    text-align: right;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.dash-hero-date {
    font-size: .78rem;
    opacity: .82;
    line-height: 1.3;
    white-space: nowrap;
}

.dash-hero-clock {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    text-shadow: -3px 5px 3px #00000091;
}

.dash-hero-clock .clock-sep {
    opacity: .45;
    margin: 0 .04em;
    margin-right: 0.06em;
    text-shadow: -3px 5px 3px black;
}

.dash-hero-clock .clock-sec {
    font-size: .66em;
    font-weight: 400;
    opacity: .6;
    vertical-align: baseline;
    letter-spacing: .06em;
    text-shadow: -3px 5px 3px rgba(192, 192, 192, 0.575);
}

/* ===== Dashboard Period Bar ===== */
.dash-period-bar {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    flex-wrap: wrap;
}

.dash-period-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    flex: 1 1 0;
    min-width: 0;
}

.dash-period-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 2rem;
    border: 1px solid var(--border-soft);
    background: var(--panel);
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1.4;
}

.dash-period-pill:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, .06);
}

.dash-period-pill.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}

.dash-custom-range {
    display: none;
    width: 100%;
    margin-top: .25rem;
}

.dash-custom-range.show {
    display: block;
}

.dash-custom-range-form {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.dash-custom-range-form input[type="date"] {
    max-width: 160px;
    font-size: .82rem;
}

.dash-report-link {
    flex-shrink: 0;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: .1rem;
}

@media (max-width: 767.98px) {

    .dash-hero-clock .clock-sep {
        opacity: .45;
        margin: 0 .04em;
        margin-right: 0.06em;
        position: relative;
        z-index: 2;
    }

    .dash-hero-clock .clock-sec {
        font-size: 2.65em;
        font-weight: 400;
        opacity: .33;
        vertical-align: baseline;
        letter-spacing: 0;
        z-index: 1;
        position: absolute;
        right: -15px;
        top: -47px;
    }

    .dash-hero-strip {
        flex-direction: column;
        align-items: stretch;
        padding: .65rem 1rem;
        border-radius: var(--radius-lg) !important;
        gap: .35rem;
    }

    .dash-hero-left {
        gap: .5rem;
    }

    .dash-hero-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: .5rem;
    }

    .dash-hero-greeting {
        font-size: .95rem;
    }

    .dash-hero-sub {
        font-size: .7rem;
        white-space: normal;
    }

    .dash-hero-icon {
        font-size: 1.2rem;
    }

    .dash-hero-clock {
        font-size: 1.25rem;
        order: 1;
    }

    .dash-hero-date {
        font-size: .7rem;
        order: -1;
    }

    /* Period bar: horizontal scrollable pills */
    .dash-period-bar {
        flex-wrap: nowrap;
        align-items: center;
    }

    .dash-period-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, #000 80%, transparent 100%);
        mask-image: linear-gradient(to right, #000 80%, transparent 100%);
        padding-bottom: 2px;
    }

    .dash-period-pills::-webkit-scrollbar {
        display: none;
    }

    .dash-period-pills.scrolled {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 80%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 80%, transparent 100%);
    }

    .dash-period-pills.scroll-end {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 100%);
        mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 100%);
    }

    .dash-period-pills.hint-bounce {
        animation: dashPillScrollHint .8s ease-in-out;
    }

    @keyframes dashPillScrollHint {
        0% {
            transform: translateX(0);
        }

        30% {
            transform: translateX(-24px);
        }

        60% {
            transform: translateX(6px);
        }

        100% {
            transform: translateX(0);
        }
    }

    .dash-period-pill {
        padding: .25rem .55rem;
        font-size: .72rem;
        flex-shrink: 0;
    }

    .dash-custom-range-form input[type="date"] {
        max-width: 130px;
        font-size: .78rem;
    }

    .dash-report-link {
        flex-shrink: 0;
        font-size: .72rem;
    }
}

[data-bs-theme="dark"] .dash-hero-strip {
    background: linear-gradient(135deg, #1e3a5f 0%, #312e81 50%, #2b94a5 100%);
}

/* ── HTTP Error Page (404 / 403 / 500) ───────────────────────────────── */
.error-page {
    position: relative;
    min-height: min(70vh, 640px);
    display: grid;
    place-items: center;
    padding: 1.5rem 0 2.5rem;
    overflow: hidden;
}

.error-page__glow {
    position: absolute;
    inset: 10% 15% auto;
    height: 220px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .35;
    pointer-events: none;
    background: radial-gradient(circle, rgba(37, 99, 235, .35), transparent 70%);
}

.error-page--warning .error-page__glow {
    background: radial-gradient(circle, rgba(217, 119, 6, .35), transparent 70%);
}

.error-page--danger .error-page__glow {
    background: radial-gradient(circle, rgba(220, 38, 38, .3), transparent 70%);
}

.error-page__card {
    position: relative;
    width: min(100%, 560px);
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.25rem 1.75rem 2rem;
    text-align: center;
}

.error-page__code {
    position: absolute;
    top: .35rem;
    right: .85rem;
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -.06em;
    line-height: 1;
    color: var(--text-main);
    opacity: .06;
    user-select: none;
    pointer-events: none;
}

.error-page__icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto .85rem;
    border-radius: 1.1rem;
    display: grid;
    place-items: center;
    font-size: 1.65rem;
    background: var(--accent-light);
    color: var(--accent);
}

.error-page--warning .error-page__icon {
    background: var(--warning-light);
    color: var(--warning);
}

.error-page--danger .error-page__icon {
    background: var(--danger-light);
    color: var(--danger);
}

.error-page__eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .55rem;
}

.error-page__title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 750;
    color: var(--text-main);
    margin: 0 0 .65rem;
    line-height: 1.25;
}

.error-page__message {
    margin: 0 auto .5rem;
    max-width: 38ch;
    color: var(--text-main);
    font-size: .98rem;
    line-height: 1.5;
}

.error-page__hint {
    margin: 0 auto 1.5rem;
    max-width: 42ch;
    color: var(--text-muted);
    font-size: .86rem;
    line-height: 1.5;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    justify-content: center;
}

@media (max-width: 576px) {
    .error-page__card {
        padding: 1.75rem 1.15rem 1.5rem;
    }

    .error-page__actions .btn {
        width: 100%;
    }
}

/* ── Global Professional Confirmation Dialog Aesthetics ──────────────── */
#globalConfirmModal {
    z-index: 1095 !important;
}

#globalConfirmModal .modal-dialog {
    transform: scale(0.92);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

#globalConfirmModal.show .modal-dialog {
    transform: scale(1);
}

#globalConfirmModal .modal-content {
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color: #fff;
}

#globalConfirmIconContainer {
    width: 68px;
    height: 68px;
    margin: 0 auto;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#globalConfirmModal.show #globalConfirmIconContainer {
    animation: confirmIconPulse 1.8s infinite ease-in-out;
}

@keyframes confirmIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

#globalConfirmTitle {
    color: #f8fafc;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

#globalConfirmMessage {
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
}

#globalConfirmCancelBtn {
    border-color: rgba(255, 255, 255, 0.22);
    color: #e2e8f0;
    transition: all 0.2s ease;
}

#globalConfirmCancelBtn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

#globalConfirmBtn {
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

#globalConfirmBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}