/* ============================================================================
   قصر العمارية — ERP LUXE SKIN
   طبقة تجميلية فقط (CSS) — لا تلمس أي منطق أو معرّفات أو بيانات.
   تُحمّل بعد التنسيقات الأصلية، وتستخدم !important فقط لتجاوز أدوات Tailwind.
   ============================================================================ */

/* ----------------------------- 1) TOKENS ---------------------------------- */
:root{
  --lux-bg:#F6F2E9;
  --lux-bg-2:#EFE9DB;
  --lux-surface:#FFFFFF;
  --lux-surface-2:#FBF8F2;
  --lux-surface-3:#F4EEE2;
  --lux-topbar:rgba(255,255,255,.88);
  --lux-ink:#1C1917;
  --lux-ink-2:#44403C;
  --lux-muted:#78716C;
  --lux-faint:#A8A29E;
  --lux-line:#E8E0D0;
  --lux-line-2:#D8CCB4;
  --lux-grid:rgba(180,131,39,.045);
  --lux-gold:#B48327;
  --lux-gold-deep:#8A641C;
  --lux-gold-text:#8A641C;
  --lux-gold-soft:#D4AF6A;
  --lux-gold-tint:#F7EFDD;
  --lux-gold-glow:rgba(180,131,39,.16);
  --lux-emerald:#0F766E;
  --lux-rose:#A12A2A;
  --lux-shadow-sm:0 1px 2px rgba(60,45,20,.05);
  --lux-shadow-md:0 10px 30px rgba(60,45,20,.07);
  --lux-shadow-lg:0 22px 60px rgba(40,30,12,.12);
  --lux-ring:0 0 0 4px rgba(180,131,39,.15);
  color-scheme: light;
}

html[data-theme="dark"]{
  --lux-bg:#0A0908;
  --lux-bg-2:#0F0D0A;
  --lux-surface:#16130E;
  --lux-surface-2:#1C1812;
  --lux-surface-3:#241F17;
  --lux-topbar:rgba(18,15,11,.88);
  --lux-ink:#F5F1E8;
  --lux-ink-2:#D8D1C4;
  --lux-muted:#A39A8B;
  --lux-faint:#7C7466;
  --lux-line:#2C261D;
  --lux-line-2:#3E3629;
  --lux-grid:rgba(212,175,106,.05);
  --lux-gold:#D4AF6A;
  --lux-gold-deep:#E7C88C;
  --lux-gold-text:#E7C88C;
  --lux-gold-soft:#B48327;
  --lux-gold-tint:#241D12;
  --lux-gold-glow:rgba(212,175,106,.14);
  --lux-emerald:#34D399;
  --lux-rose:#F87171;
  --lux-shadow-sm:0 1px 0 rgba(255,255,255,.03);
  --lux-shadow-md:0 14px 40px rgba(0,0,0,.35);
  --lux-shadow-lg:0 30px 80px rgba(0,0,0,.5);
  --lux-ring:0 0 0 4px rgba(212,175,106,.16);
  color-scheme: dark;
}

/* ----------------------------- 2) BASE ------------------------------------ */
html{ -webkit-text-size-adjust:100%; }

body{
  font-family:'IBM Plex Sans Arabic','Cairo',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:var(--lux-ink);
  background-color:var(--lux-bg)!important;
  background-image:
    radial-gradient(1100px 620px at 88% -14%, var(--lux-gold-glow), transparent 62%),
    linear-gradient(var(--lux-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--lux-grid) 1px, transparent 1px),
    linear-gradient(180deg, var(--lux-bg-2), var(--lux-bg) 460px)!important;
  background-size:auto, 46px 46px, 46px 46px, auto!important;
  background-attachment:fixed!important;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

button,input,select,textarea{ font-family:'IBM Plex Sans Arabic','Cairo',sans-serif; }

/* الخط التحريري للتطبيق فقط — الفواتير والتقارير تحتفظ بخط Cairo عبر أنماطها المضمّنة */
.app-shell, .app-shell *,
#loginOverlay, #loginOverlay *,
#modal, #modal *,
.swal2-popup, .swal2-popup *{
  font-family:'IBM Plex Sans Arabic','Cairo',sans-serif;
}

::selection{ background:rgba(212,175,106,.32); color:var(--lux-ink); }

::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--lux-line-2); border-radius:99px; }
::-webkit-scrollbar-thumb:hover{ background:var(--lux-gold-soft); }

hr{ border-color:var(--lux-line)!important; }

/* ----------------------------- 3) SIDEBAR --------------------------------- */
.app-sidebar{
  background:linear-gradient(180deg,#0D0B08 0%,#14110C 52%,#1C1710 100%);
  border-inline-end:1px solid rgba(212,175,106,.16);
  box-shadow:-16px 0 44px rgba(8,6,3,.32);
}
.sb-head{ border-bottom:1px solid rgba(212,175,106,.16); }
.sb-logo{
  background:linear-gradient(140deg,#F7E9C8 0%,#D4AF6A 48%,#B48327 100%);
  color:#241A08;
  font-weight:800;
  box-shadow:0 10px 24px rgba(180,131,39,.28), inset 0 0 0 1px rgba(255,255,255,.35);
}
.sb-title h1{ color:#F7F2E7; letter-spacing:.1px; }
.sb-title p{ color:rgba(212,175,106,.72); }

.sb-item{
  color:rgba(245,241,232,.72);
  border:1px solid transparent;
}
.sb-item:hover{
  background:rgba(212,175,106,.10);
  color:#F8F3E8;
  transform:translateX(-3px);
}
.sb-item.tab-active{
  background:linear-gradient(90deg,rgba(212,175,106,.24),rgba(212,175,106,.05))!important;
  color:#FBF6EA!important;
  box-shadow:inset 0 0 0 1px rgba(212,175,106,.28);
}
.sb-item.tab-active::before{
  background:linear-gradient(180deg,#F7E9C8,#B48327)!important;
  box-shadow:0 0 14px rgba(212,175,106,.75);
}
.sb-nav::-webkit-scrollbar{ width:4px; }
.sb-nav::-webkit-scrollbar-thumb{ background:rgba(212,175,106,.28); }

.sb-avatar{
  background:rgba(212,175,106,.16);
  color:#F3E3BF;
  box-shadow:inset 0 0 0 1px rgba(212,175,106,.25);
}
.sb-userinfo strong{ color:#F7F2E7; }
.sb-userinfo span{ color:rgba(212,175,106,.65); }
.sb-logout{
  background:rgba(212,175,106,.10);
  color:#F3E3BF;
  border:1px solid rgba(212,175,106,.18);
}
.sb-logout:hover{ background:rgba(212,175,106,.20); }

/* أيقونات التنقل الخطية */
.sb-ico{ display:inline-flex; align-items:center; justify-content:center; }
.sb-ico svg,
.bn-ico svg{
  width:19px;
  height:19px;
  display:block;
  margin:0 auto;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.sb-item.tab-active .sb-ico{ color:#E7C88C; }
.bn-item.tab-active .bn-ico{ color:var(--lux-gold-text); }

/* ----------------------------- 4) TOPBAR ---------------------------------- */
.app-topbar{
  background:var(--lux-topbar);
  border-bottom:1px solid var(--lux-line);
  box-shadow:0 1px 0 rgba(255,255,255,.35) inset;
}
.tb-logo{
  background:linear-gradient(135deg,#EFD9A8,#D4AF6A 55%,#B48327);
  color:#231A08;
  font-weight:800;
  box-shadow:0 6px 16px rgba(180,131,39,.25);
}
.tb-name{ color:var(--lux-ink); }
.tb-page{ color:var(--lux-ink); font-size:18px; }
.tb-avatar{
  background:linear-gradient(135deg,#EFD9A8,#B48327);
  color:#231A08;
}
.tb-sync{
  background:var(--lux-surface-3);
  color:var(--lux-ink-2);
  border:1px solid var(--lux-line);
}
.tb-out{
  background:var(--lux-surface-3);
  color:var(--lux-ink-2);
  border:1px solid var(--lux-line);
}
.tb-out:hover{ background:var(--lux-surface-2); color:var(--lux-ink); }

/* ----------------------------- 5) HERO ------------------------------------ */
.hero-card{
  background:
    radial-gradient(620px 260px at 88% -22%, rgba(212,175,106,.24), transparent 62%),
    radial-gradient(420px 220px at 6% 120%, rgba(212,175,106,.10), transparent 62%),
    linear-gradient(135deg,#0D0B08 0%,#171208 58%,#241B0D 100%);
  border:1px solid rgba(212,175,106,.22);
  border-radius:24px;
  box-shadow:0 26px 64px rgba(18,13,6,.36), inset 0 1px 0 rgba(255,255,255,.06);
}
.hero-card::after{ background:radial-gradient(circle,rgba(212,175,106,.30),transparent 70%); }
.hero-card::before{ background:radial-gradient(circle,rgba(212,175,106,.16),transparent 70%); }
.hero-title{ font-size:22px; letter-spacing:.2px; }
.hero-sub{ color:rgba(245,241,232,.74); }
.hero-chip{
  background:rgba(212,175,106,.08);
  border:1px solid rgba(212,175,106,.20);
  color:#F1E6D2;
  border-radius:14px;
  backdrop-filter:blur(4px);
}
.hero-chip b{ color:#F7E9C8; }

/* ----------------------------- 6) KPI CHIPS -------------------------------- */
.kpi-chip{
  border-radius:14px;
  box-shadow:inset 0 0 0 1px var(--lux-line);
}
.kpi-green{ background:var(--lux-gold-tint); box-shadow:inset 0 0 0 1px rgba(180,131,39,.20); }
.kpi-rose{ background:#FBEDEE; box-shadow:inset 0 0 0 1px #F0D2D5; }
.kpi-amber{ background:#FBF3E1; box-shadow:inset 0 0 0 1px #EEDDB6; }
.kpi-orange{ background:#FAEEE6; box-shadow:inset 0 0 0 1px #EFD8C6; }

html[data-theme="dark"] .kpi-green{ background:rgba(212,175,106,.12); box-shadow:inset 0 0 0 1px rgba(212,175,106,.22); }
html[data-theme="dark"] .kpi-rose{ background:rgba(190,60,60,.14); box-shadow:inset 0 0 0 1px rgba(190,60,60,.26); }
html[data-theme="dark"] .kpi-amber{ background:rgba(212,175,106,.10); box-shadow:inset 0 0 0 1px rgba(212,175,106,.20); }
html[data-theme="dark"] .kpi-orange{ background:rgba(200,120,60,.13); box-shadow:inset 0 0 0 1px rgba(200,120,60,.25); }

/* ----------------------------- 7) CARDS ----------------------------------- */
.card{
  background:var(--lux-surface);
  border:1px solid var(--lux-line);
  border-radius:18px;
  box-shadow:var(--lux-shadow-sm), var(--lux-shadow-md);
}
.card:hover{
  border-color:var(--lux-line-2);
  box-shadow:var(--lux-shadow-md), var(--lux-shadow-lg);
}
.card h3{ letter-spacing:.1px; }

/* ----------------------------- 8) BUTTONS --------------------------------- */
.btn-primary{
  background:linear-gradient(135deg,#9A7220 0%,#B48327 46%,#D4AF6A 100%);
  color:#fff;
  border:1px solid rgba(120,85,20,.25);
  border-radius:12px;
  letter-spacing:.1px;
  box-shadow:0 10px 24px rgba(154,114,32,.26), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-primary:hover{
  background:linear-gradient(135deg,#A87C24 0%,#C4943A 46%,#E3C287 100%);
  box-shadow:0 14px 32px rgba(154,114,32,.34);
  transform:translateY(-1px);
}
.btn-primary:active{ transform:translateY(0) scale(.99); }
.btn-primary:disabled{ opacity:.55; filter:grayscale(.25); transform:none; box-shadow:none; }

.btn-icon{ border-radius:10px; }

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:none;
  box-shadow:var(--lux-ring);
}

.auth-tab-active{
  background:linear-gradient(135deg,#9A7220,#C39A45);
  color:#fff;
  box-shadow:0 8px 18px rgba(154,114,32,.25);
}
.auth-tab-inactive{
  background:var(--lux-surface-3);
  color:var(--lux-ink-2);
}

/* أزرار رمادية (ثانوية) */
.app-main button.bg-slate-200,
.app-main button.bg-slate-300,
.modal button.bg-slate-200,
.modal button.bg-slate-300,
#loginOverlay button.bg-slate-200,
#loginOverlay button.bg-slate-300{
  background:var(--lux-surface-3)!important;
  color:var(--lux-ink-2)!important;
  border:1px solid var(--lux-line);
  border-radius:11px;
}

/* أزرار دلالية بألوان جوهرية هادئة */
.app-main .bg-green-600{ background:#0F766E!important; }
.app-main .bg-green-600:hover{ background:#0B5F58!important; }
.app-main .bg-red-600{ background:#A12A2A!important; }
.app-main .bg-red-600:hover{ background:#862222!important; }
.app-main .bg-purple-600{ background:#5B3E9E!important; }
.app-main .bg-purple-600:hover{ background:#4A3282!important; }
.app-main .bg-blue-600{ background:#2F5D8A!important; }
.app-main .bg-blue-600:hover{ background:#264B70!important; }
.app-main .bg-blue-500{ background:#3B6E9E!important; }
.app-main .bg-blue-500:hover{ background:#2F5D8A!important; }
.app-main .bg-indigo-600{ background:#3F4A8A!important; }
.app-main .bg-indigo-600:hover{ background:#333C70!important; }
.app-main .bg-emerald-600{ background:#0F766E!important; }
.app-main .bg-teal-600{ background:#0F766E!important; }

/* ----------------------------- 9) FORMS ----------------------------------- */
.app-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
.app-main select,
.app-main textarea,
#loginOverlay input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#modal select,
#modal textarea{
  background:var(--lux-surface-2)!important;
  border:1px solid var(--lux-line)!important;
  border-radius:11px!important;
  color:var(--lux-ink)!important;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.app-main input:focus,
.app-main select:focus,
.app-main textarea:focus,
#loginOverlay input:focus,
#modal input:focus,
#modal select:focus,
#modal textarea:focus{
  border-color:var(--lux-gold)!important;
  background:var(--lux-surface)!important;
  box-shadow:var(--lux-ring)!important;
}
.app-main input::placeholder,
#loginOverlay input::placeholder,
#modal input::placeholder{ color:var(--lux-faint); }

input[type="checkbox"],input[type="radio"]{ accent-color:var(--lux-gold); }

/* ----------------------------- 10) TABLES --------------------------------- */
.app-main #salesTable thead,
.app-main #purchasesTable thead{
  background:var(--lux-surface-3)!important;
  color:var(--lux-ink-2)!important;
  border-bottom:1px solid var(--lux-line);
}
.app-main #salesTable th,
.app-main #purchasesTable th{ font-weight:700; letter-spacing:.1px; }
.app-main #salesTable td,
.app-main #purchasesTable td{ border-bottom:1px solid var(--lux-line); }
.app-main #salesTable tbody tr:nth-child(even),
.app-main #purchasesTable tbody tr:nth-child(even){ background:var(--lux-surface-2)!important; }
.app-main #salesTable tbody tr:hover,
.app-main #purchasesTable tbody tr:hover{ background:var(--lux-gold-tint)!important; }

.col-filter{
  background:var(--lux-surface)!important;
  border:1px solid var(--lux-line)!important;
  color:var(--lux-ink)!important;
  border-radius:7px!important;
}
.col-filter:focus,
.rep-filter:focus{
  border-color:var(--lux-gold)!important;
  box-shadow:0 0 0 2px rgba(180,131,39,.14)!important;
}
.col-filter-row th{ background:var(--lux-surface-3)!important; border-bottom:1px solid var(--lux-line)!important; }
.col-filter-row input::placeholder{ color:var(--lux-faint); }

/* ----------------------------- 11) BADGES --------------------------------- */
.badge{
  border:1px solid transparent;
  border-radius:999px;
  padding:3px 10px;
  letter-spacing:.2px;
  font-weight:700;
}
.badge-full{ background:#E9F5EE; color:#14603C; border-color:#C7E6D3; }
.badge-deposit{ background:#FBF3E1; color:#7A5A18; border-color:#EEDCB2; }
.badge-unpaid{ background:#FBEDEE; color:#9B2C2C; border-color:#F1D2D4; }
.badge-personal{ background:#F2EDFB; color:#5B3E9E; border-color:#DFD3F4; }
.badge-refunded{ background:#EAF0FA; color:#334C9E; border-color:#D3DEF2; }

html[data-theme="dark"] .badge-full{ background:rgba(52,211,153,.12); color:#86EFC9; border-color:rgba(52,211,153,.22); }
html[data-theme="dark"] .badge-deposit{ background:rgba(212,175,106,.12); color:#E7C88C; border-color:rgba(212,175,106,.24); }
html[data-theme="dark"] .badge-unpaid{ background:rgba(248,113,113,.12); color:#FCA5A5; border-color:rgba(248,113,113,.24); }
html[data-theme="dark"] .badge-personal{ background:rgba(167,139,250,.12); color:#C4B5FD; border-color:rgba(167,139,250,.24); }
html[data-theme="dark"] .badge-refunded{ background:rgba(129,140,248,.12); color:#A5B4FC; border-color:rgba(129,140,248,.24); }

/* ----------------------------- 12) CALENDAR -------------------------------- */
.calendar-day{
  background:var(--lux-surface);
  border:1px solid var(--lux-line)!important;
  border-radius:12px;
}
.calendar-day:hover{
  background:var(--lux-gold-tint)!important;
  border-color:var(--lux-gold-soft)!important;
}
.day-unpaid{
  background:rgba(190,60,60,.06)!important;
  border-color:rgba(190,60,60,.32)!important;
}
.day-deposit{
  background:rgba(180,131,39,.08)!important;
  border-color:rgba(180,131,39,.38)!important;
}
.day-completed{
  background:rgba(15,118,110,.07)!important;
  border-color:rgba(15,118,110,.32)!important;
}
.day-personal{
  background:rgba(124,58,237,.07)!important;
  border-color:rgba(124,58,237,.30)!important;
}
html[data-theme="dark"] .day-unpaid{ background:rgba(248,113,113,.07)!important; border-color:rgba(248,113,113,.30)!important; }
html[data-theme="dark"] .day-deposit{ background:rgba(212,175,106,.08)!important; border-color:rgba(212,175,106,.32)!important; }
html[data-theme="dark"] .day-completed{ background:rgba(52,211,153,.07)!important; border-color:rgba(52,211,153,.28)!important; }
html[data-theme="dark"] .day-personal{ background:rgba(167,139,250,.07)!important; border-color:rgba(167,139,250,.28)!important; }

/* ----------------------------- 13) MODALS --------------------------------- */
.overlay{
  background:radial-gradient(900px 600px at 80% 0%, rgba(212,175,106,.16), transparent 60%),
             linear-gradient(180deg,#0B0906 0%,#141008 60%,#0B0906 100%);
}
.modal{
  background:rgba(8,6,3,.62);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.modal-inner{
  background:var(--lux-surface);
  border:1px solid var(--lux-line-2);
  border-radius:22px!important;
  box-shadow:0 40px 120px rgba(0,0,0,.45);
}
.modal .bg-white{ background:var(--lux-surface)!important; }
.modal .border-b{ border-color:var(--lux-line)!important; }
#invoiceContent{ background:var(--lux-surface-3)!important; }

/* مستندات الفاتورة/التقرير تبقى فاتحة دائماً (للطباعة والوضوح) */
.inv-wrapper{ background:#fff!important; color:#0f172a!important; }
.rep-wrapper{ background:#fff!important; color:#0f172a!important; }
html[data-theme="dark"] #invoiceModal .modal-inner,
html[data-theme="dark"] #reportModal .modal-inner{ background:#fff!important; color:#1C1917!important; }
html[data-theme="dark"] #invoiceModal .bg-white,
html[data-theme="dark"] #reportModal .bg-white{ background:#fff!important; }
html[data-theme="dark"] #invoiceModal .text-slate-800,
html[data-theme="dark"] #reportModal .text-slate-800{ color:#0f172a!important; }
html[data-theme="dark"] #invoiceContent{ background:#EDE6D8!important; }
html[data-theme="dark"] #reportModal .bg-slate-50{ background:#FBF8F2!important; }
html[data-theme="dark"] #reportModal .bg-slate-100{ background:#F4EEE2!important; }
html[data-theme="dark"] #reportModal .border-b,
html[data-theme="dark"] #reportModal .border{ border-color:#E8E0D0!important; }
html[data-theme="dark"] #reportFilters{ color:#57534E!important; }

/* ----------------------------- 14) LOGIN ---------------------------------- */
#loginOverlay .bg-white{
  background:var(--lux-surface)!important;
  border:1px solid var(--lux-line-2);
  border-radius:24px!important;
  box-shadow:0 40px 110px rgba(0,0,0,.55);
}
#brandLogoLogin{
  background:linear-gradient(140deg,#F7E9C8 0%,#D4AF6A 50%,#B48327 100%)!important;
  color:#241A08!important;
  font-weight:800;
  box-shadow:0 14px 30px rgba(180,131,39,.30), inset 0 0 0 1px rgba(255,255,255,.35);
}
#brandNameLogin{ color:var(--lux-gold-text)!important; font-weight:800; letter-spacing:.2px; }
#loginOverlay .bg-slate-50{ background:var(--lux-surface-2)!important; border:1px solid var(--lux-line); }
#loginOverlay .bg-slate-100{ background:var(--lux-surface-3)!important; }
#loginOverlay .bg-teal-50{ background:var(--lux-gold-tint)!important; }
#loginOverlay .border-teal-200{ border-color:#EAD7A8!important; }
#loginOverlay .text-teal-800{ color:#7A5A18!important; }
#loginOverlay .border-slate-200{ border-color:var(--lux-line)!important; }
#loginOverlay .text-slate-500,
#loginOverlay .text-slate-400{ color:var(--lux-muted)!important; }

.mode-badge{ border-radius:9px; letter-spacing:.1px; }
.mode-local{ background:#FBF1D8; color:#7A5A18; border:1px solid #EAD7A8; }
.mode-firebase{ background:#E9F5EE; color:#14603C; border:1px solid #BFE3CE; }
html[data-theme="dark"] .mode-local{ background:rgba(212,175,106,.12); color:#E7C88C; border-color:rgba(212,175,106,.24); }
html[data-theme="dark"] .mode-firebase{ background:rgba(52,211,153,.12); color:#86EFC9; border-color:rgba(52,211,153,.22); }

/* ----------------------------- 15) BOTTOM NAV ------------------------------ */
#bottomNav{
  background:var(--lux-topbar);
  border-top:1px solid var(--lux-line);
  box-shadow:0 -10px 30px rgba(30,22,8,.08);
}
.bn-item{ color:var(--lux-muted); }
.bn-item.tab-active{ color:var(--lux-gold-text)!important; }
#bottomNav .tab-btn.tab-active{ background:transparent!important; color:var(--lux-gold-text)!important; }
#bottomNav .tab-btn.tab-active::before{
  background:linear-gradient(90deg,#B48327,#D4AF6A)!important;
}

/* ----------------------------- 16) MISC ----------------------------------- */
.sync-online{ background:#22C55E; box-shadow:0 0 0 3px rgba(34,197,94,.15); }
.sync-offline{ background:#F59E0B; box-shadow:0 0 0 3px rgba(245,158,11,.15); }
.progress-bar{ background:var(--lux-surface-3); }
.progress-fill{ background:linear-gradient(90deg,#9A7220,#D4AF6A); }

.staging-card{
  border:1px dashed rgba(180,131,39,.55);
  background:var(--lux-gold-tint);
}
.staging-failed{
  border:1px solid rgba(190,60,60,.4);
  background:rgba(190,60,60,.06);
}
.arch-row{ border-bottom:1px solid var(--lux-line); }
.arch-row:hover{ background:var(--lux-surface-2); }
.arch-thumb{ border:1px solid var(--lux-line); border-radius:8px; }

#cloudSyncInfo{ background:var(--lux-surface-2)!important; border:1px solid var(--lux-line); }

/* ----------------------------- 17) TAILWIND OVERRIDES --------------------- */
.app-main .text-slate-800{ color:var(--lux-ink)!important; }
.app-main .text-slate-700{ color:var(--lux-ink)!important; }
.app-main .text-slate-600{ color:var(--lux-ink-2)!important; }
.app-main .text-slate-500{ color:var(--lux-muted)!important; }
.app-main .text-slate-400{ color:var(--lux-faint)!important; }

.app-main .bg-white{ background:var(--lux-surface)!important; }
.app-main .bg-slate-50{ background:var(--lux-surface-2)!important; }
.app-main .bg-slate-100{ background:var(--lux-surface-3)!important; }
.app-main .bg-slate-200,
.app-main .bg-slate-300{ background:var(--lux-surface-3)!important; }
.app-main .border-slate-200,
.app-main .border-slate-300,
.app-main .border-slate-100,
.app-main .border{ border-color:var(--lux-line)!important; }

#modal .text-slate-800,
#modal .text-slate-700{ color:var(--lux-ink)!important; }
#modal .text-slate-600{ color:var(--lux-ink-2)!important; }
#modal .text-slate-500{ color:var(--lux-muted)!important; }
#modal .text-slate-400{ color:var(--lux-faint)!important; }
#modal .bg-white{ background:var(--lux-surface)!important; }
#modal .bg-slate-50{ background:var(--lux-surface-2)!important; }
#modal .bg-slate-100{ background:var(--lux-surface-3)!important; }
#modal .border-slate-200,#modal .border-slate-300,#modal .border{ border-color:var(--lux-line)!important; }

#reportModal .bg-slate-50{ background:var(--lux-surface-2)!important; }
#reportModal .bg-slate-100{ background:var(--lux-surface-3)!important; }
#reportModal .border-b{ border-color:var(--lux-line)!important; }

/* الوضع الليلي — نصوص وأسطح داخل التطبيق فقط */
html[data-theme="dark"] .app-main .text-slate-800,
html[data-theme="dark"] .app-main .text-slate-700,
html[data-theme="dark"] .app-main .text-slate-600{ color:var(--lux-ink)!important; }
html[data-theme="dark"] .app-main .text-slate-500{ color:var(--lux-muted)!important; }
html[data-theme="dark"] .app-main .text-slate-400{ color:var(--lux-faint)!important; }
html[data-theme="dark"] .app-main .bg-white{ background:var(--lux-surface)!important; }
html[data-theme="dark"] .app-main .bg-slate-50{ background:var(--lux-surface-2)!important; }
html[data-theme="dark"] .app-main .bg-slate-100{ background:var(--lux-surface-3)!important; }
html[data-theme="dark"] .app-main .bg-slate-200,
html[data-theme="dark"] .app-main .bg-slate-300{ background:var(--lux-surface-3)!important; }
html[data-theme="dark"] .app-main .border,
html[data-theme="dark"] .app-main .border-slate-100,
html[data-theme="dark"] .app-main .border-slate-200,
html[data-theme="dark"] .app-main .border-slate-300{ border-color:var(--lux-line)!important; }

html[data-theme="dark"] #modal .text-slate-800,
html[data-theme="dark"] #modal .text-slate-700,
html[data-theme="dark"] #modal .text-slate-600{ color:var(--lux-ink)!important; }
html[data-theme="dark"] #modal .text-slate-500{ color:var(--lux-muted)!important; }
html[data-theme="dark"] #modal .text-slate-400{ color:var(--lux-faint)!important; }
html[data-theme="dark"] #modal .bg-white{ background:var(--lux-surface)!important; }
html[data-theme="dark"] #modal .bg-slate-50{ background:var(--lux-surface-2)!important; }
html[data-theme="dark"] #modal .bg-slate-100{ background:var(--lux-surface-3)!important; }

/* تلوين دلالي هادئ */
.app-main .text-green-700{ color:#146C43!important; }
.app-main .text-green-600{ color:#15803D!important; }
.app-main .text-red-700{ color:#9B2C2C!important; }
.app-main .text-red-600{ color:#B23B3B!important; }
.app-main .text-red-500{ color:#C25050!important; }
.app-main .text-amber-700{ color:#8A641C!important; }
.app-main .text-amber-600{ color:#9A7220!important; }
.app-main .text-orange-600{ color:#B45309!important; }
.app-main .text-teal-800{ color:#0F5E5A!important; }
.app-main .text-teal-600{ color:#0F766E!important; }
.app-main .text-blue-600{ color:#1D4ED8!important; }
.app-main .text-indigo-700{ color:#3730A3!important; }
.app-main .text-purple-600{ color:#6D28D9!important; }
.app-main .text-rose-600{ color:#9F1239!important; }

.app-main .bg-green-50{ background:rgba(15,118,110,.07)!important; }
.app-main .bg-green-100{ background:rgba(15,118,110,.12)!important; }
.app-main .bg-teal-50{ background:var(--lux-gold-tint)!important; }
.app-main .bg-red-50{ background:rgba(190,60,60,.07)!important; }
.app-main .bg-red-100{ background:rgba(190,60,60,.12)!important; }
.app-main .bg-amber-50{ background:rgba(180,131,39,.08)!important; }
.app-main .bg-blue-50{ background:rgba(29,78,216,.07)!important; }
.app-main .bg-indigo-50{ background:rgba(55,48,163,.07)!important; }
.app-main .bg-purple-50{ background:rgba(109,40,217,.07)!important; }
.app-main .bg-orange-50{ background:rgba(180,83,9,.07)!important; }

html[data-theme="dark"] .app-main .text-green-700,
html[data-theme="dark"] .app-main .text-green-600{ color:#6EE7B7!important; }
html[data-theme="dark"] .app-main .text-red-700,
html[data-theme="dark"] .app-main .text-red-600,
html[data-theme="dark"] .app-main .text-red-500{ color:#FCA5A5!important; }
html[data-theme="dark"] .app-main .text-amber-700,
html[data-theme="dark"] .app-main .text-amber-600{ color:#E7C88C!important; }
html[data-theme="dark"] .app-main .text-orange-600{ color:#FDBA74!important; }
html[data-theme="dark"] .app-main .text-teal-800,
html[data-theme="dark"] .app-main .text-teal-600{ color:#5EEAD4!important; }
html[data-theme="dark"] .app-main .text-blue-600{ color:#93C5FD!important; }
html[data-theme="dark"] .app-main .text-indigo-700{ color:#A5B4FC!important; }
html[data-theme="dark"] .app-main .text-purple-600{ color:#C4B5FD!important; }
html[data-theme="dark"] .app-main .text-rose-600{ color:#FDA4AF!important; }

/* أرقام KPI الملوّنة داخل البطاقات */
html[data-theme="dark"] #kpiRevenue{ color:#E7C88C!important; }
html[data-theme="dark"] #calcVat,
html[data-theme="dark"] #calcNet{ color:#E7C88C!important; }

/* ----------------------------- 18) SWEETALERT ----------------------------- */
.swal2-popup{
  font-family:'IBM Plex Sans Arabic','Cairo',sans-serif!important;
  background:var(--lux-surface)!important;
  color:var(--lux-ink)!important;
  border:1px solid var(--lux-line-2);
  border-radius:22px!important;
  box-shadow:0 40px 110px rgba(0,0,0,.45);
}
.swal2-title{ color:var(--lux-ink)!important; font-weight:800!important; }
.swal2-html-container{ color:var(--lux-ink-2)!important; }
.swal2-input,.swal2-select,.swal2-textarea{
  background:var(--lux-surface-2)!important;
  border:1px solid var(--lux-line)!important;
  color:var(--lux-ink)!important;
  border-radius:11px!important;
}
.swal2-input:focus,.swal2-select:focus,.swal2-textarea:focus{
  border-color:var(--lux-gold)!important;
  box-shadow:var(--lux-ring)!important;
}
.swal2-confirm{
  background:linear-gradient(135deg,#9A7220,#C39A45)!important;
  border-radius:11px!important;
  box-shadow:0 10px 24px rgba(154,114,32,.26)!important;
}
.swal2-cancel{
  background:var(--lux-surface-3)!important;
  color:var(--lux-ink-2)!important;
  border-radius:11px!important;
}
.swal2-actions{gap:8px}
.swal2-icon.swal2-warning{ border-color:#D4AF6A!important; color:#B48327!important; }
.swal2-icon.swal2-success{ border-color:#34D399!important; }
.swal2-icon.swal2-success [class^=swal2-success-line]{ background:#10B981!important; }
.swal2-icon.swal2-success .swal2-success-ring{ border-color:rgba(16,185,129,.35)!important; }

/* ----------------------------- 19) THEME TOGGLE ---------------------------- */
.lux-theme-btn{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid var(--lux-line-2);
  background:var(--lux-surface-2);
  color:var(--lux-ink-2);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex:none;
  transition:color .2s, background .2s, border-color .2s, transform .2s;
  box-shadow:var(--lux-shadow-sm);
}
.lux-theme-btn:hover{
  color:var(--lux-gold-text);
  border-color:var(--lux-gold-soft);
  background:var(--lux-gold-tint);
  transform:translateY(-1px);
}
.lux-theme-btn svg{ width:18px; height:18px; display:block; }
.lux-theme-login{
  position:fixed;
  top:16px;
  inset-inline-end:16px;
  z-index:120;
  background:rgba(255,255,255,.08);
  border-color:rgba(212,175,106,.30);
  color:#F3E3BF;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.lux-theme-login:hover{ background:rgba(212,175,106,.18); color:#F7E9C8; }

/* ----------------------------- 20) RESPONSIVE ------------------------------ */
@media (max-width:1023px){
  .app-topbar{ padding:10px 13px; }
  .app-main{ padding:16px 12px 104px; }
  .hero-card{ border-radius:22px; padding:20px; }
  .hero-title{ font-size:20px; }
  .modal-inner{ border-radius:18px; }
}

/* ----------------------------- 21) PRINT ----------------------------------- */
@media print{
  body{ background:#fff!important; }
  .app-sidebar,.app-topbar,#bottomNav,.lux-theme-btn{ display:none!important; }
}

/* ----------------------------- 22) REDUCED MOTION -------------------------- */
@media (prefers-reduced-motion: reduce){
  *{ transition:none!important; animation:none!important; }
}
