/* =========================================================
   الوضع الليلي — بيحمّل فوق أي ستايل (كلاسيك أو مودرن) لما الإضاءة = dark
   متغير الألوان + تصحيحات المكونات، مستقل عن اختيار شكل الواجهة.
   ========================================================= */

html[data-mode="dark"]{
  --bg:#0d1117;
  --paper:#161c26;
  --surface:#161c26;
  --text:#dfe6f0;
  --muted:#8d9aac;
  --heading:#f2f6fb;
  --border:#263040;
  --hover:#1c2531;
  --active:#22303f;
  --accent:#ff7a2f;
  --accent-2:#ffa066;
  --ok:#3ddc97;
  --warn:#f2c14e;
  --bad:#ff6b6b;
  --info:#5aa9ff;
  --sidebar:#0a0e14;
  --sidebar-text:#e6ecf5;
  --sidebar-muted:#7c8899;
  --topbar:#121821;
  --glass:#121821;
  --surface-alt:#11161d;
  --ink:#f2f6fb;
  --inset:#1b2430;
  --shadow:0 1px 2px rgba(0,0,0,.5), 0 18px 40px -28px rgba(0,0,0,.9);
  --shadow-sm:0 1px 2px rgba(0,0,0,.45);
  --ring:0 0 0 3px rgba(255,122,47,.24);
}

html[data-mode="dark"] .perm-check:has(input:checked){background:color-mix(in srgb,var(--accent) 18%,var(--surface))}

html[data-mode="dark"] .cs-avatar{background:linear-gradient(150deg,#2b3a4d,#1b2534)!important;color:var(--heading)!important;box-shadow:none!important}

html[data-mode="dark"] .cs-todo.info{color:#a8ceff}

html[data-mode="dark"] .cs-delta.up{color:#5fd39a}

html[data-mode="dark"] .cs-delta.down{color:#f3a0a0}

html[data-mode="dark"] .cs-tile.bad .value{color:#f3a0a0}

html[data-mode="dark"] .cs-tile.ok .cs-tile-ico{background:rgba(53,199,123,.16);color:#5fd39a}

html[data-mode="dark"] .cs-tile.warn .cs-tile-ico{background:rgba(242,193,78,.16);color:#f2c14e}

html[data-mode="dark"] .cs-tile.bad .cs-tile-ico{background:rgba(239,68,68,.16);color:#f3a0a0}

html[data-mode="dark"] .cs-panel-empty{color:var(--muted)}


/* ---------- الوضع الداكن ---------- */
html[data-mode="dark"] body{
  background:
    radial-gradient(1100px 480px at 100% -10%, rgba(255,122,47,.09), transparent 55%),
    radial-gradient(900px 420px at -5% 108%, rgba(90,169,255,.07), transparent 52%),
    var(--bg)!important;
}

html[data-mode="dark"] .text-muted,
html[data-mode="dark"] .muted,
html[data-mode="dark"] small.text-muted,
html[data-mode="dark"] .form-text{color:var(--muted)!important}

html[data-mode="dark"] .admin-hero p,
html[data-mode="dark"] .admin-hero .text-muted{color:#b9c4d4!important}

html[data-mode="dark"] .avatar{background:#22303f!important;color:var(--heading)!important}

html[data-mode="dark"] .btn-close{filter:invert(1) grayscale(100%) brightness(200%)}

html[data-mode="dark"] .dropdown-menu,
html[data-mode="dark"] .modal-content{background:var(--surface);border-color:var(--border);color:var(--text)}

html[data-mode="dark"] .table{color:var(--text)}

html[data-mode="dark"] .table>:not(caption)>*>*{background:var(--surface);color:var(--text);border-bottom-color:var(--border)}

html[data-mode="dark"] .cs-offline{color:#f3b6b6}

html[data-mode="dark"] .form-control::placeholder,
html[data-mode="dark"] .cs-search input::placeholder{color:#6f7d90!important}

html[data-mode="dark"] .alert-warning{color:#f4d489!important}

html[data-mode="dark"] .alert-success{color:#8fe6bd!important}

html[data-mode="dark"] hr{border-color:var(--border);opacity:1}

html[data-mode="dark"] .empty-icon,
html[data-mode="dark"] .kpi-card .kpi-icon,
html[data-mode="dark"] .entity-avatar.soft,
html[data-mode="dark"] .cs-plan-usage span{
  background:rgba(255,122,47,.15)!important;color:var(--accent)!important;border-color:rgba(255,122,47,.28)!important
}

html[data-mode="dark"] .pay-bar,
html[data-mode="dark"] .cs-meter-track{background:var(--hover)!important}

html[data-mode="dark"] .cs-chip.on{color:#14181f!important}


/* وحدة الأفراح — الوضع الداكن */
html[data-mode="dark"] .wc-chip{background:#2a3444;color:#c7d3e2}

html[data-mode="dark"] .wc-chip.ok{background:rgba(53,199,123,.18);color:#5fd39a}

html[data-mode="dark"] .wc-chip.out{background:rgba(240,138,58,.18);color:#f7b26a}

html[data-mode="dark"] .wc-chip.late{background:rgba(239,68,68,.18);color:#f3a0a0}

html[data-mode="dark"] .wc-chip.warn{background:rgba(242,193,78,.18);color:#f2c14e}

html[data-mode="dark"] .wc-alert-strip{border-color:#4a3620;background:linear-gradient(180deg,#241c14,#1d1811)}

html[data-mode="dark"] .wc-alert-head{color:#f7b26a}

html[data-mode="dark"] .wc-alert-chip{background:#1b2534;border-color:#33415a;color:var(--heading)}

html[data-mode="dark"] .wc-alert-chip b{color:#f7b26a}

html[data-mode="dark"] .wc-countdown,
html[data-mode="dark"] .wc-hero,
html[data-mode="dark"] .wc-task,
html[data-mode="dark"] .wc-vendor,
html[data-mode="dark"] .wc-guest,
html[data-mode="dark"] .wc-pay,
html[data-mode="dark"] .wc-session,
html[data-mode="dark"] .wc-cal{background:var(--surface);border-color:var(--border)}

html[data-mode="dark"] .wc-hero{background:linear-gradient(160deg,var(--surface),#1d2534)}

html[data-mode="dark"] .wc-hero.late,html[data-mode="dark"] .wc-hero.out,html[data-mode="dark"] .wc-hero.ok,html[data-mode="dark"] .wc-hero.warn{background:linear-gradient(160deg,var(--surface),#1d2534)}

html[data-mode="dark"] .wc-task.done{background:#182231}

html[data-mode="dark"] .wc-task.late{background:#241a1c}

html[data-mode="dark"] .wc-task-title{color:var(--heading)}

html[data-mode="dark"] .wc-task.done .wc-task-title{color:var(--muted)}

html[data-mode="dark"] .wc-cal-head,
html[data-mode="dark"] .wc-cell.blank{background:#161e2a}

html[data-mode="dark"] .wc-cal-dow{color:var(--muted)}

html[data-mode="dark"] .wc-cell{border-color:#26313f}

html[data-mode="dark"] .wc-cell.today{background:rgba(232,93,4,.1)}

html[data-mode="dark"] .wc-ev{background:#1b2534;color:var(--heading);border-inline-start-color:#3a465a}

html[data-mode="dark"] .wc-ev b{color:#9fb0c6}

html[data-mode="dark"] .wc-ev.ok{background:rgba(53,199,123,.12);border-inline-start-color:#35c77b}

html[data-mode="dark"] .wc-ev.out{background:rgba(240,138,58,.12);border-inline-start-color:#f08838}

html[data-mode="dark"] .wc-ev.late{background:rgba(239,68,68,.12);border-inline-start-color:#ef4444}

html[data-mode="dark"] .wc-ev.warn{background:rgba(242,193,78,.12);border-inline-start-color:#f2c14e}

html[data-mode="dark"] .wc-ev.off{background:#1b2534;border-inline-start-color:#465568}

html[data-mode="dark"] .wc-cell-add{background:#1b2534;border-color:#33415a;color:#9fb0c6}

html[data-mode="dark"] .wc-inline-form{background:#161e2a;border-color:#33415a}

html[data-mode="dark"] .wc-late-card .wc-late-task{background:#241a1c;border-color:#4b2b2b;color:var(--heading)}

html[data-mode="dark"] .wc-late-card .wc-late-session{background:#1a2130;border-color:#2b3b57;color:var(--heading)}

html[data-mode="dark"] .wc-late-date{color:#f3a0a0}

html[data-mode="dark"] .wc-sum-chip{background:#1b2534;border-color:#33415a;color:#c7d3e2}

html[data-mode="dark"] .wc-progress,
html[data-mode="dark"] .wc-occ-bar,
html[data-mode="dark"] .wc-status-track{background:#26313f}

html[data-mode="dark"] .wc-status-bar.off .wc-status-track i{background:#465568}

html[data-mode="dark"] .wc-tip,
html[data-mode="dark"] .wc-notes{background:#161e2a;color:var(--text)}

html[data-mode="dark"] .card-footer{background:#161e2a}

html[data-mode="dark"] .wc-price-head{color:var(--heading)}

html[data-mode="dark"] .wc-rule-chip{background:rgba(240,138,58,.14);border-color:#4a3620;color:#f7b26a}

html[data-mode="dark"] .wc-day{background:var(--surface)}

html[data-mode="dark"] .wc-day.on{background:rgba(240,138,58,.14);border-color:#4a3620;color:#f7b26a}

html[data-mode="dark"] .wc-quote-total{background:#241c14;border-color:#4a3620;color:#f7b26a}

html[data-mode="dark"] .wc-quote-line.plus b{color:#f7b26a}

html[data-mode="dark"] .wc-quote-line.minus b{color:#5fd39a}

html[data-mode="dark"] .bk-link-card .card-header{background:#161e2a}

html[data-mode="dark"] .bk-url{background:#161e2a;color:var(--text);border-color:#33415a}

html[data-mode="dark"] .bk-inq-row{background:#161e2a;border-color:#33415a;color:var(--text)}

html[data-mode="dark"] .bk-inq-row:hover{border-color:#5fd39a}

html[data-mode="dark"] .bk-inq-state{background:rgba(240,138,58,.14);border-color:#4a3620;color:#f7b26a}

html[data-mode="dark"] .tk-count{background:linear-gradient(135deg,#241a12,#1c1512);border-color:#4a3620}

html[data-mode="dark"] .tk-count strong{color:#f7b26a}

html[data-mode="dark"] .tk-count-label,
html[data-mode="dark"] .tk-count-sub{color:#c08a5a}

html[data-mode="dark"] .tk-row{background:#161c26;border-color:#263040}

html[data-mode="dark"] .tk-block{background:#161c26;border-color:#263040}

html[data-mode="dark"] .tk-block-head{color:#9fb0c6;border-bottom-color:#2b3b57}

html[data-mode="dark"] .tk-mos{background:#111823;border-color:#263040}

html[data-mode="dark"] .tk-mos.is-paid strong,
html[data-mode="dark"] .tk-mos.is-done strong{color:#5fd39a}

html[data-mode="dark"] .tk-mos.is-left strong{color:#f3a0a0}

/* شريط مراحل الجلسة + كروت النماذج (studio/wedding) */
html[data-mode="dark"] .wc-stagerail{background:#161c26;border-color:#263040}

html[data-mode="dark"] .wc-stage-dot{background:#2a3444;color:#c7d3e2;border-color:#3a4759}

html[data-mode="dark"] .wc-stage.done .wc-stage-dot{background:rgba(53,199,123,.18);color:#5fd39a;border-color:#2c5a41}

html[data-mode="dark"] .wc-stage.done .wc-stage-label{color:#5fd39a}

html[data-mode="dark"] .wc-stage.on .wc-stage-dot{background:#e85d04;color:#fff;border-color:#f7b26a}

html[data-mode="dark"] .wc-stage.on .wc-stage-label{color:#f7b26a}

html[data-mode="dark"] .wc-form-card,
html[data-mode="dark"] .wc-quote-card{background:#161c26;border-color:#263040}

/* ===== الكافيه والمطعم (cafe) — الثيم الداكن ===== */
html[data-mode="dark"] .cf-chip{background:var(--surface);color:#c7d3e2}

html[data-mode="dark"] .cf-live.is-on{background:rgba(53,199,123,.14);border-color:#2c5a41;color:#5fd39a}

html[data-mode="dark"] .cf-notify{background:rgba(240,138,58,.16);color:#f7b26a}

html[data-mode="dark"] .cf-flash{background:rgba(240,138,58,.1);border-color:#4a3620!important}

html[data-mode="dark"] .cf-flash b{color:#f7b26a}

html[data-mode="dark"] .cf-col{background:#141a24}

html[data-mode="dark"] .cf-col-head{background:#1b2534}

html[data-mode="dark"] .cf-col-head.tone-warn{background:#241f12;color:#f0c674}

html[data-mode="dark"] .cf-col-head.tone-out{background:#241a12;color:#f7b26a}

html[data-mode="dark"] .cf-col-head.tone-ok{background:rgba(53,199,123,.12);color:#5fd39a}

html[data-mode="dark"] .cf-col-head.tone-late{background:#241416;color:#f3a0a0}

html[data-mode="dark"] .cf-col-head.tone-off{background:#1b2534;color:#9fb0c6}

html[data-mode="dark"] .cf-card,
html[data-mode="dark"] .cf-line,
html[data-mode="dark"] .mn-item,
html[data-mode="dark"] .mn-qty,
html[data-mode="dark"] .cf-rail{background:#161c26}

html[data-mode="dark"] .cf-card.is-late,
html[data-mode="dark"] .cf-row-cancelled,
html[data-mode="dark"] .cf-row-rejected{background:#241416;border-color:#4b2b2b}

html[data-mode="dark"] .cf-row-preparing,
html[data-mode="dark"] .cf-line.has-qty,
html[data-mode="dark"] .mn-item.is-picked{background:#241a12;border-color:#4a3620;box-shadow:none}

html[data-mode="dark"] .cf-table-no,
html[data-mode="dark"] .cf-table-chip{background:var(--accent);color:#fff}

html[data-mode="dark"] .cf-src-console .cf-table-no{background:#3b2f5e;color:#c9b8ff}

html[data-mode="dark"] .cf-card-items,
html[data-mode="dark"] .cf-card-actions,
html[data-mode="dark"] .mn-lines li{border-color:#2b3546}

html[data-mode="dark"] .cf-badge.tone-warn{background:rgba(202,138,4,.18);color:#f0c674}

html[data-mode="dark"] .cf-badge.tone-out{background:rgba(240,138,58,.16);color:#f7b26a}

html[data-mode="dark"] .cf-badge.tone-ok{background:rgba(53,199,123,.16);color:#5fd39a}

html[data-mode="dark"] .cf-badge.tone-late{background:rgba(220,38,38,.18);color:#f3a0a0}

html[data-mode="dark"] .cf-badge,
html[data-mode="dark"] .cf-badge.tone-off{background:#2a3444;color:#c7d3e2}

html[data-mode="dark"] .cf-rail-step.is-done{background:rgba(53,199,123,.14);border-color:#2c5a41;color:#5fd39a}

html[data-mode="dark"] .cf-rail-step.is-dead{background:#241416;border-color:#4b2b2b;color:#f3a0a0}

html[data-mode="dark"] .cf-items tfoot td{background:#1b2534}

html[data-mode="dark"] .cf-items tfoot tr:last-child td{background:rgba(240,138,58,.12);color:#f7b26a}

html[data-mode="dark"] .cf-sumcard{background:linear-gradient(160deg,#161c26,#1b2029)}

html[data-mode="dark"] .cf-sum-row.is-total,
html[data-mode="dark"] .cf-edit-sum,
html[data-mode="dark"] .mn-total-row{background:rgba(240,138,58,.12);border-color:#4a3620;color:#f7b26a}

html[data-mode="dark"] .cf-alert.ok{background:rgba(53,199,123,.12);border-color:#2c5a41;color:#5fd39a}

html[data-mode="dark"] .cf-alert.bad{background:rgba(220,38,38,.14);border-color:#4b2b2b;color:#f3a0a0}

html[data-mode="dark"] .cf-cat{background:#1b2534;color:#c7d3e2;border-color:#33415a}

html[data-mode="dark"] .cf-cat.is-off{background:#161c26;color:#7f8ea3}

html[data-mode="dark"] .cf-avatar{background:var(--accent);color:#fff}

html[data-mode="dark"] .cf-chip-live{background:rgba(53,199,123,.14);border-color:#2c5a41;color:#5fd39a}

html[data-mode="dark"] .mn-hero{background:linear-gradient(165deg,#161c26,#1d1a26)}

html[data-mode="dark"] .mn-hero-mark{background:#1b2534;color:#f7b26a;border:1px solid #33415a}

html[data-mode="dark"] .mn-cat-title{background:#1b2534;color:#9fb0c6;border-bottom-color:#2b3546}

html[data-mode="dark"] .mn-note-strip{background:rgba(240,138,58,.12);border-color:#4a3620;color:#f7b26a}

html[data-mode="dark"] .mn-btn{background:#1b2534;border-color:#33415a;color:#c7d3e2}

html[data-mode="dark"] .mn-table-bar{background:#101620;border-color:#2b3546}


/* ===== الصفحات العامة (track / book / menu) — الثيم الداكن ===== */
html[data-mode="dark"] .track-bar{background:rgba(22,28,38,.94);border-bottom-color:#263040}

html[data-mode="dark"] .track-nav a{background:#1b2430;border-color:#33415a;color:var(--heading)}

html[data-mode="dark"] .track-nav a:hover{border-color:var(--accent)}

html[data-mode="dark"] .track-mark{background:var(--accent);color:#fff}

html[data-mode="dark"] .track-plate,
html[data-mode="dark"] .track-code-input{border-color:#33415a}

html[data-mode="dark"] .track-code-input:focus{border-color:var(--accent);box-shadow:0 0 0 4px rgba(232,93,4,.18)}

html[data-mode="dark"] .track-rail::before{background:#263040}

html[data-mode="dark"] .track-rail li{color:#8d9aac}

html[data-mode="dark"] .track-node{background:#1b2430;border-color:#33415a;color:var(--text)}

html[data-mode="dark"] .track-rail li.done{color:var(--heading)}

html[data-mode="dark"] .track-rail li.done .track-node{background:#2c5a41;border-color:#2c5a41;color:#5fd39a}

html[data-mode="dark"] .track-rail li.on .track-node{background:var(--accent);border-color:#f7b26a;color:#fff;box-shadow:0 0 0 6px rgba(232,93,4,.16)}

/* ---------- الصفحات العامة: الرئيسية، الدخول، الخطأ ----------
   البلوكات دي مكتوبة في app.css بخلفيات كريمي ثابتة (مش متغيرات)،
   فبتفضل فاتحة فوق الخلفية الداكنة. بنستبدلها بسطوح من الثيم. */
html[data-mode="dark"] .home-nav{background:rgba(13,17,23,.92);border-color:var(--border)}
html[data-mode="dark"] .home-brand .logo-mark,
html[data-mode="dark"] .home-foot-brand .logo-mark{background:rgba(255,255,255,.08);color:var(--heading)}
html[data-mode="dark"] .home-mod-filter button{background:var(--surface);color:var(--heading)}
html[data-mode="dark"] .home-mod-filter button.on{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-mode="dark"] .home-mod{background:linear-gradient(180deg,#1a222e,#151c26)}
html[data-mode="dark"] .home-mod i{background:rgba(255,255,255,.08);color:var(--home-accent-soft,#fdba74)}
html[data-mode="dark"] .home-mod:hover{border-color:#33415a;box-shadow:0 18px 30px -28px rgba(0,0,0,.9)}
html[data-mode="dark"] .home-industry-grid article{background:linear-gradient(180deg,#1a222e,#151c26)}
html[data-mode="dark"] .home-industry-grid article > i{background:rgba(232,93,4,.16);border-color:rgba(232,93,4,.34);color:var(--home-accent-soft,#fdba74)}
html[data-mode="dark"] .home-plan{background:linear-gradient(180deg,#1a222e,#151c26)}
html[data-mode="dark"] .home-feature-grid article,
html[data-mode="dark"] .home-app-grid article{background:rgba(255,255,255,.04)}
html[data-mode="dark"] .home-faq-item[open]{background:#1a222e}
html[data-mode="dark"] .home-start-no{color:rgba(255,255,255,.08)}
html[data-mode="dark"] .home-start-card:nth-child(2) > i{background:rgba(255,255,255,.1)}
html[data-mode="dark"] .home-foot{border-top-color:var(--border)}
html[data-mode="dark"] .home-social-link{background:rgba(255,255,255,.06);border-color:var(--border);color:var(--heading)}
html[data-mode="dark"] .social-edit-row{background:rgba(255,255,255,.03)}
html[data-mode="dark"] .err-copy .home-kicker,
html[data-mode="dark"] .err-points a{background:rgba(255,255,255,.05);border-color:var(--border)}
html[data-mode="dark"] .err-points a:hover{background:var(--hover);border-color:rgba(232,93,4,.45);color:var(--accent)}
@media (min-width:861px){
  html[data-mode="dark"] .home-nav{background:rgba(18,24,33,.9);border-color:var(--border)}
}

html[data-mode="dark"] .home-copy .brand-kicker{background:rgba(255,255,255,.05);color:var(--heading)}
html[data-mode="dark"] .home-cta .btn-outline-secondary,
html[data-mode="dark"] .err-copy .home-cta .btn-outline-secondary{background:rgba(255,255,255,.05);color:var(--heading);border-color:var(--border)}
html[data-mode="dark"] .home-paycycle span{background:rgba(255,255,255,.05)}
html[data-mode="dark"] .home-stats article{background:rgba(255,255,255,.04);border-color:var(--border)}
html[data-mode="dark"] .home-highlights article{background:rgba(255,255,255,.04);border-color:var(--border)}
html[data-mode="dark"] .home-nav-end{border-color:var(--border)}
html[data-mode="dark"] .home-nav-ghost:hover{background:rgba(255,255,255,.06)}
html[data-mode="dark"] .home-band{background:rgba(255,255,255,.035);border-color:var(--border)}
html[data-mode="dark"] .home-feature-grid i{background:rgba(61,220,151,.14)}
html[data-mode="dark"] .home-import-step{background:rgba(255,255,255,.04);border-color:var(--border);box-shadow:none}
html[data-mode="dark"] .home-import-ico{background:rgba(232,93,4,.18)}
html[data-mode="dark"] .demo-import-pitch{background:linear-gradient(135deg,rgba(232,93,4,.14),rgba(255,255,255,.04));border-color:var(--border)}

html[data-mode="dark"] .auth-meta span,
html[data-mode="dark"] .auth-industries article,
html[data-mode="dark"] .auth-feature-row article,
html[data-mode="dark"] .auth-plan{background:rgba(255,255,255,.045);border-color:var(--border)}
html[data-mode="dark"] .auth-industries article > i{background:rgba(232,93,4,.16);border-color:rgba(232,93,4,.34)}
html[data-mode="dark"] .auth-industries .auth-industry-more .auth-industry-actions a{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.16);color:var(--heading)}

html[data-mode="dark"] .auth-plan a{background:rgba(255,255,255,.08);color:var(--heading);border:1px solid var(--border)}
html[data-mode="dark"] .auth-plan a:hover{background:var(--hover);color:var(--accent)}

/* عناصر بتستخدم --ink كخلفية والنص جواها أبيض. في الداكن --ink بقى فاتح،
   فالنص الأبيض كان بيختفي (تاب الإدارة النشِط، فلتر الطلبات، خطوات أمر الشغل). */
html[data-mode="dark"] .admin-tabs a.on{background:var(--accent);color:#fff}
html[data-mode="dark"] .admin-tabs a.on i{color:#fff}
html[data-mode="dark"] .order-filters a.on{background:var(--accent);color:#fff}
html[data-mode="dark"] .stepper .on{background:rgba(255,255,255,.1);border-color:var(--border);color:var(--heading)}
html[data-mode="dark"] .cmdk-item:hover,
html[data-mode="dark"] .cmdk-item.active,
html[data-mode="dark"] .cmdk-item:focus{background:rgba(255,255,255,.08);color:var(--heading)}
html[data-mode="dark"] .auth-card,
html[data-mode="dark"] .auth-panel{background:var(--surface)!important}
html[data-mode="dark"] .auth-card .card-body,
html[data-mode="dark"] .auth-panel .card-body{color:var(--text)}
html[data-mode="dark"] .fab{background:var(--accent);color:#fff}

/* الشريط السفلي على الموبايل كان له لون فاتح ثابت (#fffaf3) فبيبان أبيض في الداكن */
html[data-mode="dark"] .bottom-nav{
  background:rgba(18,24,33,.96);
  border-top-color:var(--border);
  box-shadow:0 -10px 28px -22px rgba(0,0,0,.85);
}

/* المكتب العقاري: الألوان الفاتحة المكتوبة بثابت في app.css */
html[data-mode="dark"] .ls-star{background:#2a2412;border-color:#4a3d1c;color:#f2c14e}
html[data-mode="dark"] .ls-floor{background:rgba(53,199,123,.12);border-color:#2c5a41;color:#5fd39a}
html[data-mode="dark"] .br-slot-note{background:#241f12;border-color:#4a3d1c;color:#f0c674}
html[data-mode="dark"] .ls-card,
html[data-mode="dark"] .ls-price-card,
html[data-mode="dark"] .ls-inq,
html[data-mode="dark"] .ls-shot-card,
html[data-mode="dark"] .br-shot,
html[data-mode="dark"] .ls-spec{background:var(--surface)}
html[data-mode="dark"] .ls-foot{background:#131a24}
html[data-mode="dark"] .br-funnel-bar{background:#1b2534}
html[data-mode="dark"] .ls-strip-n{background:rgba(232,93,4,.16);color:#f7b26a}
/* أزرار الحدود الغامقة (كلم المكتب/نسخ/الصورة كاملة) كانت نصها غامق على خلفية غامقة فالكتابة تختفي */
html[data-mode="dark"] .btn-outline-dark{
  color:var(--heading);
  border-color:var(--border);
  background:rgba(255,255,255,.04);
}
html[data-mode="dark"] .btn-outline-dark:hover,
html[data-mode="dark"] .btn-outline-dark:focus{
  color:var(--heading);
  border-color:var(--accent);
  background:rgba(255,255,255,.1);
}

/* صفحة الطلب العامة */
html[data-mode="dark"] .order-block,
html[data-mode="dark"] .order-receipt{background:var(--surface);border-color:var(--border)}
html[data-mode="dark"] .order-industry,
html[data-mode="dark"] .order-plan,
html[data-mode="dark"] .order-pay,
html[data-mode="dark"] .order-chips button,
html[data-mode="dark"] .order-meta span,
html[data-mode="dark"] .order-trust span,
html[data-mode="dark"] .order-steps li,
html[data-mode="dark"] .order-receipt-grid div{background:var(--inset);border-color:var(--border)}
html[data-mode="dark"] .order-industry.is-on{background:linear-gradient(180deg,rgba(255,122,47,.12),var(--inset));box-shadow:0 0 0 1px var(--accent)}
html[data-mode="dark"] .order-industry-ico{background:rgba(232,93,4,.16);border-color:rgba(232,93,4,.34);color:#f7b26a}
html[data-mode="dark"] .order-industry.is-on .order-industry-ico{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-mode="dark"] .order-steps li.is-on{background:linear-gradient(180deg,rgba(255,122,47,.14),var(--inset));border-color:rgba(255,122,47,.35)}
html[data-mode="dark"] .order-steps li.is-done{background:rgba(53,199,123,.1);border-color:#2c5a41}
html[data-mode="dark"] .order-ticket{background:linear-gradient(165deg,#141a22 0%,#0f141b 55%,#1a1510 100%);border-color:#2a3340}
html[data-mode="dark"] .order-ticket-demo{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12)}
html[data-mode="dark"] .order-ticket-row{border-bottom-color:rgba(255,255,255,.08)}
html[data-mode="dark"] .order-receipt-copy{background:var(--inset);border-color:var(--border);color:var(--heading)}
html[data-mode="dark"] .order-block-no{background:#1b2534;color:#c7d3e2}
html[data-mode="dark"] .order-sticky{background:rgba(13,17,23,.96);border-top-color:var(--border)}

/* الصفحة الرئيسية — كروت «أنظمة مميزة» وفلتر الأنظمة في الوضع الليلي */
html[data-mode="dark"] .home-spot{background:linear-gradient(135deg,#1a222e,#151c26);border-color:var(--border);color:var(--heading)}
html[data-mode="dark"] .home-spot:hover{border-color:var(--accent);color:var(--heading);box-shadow:0 18px 30px -28px rgba(0,0,0,.9)}
html[data-mode="dark"] .home-spot b{color:var(--heading)}
html[data-mode="dark"] .home-spot i{background:rgba(232,93,4,.16);color:var(--home-accent-soft,#fdba74)}
html[data-mode="dark"] .home-ind-filters button{background:var(--surface);border-color:var(--border);color:var(--heading)}
html[data-mode="dark"] .home-ind-filters button.is-on{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-mode="dark"] .home-ind-search{background:var(--surface);border-color:var(--border)}
html[data-mode="dark"] .home-industry-grid article h3,
html[data-mode="dark"] .home-industry-grid article b{color:var(--heading)}


/* ===== مراجعة شاملة للوضع الليلي (مولَّد): كل مكوّن بخلفية فاتحة ثابتة ===== */
html[data-mode="dark"] .vault-kpis .is-warn{background:rgba(242,193,78,.16)}
html[data-mode="dark"] .plan-off{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .status-received{background:rgba(90,169,255,.16);color:#9ccaff}
html[data-mode="dark"] .status-inspection{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .status-approval{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .status-repairing{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .status-parts{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .status-ready{background:rgba(53,199,123,.15);color:#6fe0a8}
html[data-mode="dark"] .status-delivered{background:var(--inset);color:var(--text)}
html[data-mode="dark"] .status-urgent{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .track-note.is-received{background:rgba(90,169,255,.16);color:#9ccaff}
html[data-mode="dark"] .track-note.is-inspection{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .track-note.is-approval{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .track-note.is-repairing{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .track-note.is-parts{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .track-note.is-ready{background:rgba(53,199,123,.15);color:#6fe0a8}
html[data-mode="dark"] .track-note.is-delivered{background:var(--inset);color:var(--text)}
html[data-mode="dark"] .ios-install-sheet{background:var(--inset)}
html[data-mode="dark"] .badge.bg-success{background:rgba(53,199,123,.15)!important;color:#6fe0a8!important}
html[data-mode="dark"] .badge.text-bg-success{background:rgba(53,199,123,.15)!important;color:#6fe0a8!important}
html[data-mode="dark"] .badge.bg-warning{background:rgba(232,93,4,.16)!important;color:#fdba74!important}
html[data-mode="dark"] .badge.text-bg-warning{background:rgba(232,93,4,.16)!important;color:#fdba74!important}
html[data-mode="dark"] .badge.bg-danger{background:rgba(239,68,68,.16)!important;color:#f3a0a0!important}
html[data-mode="dark"] .badge.text-bg-danger{background:rgba(239,68,68,.16)!important;color:#f3a0a0!important}
html[data-mode="dark"] .badge.bg-info{background:rgba(90,169,255,.16)!important;color:#9ccaff!important}
html[data-mode="dark"] .badge.text-bg-info{background:rgba(90,169,255,.16)!important;color:#9ccaff!important}
html[data-mode="dark"] .badge.bg-secondary{background:var(--inset)!important;color:var(--text)!important}
html[data-mode="dark"] .badge.bg-light{background:var(--inset)!important;color:var(--text)!important}
html[data-mode="dark"] .badge.text-bg-secondary{background:var(--inset)!important;color:var(--text)!important}
html[data-mode="dark"] .badge.bg-primary{background:rgba(232,93,4,.16)!important;color:#fdba74!important}
html[data-mode="dark"] .badge.text-bg-primary{background:rgba(232,93,4,.16)!important;color:#fdba74!important}
html[data-mode="dark"] .entity-avatar.ok{background:rgba(53,199,123,.15);color:#6fe0a8}
html[data-mode="dark"] .entity-avatar.warn{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .settings-ico{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .perm-row:has(input:checked){background:rgba(232,93,4,.16)}
html[data-mode="dark"] .role-card .entity-avatar{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .entity-avatar.soft-warn{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .top-btn:hover{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .backup-opt:has(input:checked){background:rgba(232,93,4,.16)}
html[data-mode="dark"] .danger-zone{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .settings-ico.danger{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .log-type{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .perm-pill.on{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .perm-check:has(input:checked){background:rgba(232,93,4,.16)}
html[data-mode="dark"] .install-remain{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .install-remain.is-late{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .invoice-pay{background:var(--inset)}
html[data-mode="dark"] .student-photo{background:rgba(90,169,255,.16)}
html[data-mode="dark"] .student-code.light{background:rgba(90,169,255,.16)}
html[data-mode="dark"] .scan-result{background:rgba(53,199,123,.15)}
html[data-mode="dark"] .scan-result.out{background:rgba(242,193,78,.16)}
html[data-mode="dark"] .scan-result.err{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .visit-badge.in{background:rgba(53,199,123,.15);color:#6fe0a8}
html[data-mode="dark"] .visit-badge.out{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .visit-badge.done{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .home-hero-meta span{background:var(--inset)}
html[data-mode="dark"] .dress-cover{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .dress-cover-ph{background:var(--inset)}
html[data-mode="dark"] .dress-badge.ok{background:rgba(53,199,123,.15);color:#6fe0a8}
html[data-mode="dark"] .dress-badge.out{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .dress-badge.late{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .dress-badge.warn{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .dress-badge.off{background:var(--inset);color:var(--text)}
html[data-mode="dark"] .dress-due-badge{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .dress-due-badge.late{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .dress-upload:hover{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .dress-summary-photo.ph{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .dress-hero-cover{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .rent-panel.out{background:rgba(242,193,78,.16)}
html[data-mode="dark"] .rent-panel.late{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .rent-panel.ok{background:rgba(53,199,123,.15)}
html[data-mode="dark"] .rent-panel.off{background:var(--inset)}
html[data-mode="dark"] .rent-avatar.soft{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .rent-grid>div{background:var(--inset)}
html[data-mode="dark"] .rent-fine-note{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .cs-bar .track{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .cs-todo.warn{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .cs-todo.bad{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .cs-search kbd{background:var(--inset);color:var(--text)}
html[data-mode="dark"] .cs-ind{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .cs-stat{background:var(--inset)}
html[data-mode="dark"] .cs-warn.on{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .cs-tile.on{background:var(--inset)}
html[data-mode="dark"] .cs-bar.on{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .cs-warn.idle{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .cs-clear.show{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .cs-feed-row:nth-child(odd){background:var(--inset)}
html[data-mode="dark"] .cs-plan-ribbon{background:rgba(242,193,78,.16);color:#f2d27a}
html[data-mode="dark"] .order-money-net{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .revenue-month.now{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .revenue-renew.soon{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .wc-hall-avatar{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .wc-code{background:var(--inset)}
html[data-mode="dark"] .bk-note{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .bk-cal-cell.is-free{background:rgba(53,199,123,.15)}
html[data-mode="dark"] .bk-cal-cell.is-part{background:rgba(242,193,78,.16)}
html[data-mode="dark"] .bk-cal-cell.is-full{background:rgba(239,68,68,.16)}
html[data-mode="dark"] .bk-cal-cell.is-picked{background:rgba(232,93,4,.16)}
html[data-mode="dark"] .cf-time{background:var(--inset)}
html[data-mode="dark"] .mn-table-chip b{background:var(--inset);color:var(--text)}
html[data-mode="dark"] .mn-sticky-go{background:var(--inset)}
html[data-mode="dark"] .rp-delta.up{background:rgba(53,199,123,.15);color:#6fe0a8}
html[data-mode="dark"] .rp-delta.down{background:rgba(239,68,68,.16);color:#f3a0a0}
html[data-mode="dark"] .home-nav .ux-pill{background:var(--inset);color:var(--text)}

html[data-mode="dark"] .alert-warning{background:rgba(242,193,78,.12)!important;color:#f4d489!important;border-color:rgba(242,193,78,.3)!important}
html[data-mode="dark"] .alert-success{background:rgba(53,199,123,.12)!important;color:#8fe6bd!important;border-color:rgba(53,199,123,.3)!important}
html[data-mode="dark"] .alert-danger{background:rgba(239,68,68,.14)!important;color:#f3a0a0!important;border-color:rgba(239,68,68,.32)!important}
html[data-mode="dark"] .alert-info{background:rgba(90,169,255,.12)!important;color:#9ccaff!important;border-color:rgba(90,169,255,.3)!important}
html[data-mode="dark"] .alert .btn-close{filter:invert(1) grayscale(1)}

/* تصحيحات صفحات بستايل داخلي */
html[data-mode="dark"] .car-file-actions a{background:rgba(232,93,4,.16);color:#fdba74}
html[data-mode="dark"] .deploy-log th{background:var(--inset);color:var(--text)}
html[data-mode="dark"] .brand-scope-card{background:var(--surface);border-color:var(--border);color:var(--text)}
html[data-mode="dark"] .brand-preset-keep{background:var(--inset);color:var(--muted)}

@media (max-width:767.98px){
  html[data-mode="dark"] .track-bar{background:#161c26}
  html[data-mode="dark"] .home-nav{background:#0f141b}
  html[data-mode="dark"] .bottom-nav{background:#161c26}
}
