:root {
  --maroon: #86173a; --maroon-d: #6a102c; --blue: #34579b; --blue-d: #27447c;
  --ink: #1c2233; --muted: #667089; --line: #e4e7ef; --bg: #f5f6fa; --card: #fff;
  --ok: #18794e; --ok-bg: #e3f5ec; --warn: #9a5b00; --warn-bg: #fdf1d8; --bad: #b3261e; --bad-bg: #fde8e6; --info-bg: #e8eefb;
  --r: 10px; --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 14px rgba(20, 30, 60, .05);
  --font: "IBM Plex Sans Arabic", "SF Arabic", "Segoe UI", "Geeza Pro", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.6; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; } h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
td.num, th.num { display: table-cell; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .grow { flex: 1; } .hidden { display: none !important; }
.boot { padding: 80px; text-align: center; color: var(--muted); }

/* أزرار */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #c9cfdd; background: #fafbfd; text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.btn.primary { background: var(--maroon); border-color: var(--maroon); color: #fff; } .btn.primary:hover { background: var(--maroon-d); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; } .btn.blue:hover { background: var(--blue-d); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: #eceff6; }
.btn.danger { color: var(--bad); } .btn.sm { padding: 3px 10px; font-size: 12.5px; } .btn[disabled] { opacity: .55; cursor: default; }

/* الهيكل */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: #fff; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 16px 18px 10px; } .side .brand img { width: 100%; max-width: 190px; display: block; margin: 0 auto; }
.nav { padding: 6px 10px 20px; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 8px; color: var(--ink); }
.nav a:hover { background: #f1f3f8; text-decoration: none; }
.nav a.active { background: #f6e9ed; color: var(--maroon); font-weight: 600; }
.nav .group { margin-top: 14px; padding: 0 11px 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav .badge { margin-inline-start: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.search .results { position: absolute; inset-inline: 0; top: 42px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); max-height: 380px; overflow: auto; z-index: 30; }
.search .results a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; color: var(--ink); } .search .results a:hover { background: #f4f6fb; text-decoration: none; }
.page { padding: 22px 24px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.menu-btn { display: none; }

/* بطاقات */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); } .card .bd { padding: 14px 16px; }
.grid { display: grid; gap: 14px; } .kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi { padding: 14px 16px; } .kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; } .kpi .l { color: var(--muted); font-size: 13px; } .kpi .s { font-size: 12.5px; color: var(--muted); }
.kpi.alert .v { color: var(--bad); }
.cols-2 { grid-template-columns: 1.6fr 1fr; } @media (max-width: 1100px) { .cols-2 { grid-template-columns: 1fr; } }
.brief { background: linear-gradient(135deg, var(--blue) 0%, #2a4680 100%); color: #fff; border: 0; padding: 18px 20px; }
.brief h2 { color: #fff; font-size: 19px; } .brief ul { margin: 10px 0 0; padding-inline-start: 20px; } .brief li { margin: 3px 0; }
.brief .date { opacity: .8; font-size: 13px; }

/* شارات */
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f5; color: #48506a; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--blue-d); }

/* جداول */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--ink); }
td { padding: 9px 14px; border-bottom: 1px solid #eef0f5; vertical-align: top; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: #f7f9fd; }
tr.total td { font-weight: 700; background: #fafbfd; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; justify-content: flex-end; color: var(--muted); font-size: 13px; }

/* كانبان */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: 0 0 258px; background: #eceef4; border-radius: var(--r); padding: 8px; min-height: 120px; }
.kcol.over { outline: 2px dashed var(--blue); }
.kcol h3 { display: flex; justify-content: space-between; padding: 4px 6px 8px; font-size: 13.5px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 7px; cursor: grab; box-shadow: 0 1px 1px rgba(0, 0, 0, .03); }
.kcard:hover { border-color: #c5ccdd; } .kcard .t { font-weight: 600; } .kcard .m { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; }

/* تفاصيل */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 22px; }
.field .k { font-size: 12.5px; color: var(--muted); } .field .v { font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.field.wide { grid-column: 1 / -1; }

/* نماذج */
.modal-back { position: fixed; inset: 0; background: rgba(20, 26, 44, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto; z-index: 100; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 1020px; }
.modal .hd { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); } .modal .bd { padding: 18px 20px; } .modal .ft { display: flex; gap: 8px; justify-content: flex-start; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 14px 14px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; } .form .wide { grid-column: 1 / -1; } @media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
label.f { display: block; } label.f > span { display: block; font-size: 13px; color: #48506a; margin-bottom: 3px; font-weight: 500; } label.f .req { color: var(--bad); }
.inp, label.f input:not([type=checkbox]), label.f select, label.f textarea { width: 100%; padding: 8px 10px; border: 1px solid #d5dae6; border-radius: 8px; background: #fff; }
label.f textarea { min-height: 76px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.combo { position: relative; } .combo .list { position: absolute; inset-inline: 0; top: 100%; margin-top: 2px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 220px; overflow: auto; z-index: 5; }
.combo .list div { padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; } .combo .list div:hover, .combo .list div.on { background: #eef2fb; }
.err { background: var(--bad-bg); color: var(--bad); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.note { background: var(--info-bg); color: var(--blue-d); padding: 9px 13px; border-radius: 8px; }
.lines td { padding: 4px 4px; border: 0; } .lines input { width: 100%; padding: 6px 8px; border: 1px solid #d5dae6; border-radius: 6px; } .lines th { background: transparent; padding: 4px 6px; }
.totals { margin-inline-start: auto; width: 260px; margin-top: 10px; } .totals div { display: flex; justify-content: space-between; padding: 3px 0; } .totals .g { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }

/* تنبيهات الوكلاء */
.insight { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #eef0f5; align-items: flex-start; }
.insight:last-child { border-bottom: 0; }
.insight .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 8px; flex: none; background: #9aa3b8; } .insight.high .dot { background: var(--bad); } .insight.medium .dot { background: #e0a100; }
.insight .t { font-weight: 600; } .insight .d { color: var(--muted); font-size: 13.5px; } .insight .acts { display: flex; gap: 4px; flex: none; }
.bars .row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13.5px; }
.bars .bar { height: 10px; border-radius: 6px; background: var(--blue); min-width: 2px; } .bars .track { background: #eceef4; border-radius: 6px; }

/* المساعد */
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(430px, 100vw); background: #fff; border-inline-start: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0, 0, 0, .12); z-index: 90; display: flex; flex-direction: column; }
.drawer .msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 9px 13px; border-radius: 12px; max-width: 92%; white-space: pre-wrap; } .msg.me { background: var(--blue); color: #fff; align-self: flex-start; } .msg.ai { background: #f1f3f8; align-self: flex-end; }
.drawer form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); } .drawer form input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; }
.vbtn { cursor: pointer; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px 9px; font-size: 14px; line-height: 1.2; } .vbtn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.vbtn[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); } .mic[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); animation: vpulse 1.2s ease-in-out infinite; }
.msg .vbtn { padding: 1px 7px; font-size: 11px; margin-inline-start: 6px; } @keyframes vpulse { 50% { opacity: .65; } }
.vnote { padding: 0 14px 10px; font-size: 11px; color: var(--muted, #6b7280); }

/* الدخول */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #f5f6fa 0%, #e9edf7 100%); }
.auth .card { width: 100%; max-width: 420px; padding: 28px; } .auth img { width: 210px; display: block; margin: 0 auto 10px; } .auth h1 { text-align: center; font-size: 18px; margin-bottom: 4px; } .auth .form { grid-template-columns: 1fr; margin-top: 18px; }

/* إشعارات */
#toast-root { position: fixed; bottom: 20px; inset-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #1c2233; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; } .toast.bad { background: var(--bad); }

/* المستند المطبوع */
.doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 36px 40px; border: 1px solid var(--line); border-radius: 6px; }
.doc .dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--maroon); padding-bottom: 14px; }
.doc .dh img { width: 190px; } .doc h1 { color: var(--blue); font-size: 24px; }
.doc .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0; } .doc .parties h3 { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.doc table th { background: var(--blue); color: #fff; } .doc .foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; align-items: flex-start; }
.doc .terms { white-space: pre-wrap; font-size: 13px; color: #444; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 10px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 80; transform: translateX(100%); transition: transform .2s; }
  [dir=ltr] .side { transform: translateX(-100%); } .side.open { transform: none; box-shadow: var(--shadow); } .menu-btn { display: inline-flex; } .page { padding: 16px 14px 60px; } .top { padding: 10px 14px; }
  .side { height: 100dvh; width: min(86vw, 300px); } .scrim { position: fixed; inset: 0; background: rgba(20, 26, 44, .45); z-index: 70; } .side-foot { display: block; }
}
@media print {
  .side, .top, .no-print, #toast-root { display: none !important; } .shell { display: block; } .page { padding: 0; max-width: none; } body { background: #fff; } .doc { border: 0; padding: 0; max-width: none; }
  .doc table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Grid and flex children may shrink below their content width (prevents horizontal overflow on narrow screens) */
.grid > *, .form > *, .fields > *, .cols-2 > * { min-width: 0; }
pre { max-width: 100%; overflow-x: auto; }
input, select, textarea { max-width: 100%; }
/* The line-items editor must not clip the product picker dropdown */
.modal .table-wrap { overflow: visible; }
.combo .list { z-index: 20; min-width: 220px; }

/* ---------- قسم الأعمال: اللوحات والبطاقات وجدول الفرق ---------- */
.page.full { max-width: none; }
.wtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.wtabs a { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.wtabs a:hover { color: var(--ink); text-decoration: none; } .wtabs a.on { color: var(--maroon); border-color: var(--maroon); font-weight: 600; }
.wsearch { max-width: 520px; margin-bottom: 16px; }
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.btile { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--r); padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.btile:hover { text-decoration: none; border-color: var(--c); transform: translateY(-1px); } .btile .bname { font-weight: 700; font-size: 15.5px; } .btile .bmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: #eef0f6; color: #4a5370; white-space: nowrap; }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.ok { background: var(--ok-bg); color: var(--ok); } a.chip.link { color: var(--blue); } a.chip:hover { text-decoration: none; filter: brightness(.96); }
.av { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 600; flex: none; letter-spacing: 0; } .av.sm { width: 22px; height: 22px; font-size: 10px; }
.avs { display: flex; gap: 3px; flex-wrap: wrap; }

.bbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 12px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--c); border-radius: var(--r); }
.bbar select, .bbar input { padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 190px; } .bbar select.on { border-color: var(--blue); background: var(--info-bg); }
.bbar .bswitch { font-weight: 700; font-size: 15px; border-color: transparent; max-width: 300px; } .bbar .bswitch:hover { border-color: var(--line); }
.tboard { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 14px; min-height: calc(100vh - 210px); }
.tcol { flex: 0 0 272px; background: #eceef4; border-radius: var(--r); border-top: 3px solid var(--c); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.tcol.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.thead { display: flex; align-items: center; gap: 6px; padding: 8px 10px 6px; } .tname { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcount { font-size: 12px; color: var(--muted); background: #fff; border-radius: 10px; padding: 0 8px; } .tcount.bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.quick { margin: 0 8px 6px; padding: 6px 10px; border: 1px dashed #c3c9d9; border-radius: 8px; background: transparent; font: inherit; color: var(--muted); } .quick:focus, .quick:hover { background: #fff; border-style: solid; color: var(--ink); }
.tlist { overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.tcard:hover { border-color: #b9c2d8; } .tcard:focus-visible { outline: 2px solid var(--blue); } .tcard.dragging, .vcard.dragging { opacity: .35; } .tcard.drop-before { box-shadow: 0 -3px 0 var(--blue); }
.tcard.done .ttitle { text-decoration: line-through; color: var(--muted); }
.trow { display: flex; gap: 7px; align-items: flex-start; } .ttitle { font-weight: 600; overflow-wrap: anywhere; line-height: 1.45; }
.tick { flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 1.5px solid #b3bacb; background: #fff; cursor: pointer; font-size: 11px; line-height: 1; color: #fff; padding: 0; }
.tick:hover { border-color: var(--ok); background: var(--ok-bg); } .done .tick { background: var(--ok); border-color: var(--ok); }
.tcust { font-size: 12.5px; color: var(--muted); margin-top: 3px; } .tmeta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 6px; } .tmeta:empty { display: none; }
.tlabels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 5px; } .tlabel { font-size: 11px; color: #fff; border-radius: 5px; padding: 0 7px; line-height: 18px; }
.tlabel.pick { border: 1px solid var(--lc, var(--line)); background: #fff; color: var(--lc, var(--muted)); cursor: pointer; font: inherit; font-size: 12px; padding: 1px 8px; } .tlabel.pick.on { background: var(--lc); color: #fff; } .tlabel.pick.add { border-style: dashed; }
.tcol-add { flex: 0 0 150px; padding: 10px; border: 1px dashed #c3c9d9; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; font: inherit; } .tcol-add:hover { background: #fff; color: var(--ink); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; } .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; font-size: 12px; color: var(--muted); background: #fff; padding: 0; } .sw.on { box-shadow: 0 0 0 2px var(--ink); }

.modal.card-modal { max-width: 1060px; } .card-modal .bd { padding: 0; }
.cardm { display: grid; grid-template-columns: 1fr 290px; min-height: 420px; } @media (max-width: 820px) { .cardm { grid-template-columns: 1fr; } }
.cmain { padding: 16px 20px; min-width: 0; } .cside { background: #f7f8fb; border-inline-start: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; border-end-end-radius: 14px; }
.ctitle { width: 100%; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 19px; font-weight: 700; padding: 4px 8px; margin-inline: -8px; resize: none; overflow: hidden; background: transparent; color: var(--ink); } .ctitle:hover:not(:disabled), .ctitle:focus { border-color: var(--line); background: #fff; }
.cnotes { width: 100%; min-height: 76px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: inherit; margin-top: 8px; resize: vertical; background: #fafbfd; } .cnotes:focus { background: #fff; }
.csec { margin-top: 18px; } .csec h3 { font-size: 14px; margin: 0 0 8px; display: flex; align-items: center; } .csec > input { width: 100%; padding: 6px 10px; border: 1px dashed #c3c9d9; border-radius: 8px; font: inherit; margin-top: 4px; }
.pbar { height: 6px; background: #e6e9f1; border-radius: 4px; margin-bottom: 8px; overflow: hidden; } .pbar div { height: 100%; background: var(--ok); }
.check { display: flex; gap: 8px; align-items: center; padding: 3px 0; } .check.on span { text-decoration: line-through; color: var(--muted); } .check .btn { visibility: hidden; } .check:hover .btn { visibility: visible; }
.cfiles { display: flex; flex-direction: column; gap: 6px; } .cfile { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; } .cfile img { width: 54px; height: 42px; object-fit: cover; border-radius: 5px; display: block; } .cfile a { overflow-wrap: anywhere; } .ficon { font-size: 20px; }
.comment, .composer { display: flex; gap: 10px; margin-bottom: 12px; } .cbody { white-space: pre-wrap; overflow-wrap: anywhere; background: #f4f6fb; border-radius: 4px 12px 12px 12px; padding: 7px 11px; margin-top: 2px; display: inline-block; max-width: 100%; }
.cdel { visibility: hidden; } .comment:hover .cdel { visibility: visible; } .mention { color: var(--blue); font-weight: 600; background: var(--info-bg); border-radius: 4px; padding: 0 3px; }
.cinput { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font: inherit; resize: vertical; }
.msug { position: absolute; inset-inline-start: 0; bottom: 100%; margin-bottom: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 230px; z-index: 5; overflow: hidden; }
.msug div { display: flex; gap: 8px; align-items: center; padding: 6px 11px; cursor: pointer; } .msug div.on, .msug div:hover { background: var(--info-bg); }
.act { font-size: 13px; padding: 3px 0; color: #48506a; }
.sfield .k { font-size: 12px; color: var(--muted); margin-bottom: 3px; font-weight: 600; } .sfield select, .sfield input { width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; } .tlabels.wrap { margin: 0; }
.vmini { display: block; font-size: 12.5px; color: var(--ink); padding: 2px 0; }

.bell { position: relative; } .bell-n { position: absolute; top: -2px; inset-inline-end: -2px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 10.5px; min-width: 17px; text-align: center; padding: 0 4px; line-height: 17px; }
.bell-panel { position: absolute; top: 40px; inset-inline-end: 0; width: min(390px, 92vw); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 40px rgba(20, 30, 60, .18); z-index: 60; }
.bell-hd { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.bell-row { display: flex; gap: 10px; padding: 9px 14px; color: var(--ink); border-bottom: 1px solid #f0f2f7; font-size: 13.5px; } .bell-row:hover { background: #f6f8fc; text-decoration: none; } .bell-row.unread { background: #f1f5fd; }

.myrow { display: flex; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid #f0f2f7; cursor: pointer; } .myrow:hover { background: #f8f9fc; } .myrow:last-child { border-bottom: 0; }
.bdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 5px; }

.daybar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; } .daybar .dtitle { font-size: 16px; display: flex; gap: 8px; align-items: center; min-width: 250px; } .daybar input { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.dstrip { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.dcell { flex: 1 0 58px; display: flex; flex-direction: column; align-items: center; padding: 5px 4px; background: #fff; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); line-height: 1.35; }
.dcell:hover { text-decoration: none; border-color: var(--blue); } .dcell.on { background: var(--blue); border-color: var(--blue); color: #fff; } .dcell.on .muted, .dcell.on .has { color: #dfe7f8; } .dcell.today:not(.on) { border-color: var(--maroon); } .dcell.fri:not(.on) { background: #f3f4f8; } .dcell .has { color: var(--maroon); font-weight: 700; }
.vboard .tcol { flex: 1 0 264px; max-width: 420px; } .vcard { background: #fff; border: 1px solid var(--line); border-inline-start: 3px solid #9aa3b8; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.vcard.done { border-inline-start-color: var(--ok); } .vcard.in_progress, .vcard.postponed { border-inline-start-color: #c98500; } .vcard.cancelled { border-inline-start-color: var(--bad); opacity: .7; } .vcard.planned { border-inline-start-color: var(--blue); }
.vjob { font-size: 13.5px; margin-top: 2px; } .vout { font-size: 12.5px; color: #2f6b4a; background: var(--ok-bg); border-radius: 6px; padding: 3px 8px; margin-top: 6px; white-space: pre-wrap; } .vacts { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.vover { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding: 12px; }
@media print { .tboard { overflow: visible; flex-wrap: wrap; min-height: 0; } .tcol { max-height: none; break-inside: avoid; background: #fff; border: 1px solid #999; } .tlist { overflow: visible; } .vacts { display: none; } }

/* عرض ردود المساعد (Markdown) */
.msg.ai.rich { white-space: normal; max-width: 100%; width: 100%; line-height: 1.8; padding: 12px 15px; }
.md { line-height: 1.8; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md h3, .md h4, .md h5, .md h6 { margin: 16px 0 6px; line-height: 1.4; color: var(--maroon); }
.md h3 { font-size: 17px; padding-inline-start: 9px; border-inline-start: 3px solid var(--maroon); } .md h4 { font-size: 15.5px; } .md h5, .md h6 { font-size: 14.5px; color: var(--blue); }
.md strong { color: var(--maroon); font-weight: 700; }
.md em { color: var(--blue-d); }
.md ul, .md ol { margin: 0 0 10px; padding-inline-start: 22px; } .md li { margin: 3px 0; } .md li > ul, .md li > ol { margin: 3px 0 0; }
.md code { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; background: rgba(52, 87, 155, .1); color: var(--blue-d); padding: 1px 6px; border-radius: 5px; }
.md pre { direction: ltr; text-align: left; margin: 0 0 10px; padding: 10px 12px; background: #1c2233; color: #e8ecf5; border-radius: 8px; overflow-x: auto; line-height: 1.6; }
.md pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; }
.md blockquote { margin: 0 0 10px; padding: 8px 12px; background: var(--info-bg); border-inline-start: 3px solid var(--blue); border-radius: 8px; } .md blockquote > .md { line-height: 1.7; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md a { text-decoration: underline; }
.md-tw { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.6; }
.md th, .md td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.md th { background: #eceff6; font-weight: 700; white-space: nowrap; } .md tbody tr:nth-child(even) td { background: #f7f8fc; } .md tbody tr:last-child td { border-bottom: 0; }
.md td.n, .md th.n { white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg.ai.rich .vbtn { margin-top: 6px; margin-inline-start: 0; }

/* التحصيل وواتساب */
button.chip { border: 0; font: inherit; font-size: 12px; cursor: pointer; } button.chip.link { color: var(--ok); background: var(--ok-bg); } button.chip:disabled { opacity: .5; cursor: not-allowed; }
.phones { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kpi.on { border-color: var(--maroon); box-shadow: 0 0 0 1px var(--maroon) inset; }
button.card.kpi { font: inherit; color: inherit; }

/* ---------- مشترك: لوحة اليوم، البحث السريع، إضافة، أقسام إضافية ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
body.noscroll { overflow: hidden; } .side-foot { display: none; padding: 12px 14px 18px; border-top: 1px solid var(--line); margin-top: auto; } .sf-btns { display: flex; gap: 8px; margin-top: 8px; }
.search-btn { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--muted); cursor: pointer; text-align: start; }
.search-btn:hover { border-color: #c9cfdd; } .search-btn:focus-visible, .nav-extra-btn:focus-visible, .qa-item:focus-visible, .bigb:focus-visible, .pal-i:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.search-btn .search-l { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } kbd { font: 11.5px/1 ui-monospace, monospace; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; direction: ltr; }
.nav-extra { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.nav-extra-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 11px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; text-align: start; } .nav-extra-btn:hover { background: #f1f3f8; }
.qa { position: relative; } .qa-menu { position: absolute; top: 42px; inset-inline-end: 0; min-width: 180px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 40; display: grid; }
.qa-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: start; font-weight: 500; } .qa-item:hover { background: #f1f3f8; } .qa-i { width: 20px; text-align: center; color: var(--maroon); }
.pal-back { position: fixed; inset: 0; background: rgba(20, 26, 44, .5); z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.pal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3); display: flex; flex-direction: column; max-height: 76vh; overflow: hidden; }
.pal-hd { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); } .pal-in { flex: 1; border: 0; background: transparent; font-size: 16px; padding: 8px 6px; min-width: 0; } .pal-in:focus-visible { outline: 0; }
.pal-list { overflow-y: auto; padding: 6px; flex: 1; } .pal-g { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px 3px; }
.pal-i { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; min-height: 44px; } .pal-i.sel { background: #f6e9ed; } .pal-ic { width: 20px; text-align: center; color: var(--maroon); flex: none; }
.pal-t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pal-h { margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.pal-empty { padding: 22px; } .pal-tip { padding: 8px 10px; } .pal-ft { padding: 8px 14px; border-top: 1px solid var(--line); }
.crows, .crews { display: grid; gap: 10px; } .crow { display: flex; align-items: center; gap: 10px; color: inherit; min-height: 36px; } .crow:hover { text-decoration: none; } .crow .cn { flex: 0 0 120px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .crow .track { flex: 1; height: 8px; background: #e6e9f1; border-radius: 4px; overflow: hidden; } .crow .bar { height: 100%; background: var(--ok); }
.bigadd { padding: 12px 22px; font-size: 16px; }

/* ---------- «يومي»: شاشة الفني ---------- */
.day-m { margin-bottom: 12px; } .tstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tstat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; text-align: center; } .tstat b { display: block; font-size: 24px; line-height: 1.1; } .tstat span { font-size: 12.5px; color: var(--muted); } .tstat.ok b { color: var(--ok); } .tstat.warn b { color: var(--warn); }
.vlist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.vm { background: #fff; border: 1px solid var(--line); border-inline-start: 5px solid #b3bacb; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 8px; align-content: start; }
.vm.planned { border-inline-start-color: var(--blue); } .vm.in_progress { border-inline-start-color: var(--warn); } .vm.done { border-inline-start-color: var(--ok); background: #fafdfb; } .vm.postponed { border-inline-start-color: var(--warn); } .vm.late { border-inline-start-color: var(--bad); }
.vm-top { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; } .vm-name { margin: 0; font-size: 18px; line-height: 1.3; } .vm-job { font-size: 15px; } .vout { background: #f4f6fb; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; white-space: pre-wrap; }
.vm-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; } .vm-acts.two { grid-template-columns: repeat(2, 1fr); }
.bigb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; padding: 6px; }
.bigb span { font-size: 20px; line-height: 1; } .bigb:hover { text-decoration: none; background: #f4f6fb; } .bigb[disabled] { opacity: .45; cursor: not-allowed; }
.bigb.call { color: var(--blue); } .bigb.loc { color: #0e7c86; } .bigb.act { color: var(--ok); } .bigb.act.go { background: var(--ok); border-color: var(--ok); color: #fff; } .bigb.act.go:hover { background: #136a43; }
.wa-confirm { justify-content: center; min-height: 44px; }
.sheet-back { align-items: flex-end !important; padding: 0 !important; } .sheet { border-radius: 18px 18px 0 0 !important; max-width: 640px !important; margin: 0 auto; max-height: 92dvh; display: flex; flex-direction: column; animation: sheetup .22s ease-out; }
.sheet .bd { overflow-y: auto; } @keyframes sheetup { from { transform: translateY(40px); opacity: .4; } }
.sheet .ft { position: sticky; bottom: 0; background: #fff; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.sheetbody { display: grid; gap: 14px; } .segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .seg { position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; } .seg span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; background: #fff; }
.seg input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; } .seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.sheetbody textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; resize: vertical; }
.pbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .bigsec { justify-content: center; min-height: 48px; } .bigsave { justify-content: center; min-height: 48px; font-weight: 600; flex: 1; }
.pstrip { display: flex; gap: 8px; flex-wrap: wrap; } .pth { position: relative; width: 76px; height: 76px; } .pth img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pth-x { position: absolute; top: -8px; inset-inline-end: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; cursor: pointer; font-size: 13px; }

/* ---------- جوال ≤640px: يمتد على نقطة 900 أعلاه ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; } .hide-m { display: none !important; } .top { gap: 6px; padding: 8px 10px; } .page { padding: 12px 10px 80px; }
  .btn, .menu-btn { min-height: 44px; } .btn.sm { min-height: 44px; padding: 6px 12px; } .menu-btn { min-width: 44px; justify-content: center; font-size: 20px; }
  input, select, textarea { font-size: 16px; min-height: 44px; } input[type=checkbox], input[type=radio] { min-height: 0; }
  .nav a, .nav-extra-btn { min-height: 44px; } .search-btn { min-height: 44px; } .search-btn .search-l { font-size: 14px; } .qa-btn .qa-l { display: none; } .qa-btn { min-width: 44px; justify-content: center; font-size: 20px; padding: 0 12px; }
  .qa-menu { position: fixed; inset-inline: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); min-width: 0; padding: 8px; z-index: 90; } .qa-item { min-height: 52px; font-size: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 12px; } .kpi .v { font-size: 19px; } .cols-2 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; } .wtabs { overflow-x: auto; flex-wrap: nowrap; } .wtabs a { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
  .vlist { grid-template-columns: 1fr; } .vm-name { font-size: 19px; } .bigb { min-height: 64px; font-size: 16px; } .bigb span { font-size: 22px; }
  .daybar .dtitle { min-width: 0; flex-basis: 100%; order: -1; } .daybar .btn { flex: 1; justify-content: center; }
  .chip, a.chip { min-height: 28px; } a.chip.link { padding: 6px 10px; min-height: 36px; }
  .tick { position: relative; width: 24px; height: 24px; } .tick::after { content: ""; position: absolute; inset: -12px; }
  .myrow { min-height: 52px; }
  /* حوارات: ملء الشاشة */
  .modal-back { padding: 0; align-items: stretch; } .modal, .modal.wide, .modal.card-modal { max-width: none; border-radius: 0; min-height: 100dvh; display: flex; flex-direction: column; } .modal .hd { position: sticky; top: 0; background: #fff; z-index: 2; }
  .modal .bd { flex: 1; } .modal .ft { position: sticky; bottom: 0; background: #fff; padding-bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; } .modal .ft .btn { flex: 1; justify-content: center; }
  .sheet-back { align-items: flex-end; } .modal.sheet { min-height: 0; border-radius: 18px 18px 0 0 !important; max-height: 92dvh; } .sheet .ft { flex-wrap: nowrap; }
  .pal-back { padding: 0; align-items: stretch; } .pal { max-width: none; max-height: none; height: 100dvh; border-radius: 0; } .pal-ft { display: none; } .pal-i { min-height: 52px; } .pal-h { max-width: 40%; }
  /* جداول: بطاقات مكدّسة */
  table.stack, table.stack tbody { display: block; } table.stack thead { display: none; } table.stack tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 6px 12px; background: #fff; }
  table.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: end; } table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; flex: none; text-align: start; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* لوحات: عمود بعرض الشاشة تقريباً */
  .kanban, .tboard { scroll-snap-type: x mandatory; } .kcol, .tcol { flex-basis: 84vw; scroll-snap-align: center; } .tcol { max-height: none; } .tboard { min-height: 0; }
  /* الجرس: لوحة بعرض الشاشة */
  .bell-panel { position: fixed; inset-inline: 8px; top: 58px; width: auto; max-height: calc(100dvh - 74px); } .bell-x { min-height: 44px; min-width: 44px; } .bell-row { min-height: 52px; align-items: center; }
  .drawer { width: 100vw; }
}

/* ---------- ذكاء الأعمال والرسوم ---------- */
.ch-box { margin: 0 0 6px; } .ch-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ch-view { position: relative; } .ch-svg { width: 100%; height: auto; display: block; overflow: visible; } .ch-svg [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ch-svg rect[data-tip]:hover, .ch-svg circle[data-tip]:hover { filter: brightness(1.12); }
.ch-tip { position: absolute; z-index: 5; background: var(--ink); color: #fff; font-size: 12.5px; padding: 4px 9px; border-radius: 6px; pointer-events: none; white-space: nowrap; max-width: 100%; direction: rtl; }
.ch-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; } .ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.ch-spark { width: 120px; height: 30px; display: block; } .ch-toggle { font-size: 12px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.bi-filters .toolbar { gap: 10px; }
@media (max-width: 640px) { .ch-spark { width: 100px; } .ch-tip { font-size: 12px; } .bi-filters select, .bi-filters input { flex: 1 1 140px; } .grid.cols-2 { grid-template-columns: 1fr !important; } }

/* المساعد: اقتراحات سريعة، حالة البحث، مصادر الجواب */
.drawer .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; border-top: 1px solid var(--line); }
.chip-btn { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; color: var(--blue); text-decoration: none; line-height: 1.6; }
.chip-btn:hover { background: #f1f3f8; } .chip-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.drawer .chips + form { border-top: 0; }
.msg.ai.wait { color: var(--muted, #6b7280); font-size: 13px; }
.msg .src { margin-top: 8px; font-size: 11.5px; color: var(--muted, #6b7280); border-top: 1px dashed var(--line); padding-top: 5px; }
.locadd summary { cursor: pointer; color: var(--blue); font-size: 14px; padding: 6px 0; } .locadd input { width: 100%; margin-top: 6px; }
@media print { .digest .card { break-inside: avoid; box-shadow: none; border: 1px solid #999; } .digest .btn { display: none !important; } .digest .grid { gap: 8px; } .digest a { color: inherit; text-decoration: none; } }

/* التحقق بخطوتين (security.js) */
.otp { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; padding: 10px !important; }
.wide-btn { justify-content: center; padding: 10px; width: 100%; }
.linkish { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; font-size: 13.5px; padding: 4px 2px; text-decoration: underline; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
label.f.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; } label.f.chk input { margin-top: 3px; flex: none; }
.enrol .steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 14px; } .enrol .steps li { line-height: 1.7; }
.enrol .qr { display: flex; justify-content: center; margin: 8px 0; } .enrol .qr img { width: 200px; height: 200px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.enrol .secret { display: flex; gap: 8px; align-items: center; margin-top: 6px; } .enrol .secret code { flex: 1; min-width: 0; word-break: break-all; background: #f3f5fa; border-radius: 6px; padding: 6px 8px; font-size: 14px; letter-spacing: 1px; }
.enrol .otp { margin-top: 6px; width: 100%; border: 1px solid #d5dae6; border-radius: 8px; } .enrol > .btn { margin-top: 14px; }
.rcodes-box { display: grid; gap: 10px; margin: 10px 0; }
.rcodes { margin: 0; padding: 10px 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: #f3f5fa; border-radius: 8px; }
.rc-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sec { display: grid; gap: 12px; } .sec-part { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; } .sec-part summary { cursor: pointer; font-weight: 600; padding: 2px 0; } .sec-part .form { grid-template-columns: 1fr; margin-top: 8px; }
@media (max-width: 400px) { .auth { padding: 10px; } .auth .card { padding: 18px 14px; } .rcodes { grid-template-columns: 1fr; padding-inline-start: 24px; } .otp { letter-spacing: 6px; } }
@media print { body.pcodes #app:not(:has(.rcodes)), body.pcodes .modal .hd, body.pcodes .modal .ft, body.pcodes .rc-acts, body.pcodes .sec-part summary, body.pcodes .note:not(.warn) { display: none !important; } body.pcodes .modal-back { position: static; background: none; } body.pcodes .modal { box-shadow: none; } }
