/* MahalLink brand identity */
/* Sora — الخط اللاتيني للعلامة (الكلمة اللاتينية «MahalLink») حسب الهوية البصرية */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap');

:root {
    --gs-primary: #039ca8;
    --gs-primary-dark: #03818b;
    --gs-primary-light: #06aebb;
    --gs-primary-bg: #e4f4f5;
    --gs-accent: #f0a73c;
    --gs-dark: #0e1e20;
    --gs-muted: #5c7073;
    --gs-soft: #6f8385;
    --gs-sidebar: #024e57;
    --gs-sidebar-admin: #01353c;
    --gs-bg: #fbfcfc;
    --gs-border: #dbe6e7;
    --gs-border-light: #edf5f6;
    --gs-radius: 14px;
    --gs-radius-lg: 18px;
    --gs-shadow-sm: 0 1px 2px rgba(15,23,42,.04);
    --gs-shadow-md: 0 4px 12px -2px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.04);
    --gs-shadow-lg: 0 12px 32px -8px rgba(3, 156, 168,.18), 0 4px 12px -4px rgba(15,23,42,.06);
    /* لون واحد صلب فقط — لا تدرّجات (قاعدة CLAUDE.md §1). تبقى المتغيّرات كـ aliases للون الأساسي. */
    --gs-gradient: var(--gs-primary);
    --gs-gradient-primary: var(--gs-primary);

    /* Bootstrap mapping — cascades into utility classes */
    --bs-primary: #039ca8;
    --bs-primary-rgb: 3, 156, 168;
    --bs-link-color: #039ca8;
    --bs-link-color-rgb: 3, 156, 168;
    --bs-link-hover-color: #03818b;
}

/* Bootstrap component overrides — Bootstrap defines --bs-btn-bg per component
   in its CSS, so utility-level overrides like --bs-primary alone aren't enough. */
.btn-primary {
    --bs-btn-bg: #039ca8;
    --bs-btn-border-color: #039ca8;
    --bs-btn-hover-bg: #03818b;
    --bs-btn-hover-border-color: #03818b;
    --bs-btn-active-bg: #03818b;
    --bs-btn-active-border-color: #03818b;
    --bs-btn-disabled-bg: #9fd5da;
    --bs-btn-disabled-border-color: #9fd5da;
    --bs-btn-focus-shadow-rgb: 3, 156, 168;
}
.btn-outline-primary {
    --bs-btn-color: #039ca8;
    --bs-btn-border-color: #039ca8;
    --bs-btn-hover-bg: #039ca8;
    --bs-btn-hover-border-color: #039ca8;
    --bs-btn-active-bg: #039ca8;
    --bs-btn-active-border-color: #039ca8;
    --bs-btn-focus-shadow-rgb: 3, 156, 168;
}
.bg-primary { background-color: #039ca8 !important; }
.bg-primary-subtle { background-color: #e4f4f5 !important; }
.text-primary { color: #039ca8 !important; }
.text-primary-emphasis { color: #03818b !important; }
.border-primary { border-color: #039ca8 !important; }
.badge.bg-primary, .badge.text-bg-primary { background-color: #039ca8 !important; }
.link-primary { color: #039ca8 !important; }
.page-link { color: #039ca8; }
.page-item.active .page-link { background-color: #039ca8; border-color: #039ca8; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-color: #039ca8; }
.form-check-input:checked { background-color: #039ca8; border-color: #039ca8; }
.form-check-input:focus, .form-control:focus, .form-select:focus {
    border-color: #06aebb;
    box-shadow: 0 0 0 .25rem rgba(3, 156, 168,.15);
}
.dropdown-item.active, .dropdown-item:active { background-color: #039ca8; }
.alert-primary { --bs-alert-color: #03818b; --bs-alert-bg: #e4f4f5; --bs-alert-border-color: #b8d9dc; }
.progress-bar { background-color: #039ca8; }

* { box-sizing: border-box; }

body {
    font-family: "Tajawal", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    background: var(--gs-bg);
    margin: 0;
    color: var(--gs-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Auth ── */
.gs-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gs-primary);
    padding: 1rem;
}
.gs-auth-card {
    width: 100%;
    /* Widened from 420px so the country dropdown + dial code (e.g. 966) never clip. This is the
       SHARED auth-card rule — every login page uses _LoginLayout's .gs-auth-card, so this single
       value governs all current AND future login screens. Keep MahalSSO's copy in sync. */
    max-width: 480px;
    background: #fff;
    border-radius: 24px;
    padding: 2.75rem 2.25rem;
    box-shadow: 0 25px 60px -10px rgba(15,23,42,.45), 0 0 0 1px rgba(255,255,255,.05);
    margin: 1rem;
}
/* Phone field with a dial-code prefix: the input-group is forced dir="ltr" inside an RTL page, so
   Bootstrap's RTL radius rules round the INNER (touching) edges instead of the outer ones — making
   the prefix box and the number field look "reversed"/detached. Re-round only the OUTER corners so
   the two read as one joined control. (Applies to every login/signup phone field.) */
.input-group[dir="ltr"] > :first-child {
    border-radius: var(--bs-border-radius, .375rem) 0 0 var(--bs-border-radius, .375rem);
}
.input-group[dir="ltr"] > :last-child {
    border-radius: 0 var(--bs-border-radius, .375rem) var(--bs-border-radius, .375rem) 0;
}

.gs-auth-brand { text-align: center; margin-bottom: 1.75rem; }
.gs-auth-brand i {
    display: inline-grid; place-items: center;
    width: 64px; height: 64px;
    border-radius: 18px;
    background: var(--gs-gradient-primary);
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(3, 156, 168,.35);
}
.gs-auth-brand h1 { font-size: 1.4rem; font-weight: 800; margin-top: .9rem; color: var(--gs-dark); letter-spacing: -.3px; }

/* ── Shell ── */
.gs-shell { display: flex; min-height: 100vh; }
.gs-sidebar {
    width: 240px;
    background: var(--gs-sidebar);
    color: #cbd5e1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.gs-sidebar-admin { background: var(--gs-sidebar-admin); }
.gs-brand {
    padding: 1.25rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .65rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    letter-spacing: -.2px;
}
.gs-brand i {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--gs-gradient-primary);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 6px 14px rgba(3, 156, 168,.35);
}
.gs-brand-mark { width: 36px; height: 36px; flex-shrink: 0; filter: drop-shadow(0 6px 14px rgba(3, 156, 168,.4)); }

/* الكلمة اللاتينية «MahalLink» بخط Sora (الهوية البصرية) */
.gs-brand span, .gs-auth-brand h1, .ob-brand span {
    font-family: "Sora", "Tajawal", sans-serif;
    letter-spacing: -.02em;
}

/* Sidebar pin/collapse toggle — inside the sidebar, just below the brand row */
.gs-sidebar { position: relative; }
.gs-pin-btn {
    position: absolute;
    top: 66px;
    inset-inline-end: 10px;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    color: #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    z-index: 6;
    transition: background .15s, color .15s;
}
.gs-pin-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.gs-pin-btn i { font-size: .9rem; line-height: 1; }
.gs-auth-brand .gs-brand-mark { width: 64px; height: 64px; filter: drop-shadow(0 10px 24px rgba(3, 156, 168,.4)); }
.gs-nav { padding: .75rem; display: flex; flex-direction: column; gap: .15rem; }
.gs-link {
    color: #cbd5e1;
    text-decoration: none;
    padding: .7rem .9rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .94rem;
    transition: all .15s;
}
.gs-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.gs-link.active {
    background: var(--gs-gradient-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(3, 156, 168,.35);
}

.gs-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gs-topbar {
    height: 64px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gs-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.gs-tenant { font-weight: 700; color: var(--gs-dark); letter-spacing: -.2px; }
.gs-topbar-right { display: flex; align-items: center; gap: .5rem; }
.gs-content { padding: 1.5rem; flex: 1; }

/* ── Embed mode (used by workspace iframes) ── */
.gs-embed .gs-sidebar,
.gs-embed .gs-topbar { display: none !important; }
.gs-embed .gs-shell { min-height: auto; }
.gs-embed .gs-content { padding: .75rem; }

/* ── Rail mode (collapsed sidebar that expands on hover; active on /Pos) ── */
.gs-rail .gs-shell { padding-inline-start: 72px; position: relative; }
.gs-rail .gs-sidebar {
    position: fixed; top: 0; bottom: 0;
    inset-inline-start: 0;
    width: 72px;
    overflow: hidden;
    z-index: 1040;
    transition: width .22s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,.15);
}
.gs-rail .gs-sidebar:hover { width: 240px; box-shadow: 6px 0 24px rgba(0,0,0,.3); }
.gs-rail .gs-brand,
.gs-rail .gs-link {
    white-space: nowrap;
    overflow: hidden;
}
.gs-rail .gs-brand { padding-inline: 1rem; gap: .5rem; }
.gs-rail .gs-nav { padding: .75rem .6rem; }
.gs-rail .gs-link { padding: .7rem .75rem; gap: 0; }

/* Collapsed (not hovering) — only icons show, no text */
.gs-rail .gs-sidebar:not(:hover) .gs-link,
.gs-rail .gs-sidebar:not(:hover) .gs-brand { font-size: 0; }
.gs-rail .gs-sidebar:not(:hover) .gs-link > i { font-size: 1.15rem; }
.gs-rail .gs-sidebar:not(:hover) .gs-brand img,
.gs-rail .gs-sidebar:not(:hover) .gs-brand i { font-size: 1.05rem; }
.gs-rail .gs-sidebar:not(:hover) .gs-link { justify-content: center; padding-inline: 0; }
/* Hovering — restore spacing */
.gs-rail .gs-sidebar:hover .gs-link { gap: .65rem; }
@media (max-width: 991.98px) {
    .gs-rail .gs-shell { padding-inline-start: 0; }
    .gs-rail .gs-sidebar { position: fixed; inset-inline-start: -240px; width: 240px; }
    .gs-rail .gs-sidebar:hover { width: 240px; }
}

/* ── POS workspace shell ── */
.pos-shell { display: flex; flex-direction: column; min-height: calc(100vh - 6rem); }
.pos-tabs .nav-link {
    color: var(--gs-soft);
    font-weight: 600;
    border-radius: 10px;
    padding: .55rem 1.1rem;
}
.pos-tabs .nav-link:hover { color: var(--gs-primary); background: var(--gs-primary-bg); }
.pos-tabs .nav-link.active {
    background: var(--gs-primary);
    color: #fff;
    box-shadow: 0 6px 14px rgba(3, 156, 168,.28);
}
.pos-panel-wrap { position: relative; flex: 1; }
.pos-panel { display: none; }
.pos-panel.active { display: block; }
.pos-panel > .gs-content { padding: 0; }
.pos-loading { display: flex; justify-content: center; padding: 4rem 0; }

/* ── Cards / stats ── */
.gs-stat {
    background: #fff;
    border: 1px solid var(--gs-border-light);
    border-radius: var(--gs-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--gs-shadow-sm);
    height: 100%;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.gs-stat:hover { box-shadow: var(--gs-shadow-md); transform: translateY(-2px); border-color: #b8d9dc; }
.gs-stat .label { color: var(--gs-soft); font-size: .85rem; font-weight: 500; }
.gs-stat .value { font-size: 1.7rem; font-weight: 800; color: var(--gs-dark); letter-spacing: -.5px; }
.gs-stat .icon {
    display: inline-grid; place-items: center;
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--gs-primary-bg);
    color: var(--gs-primary);
    font-size: 1.3rem;
}
.gs-card {
    background: #fff;
    border: 1px solid var(--gs-border-light);
    border-radius: var(--gs-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--gs-shadow-sm);
}

.page-title { font-size: 1.5rem; font-weight: 800; color: var(--gs-dark); margin-bottom: 1.25rem; letter-spacing: -.4px; }

/* ── Settings page polish ── */
.settings-header { padding-bottom: 1rem; border-bottom: 1px solid var(--gs-border-light); }
.settings-section-head {
    display: flex; align-items: center; gap: .75rem;
    padding-bottom: .9rem; margin-bottom: 1rem;
    border-bottom: 1px solid var(--gs-border-light);
}
.settings-section-head > i { font-size: 1.4rem; }
.settings-section-head .title { font-weight: 700; color: var(--gs-dark); font-size: 1rem; line-height: 1.2; }
.settings-section-head .subtitle { font-size: .8rem; color: var(--gs-soft); line-height: 1.2; }
.tax-toggle {
    padding: 1rem 1.25rem;
    background: var(--gs-primary-bg);
    border-radius: 12px;
    border: 1px solid #b8d9dc;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.tax-toggle .form-check-input {
    width: 3rem;
    height: 1.6rem;
    margin-top: 0;
    cursor: pointer;
    background-color: #cbd5e1;
    border-color: #cbd5e1;
}
.tax-toggle .form-check-input:checked {
    background-color: var(--gs-primary);
    border-color: var(--gs-primary);
}
.tax-toggle .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(3, 156, 168,.2);
    border-color: var(--gs-primary-light);
}
.tax-toggle .form-check-label {
    cursor: pointer;
    margin: 0;
    font-size: 1rem;
    color: var(--gs-dark);
}
.tax-fields { animation: tax-fade .2s ease; }
@keyframes tax-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Settings tabs (pill style, matches POS workspace) */
.settings-tabs { flex-wrap: wrap; gap: .35rem; }
.settings-tabs .nav-link {
    color: var(--gs-soft);
    font-weight: 600;
    border-radius: 10px;
    padding: .55rem 1rem;
    border: 1px solid transparent;
    background: #fff;
}
.settings-tabs .nav-link:hover { color: var(--gs-primary); background: var(--gs-primary-bg); }
.settings-tabs .nav-link.active {
    background: var(--gs-primary);
    color: #fff;
    box-shadow: 0 6px 14px rgba(3, 156, 168,.28);
}
.settings-panels { position: relative; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-panel > .gs-content { padding: 0; }
.settings-loading { display: flex; justify-content: center; padding: 4rem 0; }

/* ── Dashboard ── */
.dash-filter input[type="date"] { min-width: 140px; }
.dash-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-inline-end: .4rem;
    vertical-align: middle;
}
.dash-dot.st-Open      { background: #f59e0b; }
.dash-dot.st-Hold      { background: #94a3b8; }
.dash-dot.st-Ready     { background: #06b6d4; }
.dash-dot.st-Delivered { background: #10b981; }
.dash-chart-wrap { position: relative; height: 260px; }
.dash-chart-donut { height: 220px; }
@media (max-width: 991.98px) {
    .dash-chart-wrap { height: 220px; }
    .dash-chart-donut { height: 200px; }
}

/* ── POS ── */
.pos-item {
    cursor: pointer;
    border: 1px solid var(--gs-border-light);
    border-radius: 14px;
    padding: .85rem .5rem;
    text-align: center;
    background: #fff;
    transition: all .15s;
    user-select: none;
}
.pos-item:hover { border-color: var(--gs-primary-light); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(3, 156, 168,.18); }
.pos-item .name { font-weight: 700; font-size: .9rem; color: var(--gs-dark); }
.pos-item .price { color: var(--gs-primary); font-size: .82rem; font-weight: 600; }
.pos-cart-table td, .pos-cart-table th { vertical-align: middle; }

/* POS category filter pills — single scrollable row (no wrap) */
.pos-cat-filter {
    display: flex; gap: .35rem; flex-wrap: nowrap;
    overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
}
.pos-cat-filter::-webkit-scrollbar { display: none; }
.pos-cat {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .7rem;
    border: 1px solid var(--gs-border-light);
    background: #fff;
    border-radius: 999px;
    font-size: .8rem; font-weight: 600;
    color: var(--gs-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.pos-cat:hover { border-color: var(--gs-primary-light); color: var(--gs-primary); }
.pos-cat.active {
    background: var(--gs-gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(3, 156, 168,.25);
}
.pos-cat .bi { font-size: .9rem; }

/* ── POS redesign: products grid (left) + order panel (right) ── */
.pos-screen { display: flex; gap: 1rem; align-items: flex-start; }
.pos-main { flex: 1 1 auto; min-width: 0; }
.pos-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.pos-search { flex: 1 1 240px; }

/* صف واحد يجمع التصنيفات (يملأ الجهة) ونوع الخدمة (الجهة المقابلة، لا يتقلّص) */
.pos-filters-row { display: flex; align-items: center; gap: .75rem; }
.pos-filters-row .pos-cat-filter { flex: 1 1 auto; min-width: 0; }
.pos-filters-row .pos-svc { flex: 0 0 auto; margin-bottom: 0; }

/* محدّد نوع الخدمة: صف قابل للتمرير أفقياً (النشط بنفسجي صلب) — بنفس حجم حبّات التصنيف */
.pos-svc {
    display: flex; flex-wrap: nowrap; gap: .35rem; margin-bottom: .5rem;
    overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
}
.pos-svc::-webkit-scrollbar { display: none; }
.pos-svc-pill {
    cursor: pointer; user-select: none; white-space: nowrap;
    display: inline-flex; align-items: center;
    padding: .25rem .7rem;
    border: 1px solid var(--gs-border-light);
    border-radius: 999px;
    background: #fff;
    color: var(--gs-muted);
    font-weight: 600; font-size: .8rem;
    transition: all .15s;
}
.pos-svc-pill:hover { border-color: var(--gs-primary-light); color: var(--gs-primary); }
.btn-check:checked + .pos-svc-pill {
    background: var(--gs-primary);
    border-color: var(--gs-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(3, 156, 168, .25);
}
.btn-check:focus-visible + .pos-svc-pill { outline: 2px solid var(--gs-primary-light); outline-offset: 2px; }

.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.pos-item { position: relative; min-height: 86px; display: flex; flex-direction: column; justify-content: center; gap: .25rem; border-bottom: 3px solid var(--gs-primary); }
.pos-item .qty-badge {
    position: absolute; inset-inline-end: 6px; bottom: 6px;
    min-width: 20px; height: 20px; padding: 0 5px;
    background: var(--gs-dark); color: #fff; border-radius: 6px;
    font-size: .72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Order panel */
.pos-order {
    width: 370px; flex: 0 0 370px; align-self: flex-start;
    order: -1;                       /* لوحة الطلب على اليمين (بداية محور RTL) */
    position: sticky; top: 1rem;
    background: #fff; border: 1px solid var(--gs-border); border-radius: var(--gs-radius-lg);
    box-shadow: var(--gs-shadow-md); display: flex; flex-direction: column;
    max-height: calc(100vh - 6.5rem); overflow: hidden;
}
.pos-order-head { padding: .75rem; border-bottom: 1px solid var(--gs-border-light); }

.pos-lines { flex: 1 1 auto; overflow-y: auto; min-height: 0; }   /* min-height:0 ليتقلّص على الشاشات القصيرة ويبقى زر الدفع ظاهراً */
.pos-empty { text-align: center; color: var(--gs-soft); padding: 2.5rem 1rem; }
.pos-empty .bi { font-size: 1.8rem; opacity: .4; margin-bottom: .4rem; }
.pos-line { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-bottom: 1px solid var(--gs-border-light); cursor: pointer; }
.pos-line:hover { background: #fbfcfc; }
.pos-line.sel { background: var(--gs-primary-bg); box-shadow: inset 3px 0 0 var(--gs-primary); }
/* ترتيب Odoo: الكمية في البداية ← الاسم ← السعر الإجمالي في النهاية */
.pos-line-qty { flex: 0 0 auto; min-width: 32px; height: 30px; padding: 0 .4rem; display: inline-flex; align-items: center; justify-content: center; background: var(--gs-primary-bg); color: var(--gs-primary); border-radius: 8px; font-weight: 800; font-size: .9rem; }
.pos-line-total { flex: 0 0 auto; font-weight: 700; color: var(--gs-dark); white-space: nowrap; text-align: end; }
.pos-line-total small { font-size: .7rem; color: var(--gs-muted); font-weight: 600; }
.pos-line-info { flex: 1 1 auto; min-width: 0; text-align: start; }
.pos-line-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-line-sub { font-size: .75rem; color: var(--gs-soft); }
.pos-line-rm { border: 0; background: transparent; color: #ef4444; font-size: 1.15rem; line-height: 1; padding: .1rem .35rem; border-radius: 6px; }
.pos-line-rm:hover { background: #fee2e2; }

.pos-totals { padding: .6rem .85rem; border-top: 1px solid var(--gs-border-light); }
/* عمودان: اثنان في كل سطر لتوفير المساحة الرأسية */
.pos-totals-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; row-gap: .3rem; align-items: center; }
.pos-totals-grid .pos-disc-row { margin: 0; }
.pos-totals-grid .pos-total-line { margin: 0; padding: 0; border-top: none; }
.pos-disc-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .35rem 0; padding: .4rem .6rem; font-size: .85rem; color: var(--gs-muted); background: #fff; border: 1px dashed var(--gs-border); border-radius: 9px; cursor: pointer; transition: all .12s; }
.pos-disc-row:hover { border-color: var(--gs-primary-light); background: var(--gs-primary-bg); }
.pos-disc-row.active { border-style: solid; border-color: var(--gs-primary); background: var(--gs-primary-bg); color: var(--gs-primary); box-shadow: 0 0 0 1px var(--gs-primary) inset; }
.pos-disc-row .bi { font-size: .9rem; }
.pos-disc-val { font-weight: 700; color: var(--gs-dark); }
.pos-disc-row.has-disc .pos-disc-val { color: #ef4444; }
.pos-disc-row.active .pos-disc-val { color: var(--gs-primary); }
.pos-total-line { font-weight: 800; font-size: 1.25rem; margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--gs-border); }
.pos-total-line small { font-size: .8rem; color: var(--gs-muted); font-weight: 600; }

.pos-numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; padding: .35rem .85rem .6rem; }
.pos-key { border: 1px solid var(--gs-border); background: #fff; border-radius: 10px; padding: .55rem 0; font-size: 1.05rem; font-weight: 700; color: var(--gs-dark); cursor: pointer; transition: all .12s; }
.pos-key:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); }
.pos-key:active { transform: scale(.96); }
.pos-key.mode { color: var(--gs-primary); font-size: .9rem; }
.pos-key.mode.active { background: var(--gs-primary); border-color: var(--gs-primary); color: #fff; }
.pos-key.key-back { color: #ef4444; }

.pos-pay { margin: 0 .85rem .85rem; padding: .9rem; border: 0; border-radius: 12px; background: var(--gs-primary); color: #fff; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.pos-pay:hover { background: var(--gs-primary-dark); }

/* شعار النظام عند فراغ السلة: يحلّ محلّ الإجماليات ولوحة الأرقام وزر الدفع */
.pos-brand-empty { display: none; }
.pos-order.is-empty .pos-lines,
.pos-order.is-empty .pos-totals,
.pos-order.is-empty .pos-actions-row,
.pos-order.is-empty .pos-numpad,
.pos-order.is-empty .pos-pay { display: none; }
.pos-order.is-empty .pos-brand-empty {
    display: flex; flex: 1 1 auto; flex-direction: column;
    align-items: center; justify-content: center; gap: 1.1rem;
    padding: 2rem 1.5rem; text-align: center;
}
.pos-brand-empty-mark { width: clamp(110px, 30vh, 180px); height: auto; max-height: 40vh; object-fit: contain; opacity: .95; }
.pos-brand-empty-title { font-size: 1.5rem; font-weight: 800; color: var(--gs-primary); letter-spacing: -.5px; }

/* شاشات اللابتوب القصيرة: ضغط لوحة الطلب رأسياً ليبقى زر الدفع ظاهراً */
@media (max-height: 800px) {
    .pos-empty { padding: 1.25rem 1rem; }
    .pos-empty .bi { font-size: 1.4rem; }
    .pos-totals { padding: .45rem .85rem; }
    .pos-total-line { font-size: 1.1rem; margin-top: .2rem; padding-top: .2rem; }
    .pos-actions-row { padding: .35rem .85rem; }
    .pos-action-btn { padding: .45rem; }
    .pos-numpad { gap: .3rem; padding: .25rem .85rem .4rem; }
    .pos-key { padding: .38rem 0; font-size: .98rem; border-radius: 8px; }
    .pos-pay { margin: 0 .85rem .55rem; padding: .6rem; font-size: 1rem; }
}

/* POS: customer action button + chooser list (Odoo-style) */
.pos-actions-row { display: flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border-top: 1px solid var(--gs-border-light); }
.pos-action-btn { flex: 1 1 0; min-width: 0; width: auto; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .6rem; border: 1px solid var(--gs-border); border-radius: 10px; background: #fff; color: var(--gs-dark); font-weight: 600; cursor: pointer; transition: all .12s; }
.pos-action-btn:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); color: var(--gs-primary); }
.pos-action-btn.has-customer { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); color: var(--gs-primary); }
.pos-action-btn #customerBtnLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-action-btn { white-space: nowrap; }
/* نص يُقاس ويُصغَّر تلقائياً ليبقى في سطر واحد (انظر fitAddonLabel في POS) */
.pos-action-label { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; line-height: 1.15; }
/* رصيد العميل بجانب اسمه داخل الزر */
.pos-cust-btn-bal { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .25rem; padding-inline-start: .5rem; margin-inline-start: .25rem; border-inline-start: 1px solid var(--gs-primary-light); color: #16a34a; font-weight: 800; font-size: .82rem; white-space: nowrap; }
.pos-cust-btn-bal .bi { font-size: .85rem; }
/* POS: customer chooser (search → list → create / recharge views) */
.pos-cust-modal .modal-body { padding: 1.1rem 1.25rem 1.25rem; }
.pos-cust-header { gap: .5rem; align-items: center; }
.pos-cust-back { border: 1px solid var(--gs-border); background: #fff; color: var(--gs-muted); width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; cursor: pointer; transition: all .12s; }
.pos-cust-back:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); color: var(--gs-primary); }

.pos-cust-search .input-group-text { background: #fff; border-inline-end: 0; color: var(--gs-soft); }
.pos-cust-search .form-control { border-inline-start: 0; box-shadow: none; }
.pos-cust-search .form-control:focus { border-color: var(--gs-border); }

.pos-cust-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: .1rem; }
/* قائمة الخدمات الإضافية (نافذة POS) */
.pos-addon-list { display: flex; flex-direction: column; gap: .5rem; }
.pos-addon-row { display: flex; align-items: center; gap: .7rem; margin: 0; padding: .6rem .75rem; border: 1px solid var(--gs-border-light); border-radius: 12px; background: #fff; cursor: pointer; transition: all .12s; }
.pos-addon-row:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); }
.pos-addon-row:has(.form-check-input:checked) { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); }
.pos-addon-row .form-check-input { flex: 0 0 auto; margin: 0; width: 1.2rem; height: 1.2rem; cursor: pointer; }
.pos-addon-name { flex: 1 1 auto; min-width: 0; font-weight: 700; color: var(--gs-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-addon-price { flex: 0 0 auto; font-weight: 700; color: var(--gs-primary); }
.pos-addon-price.free { color: var(--gs-success, #198754); font-weight: 600; font-size: .85rem; }

.pos-cust-row { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: start; padding: .6rem .7rem; border: 1px solid var(--gs-border-light); border-radius: 12px; background: #fff; cursor: pointer; transition: all .12s; }
.pos-cust-row:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); box-shadow: var(--gs-shadow-sm); }
.pos-cust-row:focus-visible { outline: 2px solid var(--gs-primary-light); outline-offset: 1px; }
.pos-cust-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--gs-primary-bg); color: var(--gs-primary); font-weight: 800; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }
.pos-cust-avatar.lg { width: 52px; height: 52px; font-size: 1.3rem; }
.pos-cust-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.pos-cust-name { font-weight: 700; color: var(--gs-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-cust-meta { color: var(--gs-soft); font-size: .82rem; }
.pos-cust-meta .bi { font-size: .78rem; }
.pos-cust-bal { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .85rem; color: #16a34a; background: #f0fdf4; border: 1px solid #dcfce7; padding: .2rem .55rem; border-radius: 999px; }
.pos-cust-recharge { flex: 0 0 auto; border: 1px solid var(--gs-border); background: #fff; color: var(--gs-primary); width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: pointer; transition: all .12s; }
.pos-cust-recharge:hover { background: var(--gs-primary); border-color: var(--gs-primary); color: #fff; }
.pos-cust-cash .pos-cust-avatar { background: #ecfdf5; color: #16a34a; }
.pos-cust-cash .pos-cust-go { color: var(--gs-soft); font-size: .9rem; margin-inline-start: auto; }
.pos-cust-empty { text-align: center; color: var(--gs-soft); padding: 2rem 1rem; }
.pos-cust-empty .bi { font-size: 1.8rem; opacity: .4; margin-bottom: .5rem; }

/* recharge view */
.pos-rc-head { display: flex; align-items: center; gap: .85rem; background: var(--gs-primary-bg); border-radius: 12px; padding: .85rem; }
.pos-rc-packages { display: flex; flex-direction: column; gap: .5rem; }
.pos-rc-pkg { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .65rem .8rem; border: 1.5px solid var(--gs-border); border-radius: 12px; background: #fff; cursor: pointer; transition: all .12s; }
.pos-rc-pkg:hover { border-color: var(--gs-primary-light); }
.pos-rc-pkg:has(input:checked) { border-color: var(--gs-primary); background: var(--gs-primary-bg); box-shadow: 0 0 0 1px var(--gs-primary) inset; }
.pos-rc-pkg .form-check-input { margin: 0; flex: 0 0 auto; }
.pos-rc-pkg .form-check-input:checked { background-color: var(--gs-primary); border-color: var(--gs-primary); }
.pos-rc-pkg-body { display: flex; flex-direction: column; gap: .1rem; flex: 1 1 auto; min-width: 0; }
.pos-rc-pkg-name { font-weight: 700; color: var(--gs-dark); }
.pos-rc-pkg-meta { font-size: .8rem; color: var(--gs-soft); }
.pos-rc-pkg .badge { margin-inline-start: auto; }

/* ── شاشة الدفع ملء الشاشة (أسلوب Odoo) ── */
.pos-pay-screen { background: var(--gs-bg); }
.pos-pay-head, .pos-pay-foot { background: #fff; }
.pos-pay-foot { justify-content: space-between; }
.pos-pay-foot .btn { min-width: 160px; font-weight: 700; padding: .7rem 1.25rem; }
.pos-pay-body { display: flex; gap: 1.5rem; padding: 1.5rem; align-items: stretch; overflow-y: auto; }
@media (max-width: 860px) { .pos-pay-body { flex-direction: column; } }

/* العمود الأيسر: الإجمالي الكبير + التفصيل */
.pos-pay-amount { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.75rem; }
.pos-pay-amount-big { direction: ltr; font-size: clamp(4rem, 11vw, 7.5rem); font-weight: 800; color: var(--gs-dark); letter-spacing: -3px; line-height: 1; }
.pos-pay-amount-big small { font-size: .26em; color: var(--gs-soft); font-weight: 700; letter-spacing: 0; margin-inline-start: .15em; }
.pos-pay-lines { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: .45rem; }
.pos-pay-line { display: flex; justify-content: space-between; font-size: 1rem; }
.pos-pay-line.pos-pay-due { font-weight: 800; font-size: 1.15rem; color: var(--gs-dark); border-top: 1px dashed var(--gs-border); padding-top: .45rem; }
.pos-pay-wallet { color: #16a34a; font-weight: 600; }
.pos-pay-change { color: var(--gs-primary); font-weight: 700; }

/* العمود الأيمن: الطرق + لوحة الأرقام */
.pos-pay-side { order: -1; flex: 0 0 420px; max-width: 420px; display: flex; flex-direction: column; gap: .7rem; }  /* الطرق/اللوحة على جهة البداية (يمين في RTL) مثل لوحة الطلب */
@media (max-width: 860px) { .pos-pay-side { flex: 1 1 auto; max-width: none; } }
.pos-pay-customer { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem; border: 1px solid var(--gs-border); border-radius: 12px; background: #fff; font-weight: 700; color: var(--gs-dark); cursor: pointer; transition: all .12s; }
.pos-pay-customer:hover { border-color: var(--gs-primary-light); color: var(--gs-primary); background: var(--gs-primary-bg); }
.pos-pay-methods { display: flex; flex-direction: row; gap: .5rem; }
.pos-pay-method { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 1rem 1.15rem; border: 1px solid var(--gs-border); border-radius: 12px; background: #fff; font-weight: 700; font-size: 1.05rem; color: var(--gs-dark); cursor: pointer; transition: all .12s; }
.pos-pay-method > span:first-of-type { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-pay-method .bi { font-size: 1.35rem; color: var(--gs-soft); }   /* الأيقونة أول العنصر = الحافة اليمنى في RTL مثل Odoo */
.pos-pay-method:hover { border-color: var(--gs-primary-light); background: var(--gs-primary-bg); }
.pos-pay-method.active { border-color: var(--gs-primary); background: var(--gs-primary-bg); color: var(--gs-primary); box-shadow: 0 0 0 1px var(--gs-primary) inset; }
.pos-pay-method.active .bi { color: var(--gs-primary); }
.pos-pay-method.disabled { opacity: .45; pointer-events: none; }
.pos-pay-method-amt { font-weight: 800; color: #16a34a; }
/* التغطية الكاملة من رصيد العميل: نفس الشكل لكن معطّل (رمادي + غير قابل للنقر) */
.pos-pay-methods.is-disabled, .pos-pay-numpad.is-disabled { opacity: .45; pointer-events: none; filter: grayscale(.4); }
/* لوحة أرقام مسطّحة بخلايا مفصولة بخط رفيع (أسلوب Odoo). LTR: الأرقام 1،2،3 يسار→يمين وأزرار الإضافة على اليمين */
.pos-pay-numpad { direction: ltr; flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 1px; background: var(--gs-border); border: 1px solid var(--gs-border); border-radius: 14px; overflow: hidden; }
.pos-paykey { display: flex; align-items: center; justify-content: center; border: 0; border-radius: 0; background: #fff; padding: .5rem 0; min-height: 3rem; font-size: 1.4rem; font-weight: 600; color: var(--gs-dark); cursor: pointer; transition: background .1s; }
.pos-paykey:hover { background: var(--gs-primary-bg); }
.pos-paykey:active { background: #cff3f6; }
.pos-paykey.quick { background: #ecfdf5; color: #16a34a; font-weight: 700; direction: ltr; }
.pos-paykey.quick:hover { background: #d1fae5; }
.pos-paykey.key-back { color: #ef4444; background: #fef2f2; }
.pos-paykey.key-back:hover { background: #fee2e2; }
/* المجموعة السفلية (الخيارات + اللوحة + الأزرار) مثبّتة بأسفل العمود */
.pos-pay-extra { margin-top: .2rem; }   /* تدفّق طبيعي من الأعلى — لوحة الأرقام تملأ الفراغ وتثبّت الأزرار بالأسفل */
/* موعد التسليم: المفتاح + حقل التاريخ على نفس الصف (التاريخ يظهر جنب المفتاح عند تفعيله) */
.pos-pay-delivery { display: flex; align-items: center; gap: .6rem; }
.pos-pay-delivery .form-check { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.pos-pay-delivery .form-control { flex: 1 1 auto; min-width: 0; }
.pos-pay-actions { display: flex; gap: .6rem; }
.pos-pay-actions .btn { flex: 1 1 0; font-weight: 700; padding: .85rem 1rem; font-size: 1.05rem; }

/* POS full-screen layout (custom _PosLayout — no app sidebar/header) */
.pos-screen-body { height: 100vh; margin: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--gs-bg); }
.pos-appbar { flex: 0 0 auto; height: 56px; display: flex; align-items: center; gap: .75rem; padding: 0 .9rem; background: #fff; border-bottom: 1px solid var(--gs-border); box-shadow: var(--gs-shadow-sm); }
.pos-appbar-btn { border: 1px solid var(--gs-border); background: #fff; border-radius: 10px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; color: var(--gs-dark); cursor: pointer; }
.pos-appbar-btn:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); color: var(--gs-primary); }
.pos-appbar-search { flex: 0 1 520px; margin-inline-start: auto; }
.pos-appbar-actions { display: flex; gap: .5rem; }
.pos-appbar-action { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border: 1px solid var(--gs-border); border-radius: 9px; background: #fff; color: var(--gs-dark); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; cursor: pointer; transition: all .12s; }
.pos-appbar-action:hover { background: var(--gs-primary-bg); border-color: var(--gs-primary-light); color: var(--gs-primary); }
.pos-appbar-action.primary { background: var(--gs-primary); border-color: var(--gs-primary); color: #fff; }
.pos-appbar-action.primary:hover { background: var(--gs-primary-dark); color: #fff; }
.pos-screen-main { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.pos-screen-body #posForm { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pos-screen-body .pos-screen { flex: 1 1 auto; min-height: 0; align-items: stretch; gap: 0; }
.pos-screen-body .pos-main { min-height: 0; overflow-y: auto; padding: .65rem 1rem 1rem; }
.pos-screen-body .pos-order { align-self: stretch; position: static; max-height: none; top: auto; border: 0; border-inline-end: 1px solid var(--gs-border); border-radius: 0; box-shadow: none; }

@media (max-width: 991.98px) {
    .pos-screen { flex-direction: column; }
    .pos-order { width: 100%; flex-basis: auto; position: static; max-height: none; order: 0; }
    .pos-screen-main { overflow-y: auto; }
    .pos-screen-body .pos-screen,
    .pos-screen-body .pos-main,
    .pos-screen-body .pos-order { height: auto; }
}

/* Item add/edit modal: center labels + input values for cleaner alignment */
#itemModal .form-label { text-align: center; display: block; width: 100%; }
#itemModal .form-control,
#itemModal .form-select { text-align: center; text-align-last: center; }
#itemModal .form-check { display: flex; justify-content: center; gap: .5rem; }

@media (max-width: 992px) {
    .gs-sidebar { position: fixed; inset-inline-start: -240px; top: 0; bottom: 0; z-index: 1040; transition: inset-inline-start .2s; }
    .gs-sidebar.open { inset-inline-start: 0; }
}

/* ── Invoices list (card style) ── */
.inv-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.inv-list { display: flex; flex-direction: column; gap: .6rem; }
.inv-card {
    background: #fff;
    border: 1px solid var(--gs-border-light);
    border-radius: var(--gs-radius-lg);
    padding: .9rem 1.1rem;
    box-shadow: var(--gs-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-inline-start: 4px solid #cbd5e1;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.inv-card:hover { box-shadow: var(--gs-shadow-lg); transform: translateY(-2px); }
.inv-card.st-Open { border-inline-start-color: var(--gs-primary); }
.inv-card.st-Hold { border-inline-start-color: #f59e0b; }
.inv-card.st-Ready { border-inline-start-color: #06b6d4; }
.inv-card.st-Delivered { border-inline-start-color: #10b981; }
.inv-left { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.inv-no { font-weight: 700; color: var(--gs-dark); display: flex; align-items: center; gap: .5rem; }
.inv-cust { color: #6b7280; font-size: .85rem; }
.inv-cust .bi { opacity: .6; }
.inv-right { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.inv-amount { font-size: 1.2rem; font-weight: 700; color: var(--gs-dark); white-space: nowrap; }
.inv-amount small { font-size: .7rem; color: #9ca3af; font-weight: 500; }
.inv-meta { color: #9ca3af; font-size: .76rem; white-space: nowrap; }
.inv-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.inv-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    padding: .35rem .75rem;
    border-radius: 8px;
    white-space: nowrap;
}
.inv-actions form { display: inline-flex; }
.inv-actions .bi { font-size: .95rem; }

/* Customers table action row — same pattern as invoices */
.cust-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.cust-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    padding: .35rem .75rem;
    border-radius: 8px;
    white-space: nowrap;
}
.cust-actions form { display: inline-flex; }
.cust-actions .bi { font-size: .95rem; }
@media (max-width: 768px) {
    .cust-actions { justify-content: flex-start; }
    .cust-actions .btn span { display: none; }
}
@media (max-width: 768px) {
    .inv-actions { justify-content: flex-start; }
    .inv-actions .btn span { display: none; }   /* fall back to icon-only on mobile */
}
.inv-empty { background: #fff; border-radius: 14px; padding: 3rem 1rem; text-align: center; color: #9ca3af; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.inv-empty .bi { font-size: 2.5rem; opacity: .4; }

@media (max-width: 768px) {
    .inv-card { flex-direction: column; align-items: stretch; gap: .6rem; }
    .inv-right { justify-content: space-between; }
}

/* ── نافذة الفواتير داخل POS (تخطيط Odoo: سجلّات يمين · تفاصيل يسار) ── */
.pos-inv-body { padding: 0; overflow: hidden; }
.pos-inv-split { display: flex; height: 100%; align-items: stretch; }

/* اليمين: سجلّات الفواتير */
.pos-inv-listcol { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.pos-inv-listtools { display: flex; flex-direction: column; gap: .55rem; padding: .85rem 1rem; border-bottom: 1px solid var(--gs-border); background: #fff; }
/* شريط فلترة الحالة: أيقونات في الأعلى بدل القائمة المنسدلة */
.pos-inv-statusbar { display: flex; gap: .4rem; flex-wrap: nowrap; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.pos-inv-statusbar::-webkit-scrollbar { display: none; }
.pos-inv-status { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 1px solid var(--gs-border-light); background: #fff; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--gs-muted); cursor: pointer; white-space: nowrap; transition: all .15s; }
.pos-inv-status .bi { font-size: 1rem; }
.pos-inv-status:hover { border-color: var(--gs-primary-light); color: var(--gs-primary); }
.pos-inv-status.active { background: var(--gs-primary); border-color: var(--gs-primary); color: #fff; box-shadow: 0 4px 12px rgba(3, 156, 168,.25); }
.pos-inv-listbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .25rem .25rem; }
/* صفوف مبسّطة ومسطّحة بنمط Odoo: بلا بطاقات/ظلال/حدود ملوّنة سميكة — فاصل خفيف وتمييز بالخلفية فقط */
.pos-inv-listbody .inv-list { gap: 0; }
.pos-inv-listbody .inv-card {
    cursor: pointer;
    border: 0; border-inline-start: 0; border-radius: 0; box-shadow: none;
    border-bottom: 1px solid var(--gs-border-light);
    padding: .5rem .65rem; gap: .75rem;
    transition: background .12s;
}
.pos-inv-listbody .inv-card:hover { background: var(--gs-bg); box-shadow: none; transform: none; }
.pos-inv-listbody .inv-card.selected { background: var(--gs-primary-bg); box-shadow: none; }
.pos-inv-listbody .inv-no { font-size: .88rem; }
.pos-inv-listbody .inv-no .badge { font-size: .66rem; padding: .2em .5em; font-weight: 600; }
.pos-inv-listbody .inv-cust { font-size: .76rem; }
.pos-inv-listbody .inv-amount { font-size: 1rem; }
.pos-inv-listbody .inv-amount small { font-size: .64rem; }
.pos-inv-listbody .inv-go { display: none; }   /* لا سهم — صف مبسّط */

/* اليسار: تفاصيل الفاتورة المختارة + الإجراءات */
.pos-inv-detailcol { flex: 0 0 400px; max-width: 400px; min-height: 0; border-inline-start: 1px solid var(--gs-border); background: var(--gs-bg); display: flex; flex-direction: column; }
.pos-inv-detailbody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pos-inv-receipt-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem; }

/* تذييل الإجراءات (بدل زر «تحميل الطلب» في Odoo) */
.pos-inv-actions { flex: 0 0 auto; border-top: 1px solid var(--gs-border); background: #fff; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.pos-inv-actions-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pos-inv-deliver-btn { width: 100%; border: 0; border-radius: 12px; background: var(--gs-primary); color: #fff; font-weight: 700; font-size: 1.05rem; padding: .8rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: background .15s; }
.pos-inv-deliver-btn:hover { background: var(--gs-primary-dark); color: #fff; }

/* حالة فارغة (لا فاتورة مختارة) */
.pos-inv-placeholder { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; color: var(--gs-soft); text-align: center; padding: 2rem; }
.pos-inv-placeholder .bi { font-size: 2.6rem; opacity: .4; }

/* جوال: تكديس عمودي (تفاصيل تحت السجلّات) */
@media (max-width: 860px) {
    .pos-inv-split { flex-direction: column; }
    .pos-inv-detailcol { flex: 0 0 auto; max-width: none; border-inline-start: 0; border-top: 1px solid var(--gs-border); }
    .pos-inv-receipt-scroll { max-height: 50vh; }
}

/* حقل المبلغ المقفل عند التسليم (الباقي يُدفع كاملاً إجبارياً — للعرض فقط) */
.pos-amount-locked .pos-amount-input { background: var(--gs-bg) !important; color: var(--gs-dark); font-weight: 700; cursor: default; }
.pos-amount-locked .input-group-text { background: var(--gs-bg); color: var(--gs-soft); }

/* ── Audit trail ── */
.audit-list { display: flex; flex-direction: column; gap: .6rem; }
.audit-card {
    background: #fff;
    border-radius: 14px;
    padding: .85rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}
.audit-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.audit-body { min-width: 0; flex: 1; }
.audit-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.audit-meta { display: flex; gap: 1rem; flex-wrap: wrap; color: #9ca3af; font-size: .78rem; margin-top: .25rem; }
.audit-meta .bi { opacity: .7; }
.audit-changes { font-size: .85rem; background: #f9fafb; border-radius: 8px; overflow: hidden; }
.audit-changes th { color: #6b7280; font-weight: 600; font-size: .76rem; border-bottom: 1px solid #e5e7eb; }
.audit-changes td, .audit-changes th { padding: .35rem .6rem; }
.audit-changes del { opacity: .7; }

/* ===== الفاتورة الحرارية (رول 80mm) — تُستهلك في POS وشاشة التفاصيل ===== */
.thermal {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    color: #000;
    font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 10px;
}
/* علم صغير داخل أزرار الطباعة (نسخة عربي/إنجليزي) */
.btn-flag { height: 13px; width: auto; border-radius: 2px; vertical-align: -1px; margin-inline: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }

.thermal-head { text-align: center; }
.thermal-shop { font-size: 16px; font-weight: 800; line-height: 1.25; }
.thermal-sub { font-size: 11px; }
.thermal-invno { font-size: 22px; font-weight: 900; letter-spacing: .5px; margin-top: 6px; direction: ltr; }
.thermal-sep { border-top: 1px dashed #000; margin: 6px 0; }
.thermal-meta > div,
.thermal-totals > div { display: flex; justify-content: space-between; gap: 8px; }
.thermal-meta span:first-child { color: #333; }
.thermal-meta .b { font-weight: 800; }
.thermal-items { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.thermal-items th { font-weight: 700; border-bottom: 1px solid #000; padding: 2px 0; }
.thermal-items th.ta-name { text-align: start; }
.thermal-items td { padding: 3px 0; vertical-align: top; }
.thermal-items .ta-name { width: 100%; text-align: start; }
.thermal-items .ta-qty { text-align: center; white-space: nowrap; }
.thermal-items .ta-price,
.thermal-items .ta-total { text-align: end; white-space: nowrap; padding-inline-start: 6px; }
.thermal-items .ta-svc { display: block; font-size: 10px; color: #555; }
.thermal-totals { font-size: 12px; }
.thermal-grand { font-size: 15px; font-weight: 800; border-top: 1px solid #000; margin-top: 4px; padding-top: 4px; }
.thermal-due { font-weight: 800; }
.thermal-qr { text-align: center; margin: 8px 0 4px; }
.thermal-qr img { width: 110px; height: 110px; }
.thermal-footer { text-align: center; font-size: 11px; }

/* معاينة على الشاشة: ورقة بيضاء على خلفية رمادية */
.thermal-stage { background: #eef0f3; padding: 16px; display: flex; justify-content: center; }
.thermal-stage .thermal { box-shadow: 0 4px 24px rgba(0,0,0,.12); border-radius: 6px; }

/* ===== الطباعة الحرارية: عزل الفاتورة وحدها (gsPrintThermal في site.js) ===== */
#gsPrintMount { display: none; }
@media print {
    body.gs-printing > *:not(#gsPrintMount) { display: none !important; }
    #gsPrintMount { display: block; }
    #gsPrintMount .thermal { width: 80mm; margin: 0; box-shadow: none; border-radius: 0; }
    @page { size: 80mm auto; margin: 0; }
}

/* ── Onboarding wizard (تسجيل محل جديد متعدّد الخطوات) ──
   هوية المشروع: لون بنفسجي صلب فقط، بلا تدرّجات. خلفية النقاط نمط SVG (صورة) لا gradient. */
.ob-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: #fbfcfc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23e2e8f0'/%3E%3C/svg%3E");
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    color: var(--gs-dark);
}
.ob-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
}
.ob-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--gs-dark); font-weight: 800; font-size: 1.2rem; }
.ob-brand .gs-brand-mark { width: 34px; height: 34px; }
.ob-lang {
    display: inline-flex; align-items: center; gap: .35rem;
    text-decoration: none; color: var(--gs-soft); font-size: .85rem; font-weight: 600;
    border: 1px solid var(--gs-border); border-radius: 999px; padding: .3rem .8rem; background: #fff;
}
.ob-lang:hover { color: var(--gs-dark); }

/* يملأ المساحة تحت الشعار ويوسّط النموذج رأسياً (دائماً في المنتصف). */
.ob-main { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 1.5rem 1.25rem 3rem; }
.ob-wizard { width: 100%; max-width: 640px; margin-inline: auto; }

.ob-progress { display: flex; gap: .45rem; justify-content: center; margin-bottom: 2.25rem; }
.ob-progress span { width: 40px; height: 5px; border-radius: 3px; background: var(--gs-border); transition: background .25s ease; }
.ob-progress span.done { background: var(--gs-primary); }

.ob-step { display: none; }
.ob-step.active { display: block; animation: obFade .28s ease; }
@keyframes obFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.ob-title { font-size: 1.85rem; font-weight: 800; text-align: center; margin-bottom: 2rem; letter-spacing: -.4px; }

.ob-field { margin-bottom: 1.15rem; }
.ob-field > .form-label { font-weight: 600; color: var(--gs-muted); font-size: .9rem; margin-bottom: .4rem; }
.ob-field .form-control, .ob-field .form-select { border-radius: var(--gs-radius); }
.ob-field-error { color: #dc2626; font-size: .85rem; margin-top: .35rem; display: none; }
.ob-field.invalid .ob-field-error { display: block; }
.ob-field.invalid .form-control, .ob-field.invalid .form-select { border-color: #dc2626; }

.ob-activities { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 560px) { .ob-activities.multi { grid-template-columns: 1fr 1fr; } }
.ob-activity-card {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: 1.4rem 1rem; width: 100%;
    border: 1.5px solid var(--gs-border); border-radius: var(--gs-radius-lg);
    background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.ob-activity-card:hover:not(:disabled) { border-color: var(--gs-primary-light); }
.ob-activity-card.selected { border-color: var(--gs-primary); background: var(--gs-primary-bg); box-shadow: var(--gs-shadow-sm); }
.ob-activity-card:disabled { opacity: .5; cursor: not-allowed; }
.ob-activity-emoji { font-size: 2.1rem; line-height: 1; }
.ob-activity-name { font-weight: 700; }
.ob-soon { font-size: .68rem; background: var(--gs-border); color: var(--gs-soft); padding: .1rem .55rem; border-radius: 999px; }

.ob-rules { list-style: none; padding: 0; margin: .65rem 0 0; font-size: .85rem; }
.ob-rule { display: flex; align-items: center; gap: .45rem; color: var(--gs-soft); padding: .15rem 0; }
.ob-rule.ok { color: #16a34a; }

.ob-nav { display: flex; flex-direction: column; gap: .65rem; align-items: center; margin-top: 1.85rem; }
.ob-next {
    width: 100%; border: 0; border-radius: var(--gs-radius);
    background: var(--gs-primary); color: #fff; font-weight: 700; font-size: 1.05rem;
    padding: .8rem 1rem; cursor: pointer; transition: background .15s ease;
}
.ob-next:hover { background: var(--gs-primary-dark); }
.ob-prev { background: transparent; border: 0; color: var(--gs-soft); font-weight: 600; cursor: pointer; padding: .25rem; }
.ob-prev:hover { color: var(--gs-dark); }
