@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Readex+Pro:wght@500;600;700&display=swap');

:root {
  --primary: #0E8079;
  --primary-deep: #145F5A;
  --primary-dark: #075E59;
  --primary-soft: #DDF4F2;
  --primary-ground: #F3F8F8;
  --accent: #F4A582;
  --accent-soft: #FDE9DE;
  --ink: #0F1B2D;
  --muted: #55606F;
  --line: #DCE6E5;
  --line-soft: #EDF2F2;
  --card: #FFFFFF;
  --danger: #B3261E;
  --danger-soft: #FDE8E6;
  --ok: #0B6B3F;
  --ok-soft: #DDF3E6;
  --violet: #5A2D9C;
  --violet-soft: #F1EAFB;
  --warn-ink: #6E2E14;
  --radius: 18px;
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --display: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--primary-ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; }
body { min-height: 100vh; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grow { flex: 1 1 auto; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.card.tight { padding: 12px 14px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat b { font-family: var(--display); font-size: 28px; font-weight: 700; }
/* كروت الرئيسية: ألوان ناعمة متناسقة لكل كارت */
a.stat { text-decoration: none; color: var(--ink); border: 1px solid transparent; border-right: 5px solid var(--tone-ink); background: linear-gradient(135deg, #fff 0%, var(--tone-bg) 100%); transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 27, 45, .08); color: var(--ink); }
.stat .lbl { color: var(--muted); font-weight: 600; }
.stat .num { color: var(--tone-ink); }
.stat .sub { color: var(--tone-ink); font-weight: 600; opacity: .85; min-height: 1.3em; }
.tone-teal { --tone-bg: #DDF4F2; --tone-ink: #0E8079; }
.tone-sky { --tone-bg: #E1EFFB; --tone-ink: #1F5F9E; }
.tone-violet { --tone-bg: #F1EAFB; --tone-ink: #5A2D9C; }
.tone-peach { --tone-bg: #FDE9DE; --tone-ink: #B4532A; }
.tone-mint { --tone-bg: #DDF3E6; --tone-ink: #0B6B3F; }
.tone-sand { --tone-bg: #F7EFD9; --tone-ink: #8A6414; }
.tone-rose { --tone-bg: #FBE4EA; --tone-ink: #A33257; }
.tone-lilac { --tone-bg: #ECE8F8; --tone-ink: #4E4494; }
.tone-gold { --tone-bg: #FFF2CC; --tone-ink: #7A5A00; }

.btn { min-height: 44px; padding: 0 18px; border-radius: 13px; border: 0; background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn.danger { background: #fff; color: var(--danger); border: 1.5px solid #F2C4BF; }
.btn.ok { background: var(--ok); }
.btn.soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.icon-btn { width: 44px; height: 44px; border-radius: 13px; border: 0; background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.in, select.in, textarea.in { min-height: 46px; border: 1.5px solid var(--line); border-radius: 13px; padding: 0 14px; background: #FAFCFC; width: 100%; font-weight: 400; }
textarea.in { padding: 12px 14px; min-height: 90px; resize: vertical; }
.in:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { text-decoration: none; color: var(--ink); }
.chip:hover { color: var(--ink); border-color: var(--primary); }
.chip.on:hover { color: #fff; }
.chip { min-height: 38px; padding: 0 15px; border-radius: 19px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; font-weight: 600; }
.chip .n { font-size: 12px; background: var(--accent); color: var(--ink); border-radius: 10px; padding: 0 7px; font-weight: 700; }
.chip.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 16px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; background: #E7EEEE; padding: 4px; border-radius: 13px; }
.seg a { min-height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px; color: #3D4757; }
.seg a.on { background: #fff; font-weight: 600; color: var(--ink); box-shadow: 0 1px 4px rgba(15,27,45,.1); }
.seg button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 14px; color: #3D4757; }
.seg button.on { background: #fff; font-weight: 600; color: var(--ink); box-shadow: 0 1px 4px rgba(15,27,45,.1); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 10px; background: var(--line-soft); color: #3D4757; white-space: nowrap; }
.b-new, .b-returned { background: var(--accent-soft); color: var(--warn-ink); }
.b-pending_accountant { background: var(--violet-soft); color: var(--violet); }
.b-approved, .b-preparing { background: var(--primary-soft); color: #0B4F4A; }
.b-shipped, .b-closed, .b-confirmed, .b-active { background: var(--ok-soft); color: var(--ok); }
.b-rejected, .b-cancelled, .b-suspended { background: var(--danger-soft); color: #7A1A14; }
.b-pending { background: var(--accent-soft); color: var(--warn-ink); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-weight: 500; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.t td { padding: 11px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td, table.t tr.sel td { background: var(--primary-ground); }
.scroll-x { overflow-x: auto; flex-shrink: 0; }

.note { display: flex; gap: 10px; align-items: flex-start; border-radius: 13px; padding: 11px 13px; font-size: 13px; }
.note.warn { background: var(--accent-soft); color: var(--warn-ink); }
.note.err { background: var(--danger-soft); color: #7A1A14; }
.note.ok { background: var(--ok-soft); color: #0B5A35; }
.note.info { background: var(--primary-soft); color: #0B4F4A; }

.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 17px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 13px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 90vw; }
#toast div.err { background: var(--danger); }

.modal-back { position: fixed; inset: 0; background: rgba(15,27,45,.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 22px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal.wide { width: min(900px, 100%); }

.logo { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }

.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; }
.qty button.plus { background: var(--primary); color: #fff; border: 0; }
.qty input { width: 56px; height: 38px; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; }

.map { width: 100%; border-radius: var(--radius); overflow: hidden; background: #E8EDE6; z-index: 0; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content { margin: 10px 12px; line-height: 1.6; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

.btn.wa { color: #128C7E; border-color: #128C7E; gap: 6px; }
.btn.wa:hover { background: #E8F8F3; }

/* مفتاح تشغيل/إيقاف */
.sw{position:relative;display:inline-block;width:44px;height:24px;vertical-align:middle;cursor:pointer}
.sw input{opacity:0;width:0;height:0;position:absolute}
.sw i{position:absolute;inset:0;background:#c9ced3;border-radius:24px;transition:.2s}
.sw i::before{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.sw input:checked + i{background:var(--ok,#1b8f5a)}
.sw input:checked + i::before{transform:translateX(20px)}
.sw input:disabled + i{opacity:.5;cursor:not-allowed}

/* صور المنتجات */
.pimgs{display:flex;gap:8px;flex-wrap:wrap}
.pimgs .pi{position:relative;width:84px;height:84px;border-radius:10px;overflow:hidden;background:#eef1f0;border:1px solid #dde3e1}
.pimgs .pi img{width:100%;height:100%;object-fit:cover;display:block}
.pimgs .pi button{position:absolute;top:2px;left:2px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;font-size:14px;line-height:22px;cursor:pointer;padding:0}
.pimgs label.add{width:84px;height:84px;border-radius:10px;border:2px dashed #b9c4c1;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#6b7a77;font-size:26px}
.gal-back{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:60;display:flex;flex-direction:column;align-items:center;justify-content:center;touch-action:pan-y}
.gal-back img{max-width:96vw;max-height:78vh;object-fit:contain;border-radius:8px;background:#111}
.gal-back .gal-bar{position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:12px 16px;color:#fff;font-weight:700}
.gal-back .gal-bar button,.gal-back .gnav button{background:rgba(255,255,255,.15);color:#fff;border:0;border-radius:50%;width:40px;height:40px;font-size:20px;cursor:pointer}
.gal-back .gnav{position:absolute;bottom:18px;display:flex;gap:28px;align-items:center;color:#fff}
.gal-back .dots{display:flex;gap:6px}.gal-back .dots i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.35)}.gal-back .dots i.on{background:#fff}

/* خانة التاريخ المكتوبة */
input.dmy{font-variant-numeric:tabular-nums;letter-spacing:.5px}
input.dmy::placeholder{color:#9aa6a3;font-weight:400;letter-spacing:1px}

/* تبويبات بعداد واضح تحت الاسم */
.chip.tabcount{display:inline-flex;flex-direction:column;align-items:center;gap:0;line-height:1.2;padding:6px 16px}
.chip.tabcount .cnt{font-size:18px;font-weight:800;font-variant-numeric:tabular-nums}

/* الدفعات: طرق الدفع كمربعات + بحث الطرف + كروت الأقسام */
.payboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.paybox { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer; font-size: 14.5px; }
.paybox input { position: absolute; opacity: 0; width: 0; height: 0; }
.paybox:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.paybox.add { border-style: dashed; color: var(--muted); font-family: inherit; }
.plist { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 240px; overflow: auto; }
.pitem { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: right; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit; font-size: 14px; }
.pitem:hover { border-color: var(--primary); background: var(--primary-ground); }
.paysec a.stat { padding: 20px 22px; }
.paysec .lbl { font-size: 17px; font-weight: 700; color: var(--tone-ink); }
.paysec .num { font-size: 40px; line-height: 1.1; }
.paysec .sub { font-size: 14px; }
.paysec a.stat.on { border-color: var(--tone-ink); box-shadow: 0 0 0 3px var(--tone-bg); }

/* طلب لمدرب: سطر لكل مستوى — الاسم · العدد · حساب السطر، والإجمالي فوق */
.ototal { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); border: 1.5px solid var(--primary); flex-wrap: wrap; }
.ototal b { font-family: var(--display); font-size: 28px; margin: 0 8px; color: var(--primary-dark); }
.oline { display: grid; grid-template-columns: 1fr 120px 130px; gap: 8px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--line-soft); border-radius: 12px; background: #fff; }
.oline .oq::placeholder { font-weight: 300; color: #9aa4ad; font-size: 13px; }
.oline-total { display: flex; align-items: center; justify-content: center; background: var(--primary-ground); color: var(--muted); font-weight: 700; }
.oline-total.has { background: var(--ok-soft); color: var(--ok); }

/* قائمة الطلبات: ألوان خفيفة متناسقة (درجات من نفس العائلة) ومن غير سحب أفقي */
.olist { table-layout: fixed; width: 100%; }
.olist th { padding: 7px 5px; font-size: 12px; }
.olist td { vertical-align: middle; padding: 7px 5px; font-size: 12.5px; line-height: 1.3; word-break: break-word; }
.olist th:nth-child(1), .olist td.c-id { width: 20%; }
.olist th:nth-child(2), .olist td.c-tr { width: 23%; }
.olist td.c-id > div:first-child { white-space: nowrap; display: flex; gap: 5px; align-items: center; }
.olist th:nth-child(3), .olist td.c-pc { width: 9%; text-align: center; }
.olist th:nth-child(4), .olist td.c-am { width: 14%; text-align: center; }
.olist th:nth-child(5), .olist td.c-ob { width: 17%; text-align: center; }
.olist th:nth-child(6), .olist td.c-ac { width: 17%; text-align: center; }
.olist td.c-id .small { white-space: nowrap; }
.olist td.c-id .small, .olist td.c-tr .small, .olist td.c-ob .small { font-size: 11.5px; }
.olist td.c-ob .small, .olist td.c-ob b, .olist td.c-am b { white-space: nowrap; }
.olist td.c-am b, .olist td.c-ob b { font-size: 13.5px; }
@media (max-width: 1200px) { .olist th, .olist td { font-size: 11px; padding: 6px 3px; } .olist td.c-ac .btn { padding: 0 5px; min-height: 26px; font-size: 11px; } .olist td.c-id .small, .olist td.c-ob .small { font-size: 10.5px; } .olist td.c-am b, .olist td.c-ob b { font-size: 12px; } }
.olist td.c-id { background: var(--oc-id, #F4F9F9); color: var(--oc-id-fg, inherit); }
.olist td.c-tr { background: var(--oc-tr, #F6F8FB); color: var(--oc-tr-fg, inherit); }
.olist td.c-tr .addr { color: var(--oc-tr-fg, #4E5D6E); opacity: .85; margin-top: 2px; }
.olist td.c-pc { background: var(--oc-pc, #F8F6F0); color: var(--oc-pc-fg, inherit); }
.olist td.c-am { background: var(--oc-am, #F1F8F3); color: var(--oc-am-fg, #0B6B3F); }
.olist td.c-ob { background: var(--oc-ob, #FBF6E6); color: var(--oc-ob-fg, #6E5400); }
.olist td.c-ac { white-space: nowrap; }
.olist td.c-ac .btn { padding: 0 7px; min-height: 28px; font-size: 12px; margin: 1px; display: inline-flex; }
.olist td .badge { font-size: 10.5px; padding: 1px 7px; }
.olist tr.sel td { box-shadow: inset 0 -2px 0 var(--primary), inset 0 2px 0 var(--primary); }
.olist tr:hover td { filter: brightness(.98); }

/* نافذة الطباعة داخل الصفحة (لما المتصفح يمنع النوافذ المنبثقة) */
.print-back { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; flex-direction: column; }
.print-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--primary-ground); border-bottom: 1px solid var(--line); }
.print-bar > div { display: flex; gap: 8px; }
.print-frame { flex: 1; border: 0; width: 100%; }

/* جدول نقص المخزن في تفاصيل الطلب */
.shortbox { border: 1.5px solid #E8B4A8; background: linear-gradient(135deg, #FFF7F5 0%, #FDEDE8 100%); border-radius: 14px; padding: 12px 14px; }
.shorthead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: #8A2E1E; font-weight: 700; margin-bottom: 8px; }
.shorttbl { background: #fff; border-radius: 10px; overflow: hidden; }
.shorttbl th { background: #FBE4DE; color: #6E2E14; font-weight: 700; text-align: center; padding: 8px; border-bottom: 0; }
.shorttbl th:first-child { text-align: right; }
.shorttbl td { text-align: center; padding: 8px; }
.shorttbl td:first-child { text-align: right; }
.shorttbl td.ok { color: #0B6B3F; background: #F1F8F3; }
.shorttbl td.bad { color: #B3261E; background: #FDE8E6; font-size: 15px; }
.shortnote { color: #8A2E1E; margin-top: 8px; }
.prow { display: flex; gap: 8px; align-items: center; }
.plist.pabs { position: absolute; top: 100%; right: 0; left: 0; z-index: 5; background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(15,27,45,.12); padding: 4px; }
.plist.pabs:empty { display: none; }

/* ===== كروت 3D كبيرة (ملخص المحافظة) ===== */
.tiles3d { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(170px, calc((100vh - 236px) / 2), 300px); gap: 14px; }
.tile3d { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 16px 18px 14px; border-radius: 22px; color: #fff; text-decoration: none;
  background: linear-gradient(145deg, var(--t1) 0%, var(--t2) 100%); box-shadow: 0 18px 34px -14px var(--t2), inset 0 1px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.08); transition: transform .18s, box-shadow .18s; }
.tile3d:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 26px 42px -14px var(--t2), inset 0 1px 0 rgba(255,255,255,.4); color: #fff; }
.tile3d::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%); pointer-events: none; }
.tile3d .ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(255,255,255,.42), rgba(255,255,255,.12)); box-shadow: 0 14px 24px -10px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(0,0,0,.12); align-self: flex-start; }
.tile3d .ico svg { width: 42px; height: 42px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.tile3d .ttl { font-size: 15px; font-weight: 800; opacity: .95; margin-top: 2px; }
.tile3d .big { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1; text-shadow: 0 4px 12px rgba(0,0,0,.25); }
.tile3d .big small { font-size: 16px; font-weight: 700; opacity: .9; margin-inline-start: 6px; }
.tile3d .lines { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; opacity: .95; margin-top: auto; }
.tile3d .lines > span { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 10px; border-radius: 10px; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.tile3d .lines b { font-size: 14px; }
.tile3d .lines b { font-weight: 800; }
.t-teal { --t1: #2BB5AA; --t2: #0B6E67; } .t-sky { --t1: #4FA8F0; --t2: #1C5FB8; } .t-violet { --t1: #A57CF2; --t2: #5B37B5; }
.t-peach { --t1: #FFA264; --t2: #D9552A; } .t-mint { --t1: #5FD39A; --t2: #1E8A55; } .t-gold { --t1: #F7C65A; --t2: #C47A12; }
.t-rose { --t1: #F77FA3; --t2: #B8285B; }
@media (max-width: 1000px) { .tiles3d { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; } .tile3d { min-height: 190px; } }
@media (max-width: 640px) { .tiles3d { grid-template-columns: 1fr; } }

/* جدول المقاسات (التيشرتات) */
.sztbl th.num, .sztbl td.num { text-align: center; }
.sztbl thead th { background: linear-gradient(180deg, #EAF6F5, #DDF4F2); color: #0B6E67; font-weight: 800; border-bottom: 2px solid #0E8079; }
.sztbl thead th.num { font-family: var(--display); font-size: 15px; }
.sztbl tbody td.num b { display: inline-grid; place-items: center; min-width: 32px; height: 28px; padding: 0 8px; border-radius: 8px; background: #DDF4F2; color: #0B6E67; font-weight: 800; }
.sztbl td.tot { background: #FFF6DD; } .sztbl td.tot b { background: #F7C65A; color: #5a3a05; }
.sztbl tfoot td { background: #0E8079; color: #fff; font-weight: 800; border-top: 2px solid #0B6E67; }
.sztbl tfoot td.num b { background: rgba(255,255,255,.18); color: #fff; }
.sztbl tfoot td.tot b { background: #F7C65A; color: #5a3a05; }
.sztbl tbody tr:nth-child(even) td { background: #FAFCFC; }
.chip.muted { opacity: .55; }

/* ===== الرئيسية: ثلاثي الأبعاد وزجاجي ===== */
.home3d { position: relative; display: flex; flex-direction: column; gap: 16px; isolation: isolate; }
.home3d::before { content: ''; position: absolute; inset: -40px -20px; z-index: -1; pointer-events: none; border-radius: 40px;
  background: radial-gradient(520px 320px at 85% 0%, rgba(43,181,170,.28), transparent 70%), radial-gradient(460px 300px at 10% 25%, rgba(165,124,242,.22), transparent 70%), radial-gradient(520px 360px at 60% 100%, rgba(255,162,100,.2), transparent 70%), radial-gradient(400px 300px at 20% 95%, rgba(79,168,240,.2), transparent 70%); }
.glass { background: rgba(255,255,255,.58) !important; backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border: 1px solid rgba(255,255,255,.85) !important; box-shadow: 0 18px 40px -22px rgba(15,27,45,.35), inset 0 1px 0 rgba(255,255,255,.9) !important; }
.hhead { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-radius: 22px; }
.tiles3d.home { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 14px; }
.tile3d.sm { min-height: 158px; padding: 16px 18px 14px; gap: 6px; justify-content: space-between; }
.tile3d.sm .ico { width: 56px; height: 56px; border-radius: 17px; position: absolute; top: 16px; inset-inline-end: 16px; }
.tile3d.sm .ico svg { width: 36px; height: 36px; }
.tile3d.sm .ttl { font-size: 15px; line-height: 1.35; padding-inline-end: 70px; min-height: 40px; display: flex; align-items: flex-start; margin: 0; }
.tile3d.sm .big { font-size: 34px; line-height: 1.1; margin: 0; }
.tile3d.sm .big small { font-size: 15px; }
.tile3d.sm .sub { font-size: 13px; line-height: 1.4; font-weight: 600; opacity: .92; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles3d.home.six { grid-template-columns: repeat(3, 1fr); }
.hhead h1 { font-size: 24px; margin: 0 0 4px; } .hhead .muted { font-size: 14px; }
.glass h2 { font-size: 17px; } .glass h3 { font-size: 15px; }
.t-sand { --t1: #E0B98A; --t2: #9A6A3A; }
@media (max-width: 1100px) { .tiles3d.home { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .tiles3d.home { grid-template-columns: repeat(2, 1fr); } }

/* ===== شريط تبويبات زجاجي (الطلبات) ===== */
.glassbar { position: relative; isolation: isolate; padding: 10px 12px; border-radius: 18px; background: rgba(255,255,255,.55); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 14px 32px -22px rgba(15,27,45,.4), inset 0 1px 0 rgba(255,255,255,.9); }
.glassbar::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(360px 120px at 90% 0%, rgba(43,181,170,.22), transparent 70%), radial-gradient(300px 120px at 15% 100%, rgba(79,168,240,.18), transparent 70%); }
.chips.gtabs { gap: 8px; }
.chips.gtabs .chip { background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 4px 10px -6px rgba(15,27,45,.35), inset 0 1px 0 #fff; color: var(--ink); font-weight: 700; padding: 8px 14px; border-radius: 14px; }
.chips.gtabs .chip:hover { background: #fff; transform: translateY(-1px); }
.chips.gtabs .chip.on { background: linear-gradient(145deg, #2BB5AA, #0B6E67); border-color: transparent; color: #fff; box-shadow: 0 10px 20px -10px #0B6E67, inset 0 1px 0 rgba(255,255,255,.35); }
.chips.gtabs .chip .cnt { color: var(--primary-deep); }
.chips.gtabs .chip.on .cnt { color: #fff; }
.glassbar .in { background: rgba(255,255,255,.8); border-color: rgba(255,255,255,.95); }

/* ===== خانة التاريخ + التقويم العربي ===== */
.dmywrap { position: relative; display: inline-flex; align-items: stretch; width: 100%; }
.row > .dmywrap { width: auto; flex: 1 1 160px; min-width: 160px; }
.dmywrap .dmy { width: 100%; padding-inline-end: 42px; }
.dmybtn { position: absolute; inset-inline-start: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary-deep); display: grid; place-items: center; cursor: pointer; }
.dmybtn svg { width: 18px; height: 18px; } .dmybtn:hover { background: var(--primary); color: #fff; }
.dmycal { position: fixed; z-index: 1000; width: 300px; padding: 10px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -16px rgba(15,27,45,.45); font-size: 14px; }
.dc-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.dc-head select { flex: 1; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font: inherit; font-weight: 700; background: #fff; }
.dc-nav { width: 34px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.dc-nav:hover { background: var(--primary-soft); }
.dc-week, .dc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dc-week span { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.dc-grid button { height: 36px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.dc-grid button:hover { background: var(--primary-soft); }
.dc-grid button.fri { color: #B8285B; }
.dc-grid button.today { box-shadow: inset 0 0 0 2px var(--primary); }
.dc-grid button.on { background: var(--primary-deep); color: #fff; }
.dc-foot { display: flex; gap: 6px; margin-top: 8px; }
.dc-foot button { flex: 1; min-height: 32px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.dc-foot button:hover { background: var(--primary-soft); } .dc-foot .clr { color: var(--danger); }
.dc-sel { margin-top: 8px; text-align: center; font-weight: 800; color: var(--primary-deep); font-size: 13px; }
.dc-year { flex: 1; text-align: center; font-family: var(--display); font-size: 20px; font-weight: 800; }
.dc-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dc-months button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.dc-months button:hover { background: var(--primary-soft); } .dc-months button.today { box-shadow: inset 0 0 0 2px var(--primary); } .dc-months button.on { background: var(--primary-deep); color: #fff; border-color: transparent; }
.dmywrap .dmy.dmy-m { padding-inline-end: 12px; padding-inline-start: 44px; text-align: start; }
.sztbl tr.dim td { color: var(--muted); } .sztbl tr.dim td b { opacity: .7; }

/* موبايل: سفاري بيكبّر الشاشة لو خط الخانة أقل من 16 — وده اللي كان بيخلي الصفحة تتهز يمين وشمال */
@media (max-width: 900px) { input, select, textarea { font-size: 16px !important; } }
input[type=date], input[type=month], input[type=time] { min-width: 0; max-width: 100%; }
html, body { overflow-x: clip; }
.modal { overflow-x: hidden; max-width: 100%; } .modal .row > * { min-width: 0; }
a, button, label, select, summary { touch-action: manipulation; }

.olist td.c-id .muted, .olist td.c-tr .muted { color: inherit; opacity: .75; }
/* الطلب المحدد في قائمة الطلبات: خلفية فاتحة وكتابة غامقة واضحة مهما كانت ألوان الجدول */
.olist tr.sel td, .olist tr.sel td b, .olist tr.sel td .small, .olist tr.sel td .muted, .olist tr.sel td .addr { color: #0B2530 !important; opacity: 1 !important; }
.olist tr.sel td { background: #FFF4C2 !important; font-weight: 700; }
.olist tr.sel td b { font-weight: 800; }
.olist tr.click:hover td, .olist tr.click:hover td b, .olist tr.click:hover td .small, .olist tr.click:hover td .muted, .olist tr.click:hover td .addr { color: #0B2530 !important; opacity: 1 !important; }
.olist tr.click:hover td { background: #FFF9DC !important; }
