/* id-cards.css — صور البطاقات القومية (الزوج/الزوجة) + نافذة طباعة البطاقات
   ألوان منسّقة: الزوج أزرق · الزوجة وردي · محايد بنفسجي/رمادي · حالات: أخضر محفوظ، كهرماني بانتظار الحفظ، أحمر حذف، برتقالي مراجعة */

:root {
    --idc-male: #2563eb; --idc-male-bg: #eff6ff; --idc-male-bd: #bfdbfe;
    --idc-female: #db2777; --idc-female-bg: #fdf2f8; --idc-female-bd: #fbcfe8;
    --idc-neutral: #6d28d9; --idc-neutral-bg: #f5f3ff; --idc-neutral-bd: #ddd6fe;
    --idc-ok: #059669; --idc-warn: #d97706; --idc-bad: #dc2626; --idc-review: #ea580c;
    --idc-cam: #0d9488; --idc-file: #4f46e5; --idc-ink: #0f172a; --idc-sub: #64748b; --idc-line: #e2e8f0; --idc-card: #ffffff;
}

/* ───────────── صندوق الشخص داخل نموذج الحالة ───────────── */
.idc-box { margin: 2px 0 6px; }
.idc-person { border: 1.5px solid var(--tone-bd); background: var(--tone-bg); border-radius: 14px; padding: 12px 14px 14px; --tone: var(--idc-neutral); --tone-bg: var(--idc-neutral-bg); --tone-bd: var(--idc-neutral-bd); }
.idc-person[data-tone="male"]   { --tone: var(--idc-male);   --tone-bg: var(--idc-male-bg);   --tone-bd: var(--idc-male-bd); }
.idc-person[data-tone="female"] { --tone: var(--idc-female); --tone-bg: var(--idc-female-bg); --tone-bd: var(--idc-female-bd); }
.idc-person-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.idc-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--tone); color: #fff; display: grid; place-items: center; font-size: .95rem; flex: 0 0 auto; }
.idc-title { font-weight: 800; color: var(--tone); font-size: 1rem; }
.idc-title small { color: var(--idc-sub); font-weight: 600; margin-inline-start: 6px; }
.idc-hint { color: var(--idc-sub); font-size: .8rem; margin-inline-start: auto; }
.idc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.idc-slot { background: var(--idc-card); border: 1px solid var(--idc-line); border-top: 3px solid var(--tone); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.idc-slot-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: .88rem; color: var(--idc-ink); }
.idc-badge { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: var(--idc-sub); white-space: nowrap; }
.idc-slot[data-state="saved"] .idc-badge   { background: #d1fae5; color: #047857; }
.idc-slot[data-state="staged"] .idc-badge  { background: #fef3c7; color: #b45309; }
.idc-slot[data-state="removed"] .idc-badge { background: #fee2e2; color: #b91c1c; }
.idc-slot[data-state="review"] .idc-badge  { background: #ffedd5; color: #c2410c; }
.idc-slot[data-state="error"] .idc-badge   { background: #fee2e2; color: #b91c1c; }
.idc-slot[data-state="loading"] .idc-badge { background: #e0e7ff; color: #4338ca; }

/* معاينة بنسبة بطاقة ID-1 — object-fit: contain فلا قصّ ولا تمدد */
.idc-preview { position: relative; aspect-ratio: 85.6 / 54; width: 100%; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1.5px dashed #cbd5e1; border-radius: 10px; overflow: hidden; display: grid; place-items: center; cursor: default; }
.idc-slot[data-state="saved"] .idc-preview, .idc-slot[data-state="staged"] .idc-preview, .idc-slot[data-state="review"] .idc-preview { cursor: zoom-in; border-style: solid; border-color: var(--tone-bd); }
.idc-slot[data-state="staged"] .idc-preview { border-color: #fcd34d; }
.idc-slot[data-state="review"] .idc-preview { border-color: #fdba74; }
.idc-slot[data-state="removed"] .idc-preview { opacity: .45; filter: grayscale(1); }
.idc-preview img { width: 100%; height: 100%; object-fit: contain; display: none; }
.idc-slot.has-img .idc-preview img { display: block; }
.idc-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #94a3b8; font-size: .8rem; }
.idc-empty i { font-size: 1.6rem; }
.idc-slot.has-img .idc-empty { display: none; }
.idc-spin { display: none; position: absolute; inset: 0; background: rgba(255, 255, 255, .6); place-items: center; }
.idc-spin::after { content: ''; width: 26px; height: 26px; border: 3px solid #c7d2fe; border-top-color: #4f46e5; border-radius: 50%; animation: idc-rot .8s linear infinite; }
.idc-slot[data-state="loading"] .idc-spin { display: grid; }
@keyframes idc-rot { to { transform: rotate(360deg); } }

.idc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.idc-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; color: #fff; min-height: 36px; transition: filter .15s, transform .08s; }
.idc-btn:hover { filter: brightness(1.08); } .idc-btn:active { transform: scale(.97); }
.idc-btn[hidden] { display: none; }
.idc-btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.idc-btn.cam { background: var(--idc-cam); } .idc-btn.file { background: var(--idc-file); }
.idc-btn.view { background: #475569; } .idc-btn.del { background: var(--idc-bad); }
.idc-btn.undo { background: var(--idc-warn); } .idc-btn.ghost { background: #fff; color: var(--idc-ink); border: 1px solid var(--idc-line); }
.idc-btn.primary { background: linear-gradient(135deg, #16a34a, #15803d); } .idc-btn.edit { background: #7c3aed; }
.idc-msg { font-size: .76rem; color: var(--idc-bad); min-height: 0; }
.idc-msg:empty { display: none; }
.idc-review-note { font-size: .76rem; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 6px 8px; display: none; }
.idc-slot[data-state="review"] .idc-review-note { display: block; }

/* ───────────── نوافذ داخلية (محرر، كاميرا، معاينة، تأكيد، طباعة) ───────────── */
.idc-ov { position: fixed; inset: 0; background: rgba(15, 23, 42, .62); z-index: 99000; display: flex; align-items: center; justify-content: center; padding: 12px; backdrop-filter: blur(2px); animation: idc-fade .18s ease-out; }
@keyframes idc-fade { from { opacity: 0; } to { opacity: 1; } }
.idc-dlg { background: #fff; border-radius: 18px; box-shadow: 0 25px 60px rgba(2, 6, 23, .45); display: flex; flex-direction: column; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: hidden; color: var(--idc-ink); }
.idc-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: linear-gradient(135deg, #1e293b, #334155); color: #fff; flex: 0 0 auto; }
.idc-dlg-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 9px; }
.idc-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; font-size: .95rem; }
.idc-x:hover { background: rgba(255, 255, 255, .3); }
.idc-dlg-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 18px; }
.idc-dlg-foot { flex: 0 0 auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--idc-line); background: #f8fafc; }
.idc-dlg-foot .grow { flex: 1; }
.idc-dlg.confirm { width: 440px; } .idc-dlg.confirm .idc-dlg-head { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.idc-dlg.confirm.safe .idc-dlg-head { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
.idc-dlg.viewer { width: min(1100px, calc(100vw - 24px)); height: min(760px, calc(100vh - 24px)); }
.idc-dlg.viewer .idc-dlg-body { display: grid; place-items: center; background: #0f172a; padding: 8px; overflow: auto; }
.idc-dlg.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.idc-dlg.viewer img.zoomed { max-width: none; max-height: none; cursor: zoom-out; } .idc-dlg.viewer img:not(.zoomed) { cursor: zoom-in; }

/* محرر الصورة */
.idc-dlg.editor { width: min(1000px, calc(100vw - 24px)); height: min(780px, calc(100vh - 24px)); }
.idc-edit-wrap { display: grid; grid-template-rows: 1fr auto; gap: 10px; height: 100%; min-height: 0; }
.idc-stage { position: relative; background: #0f172a; border-radius: 12px; display: grid; place-items: center; overflow: hidden; min-height: 200px; touch-action: none; user-select: none; -webkit-user-select: none; }
.idc-stage-inner { position: relative; line-height: 0; }
.idc-stage canvas { display: block; max-width: 100%; }
.idc-crop { position: absolute; border: 2px solid #fbbf24; box-shadow: 0 0 0 9999px rgba(2, 6, 23, .58); cursor: move; touch-action: none; }
.idc-crop::before, .idc-crop::after { content: ''; position: absolute; background: rgba(255, 255, 255, .35); pointer-events: none; }
.idc-crop::before { left: 33.3%; right: 33.3%; top: 0; bottom: 0; border-inline: 1px solid rgba(255, 255, 255, .4); background: none; }
.idc-crop::after { top: 33.3%; bottom: 33.3%; left: 0; right: 0; border-block: 1px solid rgba(255, 255, 255, .4); background: none; }
.idc-ch { position: absolute; width: 26px; height: 26px; background: #fbbf24; border: 2px solid #fff; border-radius: 50%; touch-action: none; z-index: 2; }
.idc-ch[data-h="nw"] { top: -13px; left: -13px; cursor: nwse-resize; } .idc-ch[data-h="ne"] { top: -13px; right: -13px; cursor: nesw-resize; }
.idc-ch[data-h="sw"] { bottom: -13px; left: -13px; cursor: nesw-resize; } .idc-ch[data-h="se"] { bottom: -13px; right: -13px; cursor: nwse-resize; }
.idc-ch[data-h="n"], .idc-ch[data-h="s"] { left: 50%; margin-left: -13px; cursor: ns-resize; } .idc-ch[data-h="n"] { top: -13px; } .idc-ch[data-h="s"] { bottom: -13px; }
.idc-ch[data-h="e"], .idc-ch[data-h="w"] { top: 50%; margin-top: -13px; cursor: ew-resize; } .idc-ch[data-h="e"] { right: -13px; } .idc-ch[data-h="w"] { left: -13px; }
.idc-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.idc-tools .rng { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; font-size: .85rem; font-weight: 700; }
.idc-tools input[type=range] { flex: 1; accent-color: #7c3aed; min-width: 120px; }
.idc-note { font-size: .78rem; color: var(--idc-sub); }
.idc-dims { font-size: .78rem; color: #334155; font-weight: 700; background: #f1f5f9; border-radius: 8px; padding: 4px 9px; }

/* الكاميرا */
.idc-dlg.camera { width: min(900px, calc(100vw - 24px)); }
.idc-cam-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.idc-cam-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.idc-guide { position: absolute; left: 50%; top: 50%; width: min(78%, 560px); aspect-ratio: 85.6 / 54; transform: translate(-50%, -50%); border: 2px dashed rgba(255, 255, 255, .85); border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); }
.idc-cam-msg { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; color: #fff; background: rgba(15, 23, 42, .92); font-weight: 600; line-height: 1.8; }
.idc-cam-msg.show { display: grid; }

/* إشعارات صغيرة + شريط رفع الصور */
/* الإشعارات للقراءة فقط: لا تلتقط النقرات (pointer-events:none) وتقع أعلى الصفحة بعيداً عن أزرار الحفظ/الاعتماد السفلية */
#idc-toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.idc-toast { pointer-events: none; background: #0f172a; color: #fff; border-radius: 12px; padding: 11px 16px; font-size: .88rem; line-height: 1.6; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border-inline-start: 5px solid #38bdf8; animation: idc-fade .2s; }
.idc-toast.ok { border-inline-start-color: #22c55e; } .idc-toast.err { border-inline-start-color: #ef4444; background: #3b0d0d; } .idc-toast.warn { border-inline-start-color: #f59e0b; }
#idc-chip { position: fixed; bottom: 18px; right: 18px; z-index: 99999; display: none; pointer-events: none; align-items: center; gap: 8px; background: #1e1b4b; color: #fff; border-radius: 999px; padding: 8px 14px; font-size: .82rem; font-weight: 700; box-shadow: 0 8px 22px rgba(30, 27, 75, .4); }
#idc-chip.show { display: inline-flex; }
#idc-chip i { animation: idc-rot 1.2s linear infinite; }

/* زر في رأس صفحة الحالات */
.idc-print-btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid #f59e0b !important; color: #b45309 !important; background: #fffbeb !important; font-weight: 800; }
.idc-print-btn:hover { background: #fef3c7 !important; }
.idc-mcr-btn { background: linear-gradient(135deg, #f59e0b, #c2410c) !important; }

/* ───────────── نافذة «طباعة البطاقات» ───────────── */
.idc-dlg.print { width: min(1360px, calc(100vw - 24px)); height: min(860px, calc(100vh - 24px)); }
.idc-dlg.print .idc-dlg-head { background: linear-gradient(135deg, #7c2d12, #c2410c); }
.idc-dlg.print .idc-dlg-body { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.idc-steps { display: flex; gap: 6px; padding: 10px 14px; background: #fff7ed; border-bottom: 1px solid #fed7aa; flex: 0 0 auto; flex-wrap: wrap; }
.idc-step { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: .86rem; background: #fff; color: #9a3412; border: 1.5px solid #fed7aa; cursor: pointer; }
.idc-step .n { width: 22px; height: 22px; border-radius: 50%; background: #fed7aa; color: #7c2d12; display: grid; place-items: center; font-size: .75rem; }
.idc-step.on { background: #ea580c; color: #fff; border-color: #ea580c; } .idc-step.on .n { background: #fff; color: #c2410c; }
.idc-step.done .n { background: #16a34a; color: #fff; } .idc-step[disabled] { opacity: .5; cursor: not-allowed; }
.idc-pane { flex: 1 1 auto; min-height: 0; display: none; overflow: hidden; }
.idc-pane.on { display: flex; }

/* الخطوة 1: الاختيار */
.idc-sel { display: grid; grid-template-columns: 320px 1fr; width: 100%; min-height: 0; }
.idc-side { padding: 14px; background: #f8fafc; border-inline-end: 1px solid var(--idc-line); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.idc-side h4 { margin: 0 0 6px; font-size: .9rem; color: #7c2d12; display: flex; align-items: center; gap: 7px; }
.idc-field { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 700; }
.idc-field input[type=text], .idc-field input[type=number], .idc-field select { border: 1.5px solid var(--idc-line); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .88rem; background: #fff; min-width: 0; }
.idc-field input:focus, .idc-field select:focus { outline: 2px solid #fdba74; border-color: #f97316; }
.idc-check { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.idc-group { background: #fff; border: 1px solid var(--idc-line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 9px; }
.idc-range-row { display: flex; align-items: center; gap: 6px; } .idc-range-row input { width: 76px; text-align: center; }
.idc-warnbox { font-size: .76rem; line-height: 1.7; color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 9px; padding: 7px 9px; }
.idc-list-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.idc-list-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--idc-line); background: #fff; }
.idc-count { font-weight: 800; color: #7c2d12; background: #ffedd5; border-radius: 999px; padding: 4px 12px; font-size: .84rem; }
.idc-count.sel { color: #14532d; background: #dcfce7; }
.idc-table-head, .idc-row { display: grid; grid-template-columns: 38px 52px minmax(160px, 2fr) 150px minmax(120px, 1.2fr) 170px; align-items: center; gap: 8px; padding: 0 14px; }
.idc-table-head { height: 38px; background: #f1f5f9; font-weight: 800; font-size: .78rem; color: #475569; border-bottom: 1px solid var(--idc-line); flex: 0 0 auto; }
.idc-vlist { position: relative; overflow: auto; flex: 1 1 auto; min-height: 0; }
.idc-vspacer { position: relative; }
.idc-row { position: absolute; left: 0; right: 0; height: 44px; border-bottom: 1px solid #f1f5f9; font-size: .84rem; background: #fff; cursor: pointer; }
.idc-row:hover { background: #fff7ed; } .idc-row.sel { background: #ecfdf5; }
.idc-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; } .idc-row .sub { color: var(--idc-sub); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idc-dots { display: flex; gap: 10px; align-items: center; font-size: .72rem; }
.idc-dots .p { display: inline-flex; align-items: center; gap: 3px; }
.idc-dot { width: 15px; height: 11px; border-radius: 3px; border: 1.5px solid #cbd5e1; background: #fff; display: inline-block; }
.idc-dot.ok { background: #22c55e; border-color: #16a34a; } .idc-dot.review { background: #fb923c; border-color: #ea580c; } .idc-dot.none { background: #f1f5f9; }
.idc-empty-list { padding: 40px 20px; text-align: center; color: var(--idc-sub); }

/* الخطوة 2: المراجعة */
.idc-review { width: 100%; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.idc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.idc-stat { border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border: 1.5px solid; }
.idc-stat b { font-size: 1.7rem; line-height: 1.2; } .idc-stat span { font-size: .82rem; font-weight: 700; }
.idc-stat.c1 { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; } .idc-stat.c2 { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.idc-stat.c3 { background: #ecfdf5; border-color: #a7f3d0; color: #047857; } .idc-stat.c4 { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }
.idc-stat.c5 { background: #fffbeb; border-color: #fde68a; color: #b45309; } .idc-stat.c6 { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.idc-miss { border: 1px solid #fecaca; border-radius: 12px; overflow: hidden; }
.idc-miss h4 { margin: 0; padding: 10px 14px; background: #fef2f2; color: #991b1b; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.idc-miss table { width: 100%; border-collapse: collapse; font-size: .84rem; } .idc-miss th { text-align: start; background: #fff; padding: 8px 14px; color: #64748b; font-size: .76rem; }
.idc-miss td { padding: 8px 14px; border-top: 1px solid #fee2e2; } .idc-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; margin-inline-end: 4px; }
.idc-tag.miss { background: #fee2e2; color: #b91c1c; } .idc-tag.rev { background: #ffedd5; color: #c2410c; } .idc-tag.ok { background: #dcfce7; color: #166534; }
.idc-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

/* الخطوة 3: المعاينة والإعدادات */
.idc-prev { display: grid; grid-template-columns: 330px 1fr; width: 100%; min-height: 0; }
.idc-prev-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #e2e8f0; }
.idc-prev-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; background: #fff; border-bottom: 1px solid var(--idc-line); flex: 0 0 auto; }
.idc-prev-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px; display: flex; gap: 22px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.idc-sheetbox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.idc-sheetcap { font-weight: 800; font-size: .84rem; padding: 3px 14px; border-radius: 999px; color: #fff; background: #475569; }
.idc-sheetcap.front { background: #2563eb; } .idc-sheetcap.back { background: #db2777; }
.idc-sheet { position: relative; background: #fff; box-shadow: 0 6px 26px rgba(15, 23, 42, .28); overflow: hidden; direction: rtl; flex: 0 0 auto; }
.idc-sheet * { box-sizing: border-box; }
.idc-sheet .a { position: absolute; }
.idc-sheet .img { position: absolute; display: block; border: 1px solid #94a3b8; background: #f8fafc; cursor: zoom-in; }
.idc-sheet .img:hover { outline: 2px solid #f97316; outline-offset: 1px; }
.idc-sheet .ph { position: absolute; border: 1.5px dashed #cbd5e1; color: #b45309; display: grid; place-items: center; text-align: center; font-weight: 700; padding: 4px; line-height: 1.4; }
.idc-sheet .lbl { position: absolute; display: grid; place-items: center; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idc-sheet .hd { position: absolute; border-bottom: 2px solid #4f46e5; }
.idc-sheet .ft { position: absolute; border-top: 1px solid #cbd5e1; color: #64748b; display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.idc-prev-side { padding: 14px; background: #fff; border-inline-end: 1px solid var(--idc-line); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.idc-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.idc-seg label { border: 1.5px solid var(--idc-line); border-radius: 10px; padding: 9px 8px; cursor: pointer; font-size: .8rem; font-weight: 800; text-align: center; line-height: 1.5; background: #fff; }
.idc-seg input { display: none; } .idc-seg label.on { border-color: #ea580c; background: #fff7ed; color: #9a3412; box-shadow: inset 0 0 0 1px #ea580c; }
.idc-info { font-size: .8rem; line-height: 1.8; border-radius: 10px; padding: 8px 10px; }
.idc-info.scale { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; } .idc-info.good { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.idc-info.warn { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; } .idc-info.duplex { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.idc-info ol { margin: 4px 0 0; padding-inline-start: 18px; } .idc-info li { margin-bottom: 3px; }
.idc-foot-info { color: var(--idc-sub); font-size: .82rem; }
.idc-busy { display: inline-flex; align-items: center; gap: 8px; color: #7c2d12; font-weight: 800; font-size: .84rem; }
.idc-busy::before { content: ''; width: 16px; height: 16px; border: 3px solid #fed7aa; border-top-color: #ea580c; border-radius: 50%; animation: idc-rot .8s linear infinite; }
.idc-btn.big { padding: 10px 18px; font-size: .9rem; flex: 0 0 auto; min-height: 42px; }
.idc-btn.print { background: linear-gradient(135deg, #ea580c, #c2410c); } .idc-btn.pdf { background: linear-gradient(135deg, #dc2626, #991b1b); }
.idc-btn.test { background: #0d9488; } .idc-btn.next { background: linear-gradient(135deg, #4f46e5, #3730a3); }

/* ───────────── جوال: كل شيء بملء الشاشة ولمس مريح ───────────── */
@media (max-width: 1024px) {
    .idc-sides { grid-template-columns: 1fr; }
    .idc-btn { min-height: 44px; font-size: .86rem; }
    .idc-ov { padding: 0; align-items: stretch; }
    .idc-dlg, .idc-dlg.print, .idc-dlg.editor, .idc-dlg.viewer, .idc-dlg.camera { width: 100vw !important; height: 100dvh !important; max-width: none; max-height: none; border-radius: 0; }
    .idc-dlg.confirm { width: calc(100vw - 24px) !important; height: auto !important; max-height: calc(100dvh - 24px); border-radius: 18px; align-self: center; margin: 12px; }
    .idc-sel, .idc-prev { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .idc-side, .idc-prev-side { max-height: 38vh; border-inline-end: 0; border-bottom: 1px solid var(--idc-line); }
    .idc-table-head { display: none; }
    .idc-row { grid-template-columns: 34px minmax(0, 1fr) auto; height: 58px; }
    .idc-row .c-idx, .idc-row .c-nid, .idc-row .c-role { display: none; }
    .idc-prev-scroll { padding: 10px; }
    #idc-chip { bottom: 76px; right: 10px; } #idc-toasts { top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .idc-ov, .idc-toast { animation: none; } .idc-spin::after, #idc-chip i, .idc-busy::before { animation-duration: 2s; } }
