/* =====================================================================
   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');

/* ── 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;
}

.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);
}

.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;
}

.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-breadcrumb {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.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;
    padding: .5rem 1rem;
    min-height: 2.5rem;
    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;
    padding: .75rem;
    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-cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .25rem .75rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
    transition: background .12s;
}

.pos-cart-item:hover {
    background: var(--accent-light);
}

.pos-cart-item-name {
    font-weight: 600;
    font-size: .8125rem;
    grid-column: 1;
}

.pos-cart-item-meta {
    font-size: .72rem;
    color: var(--text-muted);
    grid-column: 1;
}

.pos-cart-item-total {
    font-weight: 700;
    font-size: .875rem;
    text-align: right;
    grid-column: 2;
    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-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: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: .75rem;
    box-shadow: var(--shadow-lg);
    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;
}

.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;
}

.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: 1fr auto auto;
    grid-template-rows: 1fr;
    padding: .45rem 1rem;
    gap: .5rem;
    align-items: center;
    cursor: pointer;
}

.pos-cart-item.compact .pos-cart-item-name {
    grid-column: 1;
    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: 2;
    grid-row: 1;
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pos-cart-item.compact .pos-cart-item-total {
    grid-column: 3;
    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);
}

/* ── 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;
}

/* ── 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;
    }

    .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;
    }

    .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;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: end;
    padding: .35rem .5rem 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: grid; }
    .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 .25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-size: .65rem;
    font-weight: 600;
    text-align: center;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-link i {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-bottom-link span {
    display: block;
    line-height: 1;
}

.mobile-bottom-link:hover,
.mobile-bottom-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

/* ── 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: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

/* ── 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: 1rem;
        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 1rem;
        height: 48px;
    }

    .topbar-breadcrumb {
        font-size: .75rem;
    }
}

/* ── 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: 320px;
    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.ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    padding: .5rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   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;
}

/* ── 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;
    transition: opacity .2s;
}

.modal-backdrop-custom.open {
    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);
    overflow: hidden;
}

@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;
    }

    .customer-quick-modal.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.customer-quick-modal.open {
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
    .customer-quick-modal.open {
        transform: translate(-50%, -50%) scale(1);
    }
}

.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;
}

/* ===== Quick Operations Grid (Dashboard) ===== */
.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); }

/* ===== 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;
    }
}
