/* جولدفاي — النسخة الأونلاين: نفس ألوان البرنامج، وتشتغل على الكمبيوتر والموبايل (عربي/إنجليزي) */
:root {
    --ink: #1A1814; --ink-2: #26231D; --ink-3: #33302A;
    --gold: #C9A227; --gold-light: #E8CF7A; --gold-soft: #FBF5E1; --gold-deep: #9C7A12;
    --bg: #F6F3EC; --card: #FFFFFF; --line: #E8E2D4; --text: #24211C; --muted: #8A8273;
    --good: #2E7D32; --bad: #C62828; --info: #1565C0; --warn: #B26A00;
    --radius: 14px; --side: 252px;
    --shadow: 0 1px 2px rgba(26, 24, 20, .05), 0 6px 20px -12px rgba(26, 24, 20, .18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--gold-deep); text-decoration: none; }
h1 { font-size: 26px; margin: 0; font-weight: 800; }
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.good { color: var(--good); } .bad { color: var(--bad); } .info { color: var(--info); } .gold { color: var(--gold); }
.ic { flex: none; }

/* ===== القائمة الجانبية ===== */
.side {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); z-index: 40;
    background: var(--ink); color: #D9D3C3; display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.side-head { padding: 22px 20px 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 800; font-size: 22px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #F7E7A9, var(--gold) 50%, var(--gold-deep)); color: var(--ink); font-size: 16px; }
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; font-size: 30px; }
.shop { color: #9E978A; font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 3px; }
.side-nav a, .side-nav .soon { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #E9E3D2; font-weight: 600; }
.side-nav a:hover { background: var(--ink-3); }
.side-nav a.on { background: var(--gold); color: var(--ink); }
.side-nav .soon { opacity: .45; cursor: default; }
.side-nav .soon small { margin-inline-start: auto; font-size: 11px; border: 1px solid #6b6455; border-radius: 999px; padding: 0 7px; }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--ink-3); }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: #9E978A; }
.side-foot a { color: #C9C2B2; padding: 6px; border-radius: 8px; display: inline-flex; }
.side-foot a:hover { background: var(--ink-3); color: var(--gold); }
.side-backdrop { display: none; }

/* ===== المحتوى ===== */
.main { margin-inline-start: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.top {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.icon-btn { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 800; font-family: inherit; cursor: pointer; }
.ticker { flex: 1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); border: 1px solid #F0E2B0; font-size: 14px; font-weight: 700; white-space: nowrap; direction: ltr; }
.chip b { color: var(--gold-deep); margin-inline-end: 4px; }
.chip i { font-style: normal; color: var(--muted); font-weight: 600; }
.branch-pick { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.branch-pick select { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-family: inherit; font-size: 14px; background: #fff; max-width: 190px; }
.trial-bar { background: #FFF4D6; color: #7A5A00; text-align: center; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.trial-bar a { font-weight: 800; }
.content { padding: 22px 24px 40px; width: 100%; max-width: 1400px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.section-title { margin: 22px 0 12px; font-size: 17px; }

/* ===== البطاقات والشبكات ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.highlight { border-color: var(--gold-light); box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow); }
.card.empty { text-align: center; padding: 48px 20px; }
.card.start ol { margin: 0 0 8px; padding-inline-start: 22px; line-height: 2.1; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .grid2 { margin-top: 16px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.hero-card {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px;
    background: linear-gradient(135deg, var(--ink), var(--ink-2)); color: #CFC8B8; border-radius: var(--radius); padding: 22px 24px;
    border: 1px solid #3a352c; box-shadow: var(--shadow);
}
.hero-card span { display: block; font-size: 14px; }
.hero-card b { font-size: 30px; color: #fff; font-weight: 800; letter-spacing: .3px; }
.hero-card b.gold { color: var(--gold-light); }
.hero-card small { font-size: 14px; color: #CFC8B8; font-weight: 600; }
.karat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.karat-grid .card { margin: 0; }
.karat-head { display: flex; justify-content: space-between; align-items: center; color: var(--gold-deep); font-size: 17px; }
.karat-w { font-size: 26px; font-weight: 800; margin-top: 6px; }
.karat-w small { font-size: 14px; color: var(--muted); }
.karat-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 13.5px; color: var(--muted); }
.karat-foot b { color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.stat-grid .card { margin: 0; }
.stat span { display: block; color: var(--muted); font-size: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 800; margin: 2px 0; }
.stat small { color: var(--muted); }

/* ===== الجداول ===== */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: start; color: var(--muted); font-weight: 700; font-size: 13px; padding: 9px 8px; border-bottom: 1px solid var(--line); background: #FCFAF4; white-space: nowrap; }
.table td { padding: 10px 8px; border-bottom: 1px solid #F1ECE1; vertical-align: middle; }
.table tr.dim td { opacity: .55; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table input, .table select { width: 100%; min-width: 70px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-family: inherit; font-size: 14.5px; background: #fff; }
.table input[type=checkbox] { width: 18px; min-width: 0; height: 18px; }
.table .new-row td { background: #FDFBF5; }
.prices-table .price-in { max-width: 150px; text-align: end; font-weight: 700; font-size: 16px; direction: ltr; }
.spread { color: var(--muted); }

/* ===== النماذج والأزرار ===== */
.form label { display: block; font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.form input, .form select, .form textarea {
    display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    font-family: inherit; font-size: 15px; color: var(--text); background: #fff;
}
.form input:focus, .form select:focus, .table input:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }
.form label.check, label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14.5px; }
.form label.check input, label.check input { width: auto; margin: 0; }
.form.narrow { max-width: 460px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset.perms { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 4px; margin: 0 0 12px; }
fieldset.perms legend { font-weight: 800; padding: 0 6px; color: var(--gold-deep); }
fieldset.perms label.check { margin-bottom: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; color: var(--text); background: #fff;
}
.btn.gold { background: linear-gradient(180deg, #D9B53C, var(--gold)); color: #1A1406; border-color: #B8921E; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.line { border-color: var(--line); }
.btn.line:hover { border-color: var(--gold); }
.btn.small { padding: 5px 12px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.derive { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); }
.derive select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-family: inherit; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 16px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--gold-deep); border-color: var(--gold); }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.alert.ok { background: #E8F5E9; color: var(--good); }
.alert.err { background: #FDECEA; color: var(--bad); }
.alert.warn { background: #FFF4D6; color: #7A5A00; }
.alert.info { background: #E3F0FD; color: var(--info); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--gold-soft); color: var(--gold-deep); }
.pill.good { background: #E8F5E9; color: var(--good); }
.pill.bad { background: #FDECEA; color: var(--bad); }
.pill.gold { background: var(--gold); color: var(--ink); }

/* ===== الدخول ===== */
body.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, #3a3226, var(--ink)); }
.bare-box { width: 100%; max-width: 440px; }
.login-brand { text-align: center; color: #E9E3D2; margin-bottom: 18px; }
.login-brand h1 { color: var(--gold); font-size: 32px; margin-top: 10px; }
.login-brand p { margin: 0; color: #B9B1A0; }
.login-card { padding: 26px; }
.login-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.login-top h2 { margin: 0; }
.chip-link { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; }
.owner-login { margin: 14px 0 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0; font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ===== شريط الموبايل السفلي ===== */
.bottom-nav { display: none; }

@media (max-width: 1000px) {
    .side { transform: translateX(105%); box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
    [dir="ltr"] .side { transform: translateX(-105%); }
    body.side-open .side { transform: none; }
    body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .45); }
    .main { margin-inline-start: 0; }
    .menu-btn { display: inline-grid; }
    .top { padding: 8px 12px; gap: 8px; }
    .content { padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }
    .grid2, .grid-side { grid-template-columns: minmax(0, 1fr); }
    .bottom-nav {
        display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, .25);
    }
    .bottom-nav a, .bottom-nav button {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 700;
        background: none; border: 0; font-family: inherit; padding: 4px 0; cursor: pointer;
    }
    .bottom-nav a:active, .bottom-nav button:active { color: var(--gold-deep); }
    .branch-pick select { max-width: 130px; }
    .branch-pick .ic { display: none; }
    h1 { font-size: 22px; }
    .hero-card b { font-size: 24px; }
}
@media (max-width: 520px) {
    .row2 { grid-template-columns: 1fr; }
    .chip { font-size: 13px; padding: 3px 10px; }
    .card { padding: 16px; }
}
/* ===== فلاتر وشبكات إضافية ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 14px 16px; }
.filters label { font-size: 13px; color: var(--muted); font-weight: 600; }
.filters label.grow { flex: 1; min-width: 200px; }
.filters input:not([type=checkbox]), .filters select { display: block; margin-top: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-family: inherit; font-size: 14.5px; background: #fff; width: 100%; }
.filters label.check { padding-bottom: 9px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid3.cards { gap: 16px; align-items: start; }
.grid3.cards > .card { margin: 0; }
.grid3 .span2 { grid-column: span 2; }
.row-actions { white-space: nowrap; }
.row-actions .btn + .btn { margin-inline-start: 4px; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #FCF8EC; }
.table tr.total-row td { border-top: 2px solid var(--line); background: #FCFAF4; }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.tabs.scroll a { white-space: nowrap; }
@media (max-width: 1000px) { .grid3, .grid3.cards { grid-template-columns: 1fr; } .grid3 .span2 { grid-column: auto; } }

/* ===== التقارير والمصروفات ولوحة التحكم ===== */
.reports { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.report-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 74px; }
.report-list a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text); }
.report-list a b { display: block; font-size: 14.5px; }
.report-list a small { color: var(--muted); font-size: 12px; }
.report-list a:hover { background: #FCF8EC; }
.report-list a.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] .report-list a.on { box-shadow: inset -3px 0 0 var(--gold); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.quick .btn.on { border-color: var(--gold); background: var(--gold-soft); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.report-head h2 { margin: 0; font-size: 21px; }
.report-head p { margin: 2px 0 0; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.summary-grid .sum { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #FDFBF6; }
.summary-grid .sum span { display: block; color: var(--muted); font-size: 13px; }
.summary-grid .sum b { font-size: 18px; font-variant-numeric: tabular-nums; }
.summary-grid .sum.hl { background: var(--ink); border-color: var(--ink); }
.summary-grid .sum.hl span { color: #CFC8B8; }
.summary-grid .sum.hl b { color: var(--gold-light); }
.report-table tr.em td { font-weight: 800; background: #FCFAF4; border-top: 1px solid var(--line); }
.bars { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 110px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row b { text-align: end; font-variant-numeric: tabular-nums; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bar { display: block; height: 10px; border-radius: 6px; background: #F1ECE0; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold-light), var(--gold)); }
.cat-bar { margin-bottom: 12px; }
.cat-bar-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.cat-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: 14px; }
.cat-list a:hover { background: #FCF8EC; }
.cat-list a.dim { opacity: .5; }
.cat-list i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.cat-list small { margin-inline-start: auto; color: var(--muted); }
.sub-title { font-size: 15px; margin: 0 0 10px; }
.total-line { margin: 12px 0 0; font-size: 16px; }
.dash-bottom { margin-top: 16px; }
.vchart { display: flex; align-items: flex-end; gap: 6px; height: 200px; direction: ltr; }
.vcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.vbar { width: 100%; max-width: 32px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--gold), var(--gold-light)); }
.vval { font-size: 10px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }
.vlbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.vbar { position: relative; }
.vbar em { position: absolute; bottom: 0; left: 22%; right: 22%; background: var(--good, #2E7D4F); border-radius: 4px 4px 0 0; }
.vchart.hours { height: 140px; gap: 2px; }
.bar-list { display: grid; gap: 9px; }
.bar-list .bar-label { unicode-bidi: plaintext; text-align: start; }
.stats-filter { margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.stats-filter .seg { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-grid + .card, .stat-grid + .grid2 { margin-top: 16px; }
input[type=color] { height: 42px; padding: 4px; }
@media (max-width: 1000px) {
    .reports { grid-template-columns: minmax(0, 1fr); }
    .report-list { position: static; flex-direction: row; overflow-x: auto; }
    .report-list a { flex: none; max-width: 210px; }
    .report-list a small { display: none; }
    .bar-row { grid-template-columns: 100px minmax(0, 1fr) 80px; }
}
@media print {
    .reports { display: block; }
    .report-doc { border: 0; box-shadow: none; padding: 0; }
    .summary-grid .sum.hl, .table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-table { font-size: 11px; }
}

/* ===== قارئ الباركود بالكاميرا والتثبيت والميزان ===== */
.scanner { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; color: #fff; }
.scanner-top { width: 100%; max-width: 520px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.scanner-top .icon-btn { font-size: 24px; background: #fff; }
.scanner-view { position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #111; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 22% 10%; border: 3px solid var(--gold); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.scanner-msg { margin-top: 14px; text-align: center; color: #ddd; }
.scanner-msg.err { color: #ff8a80; }
.input-with-btn { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
.input-with-btn input { margin-top: 0 !important; }
.scale-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; color: var(--muted); }
.scale-bar b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.scale-bar.stable { border-color: #A5D6A7; background: #F1F8F1; }
.scale-bar.stable #scale-status { color: var(--good); font-weight: 700; }
.install-hero { display: flex; gap: 18px; align-items: center; }
.install-hero img { border-radius: 18px; flex: none; }
.install-hero h2 { margin-bottom: 4px; }
.steps-list { margin: 0; padding-inline-start: 20px; line-height: 2; }
.small-b { font-size: 14px !important; word-break: break-all; }

/* ===== شاشة البيع ===== */
.pos-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: #EDE7D8; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; padding: 9px 18px; border-radius: 9px; font-family: inherit; font-size: 15px; font-weight: 800; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--gold-deep); box-shadow: var(--shadow); }
.seg button.on.buy { color: var(--info); }
kbd { font-family: inherit; font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: #fff; }
.btn kbd { background: rgba(255, 255, 255, .5); }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pos-main, .pos-side, .grid2 > *, .grid-side > *, .grid3 > * { min-width: 0; }
.pos-main .card, .pos-side .card { margin-bottom: 14px; }
.pos.mode-buy .sell-only, .pos.mode-sell .buy-only { display: none !important; }
.scan { display: flex; align-items: center; gap: 10px; border: 2px dashed var(--gold-light); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; color: var(--gold-deep); }
.scan input { flex: 1; border: 0; outline: 0; font-family: inherit; font-size: 17px; font-weight: 700; background: transparent; min-width: 0; }
.free summary { cursor: pointer; font-weight: 800; color: var(--gold-deep); padding: 4px 0 10px; }
.pos.mode-buy .free summary { color: var(--info); }
.free-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.free-grid label { font-size: 13px; color: var(--muted); font-weight: 600; }
.free-grid label.wide { grid-column: span 2; }
.free-grid input, .free-grid select { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font-family: inherit; font-size: 15px; background: #fff; }
.pos-lines .cell-in { width: 92px; min-width: 70px; text-align: end; padding: 6px 8px; }
.icon-btn.danger { min-width: 30px; height: 30px; color: var(--bad); font-size: 20px; line-height: 1; }
.totals .tot-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #F1ECE1; color: var(--muted); }
.totals .tot-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.totals .grand { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; }
.totals .grand b { font-size: 24px; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.pos.mode-buy .totals .grand { background: #0D3C73; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pay-grid label { margin-bottom: 8px; }
.pay-left { margin: 10px 0; font-weight: 700; }
.pay-left .warn { color: var(--warn); } .pay-left .bad { color: var(--bad); } .pay-left .info { color: var(--info); }
.btn.big { padding: 14px 18px; font-size: 17px; margin-top: 6px; }
.btn.block + .btn.block { margin-top: 8px; }
.req { color: var(--bad); }
@media (max-width: 1200px) { .free-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .pos-grid { grid-template-columns: minmax(0, 1fr); } }

/* ===== الفاتورة المطبوعة ===== */
.doc-wrap { display: flex; justify-content: center; margin-bottom: 18px; }
.doc { background: #fff; color: #000; box-shadow: var(--shadow); border: 1px solid var(--line); }
.receipt { width: 80mm; padding: 4mm 4mm 6mm; font-size: 11px; line-height: 1.45; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1.5px 1px; vertical-align: top; }
.receipt .end { text-align: end; }
.r-shop { text-align: center; font-size: 17px; font-weight: 800; }
.r-soft { text-align: center; color: #555; font-size: 10px; }
.r-band { background: #000; color: #fff; text-align: center; font-weight: 800; font-size: 13px; padding: 3px; margin: 6px 0 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.r-info td:first-child { color: #555; font-size: 10px; width: 38%; }
.r-info td:last-child { text-align: end; }
.r-dash { border-top: 1px dashed #000; margin: 5px 0; }
.r-head td { font-weight: 800; font-size: 10px; border-bottom: 1px solid #000; }
.r-desc { font-weight: 800; padding-top: 5px !important; }
.r-detail { color: #555; font-size: 9px; }
.r-sep td { border-bottom: .5px solid #999; padding-bottom: 4px; }
.r-totals td:first-child { color: #555; }
.r-totals { margin-top: 4px; }
.r-grand { display: flex; justify-content: space-between; align-items: center; background: #000; color: #fff; padding: 5px 6px; margin: 4px 0; font-weight: 800; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.r-grand b { font-size: 14px; }
.r-sign { margin-top: 14px; }
.r-footer { text-align: center; font-weight: 700; margin: 4px 0 6px; }
.r-code { text-align: center; font-size: 9px; }
.r-code svg { width: 58mm; height: 11mm; display: block; margin: 0 auto 2px; }
.a4 { width: 210mm; min-height: 297mm; padding: 14mm; font-size: 12.5px; }
.a4 .soft { color: #555; }
.a4 .end { text-align: end; }
.a4-head { display: flex; justify-content: space-between; gap: 20px; }
.a4-shop { font-size: 24px; font-weight: 800; }
.a4-title { font-size: 21px; font-weight: 800; color: #B8921E; }
.a4-no { font-size: 15px; font-weight: 800; }
.a4-rule { border-top: 2px solid #B8921E; margin: 10px 0 14px; }
.a4-rule.thin { border-top-width: 1px; margin-top: 22px; }
.a4 table { width: 100%; border-collapse: collapse; }
.a4-who td { padding: 5px 4px; border-bottom: .5px solid #bbb; }
.a4-who { margin-bottom: 14px; }
.a4-items th { background: #24221E; color: #fff; padding: 7px 6px; text-align: start; font-size: 11.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4-items th.end { text-align: end; }
.a4-items td { padding: 7px 6px; border-bottom: .5px solid #ddd; }
.a4-items tbody tr:nth-child(even) td { background: #F4F1EA; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4-items tbody tr:last-child td { border-bottom: 1px solid #000; }
.a4-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 14px; }
.a4-pay td, .a4-tot td { padding: 5px 6px; border-bottom: .5px solid #bbb; }
.a4-tot tr.grand td { background: #24221E; color: #fff; font-weight: 800; font-size: 15px; padding: 9px 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4-sign { display: flex; justify-content: space-between; margin-top: 40px; }
.a4-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.a4-foot .r-code svg { width: 55mm; }

@media print {
    .side, .top, .bottom-nav, .trial-bar, .actions, .no-print, .alert, .side-backdrop { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; max-width: none; }
    body { background: #fff; }
    .doc { box-shadow: none; border: 0; }
    .doc-wrap { display: block; margin: 0; }
    .receipt { width: 72mm; padding: 0 2mm; }
    .a4 { width: auto; min-height: 0; padding: 0; }
}

/* ===== المتجر الإلكتروني ===== */
.nav-badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.spread-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F1ECE1; }
.spread-row:last-of-type { border-bottom: 0; }
.store-link { margin-top: 14px; }
.store-link input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-family: inherit; background: #FCFAF4; }
.steps-list li.done { color: var(--good); }
.steps-list li.done::marker { content: "✓  "; }
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; display: block; border: 1px solid var(--line); }
.thumb.none { display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-deep); }
.thumb.big { width: 90px; height: 90px; margin-bottom: 6px; }
.thumb.wide { width: 100%; max-width: 260px; height: 90px; margin-bottom: 6px; }
.pay-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.pay-cards > .card { margin: 0; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.img-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.img-item.main { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.img-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.img-actions { display: flex; gap: 6px; padding: 8px; justify-content: space-between; align-items: center; }
.img-actions form { margin: 0; }
.deliver-box { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #F0E2B0; }
.deliver-box h3 { margin: 0 0 4px; font-size: 16px; }
.cancel-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.card.form form + form { margin-top: 10px; }
.btn.bad { color: var(--bad); }
.en-fields { margin: 4px 0 16px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
.en-fields summary { cursor: pointer; font-weight: 700; color: var(--gold-deep); margin-bottom: 8px; }
.table td b + br + .muted, .table td a b { white-space: nowrap; }

form.inline { display: inline; }
.nowrap { white-space: nowrap; }
.einv-box { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.einv-box .grow { flex: 1; min-width: 240px; }
.einv-qr { display: flex; justify-content: center; margin: 8px auto 2px; }
.einv-qr img, .einv-qr canvas { width: 120px !important; height: 120px !important; }
.a4 .einv-qr { margin: 0; }
.a4 .einv-qr img, .a4 .einv-qr canvas { width: 110px !important; height: 110px !important; }
.pos-tax { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #E3F0FD; color: var(--info); font-weight: 700; margin-bottom: 10px; }
.store-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px 4px; margin: 6px 0 12px; display: grid; gap: 8px; }
.store-box legend { font-weight: 800; color: var(--gold-deep); padding: 0 6px; display: inline-flex; gap: 6px; align-items: center; }
.branch-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 4px 0 10px; display: grid; gap: 6px; }
.branch-box legend { font-weight: 700; padding: 0 6px; }
.branch-box #branch-list { display: grid; gap: 4px; padding-inline-start: 8px; }

/* ===== المساعد الذكي ===== */
.ai-fab { position: fixed; z-index: 60; inset-inline-end: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; color: #1E1C18;
    background: radial-gradient(circle at 30% 25%, #FFF3C4, #E9C766 45%, #B8892B 100%); box-shadow: 0 10px 28px -8px rgba(120, 88, 20, .65), 0 0 0 4px rgba(233, 199, 102, .22);
    display: grid; place-items: center; transition: transform .2s; animation: ai-glow 3.2s ease-in-out infinite; }
.ai-fab:hover { transform: translateY(-2px) scale(1.04); }
@keyframes ai-glow { 50% { box-shadow: 0 10px 28px -8px rgba(120, 88, 20, .65), 0 0 0 9px rgba(233, 199, 102, .12); } }
body.ai-open .ai-fab { display: none; }
.ai-panel { position: fixed; z-index: 61; inset-inline-end: 22px; bottom: 22px; width: min(430px, calc(100vw - 24px)); height: min(640px, calc(100vh - 44px));
    background: #FFFDF8; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 70px -20px rgba(30, 28, 24, .45); display: flex; flex-direction: column; overflow: hidden; }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: linear-gradient(135deg, #1E1C18, #3A3226); color: #F6EBC8; }
.ai-head > div { flex: 1; min-width: 0; }
.ai-head b { display: block; font-size: 15.5px; }
.ai-head small { display: block; font-size: 11.5px; color: #B8AF99; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-hbtn { background: rgba(255, 255, 255, .08); border: 0; color: #F6EBC8; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.ai-hbtn:hover { background: rgba(255, 255, 255, .16); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; line-height: 1.75; font-size: 14.5px; overflow-wrap: anywhere; }
.ai-msg.user { align-self: flex-start; background: linear-gradient(135deg, #E9C766, #C9A227); color: #1E1C18; border-end-start-radius: 4px; white-space: pre-wrap; }
.ai-msg.bot { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-end-end-radius: 4px; }
[dir="ltr"] .ai-msg.user { align-self: flex-end; } [dir="ltr"] .ai-msg.bot { align-self: flex-start; }
.ai-msg.err { border-color: #F2B8B5; background: #FDECEA; color: var(--bad); }
.ai-msg p { margin: 0 0 8px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul, .ai-msg ol { margin: 4px 0 8px; padding-inline-start: 20px; }
.ai-msg h4 { margin: 8px 0 4px; font-size: 15px; }
.ai-msg code { background: #F4EFE2; padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.ai-msg .ai-tbl { overflow-x: auto; margin: 6px 0; }
.ai-msg table { border-collapse: collapse; font-size: 13px; width: 100%; }
.ai-msg th, .ai-msg td { border: 1px solid var(--line); padding: 5px 8px; text-align: start; white-space: nowrap; }
.ai-msg th { background: #FBF6E6; }
.ai-copy { display: block; margin-top: 6px; background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 13px; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: #C9A227; animation: ai-dot 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 50% { opacity: .25; transform: translateY(-3px); } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips button { border: 1px solid #E8D9A8; background: #FFF8E4; color: #6B5413; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ai-chips button:hover { background: #FBEFC8; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-form textarea { flex: 1; resize: none; max-height: 120px; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 14.5px; margin: 0; }
.ai-send { flex: none; width: 44px; height: 42px; border-radius: 12px; border: 0; background: #1E1C18; color: #E9C766; cursor: pointer; display: grid; place-items: center; }
[dir="rtl"] .ai-send svg { transform: scaleX(-1); }
.ai-send:disabled { opacity: .5; cursor: default; }
.ai-foot { margin: 0; padding: 0 12px 8px; font-size: 11px; color: var(--muted); background: #fff; text-align: center; }
@media (max-width: 1000px) {
    .ai-fab { bottom: 80px; inset-inline-end: 14px; width: 52px; height: 52px; }
    .ai-panel { bottom: 76px; height: min(640px, calc(100vh - 96px)); }
}
@media (max-width: 600px) {
    .ai-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; z-index: 80; }
}
@media print { .ai-fab, .ai-panel { display: none !important; } }
/* إعدادات المساعد */
.ai-settings .ai-key-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 2px; }
.ai-model-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ai-model-tools input[type=search] { flex: 1; min-width: 220px; margin: 0; }
.ai-models { width: 100%; font-size: 13.5px; padding: 6px; border-radius: 10px; }
.ai-models option { padding: 5px 6px; border-radius: 6px; }
.ai-note { background: #FAF7EF; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 13.5px; }
.ai-note ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--muted); }
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters-bar .seg { display: flex; gap: 6px; flex-wrap: wrap; margin-inline-end: auto; }
.filters-bar label { margin: 0; font-size: 13px; }
.filters-bar input, .filters-bar select { margin-top: 2px; }
.ai-bal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.ai-bal { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #FFFDF8; }
.ai-bal h3 { margin: 0 0 8px; font-size: 15px; }
.ai-bal h3 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.ai-bal-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ai-bal-row.big b { font-size: 19px; color: var(--gold-deep); }
.ai-bar { height: 8px; border-radius: 6px; background: #F1ECE0; overflow: hidden; margin-top: 10px; }
.ai-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #E9C766, #C9A227); border-radius: 6px; transition: width .6s; }
.ai-bar i.hot { background: linear-gradient(90deg, #F2A35E, #C62828); }
@media (max-width: 1000px) { .ai-bal-grid { grid-template-columns: minmax(0, 1fr); } }

/* ===== لوحة الملاحظات ===== */
.corkboard { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 30px 26px; align-items: start; padding: 34px 26px 40px; border-radius: 22px; min-height: 360px;
    background-color: #C9A57A;
    background-image: radial-gradient(rgba(120, 82, 40, .35) 1px, transparent 1.4px), radial-gradient(rgba(255, 240, 210, .28) 1px, transparent 1.6px), linear-gradient(135deg, #D2B088, #B88E5F);
    background-size: 7px 7px, 11px 11px, 100% 100%; background-position: 0 0, 3px 4px, 0 0;
    box-shadow: inset 0 0 0 10px #8A5E34, inset 0 0 0 12px #6E4825, inset 0 6px 22px rgba(0, 0, 0, .25), 0 14px 30px -18px rgba(60, 35, 10, .6); }
.note-card { position: relative; padding: 26px 18px 12px; min-height: 170px; display: flex; flex-direction: column; color: #2B2620; border-radius: 3px 3px 18px 3px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 12px 18px -10px rgba(0, 0, 0, .45); transition: transform .18s, box-shadow .18s; overflow-wrap: anywhere; }
.note-card::after { content: ""; position: absolute; inset-inline-end: 0; bottom: 0; width: 26px; height: 26px; background: linear-gradient(135deg, rgba(0, 0, 0, .14) 50%, transparent 50%); border-radius: 0 0 16px 0; }
[dir="rtl"] .note-card { border-radius: 3px 3px 3px 18px; } [dir="rtl"] .note-card::after { background: linear-gradient(225deg, rgba(0, 0, 0, .14) 50%, transparent 50%); border-radius: 0 0 0 16px; }
.note-card:hover { transform: rotate(0) translateY(-3px) scale(1.02) !important; box-shadow: 0 2px 2px rgba(0, 0, 0, .12), 0 22px 30px -14px rgba(0, 0, 0, .5); z-index: 2; }
.tilt-0 { transform: rotate(-2deg); } .tilt-1 { transform: rotate(1.5deg); } .tilt-2 { transform: rotate(-.8deg); } .tilt-3 { transform: rotate(2.2deg); } .tilt-4 { transform: rotate(-1.6deg); }
.note-pin { position: absolute; top: -9px; left: 50%; margin-left: -10px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FF8A80, #C62828 60%, #7F1010); box-shadow: 0 3px 4px rgba(0, 0, 0, .4); }
.note-card.pinned .note-pin { background: radial-gradient(circle at 35% 30%, #FFE08A, #C9A227 60%, #7A5E10); width: 24px; height: 24px; margin-left: -12px; top: -11px; }
.note-card h3, .note-body { text-align: start; }
.note-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; line-height: 1.4; }
.note-body { font-size: 15px; line-height: 1.75; flex: 1; white-space: normal; }
.note-card footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, .14); font-size: 11.5px; color: rgba(43, 38, 32, .65); }
.note-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.note-card:hover .note-actions, .note-actions:focus-within { opacity: 1; }
.note-actions form { margin: 0; }
.nbtn { border: 0; background: rgba(255, 255, 255, .45); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: #3A332A; }
.nbtn:hover { background: rgba(255, 255, 255, .85); }
.nbtn.on { color: #9C7A12; background: rgba(255, 255, 255, .8); }
.n-yellow { background: linear-gradient(180deg, #FFF59D, #FFEE7A); }
.n-pink { background: linear-gradient(180deg, #FFCDD9, #FFB6C8); }
.n-blue { background: linear-gradient(180deg, #C8E6FF, #AFD9FF); }
.n-green { background: linear-gradient(180deg, #D4F5C4, #BDEDA8); }
.n-purple { background: linear-gradient(180deg, #E5D4FF, #D6BEFF); }
.n-orange { background: linear-gradient(180deg, #FFDDB3, #FFCB8F); }
.n-white { background: linear-gradient(180deg, #FFFFFF, #F4F1EA); }
.board-empty { grid-column: 1 / -1; display: grid; place-items: center; padding: 30px 0; }
.board-empty .note-card { max-width: 320px; text-align: center; }
.notes-filters { align-items: flex-end; }
.note-swatches { display: flex; gap: 6px; align-items: center; padding-bottom: 6px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .12); display: inline-block; cursor: pointer; position: relative; }
.sw.all { background: conic-gradient(#FFEE7A 0 14%, #FFB6C8 0 28%, #AFD9FF 0 42%, #BDEDA8 0 57%, #D6BEFF 0 71%, #FFCB8F 0 85%, #fff 0); }
.sw.on, .note-colors .sw:has(input:checked) { border-color: #1E1C18; box-shadow: 0 0 0 3px rgba(201, 162, 39, .45); }
.note-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.note-colors > span { font-size: 13px; color: var(--muted); margin-inline-end: 4px; }
.note-colors input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.note-opts { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.note-dialog { border: 0; padding: 0; background: transparent; width: min(520px, calc(100vw - 24px)); }
.note-dialog::backdrop { background: rgba(30, 28, 24, .55); backdrop-filter: blur(2px); }
.note-form { padding: 22px; border-radius: 6px 6px 22px 6px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
.note-form h2 { margin: 0 0 12px; }
.note-form input:not([type=radio]):not([type=checkbox]), .note-form textarea { background: rgba(255, 255, 255, .72); }
@media (max-width: 600px) { .corkboard { padding: 26px 14px 30px; gap: 26px; grid-template-columns: minmax(0, 1fr); } }
@media print { .corkboard { background: none; box-shadow: none; } .note-actions, .note-pin { display: none; } }

.forgot-box { margin: 4px 0 12px; font-size: 13.5px; }
.forgot-box summary { cursor: pointer; text-align: center; color: var(--gold-deep); font-weight: 700; list-style: none; }
.forgot-box summary::-webkit-details-marker { display: none; }
.forgot-box p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; }
.forgot-box b { color: var(--text); }

/* حسابات الدفع وصورة البطاقة في شاشة البيع */
.pay-grid label { display: flex; flex-direction: column; gap: 4px; }
.pay-grid .acc-pick { font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #FCFAF4; color: var(--muted); margin: 0; }
.id-image { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; }
.id-pick { cursor: pointer; margin: 0; }
.id-thumb { position: relative; }
.id-thumb img { width: 74px; height: 50px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.id-thumb .nbtn { position: absolute; top: -8px; inset-inline-end: -8px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 11px; }

.inv-extra { margin-top: 16px; }
.id-view img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; margin-bottom: 10px; }

/* ===== الخزنة والحسابات ===== */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.acc-card { margin: 0; position: relative; overflow: hidden; border-top: 4px solid var(--gold); }
.acc-card.t-bank { border-top-color: #1565C0; } .acc-card.t-wallet { border-top-color: #7B1FA2; }
.acc-card.off { opacity: .55; }
.acc-top { display: flex; gap: 10px; align-items: center; }
.acc-top small { display: block; color: var(--muted); font-size: 12px; }
.acc-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #FBF3D9; color: #9C7A12; flex: none; }
.t-bank .acc-ic { background: #E3EEFB; color: #1565C0; } .t-wallet .acc-ic { background: #F1E4F8; color: #7B1FA2; }
.acc-bal { font-size: 24px; font-weight: 800; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.acc-bal small { font-size: 13px; color: var(--muted); font-weight: 600; }
.acc-actions { display: flex; gap: 6px; margin-top: 10px; }
.vpair { display: flex; gap: 2px; align-items: flex-end; width: 100%; justify-content: center; height: 100%; }
.vpair .vbar { max-width: 14px; }
.vpair .vbar.out { background: linear-gradient(180deg, #EF9A9A, #C62828); }
tr.total td { border-top: 2px solid var(--line); background: #FCFAF4; }

.brand-pill { font-size: 11px; padding: 1px 8px; background: #F3ECDA; color: #6B5413; vertical-align: middle; }

/* سطر «اسم — قيمة» وحقول الأرقام الصغيرة (تنبيهات المخزون والأمانات وحساب المورد) */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line, #e8e2d4); }
.kv:last-child { border-bottom: 0; }
.bad-text { color: #c0392b; }
.good-text { color: #2e7d32; }
.inline-num { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; flex-direction: row !important; }
.inline-num input { width: 90px; flex: none; text-align: center; }
.ledger-bal { display: flex; flex-wrap: wrap; gap: 10px; }
.ledger-bal .card.stat b { font-size: 22px; }
.op-fields [data-for] { display: none; }
.pill.warn { background: #FFF4E0; color: #9a6400; }
.row-actions form { display: inline; }
/* سطور القيد في المحاسبة */
.je-line { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(70px, 1fr) minmax(70px, 1fr) minmax(0, 1.4fr); gap: 6px; margin-bottom: 6px; }
.table tr.entry-head td { border-top: 2px solid var(--line, #e8e2d4); }
@media (max-width: 640px) { .je-line { grid-template-columns: 1fr 1fr; } .je-line select { grid-column: 1 / -1; } }

/* ===== البيع أوفلاين ===== */
.net-bar { background: #FFF4D6; color: #7A5A00; text-align: center; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.net-bar.off { background: #33291A; color: #F7E7A9; }
.offline-bar { background: #FDECEA; color: var(--bad); }
.pos.is-offline .pos-head { box-shadow: inset 0 -3px 0 #C9A227; }
.off-receipt { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .6); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 16px; overflow: auto; }
.off-receipt[hidden] { display: none; }
.off-receipt .actions { display: flex; gap: 10px; }
.r-note { text-align: center; font-size: 10px; font-weight: 700; }
.offline-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.offline-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.offline-total { margin-inline-start: auto; }
.offline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.offline-actions input { width: auto; flex: 1; min-width: 160px; margin: 0; }
@media print {
    body.off-printing .content > :not(.off-receipt), body.off-printing .net-bar { display: none !important; }
    body.off-printing .off-receipt { position: static; background: none; padding: 0; overflow: visible; }
    body.off-printing .off-receipt .doc { box-shadow: none; border: 0; }
}
