/* =========================================================================
   عزم AZM — ملف التنسيق الموحد (المرجع الذهبي v3.0، الفصلان 2 و10)
   ملف واحد لكل الشاشات. لا أنماط داخل الصفحات ولا !important (عدا قاعدة [hidden]).
   ========================================================================= */
[hidden] { display: none !important; }

@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(../fonts/plex-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 500; font-display: swap; src: url(../fonts/plex-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(../fonts/plex-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(../fonts/plex-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(../fonts/plex-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Plex; font-weight: 500; font-display: swap; src: url(../fonts/plex-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(../fonts/plex-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(../fonts/plex-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --navy: #0F2A4A;
  --navy-2: color-mix(in srgb, var(--navy) 84%, #fff);
  --amber: #F3A524;
  --amber-ink: color-mix(in srgb, var(--amber) 44%, #000);
  --brand: var(--navy);           /* لون الورشة: يُستبدل من الإعدادات */
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #1B2A3D;
  --muted: #5B6B7F;
  --line: #E1E6ED;
  --line-2: #CBD3DD;
  --ok: #1E8449;
  --ok-bg: #EAF6EE;
  --bad: #C0392B;
  --bad-bg: #FDEDEC;
  --warn: #9A6B00;
  --warn-bg: #FEF5E1;
  --info-bg: #E8F1FA;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 42, 74, .05), 0 4px 14px rgba(15, 42, 74, .06);
  --sidebar: 268px;
  --touch: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font, Plex), Plex, Tahoma, sans-serif; font-size: var(--fs, 15px); line-height: 1.65; color: var(--ink); background: var(--bg); }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
bdi, .ltr { unicode-bidi: isolate; }
.ltr { direction: ltr; display: inline-block; }
h1, h2, h3 { color: var(--navy); line-height: 1.35; margin: 0; }
h1 { font-size: calc(24px * var(--fz, 1)); font-weight: 700; }
h2 { font-size: calc(18px * var(--fz, 1)); font-weight: 600; }
h3 { font-size: calc(15.5px * var(--fz, 1)); font-weight: 600; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke-width: 1.8; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy); color: #D5DEE8; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .logo { width: 44px; height: 44px; border-radius: 11px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: 0 0 44px; }
.sidebar-brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand .logo.placeholder { background: var(--brand); color: #fff; font-weight: 700; font-size: calc(18px * var(--fz, 1)); border: 2px solid rgba(255,255,255,.25); }
.sidebar-brand b { display: block; color: #fff; font-size: calc(14.5px * var(--fz, 1)); line-height: 1.35; }
.sidebar-brand span { font-size: calc(12px * var(--fz, 1)); color: #9FB0C4; }
.nav { padding: 10px 10px 18px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group-label { font-size: calc(11.5px * var(--fz, 1)); color: #8FA3BA; padding: 0 10px 6px; font-weight: 600; letter-spacing: .2px; }
.nav a, .nav .nav-soon { display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 8px 10px; border-radius: 9px; color: #D5DEE8; font-size: calc(14px * var(--fz, 1)); }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(243,165,36,.14); color: #fff; box-shadow: inset -3px 0 0 var(--amber); }
.nav a .icon { color: var(--amber); }
.nav .nav-no { font-size: calc(11px * var(--fz, 1)); color: #7E93AA; margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.nav .nav-soon { opacity: .45; cursor: default; }
.nav .nav-soon em { font-style: normal; font-size: calc(10.5px * var(--fz, 1)); margin-inline-start: auto; background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 9px; }
.nav .nav-sub { padding-inline-start: 40px; min-height: 36px; font-size: calc(13px * var(--fz, 1)); }
.sidebar-foot { padding: 14px 18px; font-size: calc(11.5px * var(--fz, 1)); color: #7E93AA; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; }
.sidebar-foot svg { width: 18px; height: 18px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 24px; min-height: 64px; }
.topbar .menu-btn { display: none; }
.topbar .spacer { flex: 1; }
.branch-switch { display: flex; align-items: center; gap: 8px; }
.branch-switch select { min-height: 40px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 10px; min-height: var(--touch); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: calc(13px * var(--fz, 1)); }
.user-menu .who { line-height: 1.25; }
.user-menu .who b { display: block; font-size: calc(14px * var(--fz, 1)); }
.user-menu .who span { font-size: calc(12px * var(--fz, 1)); color: var(--muted); }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; padding: 6px; }
.menu-pop form { margin: 0; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; font: inherit; color: var(--ink); border-radius: 8px; cursor: pointer; text-align: start; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--bg); text-decoration: none; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.content { padding: 24px 28px; width: 100%; max-width: none; }
.w-boxed .content { max-width: 1320px; margin-inline: auto; }
.d-compact .content { padding: 16px 18px; }
.d-compact .home, .d-compact .home-main { gap: 14px; }
.d-compact .mod-card { padding: 14px; min-height: 140px; }
.d-compact .kpi { padding: 12px 14px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .module-no { color: var(--amber-ink); font-size: calc(12.5px * var(--fz, 1)); font-weight: 600; background: var(--warn-bg); padding: 1px 9px; border-radius: 9px; display: inline-block; margin-bottom: 6px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: calc(13px * var(--fz, 1)); color: var(--muted); margin-bottom: 6px; }

/* ---------------------------------------------------------------- elements */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: calc(16px * var(--fz, 1)); flex: 1; }
.card + .card, .card + form, form + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch); padding: 8px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: calc(14.5px * var(--fz, 1)); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(243,165,36,.55); outline-offset: 2px; }
.btn-primary { color: var(--navy); background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 55%, #fff) 0%, var(--amber) 48%, color-mix(in srgb, var(--amber) 88%, #000) 52%, color-mix(in srgb, var(--amber) 80%, #fff) 100%);
  border-color: color-mix(in srgb, var(--amber) 85%, #000); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 10px -4px color-mix(in srgb, var(--amber) 80%, transparent); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); border-color: var(--line-2); }
.btn-danger { background: #fff; color: var(--bad); border-color: #F1B9B2; }
.btn-ghost { background: transparent; color: var(--navy-2); padding-inline: 10px; }
.btn-sm { min-height: 36px; padding: 5px 12px; font-size: calc(13.5px * var(--fz, 1)); }
.btn-block { width: 100%; }
.icon-btn { width: var(--touch); height: var(--touch); display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }

label, .label { display: block; font-weight: 600; font-size: calc(14px * var(--fz, 1)); color: var(--navy); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { display: block; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=time], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: var(--touch); padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font: inherit; font-size: calc(15px * var(--fz, 1)); color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(243,165,36,.18); }
input[type=color] { width: 56px; height: var(--touch); padding: 4px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
input.ltr-input { direction: ltr; text-align: right; }
.is-invalid { border-color: var(--bad) !important; }
.error-text { color: var(--bad); font-size: calc(13px * var(--fz, 1)); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); min-height: 36px; cursor: pointer; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.form-actions { display: flex; gap: 10px; justify-content: flex-start; padding-top: 6px; flex-wrap: wrap; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: calc(14.5px * var(--fz, 1)); }
.alert-ok { background: var(--ok-bg); color: #145A32; }
.alert-bad { background: var(--bad-bg); color: #922B21; }
.alert-warn { background: var(--warn-bg); color: #6E4C00; }
.alert-info { background: var(--info-bg); color: #1F4E79; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12.5px * var(--fz, 1)); font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #EEF1F5; color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: #1F5F99; }
.badge-navy { background: var(--navy); color: #fff; }

/* tables → cards on mobile */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: calc(14.5px * var(--fz, 1) * var(--tz, 1)); }
.table th { text-align: start; font-size: calc(13px * var(--fz, 1) * var(--tz, 1)); color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFBFD; }
.table .t-actions { text-align: end; white-space: nowrap; }
.row-muted td { color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--line-2); margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; min-height: var(--touch); display: flex; align-items: center; gap: 8px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--amber); }
.tabs a:hover { text-decoration: none; color: var(--navy); }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: #fff; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination .disabled { opacity: .45; }

/* ---------------------------------------------------------------- home */
.home { display: flex; flex-direction: column; gap: 20px; }
.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 26px 30px; border-radius: calc(var(--radius) + 4px); color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #1E4D7E 0%, var(--navy) 55%, #0A1F37 100%); }
.hero::before { content: ""; position: absolute; inset-inline-start: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; border: 42px solid rgba(243,165,36,.10); }
.hero::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: 6px; background: var(--amber); }
.hero-text { flex: 1; min-width: 240px; position: relative; z-index: 1; }
.hero-kicker { display: inline-block; font-size: calc(13px * var(--fz, 1)); color: var(--amber); font-weight: 600; margin-bottom: 4px; }
.hero h1 { color: #fff; font-size: calc(28px * var(--fz, 1)); }
.hero p { color: #C8D3E0; margin: 6px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero .dot { opacity: .5; padding: 0 4px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.btn-glass { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.22); }
.btn-glass:hover { background: rgba(255,255,255,.18); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi::before { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: 4px; background: var(--kc); }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,42,74,.10); }
.kpi-ico { width: 52px; height: 52px; border-radius: calc(var(--radius) - 2px); display: grid; place-items: center; flex: 0 0 52px;
  color: var(--kc); background: color-mix(in srgb, var(--kc) 12%, #fff); }
.kpi-ico .icon { width: 26px; height: 26px; }
.kpi-body b { display: block; font-size: calc(30px * var(--fz, 1)); line-height: 1.05; color: var(--navy); font-weight: 700; }
.kpi-body span { display: block; color: var(--muted); font-size: calc(13.5px * var(--fz, 1)); margin-top: 4px; }
.kpi-body small { display: block; color: #9AA6B5; font-size: calc(12px * var(--fz, 1)); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.home-grid.has-side { grid-template-columns: minmax(0, 1fr) 340px; }
.home-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.mod-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mod-group-bar { width: 6px; height: 22px; border-radius: 3px; background: var(--gc); }
.mod-group-head h2 { font-size: calc(17px * var(--fz, 1)); }
.mod-group-count { font-size: calc(12px * var(--fz, 1)); font-weight: 600; color: var(--gc); background: color-mix(in srgb, var(--gc) 10%, #fff); padding: 1px 9px; border-radius: 999px; }

.mod-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
:root[style*="--cols"] .mod-grid { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.mod-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; min-height: 168px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.mod-card::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--gc); opacity: .85; }
a.mod-card:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--gc) 45%, #fff); box-shadow: 0 12px 28px rgba(15,42,74,.12); }
.mod-ico { width: 54px; height: 54px; border-radius: calc(var(--radius) - 2px); display: grid; place-items: center;
  color: #fff; background: var(--gc); box-shadow: 0 6px 14px color-mix(in srgb, var(--gc) 35%, transparent); }
.mod-ico .icon { width: 27px; height: 27px; stroke-width: 1.7; }
.mod-text { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mod-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mod-no { font-size: calc(12px * var(--fz, 1)); font-weight: 700; color: var(--gc); letter-spacing: .5px; }
.mod-card b { font-size: calc(17px * var(--fz, 1)); color: var(--navy); line-height: 1.4; }
.mod-desc { font-size: calc(13.5px * var(--fz, 1)); color: var(--muted); line-height: 1.6; }
.mod-go { position: absolute; inset-inline-start: 18px; top: 22px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); color: var(--navy); transition: background .15s, color .15s; }
a.mod-card:hover .mod-go { background: var(--gc); color: #fff; }
.mod-card.is-soon { background: #FBFCFD; box-shadow: none; }
.mod-card.is-soon .mod-ico { background: color-mix(in srgb, var(--gc) 14%, #fff); color: var(--gc); box-shadow: none; }
.mod-card.is-soon b { color: #4A5B70; }

/* النمط المدمج للكروت */
.cards-compact .mod-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.cards-compact .mod-card { flex-direction: row; align-items: center; min-height: 0; padding: 14px 16px; gap: 14px; }
.cards-compact .mod-ico { width: 44px; height: 44px; flex: 0 0 44px; }
.cards-compact .mod-ico .icon { width: 22px; height: 22px; }
.cards-compact .mod-desc { display: none; }
.cards-compact .mod-card b { font-size: calc(15.5px * var(--fz, 1)); }
.cards-compact .mod-go { position: static; flex: 0 0 32px; }

.home-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.side-card .card-head h2 { font-size: calc(15px * var(--fz, 1)); }
.facts { margin: 0; padding: 8px 20px 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: calc(14px * var(--fz, 1)); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--navy); }
.timeline { list-style: none; margin: 0; padding: 10px 20px 14px; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 5px; top: 24px; bottom: -6px; width: 2px; background: var(--line); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: #9AA6B5; margin-top: 6px; flex: 0 0 12px; box-shadow: 0 0 0 3px #fff; }
.tl-created { background: var(--ok); } .tl-updated { background: #2E86C1; } .tl-deleted { background: var(--bad); } .tl-login { background: var(--amber); }
.timeline b { display: block; font-size: calc(13.5px * var(--fz, 1)); color: var(--ink); font-weight: 600; }
.timeline small { font-size: calc(12px * var(--fz, 1)); color: var(--muted); }

/* معاينة المظهر في الإعدادات */
.ui-preview { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 16px; background: var(--bg); }

/* permission matrix */
.perm-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.perm-group-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #FAFBFC; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--navy); }
.perm-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; padding: 10px 14px; }

/* diff */
.diff { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--fz, 1)); }
.diff th, .diff td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.diff .old { background: #FFF5F4; color: #922B21; }
.diff .new { background: #F3FBF6; color: #145A32; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: calc(13px * var(--fz, 1)); direction: ltr; unicode-bidi: isolate; }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 480px); background: var(--bg); }
.auth-brand { background: var(--navy); color: #fff; padding: 48px clamp(28px, 6vw, 80px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 6px; background: var(--amber); }
.auth-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255,255,255,.035); inset-inline-start: -180px; bottom: -220px; }
.brand-lockup { display: flex; align-items: center; gap: 18px; }
.brand-lockup .word b { display: block; font-size: calc(54px * var(--fz, 1)); line-height: 1; font-weight: 700; }
.brand-lockup .word span { display: block; letter-spacing: 9px; font-weight: 600; color: #C8D3E0; margin-top: 6px; direction: ltr; text-align: end; }
.brand-rule { width: 54px; height: 5px; border-radius: 3px; background: var(--amber); margin: 18px 0 10px; }
.auth-brand .tag { color: #C8D3E0; font-size: calc(16px * var(--fz, 1)); }
.auth-brand .slogan { font-size: calc(clamp(26px, 3vw, 38px) * var(--fz, 1)); font-weight: 700; line-height: 1.45; max-width: 520px; position: relative; z-index: 1; }
.auth-brand .slogan em { font-style: normal; color: var(--amber); }
.auth-brand .foot { color: #8FA3BA; font-size: calc(13px * var(--fz, 1)); position: relative; z-index: 1; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 4vw, 48px); background: #fff; }
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-card .tenant-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card .tenant-head img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); }
.auth-card h1 { font-size: calc(22px * var(--fz, 1)); margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #EEF1F5; padding: 4px; border-radius: 11px; margin-bottom: 20px; }
.seg button { border: 0; background: transparent; min-height: 40px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(15,42,74,.1); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-start: 42px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; font-size: calc(14px * var(--fz, 1)); flex-wrap: wrap; gap: 8px; }
.auth-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.otp-input { letter-spacing: 12px; text-align: center; font-size: calc(26px * var(--fz, 1))!important; font-weight: 700; direction: ltr; }
.tenant-pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; margin-bottom: 10px; text-align: start; min-height: 64px; }
.tenant-pick:hover { border-color: var(--amber); }
.tenant-pick .logo { width: 42px; height: 42px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.tenant-pick .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ---------------------------------------------------------------- responsive (كل الأجهزة) */
@media (max-width: 1280px) {
  .home-grid.has-side { grid-template-columns: minmax(0, 1fr); }
  .home-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[style*="--cols"] .mod-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); z-index: 50; transform: translateX(100%); transition: transform .2s ease; }
  html[dir=ltr] .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,20,35,.45); z-index: 40; }
  .topbar { padding: 8px 14px; }
  .topbar .menu-btn { display: inline-grid; }
  .user-menu .who { display: none; }
  .content { padding: 16px 14px 28px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 26px 22px 22px; }
  .auth-brand .slogan, .auth-brand .foot { display: none; }
  .brand-lockup .word b { font-size: calc(36px * var(--fz, 1)); }
  .brand-lockup svg { width: 58px; height: 58px; }
  .auth-panel { padding: 26px 18px 32px; }
}
@media (max-width: 640px) {
  .hero { padding: 20px; }
  .hero h1 { font-size: calc(22px * var(--fz, 1)); }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi-ico { width: 40px; height: 40px; flex-basis: 40px; }
  .kpi-body b { font-size: calc(24px * var(--fz, 1)); }
  .mod-grid, :root[style*="--cols"] .mod-grid, .cards-compact .mod-grid { grid-template-columns: minmax(0, 1fr); }
  .mod-card { min-height: 0; flex-direction: row; align-items: center; padding: 14px; gap: 12px; }
  .mod-ico { width: 46px; height: 46px; flex: 0 0 46px; }
  .mod-ico .icon { width: 23px; height: 23px; }
  .mod-card b { font-size: calc(15.5px * var(--fz, 1)); }
  .mod-desc { font-size: calc(12.5px * var(--fz, 1)); }
  .mod-go { position: static; flex: 0 0 30px; width: 30px; height: 30px; }
  .home-side { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: calc(21px * var(--fz, 1)); }
  .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .stat-icon { width: 38px; height: 38px; }
  .stat b { font-size: calc(20px * var(--fz, 1)); }
  .branch-switch .label-text { display: none; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  /* الجداول تتحول إلى بطاقات */
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .table.responsive td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: calc(13px * var(--fz, 1)); font-weight: 600; }
  .table.responsive td.t-actions { justify-content: flex-start; padding-top: 8px; }
  .table.responsive td.t-actions::before { display: none; }
  .table.responsive td.t-main { font-size: calc(15.5px * var(--fz, 1)); }
  .table.responsive td.t-main::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar { display: none; } .app { display: block; } }

/* ساعات العمل: مضغوطة على الجوال */
.table-wrap { max-width: 100%; }
.card { min-width: 0; }
.hours-table input[type=time] { min-width: 0; max-width: 140px; }
@media (max-width: 640px) {
  .hours-table th, .hours-table td { padding: 8px 6px; }
  .hours-table input[type=time] { padding: 6px 4px; font-size: calc(14px * var(--fz, 1)); max-width: 104px; }
}

/* =========================================================================
   التصميم الكلاسيكي (الافتراضي): شريط علوي كحلي وكروت بيضاء
   ========================================================================= */
.classic { min-height: 100vh; display: flex; flex-direction: column; }
/* شريط علوي معدني: أزرق فولاذي متدرج مع لمعة، وحافة ذهبية معدنية */
.classic-header { color: #fff; padding: 14px clamp(16px, 4.5vw, 64px);
  background:
    linear-gradient(110deg, transparent 38%, rgba(255,255,255,.16) 50%, transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.03) 42%, rgba(0,0,0,.10) 58%, rgba(0,0,0,.22) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, color-mix(in srgb, var(--navy) 72%, #000) 0%, color-mix(in srgb, var(--navy) 88%, #fff) 18%, color-mix(in srgb, var(--navy) 66%, #fff) 31%, color-mix(in srgb, var(--navy) 92%, #fff) 44%, color-mix(in srgb, var(--navy) 85%, #000) 60%, color-mix(in srgb, var(--navy) 78%, #fff) 78%, color-mix(in srgb, var(--navy) 74%, #000) 100%);
  background-size: 260% 100%, 100% 100%, auto, 100% 100%;
  background-position: 120% 0, 0 0, 0 0, 0 0;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, color-mix(in srgb, var(--amber) 70%, #000), var(--amber) 18%, color-mix(in srgb, var(--amber) 40%, #fff) 34%, color-mix(in srgb, var(--amber) 88%, #000) 52%, color-mix(in srgb, var(--amber) 75%, #fff) 70%, color-mix(in srgb, var(--amber) 25%, #fff) 82%, color-mix(in srgb, var(--amber) 76%, #000)) 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.35), 0 8px 22px -12px rgba(5,20,40,.55);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20;
  animation: header-sheen 2.4s .3s cubic-bezier(.4,0,.2,1) both; }
@keyframes header-sheen { from { background-position: 120% 0, 0 0, 0 0, 0 0; } to { background-position: -20% 0, 0 0, 0 0, 0 0; } }
.classic-brand b { text-shadow: 0 1px 0 rgba(0,0,0,.35); }
/* التحية في الشريط العلوي */
.header-greet { display: flex; align-items: center; gap: 10px; margin-inline: auto; padding: 5px 16px 5px 6px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 14px -8px rgba(0,0,0,.5); backdrop-filter: blur(6px); }
html[dir=ltr] .header-greet { padding: 5px 6px 5px 16px; }
.hg-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: color-mix(in srgb, var(--amber) 30%, #000);
  background: linear-gradient(145deg, color-mix(in srgb, var(--amber) 25%, #fff) 0%, color-mix(in srgb, var(--amber) 75%, #fff) 35%, color-mix(in srgb, var(--amber) 88%, #000) 70%, color-mix(in srgb, var(--amber) 60%, #fff) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(0,0,0,.15), 0 6px 14px -6px rgba(243,165,36,.8); }
.hg-icon .icon { width: 22px; height: 22px; stroke-width: 2; }
.hg-icon.hg-sun .icon { animation: hg-spin 24s linear infinite; }
.hg-icon.hg-moon-stars { color: #EAF1FF; background: linear-gradient(145deg, #8EA6CC 0%, #4C6894 40%, #22385C 75%, #5E7AA6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.25), 0 6px 14px -6px rgba(120,150,200,.7); }
@keyframes hg-spin { to { transform: rotate(360deg); } }
.hg-text { line-height: 1.3; }
.hg-text b { display: block; font-size: calc(15px * var(--fz, 1)); font-weight: 700; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3); white-space: nowrap; }
.hg-text small { display: block; font-size: calc(12px * var(--fz, 1)); color: #D3DDEA; white-space: nowrap; }
.hg-sep { margin-inline: 6px; opacity: .6; }
.hg-text time { font-weight: 700; color: #FFD892; font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) { .hg-text small { display: none; } }
@media (max-width: 900px) { .header-greet { order: 3; margin-inline: 0; width: 100%; } .classic-header .classic-actions { order: 4; } .hg-text small { display: block; } }
@media (prefers-reduced-motion: reduce) { .classic-header { animation: none; } .hg-icon .icon { animation: none !important; } }
.classic-brand { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; }
.classic-brand:hover { text-decoration: none; }
.classic-logo { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; overflow: hidden; flex: 0 0 46px; }
.classic-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.classic-brand b { display: block; font-size: calc(22px * var(--fz, 1)); font-weight: 700; line-height: 1.3; }
.classic-brand small { display: block; font-size: calc(12px * var(--fz, 1)); color: #C8D3E0; }
.classic-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.classic-actions form { margin: 0; }
.classic-chip { font-size: calc(13px * var(--fz, 1)); padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); white-space: nowrap; }
.classic-chip.warn { background: rgba(243,165,36,.18); border-color: rgba(243,165,36,.45); color: #FFE2AE; }
.classic-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 9px; padding: 9px 15px; font: inherit; font-size: calc(13.5px * var(--fz, 1)); font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 40px; }
.classic-btn:hover { text-decoration: none; filter: brightness(.96); }
.classic-btn.light { background: #fff; color: var(--navy); }
.classic-btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.classic-user { order: 0; }
.classic-user summary { color: #fff; gap: 4px; padding: 2px 6px 2px 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); min-height: 40px; transition: background .15s, border-color .15s; }
.classic-user summary:hover, .classic-user[open] summary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.45); }
.classic-user summary .avatar { width: 32px; height: 32px; background: linear-gradient(145deg, #F7B24A, var(--amber)); color: var(--navy); font-weight: 700; }
.classic-user summary .icon { transition: transform .2s; }
.classic-user[open] summary .icon { transform: rotate(180deg); }
.classic-user .menu-pop { z-index: 60; color: var(--ink); animation: menu-in .16s ease-out; }
.menu-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.menu-who b { display: block; font-size: calc(14px * var(--fz, 1)); color: var(--navy); }
.menu-who small { display: block; font-size: calc(12px * var(--fz, 1)); color: var(--muted); }
.menu-who .avatar { flex: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.classic-branch select { min-height: 40px; background: rgba(255,255,255,.95); border-radius: 9px; padding: 6px 10px; font-size: calc(13.5px * var(--fz, 1)); width: auto; }
.classic-content { flex: 1; padding: 28px clamp(16px, 4.5vw, 64px); }
.w-boxed .classic-content { max-width: 1400px; margin-inline: auto; }
.classic-footer { text-align: center; padding: 22px; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); }

.classic-welcome { margin-bottom: 8px; }
.classic-welcome h1 { font-size: calc(30px * var(--fz, 1)); margin-bottom: 8px; }
.classic-welcome p { color: var(--muted); font-size: calc(15px * var(--fz, 1)); }
.classic-section { font-size: calc(20px * var(--fz, 1)); margin: 22px 0 16px; }

.classic-grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.classic-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px 22px 18px; min-height: 160px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: 0 3px 10px rgba(15,42,74,.04);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
a.classic-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--amber); box-shadow: 0 10px 24px rgba(15,42,74,.10); }
.classic-icon { font-size: calc(30px * var(--fz, 1)); line-height: 1; margin-bottom: 10px; min-height: 34px; display: flex; align-items: center; }
.classic-icon .icon { width: 32px; height: 32px; color: var(--gc); stroke-width: 1.7; }
.classic-card h3 { font-size: calc(18px * var(--fz, 1)); font-weight: 700; color: var(--navy); margin: 0; }
.classic-card p { font-size: calc(13px * var(--fz, 1)); color: var(--muted); line-height: 1.7; margin: 0; flex: 1; }
.classic-pill { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; font-size: calc(12px * var(--fz, 1)); font-weight: 600; background: #EDF1F6; color: #617287; }
.classic-pill.open { background: #FFF0DF; color: #99530E; }
.classic-card.is-soon { background: #FBFCFE; }
.d-compact .classic-card { min-height: 130px; padding: 16px; }
.d-compact .classic-content { padding-block: 18px; }

@media (max-width: 1200px) { .classic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .classic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .classic-header { position: static; }
  .classic-brand b { font-size: calc(18px * var(--fz, 1)); }
  .classic-chip:not(.warn) { display: none; }
}
@media (max-width: 520px) {
  .classic-grid { grid-template-columns: minmax(0, 1fr); }
  .classic-card { min-height: 0; }
  .classic-welcome h1 { font-size: calc(23px * var(--fz, 1)); }
  .classic-actions { width: 100%; }
  .classic-actions > * { flex: 1; }
  .classic-actions .classic-btn { justify-content: center; width: 100%; }
  .classic-branch select { width: 100%; }
  .classic-actions > .classic-branch { flex-basis: 100%; }
  .classic-actions > .classic-user { flex: none; }
  .classic-user .menu-pop { inset-inline-end: auto; inset-inline-start: 0; }
}

/* =========================================================================
   بوابات الدخول الثلاث: نموذج على اليمين وصورة الورشة على اليسار
   ========================================================================= */
body.gate { margin: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 560px) minmax(0, 1fr); background: #F4F6F9; }
.gate-form { display: flex; flex-direction: column; min-height: 100vh; padding: 28px clamp(22px, 3.4vw, 52px) 20px; background: #fff; position: relative; z-index: 2;
  box-shadow: 12px 0 40px rgba(10,28,50,.08); }
.gate-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gate-brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.gate-brand:hover { text-decoration: none; }
.gate-brand b { display: block; font-size: calc(26px * var(--fz, 1)); line-height: 1.1; }
.gate-brand small { display: block; font-size: calc(12px * var(--fz, 1)); color: var(--muted); margin-top: 3px; }
.gate-tenant-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 12px; }
.gate-lang { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--fz, 1)); font-weight: 600; color: var(--navy); background: #F1F4F8; padding: 7px 13px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s; }
.gate-lang:hover { background: #fff; border-color: var(--accent); transform: translateY(-1px); }
.gate-lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gate-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 30px 0 4px; padding: 5px; background: #F1F4F8; border-radius: 16px; }
.gate-switch a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 12px; color: #4A5B70; font-weight: 700; font-size: calc(14.5px * var(--fz, 1)); transition: background .15s, color .15s; }
.gate-switch a:hover { text-decoration: none; color: var(--navy); background: rgba(255,255,255,.7); }
.gate-switch a.on { background: #fff; color: var(--navy); box-shadow: 0 4px 14px rgba(15,42,74,.10), inset 0 -3px 0 var(--accent); }
.gate-switch a .icon { width: 20px; height: 20px; color: var(--accent); }

.gate-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 26px 0; max-width: 460px; width: 100%; margin: 0 auto; }
.gate-heading { font-size: calc(30px * var(--fz, 1)); font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.gate-sub { color: var(--muted); margin: 0 0 22px; font-size: calc(15px * var(--fz, 1)); line-height: 1.8; }
.gate-device { display: inline-flex; align-items: center; gap: 8px; font-size: calc(13.5px * var(--fz, 1)); color: #4A5B70; background: #F6F7F9; border: 1px dashed var(--line-2); padding: 7px 12px; border-radius: 10px; margin-bottom: 18px; }
.gate-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); border-top: 1px solid #EEF1F5; padding-top: 14px; }

/* الصورة */
.gate-photo { position: relative; overflow: hidden; margin: 14px; border-radius: 28px; min-height: calc(100vh - 28px);
  background: linear-gradient(0deg, rgba(8,24,44,.92) 0%, rgba(8,24,44,.55) 38%, rgba(8,24,44,.08) 70%), var(--photo) center / cover no-repeat; }
.gate-photo::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 85% 10%, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.gate-photo-inner { position: absolute; inset-inline: clamp(24px, 4vw, 64px); bottom: clamp(28px, 6vh, 64px); color: #fff; max-width: 620px; }
.gate-chip { display: inline-flex; align-items: center; gap: 8px; font-size: calc(13.5px * var(--fz, 1)); font-weight: 700; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(8px); }
.gate-chip .icon { color: var(--accent); }
.gate-photo h2 { color: #fff; font-size: calc(clamp(30px, 3.3vw, 50px) * var(--fz, 1)); line-height: 1.25; margin: 16px 0 10px; text-shadow: 0 4px 24px rgba(0,0,0,.25); }
.gate-photo p { color: #D6E0EB; font-size: calc(clamp(15px, 1.2vw, 18px) * var(--fz, 1)); margin: 0 0 22px; max-width: 520px; }
.gate-photo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gate-photo li { display: flex; align-items: center; gap: 12px; font-size: calc(15px * var(--fz, 1)); font-weight: 600; color: #EEF3F8; }
.gate-photo li span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.gate-photo li .icon { color: var(--accent); width: 20px; height: 20px; }
.gate-photo-stripe { position: absolute; top: 0; inset-inline-end: 0; width: 8px; height: 100%; background: linear-gradient(180deg, var(--accent), rgba(243,165,36,0)); }

/* عناصر النماذج المشتركة في البوابات */
.auth2-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #F1F4F8; border-radius: 14px; padding: 4px; margin-bottom: 22px; }
.auth2-tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 0; border-radius: 11px;
  background: transparent; font: inherit; font-size: calc(14.5px * var(--fz, 1)); font-weight: 700; color: #4A5B70; cursor: pointer; }
.auth2-tabs button .icon { width: 20px; height: 20px; }
.auth2-tabs button.on { background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 72%, #fff), var(--accent)); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.auth2-tabs button.on::after { content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid var(--accent); }
.auth2-label { display: block; font-size: calc(15px * var(--fz, 1)); font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.auth2-input { position: relative; margin-bottom: 16px; }
.auth2-input .icon { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); color: #5B6B7F; width: 21px; height: 21px; pointer-events: none; }
.auth2-input input { width: 100%; min-height: 54px; padding: 12px 15px; padding-inline-start: 48px; border: 1.5px solid #DCE3EB; border-radius: 12px; background: #FBFCFD; font: inherit; font-size: calc(15px * var(--fz, 1)); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
.auth2-input input::placeholder { color: #98A4B3; }
.auth2-input input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.auth2-input input:disabled { background: #F3F5F8; cursor: not-allowed; }
.auth2-remember { margin: -4px 0 14px; font-size: calc(14px * var(--fz, 1)); }
.auth2-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: calc(16.5px * var(--fz, 1)); font-weight: 700; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); background: linear-gradient(180deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.06) 51%, rgba(255,255,255,.08) 100%), linear-gradient(100deg, color-mix(in srgb, var(--accent) 72%, #fff), var(--accent)); box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 32%, transparent); transition: transform .12s, filter .12s; }
.auth2-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.auth2-btn:disabled, .auth2-btn-outline:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.2); }
.auth2-btn .icon, .auth2-btn-outline .icon { width: 21px; height: 21px; }
.auth2-or { display: flex; align-items: center; gap: 14px; margin: 16px 0; color: #7A8899; font-weight: 600; font-size: calc(14px * var(--fz, 1)); }
.auth2-or::before, .auth2-or::after { content: ""; flex: 1; height: 1px; background: #E3E8EF; }
.auth2-btn-outline { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid #CFD8E3; background: #fff; color: var(--navy); font: inherit; font-size: calc(15px * var(--fz, 1)); font-weight: 700; transition: border-color .15s, background .15s; }
.auth2-btn-outline:hover:not(:disabled) { border-color: var(--navy); background: #F8FAFC; }
.auth2-info { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 0; font-size: calc(13px * var(--fz, 1)); color: #5B6B7F; line-height: 1.7; }
.auth2-info .icon { color: var(--navy); width: 19px; height: 19px; flex: 0 0 19px; margin-top: 2px; }
.gate .otp-input { min-height: 60px; border-radius: 12px; }
.gate .alert { font-size: calc(13.5px * var(--fz, 1)); }

/* لوحة PIN */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0 14px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--navy); transition: background .12s, transform .12s; }
.pin-dots i.f { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pin-pad button { min-height: 58px; border-radius: 14px; border: 1px solid #E1E6ED; background: linear-gradient(180deg, #fff, #F5F7FA);
  font: inherit; font-size: calc(22px * var(--fz, 1)); font-weight: 700; color: var(--navy); cursor: pointer; box-shadow: 0 3px 0 #DCE3EB; transition: transform .08s, box-shadow .08s; }
.pin-pad button:active { transform: translateY(2px); box-shadow: 0 1px 0 #DCE3EB; }
.pin-pad .pin-muted { font-size: calc(14px * var(--fz, 1)); color: #5B6B7F; display: grid; place-items: center; }

@media (max-width: 980px) {
  body.gate { grid-template-columns: minmax(0, 1fr); }
  .gate-photo { order: -1; margin: 0; border-radius: 0 0 26px 26px; min-height: 230px; }
  .gate-photo-inner { bottom: 22px; }
  .gate-photo h2 { font-size: calc(26px * var(--fz, 1)); margin: 10px 0 0; }
  .gate-photo p, .gate-photo ul { display: none; }
  .gate-form { min-height: 0; box-shadow: none; padding-top: 18px; }
  .gate-switch { margin-top: 18px; }
  .gate-body { padding: 18px 0; }
  .gate-heading { font-size: calc(24px * var(--fz, 1)); }
}
@media (max-width: 420px) {
  .gate-switch a { font-size: calc(13px * var(--fz, 1)); gap: 5px; }
  .gate-brand small { display: none; }
}

/* =========================================================================
   كروت الرئيسية ثلاثية الأبعاد بخلفيات مميزة لكل مجموعة
   ========================================================================= */
.classic-grid { perspective: 1400px; gap: 20px; }
.classic-card { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  overflow: hidden; isolation: isolate; border: 1px solid color-mix(in srgb, var(--gc) 14%, #E6EAF0); border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(120px 120px at var(--mx) var(--my), rgba(255,255,255,.75), transparent 70%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--gc) 24%, transparent) 0, transparent 50%),
    linear-gradient(160deg, #FFFFFF 0%, color-mix(in srgb, var(--gc) 8%, #fff) 55%, color-mix(in srgb, var(--gc) 17%, #fff) 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(15,42,74,.06),
    0 10px 24px -10px rgba(15,42,74,.18),
    0 7px 0 -3px color-mix(in srgb, var(--gc) 22%, #E3E8EF);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d; transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .25s; padding: 24px 24px 20px; min-height: 178px; }
/* نقش خلفي خفيف */
.classic-card::before { content: ""; position: absolute; z-index: -1; inset-inline-end: -40px; bottom: -50px; width: 190px; height: 190px; border-radius: 50%;
  background: repeating-radial-gradient(circle, color-mix(in srgb, var(--gc) 13%, transparent) 0 2px, transparent 2px 14px); opacity: .7; }
.classic-card::after { content: ""; position: absolute; z-index: -1; top: 0; inset-inline: 0; height: 4px; background: linear-gradient(90deg, var(--gc), color-mix(in srgb, var(--gc) 40%, #fff)); }
.classic-card:hover, a.classic-card:focus-visible { transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px); border-color: color-mix(in srgb, var(--gc) 40%, #fff);
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(15,42,74,.06), 0 26px 44px -14px rgba(15,42,74,.30), 0 9px 0 -3px color-mix(in srgb, var(--gc) 35%, #E3E8EF); }
.classic-icon { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 14px; font-size: calc(30px * var(--fz, 1)); transform: translateZ(28px);
  background: linear-gradient(145deg, color-mix(in srgb, var(--gc) 70%, #fff), var(--gc));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.12), 0 12px 20px -6px color-mix(in srgb, var(--gc) 60%, transparent); }
.classic-icon .icon { color: #fff; width: 30px; height: 30px; }
.classic-icon .emoji { filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.classic-card h3, .classic-card p, .classic-pill { transform: translateZ(18px); }
.classic-pill.open { background: var(--gc); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--gc) 70%, transparent); }
.classic-card.is-soon { filter: saturate(.8); }
.classic-card.is-soon .classic-pill { background: rgba(255,255,255,.8); color: #5B6B7F; border: 1px solid #E1E6ED; }
.classic-card.is-soon h3 { color: #2E4157; }
/* حركة إرشادية عند الوقوف على أي كرت */
.classic-icon { transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.classic-card:hover .classic-icon, a.classic-card:focus-visible .classic-icon { transform: translateZ(40px) scale(1.08) rotate(-4deg);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.12), 0 18px 26px -8px color-mix(in srgb, var(--gc) 70%, transparent); }
.classic-card h3 { transition: color .2s; }
.classic-card:hover h3 { color: color-mix(in srgb, var(--gc) 75%, var(--navy)); }
.classic-pill { transition: transform .25s, background .25s, color .25s, border-color .25s; }
.classic-card:hover .classic-pill { transform: translateZ(24px) translateY(-2px); }
.classic-card.is-soon { cursor: default; transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .25s, filter .25s; }
.classic-card.is-soon:hover { filter: none; }
.classic-card.is-soon:hover .classic-pill { border-color: color-mix(in srgb, var(--gc) 45%, #fff); color: color-mix(in srgb, var(--gc) 80%, #000); }
/* لمعة تعبر الكرت */
.classic-card > .card-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; overflow: hidden; }
.classic-card > .card-shine::before { content: ""; position: absolute; top: 0; bottom: 0; width: 45%; inset-inline-start: -60%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg); }
.classic-card:hover > .card-shine::before { animation: card-shine .8s ease-out; }
@keyframes card-shine { to { inset-inline-start: 120%; } }
body.sorting .card-shine { display: none; }
@media (prefers-reduced-motion: reduce) { .classic-card:hover .classic-icon { transform: translateZ(28px); } .card-shine { display: none; } }
@media (prefers-reduced-motion: reduce) { .classic-card { transform: none !important; } }

/* الدخول بالبصمة (WebAuthn / Passkeys) */
.bio-btn { margin-top: 10px; border-style: dashed; }
.bio-btn .icon { color: var(--accent); width: 24px; height: 24px; }
.bio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bio-row .bio-btn { margin-top: 0; }
.bio-note { margin: 6px 0 0; font-size: calc(12px * var(--fz, 1)); color: #7A8899; text-align: center; }
.bio-note.supported::before { content: "✓ جهازك يدعم البصمة. "; color: var(--ok); font-weight: 600; }

/* ترتيب الكروت بالسحب */
.classic-section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 16px; }
.classic-section-row .classic-section { margin: 0; }
.sort-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sort-tools form { margin: 0; }
.sort-hint { font-size: calc(13px * var(--fz, 1)); color: var(--amber-ink); background: var(--warn-bg); padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.sort-grip { display: none; position: absolute; top: 14px; inset-inline-start: 14px; width: 34px; height: 34px; border-radius: 10px; place-items: center;
  background: rgba(255,255,255,.9); border: 1px solid #E1E6ED; color: #5B6B7F; box-shadow: 0 2px 6px rgba(15,42,74,.08); }
.sort-grip .icon { width: 18px; height: 18px; }
body.sorting .sort-grip { display: grid; }
body.sorting .classic-card { cursor: grab; touch-action: none; user-select: none; transform: none !important;
  outline: 2px dashed color-mix(in srgb, var(--gc) 45%, #fff); outline-offset: 3px; animation: sort-wiggle .32s ease-in-out infinite alternate; }
body.sorting .classic-card:nth-child(even) { animation-delay: .16s; }
@keyframes sort-wiggle { from { rotate: -.4deg; } to { rotate: .4deg; } }
.classic-card.sort-placeholder { opacity: .25; animation: none !important; }
.sort-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; cursor: grabbing; rotate: 2deg; scale: 1.04;
  box-shadow: 0 30px 60px -12px rgba(15,42,74,.45) !important; }
@media (prefers-reduced-motion: reduce) { body.sorting .classic-card { animation: none; } }

/* لمسات: تحية حسب الوقت، ودخول متدرج للكروت */
.classic-greet { display: inline-block; font-size: calc(13.5px * var(--fz, 1)); font-weight: 600; color: var(--amber-ink); background: var(--warn-bg); padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .classic-grid > .classic-card { animation: card-in .45s cubic-bezier(.2,.7,.2,1) both; }
  .classic-grid > .classic-card:nth-child(2) { animation-delay: .03s } .classic-grid > .classic-card:nth-child(3) { animation-delay: .06s }
  .classic-grid > .classic-card:nth-child(4) { animation-delay: .09s } .classic-grid > .classic-card:nth-child(5) { animation-delay: .12s }
  .classic-grid > .classic-card:nth-child(6) { animation-delay: .15s } .classic-grid > .classic-card:nth-child(7) { animation-delay: .18s }
  .classic-grid > .classic-card:nth-child(8) { animation-delay: .21s } .classic-grid > .classic-card:nth-child(n+9) { animation-delay: .24s }
}
@keyframes card-in { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
body.sorting .classic-grid > .classic-card { animation: sort-wiggle .32s ease-in-out infinite alternate; }


/* =========================================================================
   استوديو المظهر: أنماط الشريط، وعمق الكروت، والحركة، والصور، ووزن العناوين
   ========================================================================= */
h1, h2, .classic-card h3, .classic-welcome h1, .classic-brand b, .page-head h1 { font-weight: var(--hw, 700); }

/* الشريط: متدرج ناعم */
.header-gradient .classic-header { animation: none;
  background: linear-gradient(100deg, color-mix(in srgb, var(--navy) 80%, #000), var(--navy) 45%, color-mix(in srgb, var(--navy) 70%, #fff)); }
/* الشريط: لون واحد */
.header-solid .classic-header { animation: none; background: var(--navy); box-shadow: none; border-image: none; border-bottom-color: var(--amber); }
/* الشريط: فاتح */
.header-light .classic-header { animation: none; color: var(--ink); background: #fff; box-shadow: 0 1px 0 var(--line), 0 6px 18px -14px rgba(15,42,74,.4); border-image: none; border-bottom: 3px solid var(--amber); }
.header-light .classic-brand { color: var(--navy); }
.header-light .classic-brand b { text-shadow: none; }
.header-light .classic-brand small { color: var(--muted); }
.header-light .classic-btn.ghost { color: var(--navy); border-color: var(--line-2); }
.header-light .classic-btn.light { background: var(--navy); color: #fff; }
.header-light .classic-chip { background: var(--bg); border-color: var(--line); color: var(--ink); }
.header-light .classic-user summary { color: var(--navy); border-color: var(--line-2); }
.header-light .classic-user summary:hover, .header-light .classic-user[open] summary { background: var(--bg); }
.header-light .header-greet { background: var(--bg); border-color: var(--line); box-shadow: none; }
.header-light .hg-text b { color: var(--navy); text-shadow: none; }
.header-light .hg-text small { color: var(--muted); }
.header-light .hg-text time { color: var(--amber-ink); }
.header-light .classic-branch select { border: 1px solid var(--line-2); }
/* صورة خلفية للشريط تُمزج مع لونه */
.has-header-img .classic-header { background-image: linear-gradient(100deg, color-mix(in srgb, var(--navy) 92%, transparent), color-mix(in srgb, var(--navy) 70%, transparent)), var(--header-img); background-size: cover; background-position: center; animation: none; }
.has-header-img.header-light .classic-header { background-image: linear-gradient(100deg, rgba(255,255,255,.94), rgba(255,255,255,.8)), var(--header-img); }

/* عمق الكروت */
.depth-flat .classic-card { box-shadow: none; transform: none; }
.depth-flat .classic-card:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 35%, transparent); transform: translateY(-2px); }
.depth-flat .classic-icon { box-shadow: none; transform: none; }
.depth-soft .classic-card { box-shadow: 0 1px 2px rgba(15,42,74,.06), 0 6px 16px -8px rgba(15,42,74,.18); }
.depth-soft .classic-card:hover { box-shadow: 0 2px 4px rgba(15,42,74,.06), 0 16px 30px -14px rgba(15,42,74,.28); transform: translateY(-4px); }

/* تقليل الحركة باختيار الورشة */
.motion-reduced .classic-header, .motion-reduced .classic-grid > .classic-card, .motion-reduced .hg-icon .icon, .motion-reduced .menu-pop { animation: none !important; }
.motion-reduced .classic-card, .motion-reduced .classic-card:hover { transform: none; }
.motion-reduced .classic-card:hover .classic-icon { transform: translateZ(28px); }
.motion-reduced .card-shine { display: none; }

/* صورة شريط الترحيب */
.classic-welcome.has-image { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px); padding: clamp(22px, 4vw, 40px); margin-bottom: 18px; color: #fff;
  background: linear-gradient(90deg, color-mix(in srgb, var(--navy) 88%, transparent) 0%, color-mix(in srgb, var(--navy) 55%, transparent) 60%, transparent 100%), var(--welcome-img) center / cover no-repeat;
  box-shadow: 0 14px 30px -18px rgba(15,42,74,.55); min-height: 170px; display: flex; flex-direction: column; justify-content: center; }
html[dir=ltr] .classic-welcome.has-image { background: linear-gradient(270deg, color-mix(in srgb, var(--navy) 88%, transparent) 0%, color-mix(in srgb, var(--navy) 55%, transparent) 60%, transparent 100%), var(--welcome-img) center / cover no-repeat; }
.classic-welcome.has-image h1 { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.classic-welcome.has-image p { color: rgba(255,255,255,.9); max-width: 60ch; }

/* =========================================================================
   استوديو المظهر (الإعدادات ← المظهر والهوية)
   ========================================================================= */
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.studio-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.studio-sec { scroll-margin-top: 140px; }
.studio-nav { position: sticky; top: 92px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 6px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; }
.studio-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: calc(13.5px * var(--fz, 1)); white-space: nowrap; }
.studio-nav a:hover { text-decoration: none; background: #fff; color: var(--navy); }
.studio-nav a.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(15,42,74,.12); }
.studio .label small { font-weight: 400; color: var(--muted); }
.hint-line { display: flex; align-items: center; gap: 6px; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); margin: 10px 0 0; }

/* الثيمات الجاهزة */
.preset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 18px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; transition: transform .15s, border-color .15s, box-shadow .15s; }
.preset:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 6px 14px -8px rgba(15,42,74,.3); }
.preset.on { border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent); }
.preset small { font-size: calc(12px * var(--fz, 1)); font-weight: 600; color: var(--ink); }
.preset-swatch { display: flex; width: 100%; height: 34px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.preset-swatch i { flex: 2; background: linear-gradient(160deg, color-mix(in srgb, var(--p1) 70%, #fff), var(--p1) 55%, color-mix(in srgb, var(--p1) 70%, #000)); }
.preset-swatch i:nth-child(2) { flex: 1; background: linear-gradient(180deg, color-mix(in srgb, var(--p2) 55%, #fff), var(--p2)); }
.preset-swatch i:nth-child(3) { flex: 1; background: var(--p3); }

/* حقول الألوان */
.color-grid { gap: 10px; }
.color-field { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 0; cursor: pointer; font-weight: 400; }
.color-field:hover { border-color: var(--line-2); }
.color-field b { display: block; font-size: calc(13.5px * var(--fz, 1)); color: var(--navy); }
.color-field small { display: block; font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); line-height: 1.4; }
.color-field code { font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); direction: ltr; display: inline-block; }
.color-swatch { position: relative; width: 42px; height: 42px; flex: none; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 2px 6px -2px rgba(0,0,0,.25); }
.color-swatch input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; background: none; }
.color-grid.compact .color-swatch { width: 34px; height: 34px; }

/* بطاقات الاختيار */
.choice-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.choice { margin: 0; font-weight: 600; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: calc(13px * var(--fz, 1)); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; }
.choice:hover .choice-card { transform: translateY(-1px); border-color: var(--line-2); }
.choice input:checked + .choice-card { border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent); }
.choice input:focus-visible + .choice-card { outline: 2px solid var(--navy); outline-offset: 2px; }
.hdr-sample { display: flex; align-items: center; justify-content: space-between; height: 34px; border-radius: 8px; padding: 0 8px; border-bottom: 3px solid var(--amber); }
.hdr-sample i { width: 30%; height: 6px; border-radius: 3px; background: rgba(255,255,255,.75); }
.hdr-sample i:last-child { width: 18%; }
.hdr-metallic { background: linear-gradient(180deg, rgba(255,255,255,.25), transparent 45%, rgba(0,0,0,.2)), linear-gradient(100deg, color-mix(in srgb, var(--navy) 75%, #000), color-mix(in srgb, var(--navy) 65%, #fff) 35%, color-mix(in srgb, var(--navy) 85%, #000) 65%, color-mix(in srgb, var(--navy) 75%, #fff)); }
.hdr-gradient { background: linear-gradient(100deg, color-mix(in srgb, var(--navy) 80%, #000), color-mix(in srgb, var(--navy) 70%, #fff)); }
.hdr-solid { background: var(--navy); }
.hdr-light { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.hdr-light i { background: var(--line-2); }
.depth-sample { height: 34px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.ds-soft { box-shadow: 0 6px 12px -6px rgba(15,42,74,.35); }
.ds-3d { box-shadow: 0 10px 16px -8px rgba(15,42,74,.45), 0 5px 0 -2px color-mix(in srgb, var(--amber) 40%, #E3E8EF); transform: perspective(200px) rotateX(10deg); }

/* الخطوط */
.font-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.font-card b { font-size: calc(17px * var(--fz, 1)); color: var(--navy); font-weight: 700; line-height: 1.4; }
.font-card .ltr { font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); }
.font-card small { font-family: Plex, sans-serif; font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); }
.studio input[type=range] { width: 100%; accent-color: var(--amber); height: 28px; }
.studio output { font-weight: 700; color: var(--amber-ink); background: var(--warn-bg); padding: 1px 8px; border-radius: 999px; font-size: calc(12px * var(--fz, 1)); margin-inline-start: 6px; }
.range-scale { display: flex; justify-content: space-between; font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 9px; font-size: calc(13.5px * var(--fz, 1)); color: var(--muted); font-weight: 600; }
.seg input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(15,42,74,.15); }
.seg input:focus-visible + span { outline: 2px solid var(--navy); }

/* الصور */
.image-grid { gap: 16px; }
.image-drop { position: relative; display: grid; place-items: center; margin: 0; border: 2px dashed var(--line-2); border-radius: 12px; background: var(--bg) repeating-conic-gradient(#EEF1F5 0 25%, transparent 0 50%) 0 0 / 16px 16px; cursor: pointer; overflow: hidden; transition: border-color .15s, background-color .15s; font-weight: 500; }
.image-drop.logo { aspect-ratio: 1 / 1; max-width: 170px; }
.image-drop.wide { aspect-ratio: 4 / 1.6; }
.image-drop:hover, .image-drop.drag { border-color: var(--amber); }
.image-drop img { width: 100%; height: 100%; object-fit: contain; }
.image-drop.wide img { object-fit: cover; }
.image-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); text-align: center; padding: 10px; }
.image-empty .icon { width: 28px; height: 28px; }

/* مفاتيح التشغيل */
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 6px; }
.switch { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 40px; font-weight: 500; color: var(--ink); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.switch input:checked + .switch-track { background: var(--amber); }
.switch input:checked + .switch-track::after { inset-inline-start: 21px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--navy); outline-offset: 2px; }

/* المعاينة */
.studio-preview { position: sticky; top: 92px; }
.pv { padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); border-radius: 0 0 var(--radius) var(--radius); }
.pv-header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: #fff; font-size: calc(13px * var(--fz, 1));
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 45%, rgba(0,0,0,.2)), linear-gradient(100deg, color-mix(in srgb, var(--navy) 75%, #000), color-mix(in srgb, var(--navy) 65%, #fff) 35%, color-mix(in srgb, var(--navy) 85%, #000) 65%, color-mix(in srgb, var(--navy) 75%, #fff));
  border-bottom: 3px solid var(--amber); }
.pv-header b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-logo { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; overflow: hidden; flex: none; }
.pv-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pv-greet { display: inline-flex; align-items: center; gap: 4px; font-size: calc(11px * var(--fz, 1)); padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); }
.header-gradient .pv-header { background: linear-gradient(100deg, color-mix(in srgb, var(--navy) 80%, #000), color-mix(in srgb, var(--navy) 70%, #fff)); }
.header-solid .pv-header { background: var(--navy); }
.header-light .pv-header { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--line); }
.header-light .pv-greet { background: var(--bg); border-color: var(--line); color: var(--ink); }
.pv-welcome { padding: 4px 2px; }
.pv-welcome h3 { font-size: calc(16px * var(--fz, 1)); font-weight: var(--hw, 700); color: var(--navy); }
.pv-welcome p { font-size: calc(12px * var(--fz, 1)); color: var(--muted); margin: 0; }
.pv-welcome.has-image { padding: 14px; border-radius: 10px; color: #fff; background: linear-gradient(90deg, color-mix(in srgb, var(--navy) 88%, transparent), color-mix(in srgb, var(--navy) 40%, transparent)), var(--welcome-img) center / cover; }
.pv-welcome.has-image h3, .pv-welcome.has-image p { color: #fff; }
.pv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pv-card.classic-card { min-height: 0; padding: 12px; gap: 2px; animation: none; }
.pv-card .classic-icon { width: 36px; height: 36px; border-radius: 10px; font-size: calc(18px * var(--fz, 1)); margin-bottom: 6px; }
.pv-card h3 { font-size: calc(13px * var(--fz, 1)); }
.pv-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pv-text { font-size: calc(12.5px * var(--fz, 1)); color: var(--ink); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: calc(13px * var(--fz, 1)); }

/* شريط التغييرات غير المحفوظة */
.studio-bar { position: fixed; bottom: 18px; inset-inline: 0; margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); z-index: 70;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 16px; border-radius: 14px; color: #fff; font-size: calc(13.5px * var(--fz, 1));
  background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 85%, #fff), var(--navy)); box-shadow: 0 16px 34px -12px rgba(5,20,40,.6); animation: bar-in .25s ease-out; }
.studio-bar > span { display: inline-flex; align-items: center; gap: 6px; }
@keyframes bar-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } .studio-preview { position: static; order: -1; } .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-4, .grid-5, .toggle-grid { grid-template-columns: minmax(0, 1fr); } .studio-nav { top: 8px; } }

/* =========================================================================
   شريط الترحيب المتحرك: سلايدر بتأثير «كين بيرنز» أو فيديو قصير
   ========================================================================= */
.hero-media { position: relative; overflow: hidden; isolation: isolate; border-radius: calc(var(--radius) + 6px); margin-bottom: 18px;
  min-height: clamp(200px, 22vw, 290px); display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 4vw, 44px);
  color: #fff; background: var(--navy); box-shadow: 0 18px 36px -20px rgba(15,42,74,.6); }
.hero-slides, .hero-video { position: absolute; inset: 0; z-index: -2; }
.hero-video { width: 100%; height: 100%; object-fit: cover; }
.hero-slide { position: absolute; inset: 0; margin: 0; background: var(--img) var(--focus, center) / cover no-repeat; opacity: 0; transform: scale(1.12);
  transition: opacity 1.4s ease, transform 8s linear; will-change: opacity, transform; }
.hero-slide.on { opacity: 1; transform: scale(1) translateX(var(--kb-x, -1.5%)); }
.hero-slide:nth-child(even) { --kb-x: 1.5%; }
/* تظليل يضمن وضوح النص */
.hero-media::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(270deg, color-mix(in srgb, var(--navy) 92%, transparent) 0%, color-mix(in srgb, var(--navy) 70%, transparent) 38%, color-mix(in srgb, var(--navy) 15%, transparent) 75%, transparent 100%),
              linear-gradient(0deg, rgba(5,15,30,.45), transparent 45%); }
html[dir=ltr] .hero-media::before { background: linear-gradient(90deg, color-mix(in srgb, var(--navy) 92%, transparent) 0%, color-mix(in srgb, var(--navy) 70%, transparent) 38%, color-mix(in srgb, var(--navy) 15%, transparent) 75%, transparent 100%), linear-gradient(0deg, rgba(5,15,30,.45), transparent 45%); }
/* خط ذهبي معدني أسفل الشريط */
.hero-media::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; z-index: 1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 70%, #000), var(--amber), color-mix(in srgb, var(--amber) 35%, #fff), var(--amber), color-mix(in srgb, var(--amber) 70%, #000)); }
.hero-content { max-width: min(640px, 70%); }
.hero-content h1 { color: #fff; font-size: calc(clamp(24px, 2.6vw, 34px) * var(--fz, 1)); text-shadow: 0 2px 10px rgba(0,0,0,.35); margin-bottom: 8px; }
.hero-content p { color: rgba(255,255,255,.9); font-size: calc(15px * var(--fz, 1)); text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.hero-caption { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 14px; border-radius: 999px; font-size: calc(13.5px * var(--fz, 1)); font-weight: 600;
  color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.hero-caption .icon { color: color-mix(in srgb, var(--amber) 60%, #fff); }
.hero-caption.swap span { animation: cap-in .6s cubic-bezier(.2,.7,.2,1); }
@keyframes cap-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* مؤشرات الشرائح مع شريط تقدم */
.hero-dots { position: absolute; bottom: 16px; inset-inline-end: 22px; display: flex; gap: 6px; z-index: 2; }
.hero-dots button { width: 26px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.35); cursor: pointer; overflow: hidden; transition: width .3s; }
.hero-dots button.on { width: 46px; }
.hero-dots button i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 60%, #fff), var(--amber)); border-radius: inherit; }
.hero-dots button.on i { animation: dot-fill var(--interval, 6500ms) linear forwards; }
.hero-media.paused .hero-dots button.on i { animation-play-state: paused; }
@keyframes dot-fill { to { width: 100%; } }
.hero-play { position: absolute; bottom: 14px; inset-inline-end: 18px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.hero-play:hover { background: rgba(255,255,255,.28); }
@media (max-width: 700px) { .hero-content { max-width: 100%; } .hero-media::before { background: linear-gradient(0deg, color-mix(in srgb, var(--navy) 92%, transparent), color-mix(in srgb, var(--navy) 55%, transparent)); } }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: opacity .4s; transform: none !important; } }
.motion-reduced .hero-slide { transition: opacity .4s; transform: none !important; }
.media-card { flex-direction: row; align-items: center; justify-content: center; min-height: 56px; }
.slide-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.slide-thumb { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-thumb figcaption { position: absolute; top: 6px; inset-inline-start: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: calc(11px * var(--fz, 1)); font-weight: 700; background: rgba(15,42,74,.75); color: #fff; }
.slide-remove { position: absolute; top: 6px; inset-inline-end: 6px; display: flex; align-items: center; gap: 4px; margin: 0; padding: 3px 6px; border-radius: 8px; background: rgba(255,255,255,.92); color: var(--bad); font-size: calc(12px * var(--fz, 1)); cursor: pointer; }
.slide-remove:has(input:checked) { background: var(--bad); color: #fff; }
.slide-thumb:has(.slide-remove input:checked) img { opacity: .35; filter: grayscale(1); }
.slide-add { display: grid; place-items: center; border-style: dashed; border-width: 2px; cursor: pointer; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); font-weight: 600; }
.slide-add span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slide-add:hover { border-color: var(--amber); color: var(--navy); }
.slide-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.video-drop video { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================================
   الموديول 02: العملاء والسيارات
   ========================================================================= */
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mini-stats span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: calc(13px * var(--fz, 1)); color: var(--muted); }
.mini-stats b { color: var(--navy); font-size: calc(14px * var(--fz, 1)); }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line-2); border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow); }
html[dir=rtl] .search-bar { padding: 8px 14px 8px 8px; }
.search-bar:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 18%, transparent); }
.search-bar > .icon { color: var(--muted); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: calc(15.5px * var(--fz, 1)); padding: 8px 0; box-shadow: none; }
.search-clear { color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.search-clear:hover { background: var(--bg); text-decoration: none; }
.empty-state { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state.small { padding: 18px; }
.empty-state h2 { font-size: calc(18px * var(--fz, 1)); }
.empty-state p { color: var(--muted); }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--amber) 16%, #fff); color: var(--amber-ink); margin-bottom: 6px; }
.empty-ico .icon { width: 32px; height: 32px; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar-sm, .avatar-lg { display: grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 700; background: linear-gradient(145deg, color-mix(in srgb, var(--navy) 70%, #fff), var(--navy)); }
.avatar-sm { width: 36px; height: 36px; font-size: calc(14px * var(--fz, 1)); }
.avatar-lg { width: 64px; height: 64px; font-size: calc(26px * var(--fz, 1)); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--navy) 70%, transparent); }
.avatar-sm.company, .avatar-lg.company { border-radius: 12px; background: linear-gradient(145deg, color-mix(in srgb, var(--amber) 65%, #fff), color-mix(in srgb, var(--amber) 85%, #000)); color: var(--navy); }
.plates { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-link { cursor: pointer; }
.row-link:hover td { background: color-mix(in srgb, var(--amber) 5%, #fff); }
.pager { margin-top: 14px; }
.mono-input { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; }

/* اللوحة السعودية */
.ksa-plate { display: inline-flex; align-items: stretch; direction: ltr; background: #fff; border: 2px solid #1B1B1B; border-radius: 6px; overflow: hidden; font-family: Plex, sans-serif; line-height: 1.05; box-shadow: 0 2px 4px rgba(0,0,0,.12); vertical-align: middle; }
.kp-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 8px; min-width: 54px; }
.kp-cell + .kp-cell { border-inline-start: 1.5px solid #1B1B1B; }
.kp-cell b { font-size: calc(15px * var(--fz, 1)); font-weight: 700; color: #111; letter-spacing: 1px; white-space: nowrap; }
.kp-cell small { font-size: calc(11px * var(--fz, 1)); font-weight: 700; color: #111; border-top: 1.5px solid #1B1B1B; width: 100%; text-align: center; margin-top: 2px; padding-top: 1px; letter-spacing: 1.5px; }
.kp-ksa { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3px 4px; background: #F2F4F7; border-inline-start: 1.5px solid #1B1B1B; }
.kp-ksa i { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #4BB37C, #0B6B3A); }
.kp-ksa small { font-size: calc(7.5px * var(--fz, 1)); font-weight: 700; color: #111; letter-spacing: .5px; }
.ksa-plate-sm .kp-cell { padding: 1px 5px; min-width: 40px; }
.ksa-plate-sm .kp-cell b { font-size: calc(12px * var(--fz, 1)); }
.ksa-plate-sm .kp-cell small { font-size: calc(9px * var(--fz, 1)); }
.ksa-plate-sm .kp-ksa { display: none; }
.plate-preview-field [data-plate-preview] { display: flex; align-items: center; min-height: 46px; }

/* ملف العميل */
.profile-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px; margin-bottom: 18px; }
.profile-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-main h1 { font-size: calc(24px * var(--fz, 1)); margin-bottom: 4px; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: calc(13px * var(--fz, 1)); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-actions .wa { color: #128C4A; }
.profile-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-row h2 { display: flex; align-items: center; gap: 8px; font-size: calc(17px * var(--fz, 1)); }
.vehicle-list { display: flex; flex-direction: column; gap: 12px; }
.vehicle-card { padding: 16px 18px; transition: box-shadow .2s, transform .2s; }
.vehicle-card:hover { box-shadow: 0 10px 22px -12px rgba(15,42,74,.3); }
.vehicle-card.is-off { opacity: .65; }
.vehicle-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vehicle-title b { display: block; font-size: calc(16px * var(--fz, 1)); color: var(--navy); }
.vehicle-title small { color: var(--muted); }
.vehicle-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.vehicle-facts dt { font-size: calc(12px * var(--fz, 1)); color: var(--muted); }
.vehicle-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); font-size: calc(13.5px * var(--fz, 1)); word-break: break-all; }
.vehicle-notes { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; font-size: calc(13px * var(--fz, 1)); color: var(--warn); }
.vehicle-actions { display: flex; gap: 6px; margin-top: 12px; }
.vehicle-edit { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.side-notes { margin: 0 20px 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-size: calc(13px * var(--fz, 1)); }
.soon-card { opacity: .85; }
@media (max-width: 1000px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .vehicle-facts { grid-template-columns: minmax(0, 1fr); } .profile-actions { width: 100%; } .profile-actions .btn { flex: 1; } }

/* =========================================================================
   الموديول 01: لوحة الورشة وأمر التشغيل
   ========================================================================= */
.wo-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.wo-stats > div, .wo-stats > a { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.wo-stats span { font-size: calc(13px * var(--fz, 1)); color: var(--muted); }
.wo-stats b { font-size: calc(26px * var(--fz, 1)); color: var(--navy); line-height: 1.2; }
.wo-stats .warn b { color: var(--warn); } .wo-stats .ok b { color: var(--ok); }
.wo-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.wo-col { background: color-mix(in srgb, var(--sc) 6%, #F3F5F8); border: 1px solid color-mix(in srgb, var(--sc) 18%, var(--line)); border-radius: calc(var(--radius) + 2px); min-height: 200px; }
.wo-col header { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-weight: 700; font-size: calc(13.5px * var(--fz, 1)); color: color-mix(in srgb, var(--sc) 80%, #000); border-bottom: 3px solid var(--sc); }
.wo-count { margin-inline-start: auto; background: var(--sc); color: #fff; border-radius: 999px; padding: 0 9px; font-size: calc(12px * var(--fz, 1)); }
.wo-col-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.wo-empty { color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); text-align: center; margin: 14px 0; }
.wo-card { display: block; background: #fff; border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--line); border-inline-start: 4px solid var(--sc); color: var(--ink); box-shadow: 0 1px 2px rgba(15,42,74,.06); transition: transform .15s, box-shadow .15s; }
.wo-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(15,42,74,.35); }
.wo-card.is-late { background: linear-gradient(0deg, #fff, #fff), #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent); }
.wo-card.is-urgent { border-inline-start-color: var(--bad); }
.wo-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.wo-no { font-size: calc(12px * var(--fz, 1)); color: var(--muted); }
.wo-card-car { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wo-card-car b { font-size: calc(14px * var(--fz, 1)); color: var(--navy); }
.wo-card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: calc(12px * var(--fz, 1)); color: var(--muted); }
.wo-card-meta span { display: inline-flex; align-items: center; gap: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: calc(13px * var(--fz, 1)); font-weight: 600; }
.chips a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips a:hover { text-decoration: none; }
.status-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: calc(12.5px * var(--fz, 1)); font-weight: 700; color: color-mix(in srgb, var(--sc) 85%, #000); background: color-mix(in srgb, var(--sc) 14%, #fff); border: 1px solid color-mix(in srgb, var(--sc) 30%, #fff); vertical-align: middle; }

/* الاستقبال */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: calc(13.5px * var(--fz, 1)); font-weight: 600; }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: calc(12px * var(--fz, 1)); }
.steps li.on { border-color: var(--amber); color: var(--navy); } .steps li.on span { background: var(--amber); color: var(--navy); }
.steps li.done span { background: var(--ok); color: #fff; }
.search-bar.big input { font-size: calc(17px * var(--fz, 1)); padding: 12px 0; }
.lookup-results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lookup-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s, background .15s; }
.lookup-item:hover, .lookup-item:focus { text-decoration: none; border-color: var(--amber); background: color-mix(in srgb, var(--amber) 6%, #fff); outline: 0; }
.lookup-item .li-main { flex: 1; min-width: 0; }
.lookup-item b { color: var(--navy); }
.lookup-item small { display: block; color: var(--muted); }
.checkin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.checkin-grid aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 96px; }
.checkin-grid aside .card + .card { margin-top: 0; }
.btn-block { width: 100%; justify-content: center; min-height: 52px; font-size: calc(16px * var(--fz, 1)); }
.fuel-gauge { display: flex; align-items: center; gap: 8px; direction: ltr; }
.fuel-gauge input { flex: 1; accent-color: var(--amber); }
.fuel-gauge span { font-weight: 700; color: var(--muted); }
.check-chips, .quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chips label { margin: 0; cursor: pointer; }
.check-chips input { position: absolute; opacity: 0; }
.check-chips span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: calc(13px * var(--fz, 1)); font-weight: 500; color: var(--ink); }
.check-chips input:checked + span { background: color-mix(in srgb, var(--ok) 12%, #fff); border-color: var(--ok); color: var(--ok); }
.check-chips input:focus-visible + span { outline: 2px solid var(--navy); }
.quick-chips button { border: 1px dashed var(--line-2); background: var(--bg); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: calc(12.5px * var(--fz, 1)); cursor: pointer; color: var(--muted); }
.quick-chips button:hover { border-color: var(--amber); color: var(--navy); }
.photo-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--bg); cursor: pointer; text-align: center; margin: 0; font-weight: 500; }
.photo-drop .icon { width: 34px; height: 34px; color: var(--amber-ink); }
.photo-drop small { color: var(--muted); }
.photo-drop:hover, .photo-drop.drag { border-color: var(--amber); }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-thumbs, .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-thumbs img, .gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.gallery { margin-bottom: 14px; }
.gallery a { display: block; transition: transform .15s; } .gallery a:hover { transform: scale(1.03); }
hr.soft { border: 0; border-top: 1px dashed var(--line-2); margin: 12px 0; }
.mini-history { list-style: none; padding: 0; margin: 0; font-size: calc(13px * var(--fz, 1)); } .mini-history li { padding: 3px 0; }

/* أمر التشغيل */
.wo-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; margin-bottom: 14px; border-top: 4px solid var(--sc); }
.wo-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wo-head-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--sc) 70%, #fff), var(--sc)); box-shadow: 0 8px 16px -8px var(--sc); }
.wo-head-ico .icon { width: 28px; height: 28px; }
.wo-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: calc(22px * var(--fz, 1)); }
.wo-head .status-pill { --sc: inherit; }
.wo-head p { margin: 4px 0 0; font-size: calc(13px * var(--fz, 1)); }
.wo-flow { display: flex; list-style: none; padding: 0; margin: 0 0 14px; overflow-x: auto; }
.wo-flow li { flex: 1; min-width: 100px; position: relative; text-align: center; font-size: calc(12px * var(--fz, 1)); color: var(--muted); padding-top: 26px; font-weight: 600; }
.wo-flow li span { position: absolute; top: 4px; inset-inline-start: 50%; transform: translateX(50%); width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line-2); z-index: 1; }
html[dir=ltr] .wo-flow li span { transform: translateX(-50%); }
.wo-flow li::before { content: ""; position: absolute; top: 10px; inset-inline-start: 50%; width: 100%; height: 3px; background: var(--line); }
.wo-flow li:last-child::before { display: none; }
.wo-flow li.done span { background: var(--ok); border-color: var(--ok); } .wo-flow li.done::before { background: var(--ok); } .wo-flow li.done { color: var(--ok); }
.wo-flow li.on span { background: var(--amber); border-color: color-mix(in srgb, var(--amber) 70%, #000); box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 25%, transparent); } .wo-flow li.on { color: var(--navy); }
.status-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; margin-bottom: 16px; }
.status-bar .label { margin: 0; }
.status-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status-btn { color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--sc) 80%, #fff), var(--sc)); border-color: color-mix(in srgb, var(--sc) 85%, #000); }
.status-btn:hover { filter: brightness(1.06); }
.status-btn.is-cancel { background: #fff; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, #fff); }
.status-note { flex: 1; min-width: 200px; }
blockquote.complaint { margin: 0 0 14px; padding: 12px 14px; border-inline-start: 4px solid var(--amber); background: var(--warn-bg); border-radius: var(--radius-sm); white-space: pre-line; color: var(--ink); }
fieldset.plain { border: 0; padding: 0; margin: 0; }
.item-type { display: inline-block; font-size: calc(11px * var(--fz, 1)); font-weight: 700; padding: 1px 8px; border-radius: 6px; margin-inline-end: 6px; background: #EEF1F5; color: var(--muted); }
.item-type.t-labor { background: #E8F1FA; color: #2471A3; } .item-type.t-part { background: #FDF0E3; color: #B9770E; } .item-type.t-service { background: #EAF6EE; color: #1E8449; }
.item-form { padding: 14px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, #fff); }
.item-grid { display: grid; grid-template-columns: 2.4fr 1.2fr .8fr 1fr .8fr 1.2fr; gap: 0 10px; margin-top: 12px; }
.item-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.item-preview { margin-inline-start: auto; color: var(--muted); } .item-preview b { color: var(--navy); font-size: calc(16px * var(--fz, 1)); }
.totals { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; max-width: 420px; margin-inline-start: auto; }
.totals > div, .discount-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: calc(14px * var(--fz, 1)); }
.totals .grand { padding-top: 8px; border-top: 2px solid var(--navy); font-size: calc(18px * var(--fz, 1)); } .totals .grand b { color: var(--navy); }
.discount-input { display: inline-flex; gap: 4px; } .discount-input input { width: 110px; min-height: 34px; padding: 4px 8px; }
.photo-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px dashed var(--line); }
.photo-upload select { width: auto; }
.contact-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; } .contact-row .wa { color: #128C4A; }
.fuel-bar { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; vertical-align: middle; } .fuel-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bad), var(--amber), var(--ok)); }
.check-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 16px; } .check-list span { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12.5px * var(--fz, 1)); color: var(--ok); background: var(--ok-bg); padding: 3px 9px; border-radius: 999px; }
.note-form { display: flex; gap: 6px; margin-bottom: 12px; } .note-form input { flex: 1; min-width: 0; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 22px 14px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; padding-inline-start: 16px; padding-inline-end: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 3px #fff; }
.timeline li:last-child { border-color: transparent; }
.timeline b { display: block; font-size: calc(13.5px * var(--fz, 1)); color: var(--navy); } .timeline p { margin: 2px 0; font-size: calc(13px * var(--fz, 1)); } .timeline small { font-size: calc(11.5px * var(--fz, 1)); }

/* كرت العمل للطباعة */
.print-page { background: #E9ECF0; }
.print-tools { display: flex; gap: 8px; justify-content: center; padding: 14px; }
.job-card { background: #fff; width: 210mm; min-height: 280mm; margin: 0 auto 30px; padding: 14mm; box-shadow: 0 10px 30px rgba(0,0,0,.15); font-size: calc(13px * var(--fz, 1)); }
.job-card header { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; }
.jc-brand { display: flex; align-items: center; gap: 10px; } .jc-brand img { width: 54px; height: 54px; object-fit: contain; }
.jc-brand b { display: block; font-size: calc(18px * var(--fz, 1)); color: var(--navy); } .jc-brand small { display: block; color: var(--muted); }
.jc-title { text-align: end; } .jc-title h1 { font-size: calc(22px * var(--fz, 1)); } .jc-title .mono { font-size: calc(16px * var(--fz, 1)); font-weight: 700; display: block; } .jc-title small { color: var(--muted); }
.jc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.jc-grid > div { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; } .jc-grid p { margin: 2px 0; }
.job-card h3 { font-size: calc(13px * var(--fz, 1)); color: var(--navy); margin: 8px 0 4px; }
.jc-box { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-height: 40px; white-space: pre-line; }
.jc-table { width: 100%; border-collapse: collapse; } .jc-table th, .jc-table td { border: 1px solid var(--line-2); padding: 6px 8px; text-align: start; }
.jc-table th { background: #F1F4F8; } .jc-table tfoot td { font-weight: 600; } .jc-table tfoot td:first-child { text-align: end; } .jc-table .grand td { background: #F1F4F8; font-size: calc(14px * var(--fz, 1)); }
.jc-note { font-size: calc(11px * var(--fz, 1)); color: var(--muted); margin-top: 6px; }
.jc-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; } .jc-sign div { border-top: 1px solid #333; padding-top: 6px; text-align: center; font-size: calc(12px * var(--fz, 1)); }
@media print { .print-tools { display: none; } .print-page { background: #fff; } .job-card { box-shadow: none; margin: 0; width: auto; min-height: 0; padding: 0; } @page { size: A4; margin: 12mm; } }

@media (max-width: 1100px) { .checkin-grid { grid-template-columns: minmax(0, 1fr); } .checkin-grid aside { position: static; } .item-grid { grid-template-columns: 1fr 1fr; } .wo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .item-grid { grid-template-columns: minmax(0, 1fr); } .wo-board { grid-auto-columns: 85%; } }
.vehicle-cta { margin-inline-start: auto; }
.order-mini { list-style: none; margin: 0; padding: 6px 20px 14px; }
.order-mini li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.order-mini li:last-child { border-bottom: 0; }
.order-mini a { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.order-mini small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); }

/* =========================================================================
   المرحلة 3.3: لوحة الفني (واجهة تابلت بأزرار كبيرة)
   ========================================================================= */
.tech-ui { background: var(--bg); }
.tech-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(14px, 3vw, 32px); color: #fff; position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 45%, rgba(0,0,0,.18)), linear-gradient(100deg, color-mix(in srgb, var(--navy) 75%, #000), color-mix(in srgb, var(--navy) 70%, #fff) 40%, color-mix(in srgb, var(--navy) 85%, #000));
  border-bottom: 4px solid var(--amber); }
.tech-brand { display: flex; align-items: center; gap: 10px; color: #fff; } .tech-brand:hover { text-decoration: none; }
.tech-brand b { display: block; font-size: calc(17px * var(--fz, 1)); } .tech-brand small { display: block; color: #C8D3E0; font-size: calc(12px * var(--fz, 1)); }
.tech-who { display: flex; align-items: center; gap: 10px; } .tech-who form { margin: 0; }
.tech-who .avatar { background: linear-gradient(145deg, #F7B24A, var(--amber)); color: var(--navy); font-weight: 700; }
.tech-main { max-width: 1200px; margin: 0 auto; padding: 18px clamp(12px, 3vw, 28px) 60px; }
.tech-h { display: flex; align-items: center; gap: 8px; font-size: calc(19px * var(--fz, 1)); margin: 22px 0 10px; }
.tech-btn { min-height: 52px; padding: 10px 20px; font-size: calc(16px * var(--fz, 1)); font-weight: 700; border-radius: 12px; }
.tech-btn.btn-sm { min-height: 40px; padding: 6px 14px; font-size: calc(14px * var(--fz, 1)); }
.tech-btn.go { color: #fff; background: linear-gradient(180deg, #3DBB6E, #1E8449); border-color: #18703D; box-shadow: 0 6px 14px -6px rgba(30,132,73,.7); }
.tech-btn.ok { color: #fff; background: linear-gradient(180deg, #2E86C1, #1B4F72); border-color: #1B4F72; }
.tech-btn.light { background: #fff; color: var(--navy); border-color: var(--line-2); }
.tech-timer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: calc(var(--radius) + 4px); color: #fff; margin-bottom: 16px;
  background: linear-gradient(120deg, #1E8449, #17A589); box-shadow: 0 16px 30px -16px rgba(23,165,137,.8); }
.tt-pulse { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 1.6s infinite; flex: none; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.tt-info { flex: 1; min-width: 180px; } .tt-info b { display: block; font-size: calc(19px * var(--fz, 1)); } .tt-info small { display: block; opacity: .85; }
.tt-clock { font-size: calc(40px * var(--fz, 1)); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; direction: ltr; }
.tt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .tt-actions form { margin: 0; }
.tech-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tech-stats > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.tech-stats span { display: block; font-size: calc(13px * var(--fz, 1)); color: var(--muted); } .tech-stats b { font-size: calc(28px * var(--fz, 1)); color: var(--navy); } .tech-stats small { color: var(--muted); }
.tech-task { background: #fff; border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow); border-inline-start: 5px solid #F07A12; }
.tech-task.is-urgent { border-inline-start-color: var(--bad); }
.tech-task.is-running { border-inline-start-color: #1E8449; background: color-mix(in srgb, #1E8449 5%, #fff); }
.tech-task.compact { margin: 0; border-inline-start-color: var(--line-2); }
.tt-car { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .tt-car b { display: block; font-size: calc(16px * var(--fz, 1)); color: var(--navy); } .tt-car small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.tt-desc { font-size: calc(17px * var(--fz, 1)); margin: 10px 0 12px; color: var(--ink); font-weight: 600; } .tt-desc small { font-weight: 400; color: var(--muted); font-size: calc(13px * var(--fz, 1)); }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tech-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; }
.tech-order-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; } .tech-order-head h1 { font-size: calc(22px * var(--fz, 1)); }
.tech-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tech-cols .card + .card { margin-top: 16px; }
.tech-items { list-style: none; margin: 0; padding: 6px 18px 14px; }
.tech-items li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tech-items li > span:nth-child(2) { flex: 1; } .tech-items small { display: block; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); }
.tech-items li.done b { text-decoration: line-through; color: var(--muted); } .tech-items .ti-state { color: var(--muted); } .tech-items li.done .ti-state { color: var(--ok); }
.tech-items form { margin: 0; }
.part-reqs { list-style: none; padding: 0; margin: 12px 0 0; } .part-reqs li { padding: 6px 0; border-top: 1px dashed var(--line); font-size: calc(14px * var(--fz, 1)); }
.photo-drop.compact { padding: 12px; flex-direction: row; justify-content: center; gap: 8px; } .photo-drop.compact .icon { width: 24px; height: 24px; }
.gate-device.ok { color: var(--ok); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.howto { margin: 16px 0 0; padding-inline-start: 20px; color: var(--muted); font-size: calc(13.5px * var(--fz, 1)); } .howto li { padding: 3px 0; }
/* جهة المستشار */
.live-work { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.live-work span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, #1E8449 12%, #fff); color: #1E8449; font-weight: 600; font-size: calc(13px * var(--fz, 1)); }
.live-work .tt-pulse { width: 10px; height: 10px; background: #1E8449; }
.part-panel { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); margin-bottom: 16px; }
.part-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); }
.part-row > div { flex: 1; min-width: 180px; } .part-row small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.part-row form { margin: 0; } .part-issue { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .part-issue input[type=text], .part-issue input[type=number] { width: 120px; min-height: 36px; padding: 4px 8px; }
.items-table .actual { color: #1E8449; }
@media (max-width: 800px) { .tech-cols { grid-template-columns: minmax(0, 1fr); } .tech-stats b { font-size: calc(22px * var(--fz, 1)); } .tt-clock { font-size: calc(32px * var(--fz, 1)); } }
.tt-info small { color: rgba(255,255,255,.88); }

/* =========================================================================
   المرحلة 3.4: فحص الجودة
   ========================================================================= */
.qc-card { border: 2px solid color-mix(in srgb, #17A589 45%, var(--line)); margin-bottom: 16px; }
.qc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qc-check { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.qc-check input { position: absolute; opacity: 0; }
.qc-box { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: all .15s; }
.qc-check input:checked + .qc-box { background: #17A589; border-color: #17A589; color: #fff; }
.qc-check:has(input:checked) { border-color: color-mix(in srgb, #17A589 50%, #fff); background: color-mix(in srgb, #17A589 6%, #fff); }
.qc-check input:focus-visible + .qc-box { outline: 2px solid var(--navy); outline-offset: 2px; }
.qc-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-weight: 700; color: var(--navy); }
.qc-progress i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.qc-progress b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #17A589, #1E8449); transition: width .25s; }
.qc-rework { margin: 6px 0 12px; } .qc-rework summary { cursor: pointer; font-weight: 600; color: var(--bad); margin-bottom: 6px; }
.qc-pass { color: #fff; background: linear-gradient(180deg, #3DBB6E, #1E8449); border-color: #18703D; }
.qc-pass:disabled { opacity: .45; cursor: not-allowed; }
.qc-fail { background: #fff; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, #fff); }
.qc-history { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.qc-h { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); font-size: calc(13px * var(--fz, 1)); }
.qc-h.ok { background: var(--ok-bg); color: var(--ok); } .qc-h span { display: block; color: var(--ink); margin-top: 2px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: calc(17px * var(--fz, 1)); margin: 20px 0 10px; }
.qc-wait { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 10px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.qc-wait:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgba(15,42,74,.35); }
.qw-main { flex: 1; min-width: 200px; } .qw-main b { display: block; color: var(--navy); } .qw-main small { color: var(--muted); }
@media (max-width: 700px) { .qc-list { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================================
   المرحلة 3.5: الفاتورة الضريبية والتحصيل
   ========================================================================= */
.invoice-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.invoice-bar > div:first-child { display: flex; align-items: center; gap: 10px; } .invoice-bar b { font-size: calc(20px * var(--fz, 1)); color: var(--navy); }
.invoice-actions { display: flex; gap: 8px; flex-wrap: wrap; } .invoice-actions form { margin: 0; }
.invoice-card { padding: 22px; overflow-x: auto; }
.tax-invoice { font-size: calc(13px * var(--fz, 1)); color: #111; min-width: 640px; }
.ti-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 3px solid var(--navy); }
.ti-seller { display: flex; gap: 12px; align-items: flex-start; } .ti-seller img { width: 60px; height: 60px; object-fit: contain; }
.ti-seller b { display: block; font-size: calc(18px * var(--fz, 1)); color: var(--navy); } .ti-seller small { display: block; color: #444; line-height: 1.6; }
.ti-title { text-align: end; } .ti-title h1 { font-size: calc(22px * var(--fz, 1)); color: var(--navy); } .ti-title > span { display: block; color: #555; font-weight: 600; }
.ti-title dl { margin: 8px 0 0; } .ti-title dl div { display: flex; gap: 8px; justify-content: flex-end; font-size: calc(12.5px * var(--fz, 1)); } .ti-title dt { color: #555; } .ti-title dd { margin: 0; font-weight: 700; }
.ti-parties { display: grid; grid-template-columns: 1fr 1fr 130px; gap: 12px; margin: 14px 0; align-items: start; }
.ti-parties > div:not(.ti-qr) { border: 1px solid #D5DBE3; border-radius: 8px; padding: 8px 12px; } .ti-parties h3 { font-size: calc(12.5px * var(--fz, 1)); color: var(--navy); margin-bottom: 4px; } .ti-parties p { margin: 2px 0; }
.ti-qr { width: 130px; height: 130px; } .ti-qr svg { width: 100%; height: 100%; display: block; }
.ti-table { width: 100%; border-collapse: collapse; } .ti-table th, .ti-table td { border: 1px solid #D5DBE3; padding: 6px 8px; text-align: start; vertical-align: top; }
.ti-table th { background: #F1F4F8; font-size: calc(12px * var(--fz, 1)); } .ti-table th small { font-weight: 400; color: #666; } .ti-table td small { font-size: calc(11px * var(--fz, 1)); }
.ti-totals { width: 380px; margin: 12px 0 0; margin-inline-start: auto; display: flex; flex-direction: column; gap: 4px; }
.ti-totals div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #D5DBE3; } .ti-totals small { color: #666; font-size: calc(11px * var(--fz, 1)); }
.ti-totals .grand { border-bottom: 0; border-top: 2px solid var(--navy); padding-top: 8px; font-size: calc(16px * var(--fz, 1)); } .ti-totals .grand b { color: var(--navy); }
.ti-foot { margin-top: 24px; text-align: center; color: #666; font-size: calc(12px * var(--fz, 1)); border-top: 1px solid #E1E6ED; padding-top: 8px; }
.print-sheet { background: #fff; width: 210mm; margin: 0 auto 30px; padding: 12mm; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
@media print { .print-sheet { box-shadow: none; margin: 0; width: auto; padding: 0; } .tax-invoice { min-width: 0; } }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.pay-methods label { margin: 0; cursor: pointer; } .pay-methods input { position: absolute; opacity: 0; }
.pay-methods span { display: block; text-align: center; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-weight: 600; background: #fff; }
.pay-methods input:checked + span { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, #fff); color: var(--navy); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 30%, transparent); }
.pay-methods input:focus-visible + span { outline: 2px solid var(--navy); }
.filter-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; } .filter-row .field { margin: 0; min-width: 160px; }
.collect-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.collect-row span { display: flex; flex-direction: column; padding: 8px 14px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); min-width: 120px; }
.collect-row small { color: var(--muted); } .collect-row b { color: var(--navy); font-size: calc(16px * var(--fz, 1)); } .collect-row .sum { background: var(--navy); border-color: var(--navy); } .collect-row .sum small, .collect-row .sum b { color: #fff; }

/* =========================================================================
   المرحلة 3.6: المخزون
   ========================================================================= */
.stat-link { color: inherit; } .stat-link:hover { text-decoration: none; border-color: var(--warn); }
.wo-stats b.sm { font-size: calc(16px * var(--fz, 1)); }
.stock-qty { font-weight: 700; color: var(--ok); } .stock-qty.low { color: var(--warn); } .stock-qty.zero { color: var(--bad); }
.stock-big { display: flex; flex-direction: column; align-items: center; padding: 8px 18px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); }
.stock-big.low { background: var(--warn-bg); color: var(--warn); } .stock-big b { font-size: calc(30px * var(--fz, 1)); line-height: 1.1; } .stock-big b span { font-size: calc(15px * var(--fz, 1)); } .stock-big small { color: inherit; opacity: .85; }
.avatar-lg .icon { width: 30px; height: 30px; }
.mv { font-size: calc(12px * var(--fz, 1)); font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #EEF1F5; }
.mv-receive { background: var(--ok-bg); color: var(--ok); } .mv-issue { background: #FDF0E3; color: #B9770E; } .mv-return { background: #E8F1FA; color: #2471A3; } .mv-adjust { background: #F3E8F7; color: #7D3C98; }
b.plus { color: var(--ok); } b.minus { color: var(--bad); }
.stock-form { border-top: 1px dashed var(--line-2); }
.stock-form .label { display: flex; align-items: center; gap: 6px; }
.stock-form .item-foot .field { margin: 0; width: 130px; }
.stock-picker { position: relative; display: block; } .stock-picker.compact { display: inline-block; min-width: 200px; }
.stock-picker input[type=search] { width: 100%; }
.stock-results { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 280px; overflow: auto; display: block; }
.stock-results:empty { display: none; border: 0; }
.stock-results button { display: block; width: 100%; text-align: start; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; cursor: pointer; }
.stock-results button:hover, .stock-results button:focus { background: color-mix(in srgb, var(--amber) 8%, #fff); outline: 0; }
.stock-results button.out b { color: var(--bad); } .stock-results small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); } .stock-results em { display: block; padding: 10px 12px; color: var(--muted); }
.stock-chosen { margin: 8px 0; font-size: calc(13.5px * var(--fz, 1)); padding: 6px 10px; background: var(--bg); border-radius: var(--radius-sm); }

/* =========================================================================
   المرحلة 4.1: رابط متابعة العميل (واجهة جوال)
   ========================================================================= */
.public-ui { background: var(--bg); }
.pub-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; border-bottom: 4px solid var(--amber);
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 45%, rgba(0,0,0,.18)), linear-gradient(100deg, color-mix(in srgb, var(--navy) 75%, #000), color-mix(in srgb, var(--navy) 70%, #fff) 45%, color-mix(in srgb, var(--navy) 85%, #000)); }
.pub-top img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; }
.pub-top b { display: block; font-size: calc(16px * var(--fz, 1)); } .pub-top a { color: #D9E2EC; font-size: calc(12.5px * var(--fz, 1)); }
.pub-main { max-width: 640px; margin: 0 auto; padding: 16px 14px 30px; display: flex; flex-direction: column; gap: 14px; }
.pub-main .card + .card { margin-top: 0; }
.pub-car { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .pub-car h1 { font-size: calc(21px * var(--fz, 1)); } .pub-car p { margin: 2px 0 0; color: var(--muted); }
.pub-status { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: calc(var(--radius) + 4px); color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 80%, #fff), var(--sc)); box-shadow: 0 14px 28px -16px var(--sc); }
.ps-ico { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.ps-ico .icon { width: 28px; height: 28px; }
.pub-status small { display: block; opacity: .9; color: #fff; } .pub-status > div > b { display: block; font-size: calc(20px * var(--fz, 1)); }
.pub-flow { list-style: none; margin: 0; padding: 4px 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.pub-flow li { position: relative; padding: 10px 46px 10px 16px; color: var(--muted); }
html[dir=rtl] .pub-flow li { padding: 10px 46px 10px 16px; }
.pub-flow li::before { content: ""; position: absolute; inset-inline-start: 23px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.pub-flow li:first-child::before { top: 50%; } .pub-flow li:last-child::before { bottom: 50%; }
.pf-dot { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line-2); z-index: 1; }
.pub-flow b { display: block; font-size: calc(14.5px * var(--fz, 1)); } .pub-flow small { font-size: calc(12px * var(--fz, 1)); }
.pub-flow li.done { color: var(--ink); } .pub-flow li.done .pf-dot { background: var(--ok); border-color: var(--ok); } .pub-flow li.done::before { background: var(--ok); }
.pub-flow li.on { color: var(--navy); } .pub-flow li.on b { font-size: calc(16px * var(--fz, 1)); } .pub-flow li.on .pf-dot { background: var(--amber); border-color: color-mix(in srgb, var(--amber) 70%, #000); box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 25%, transparent); }
.pub-approve { border: 2px solid color-mix(in srgb, var(--amber) 60%, var(--line)); }
.pa-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.pa-row b { display: block; } .pa-row small { color: var(--muted); }
.pa-actions { display: flex; gap: 6px; } .pa-actions form { margin: 0; }
.pa-yes { color: #fff; background: linear-gradient(180deg, #3DBB6E, #1E8449); border-color: #18703D; min-height: 44px; }
.pa-no { background: #fff; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, #fff); min-height: 44px; }
.pub-items { list-style: none; margin: 0; padding: 4px 16px; } .pub-items li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ok-ico { color: var(--ok); }
.pub-total { padding: 8px 16px 14px; } .pub-total div { display: flex; justify-content: space-between; padding: 4px 0; } .pub-total .grand { font-size: calc(18px * var(--fz, 1)); border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 8px; } .pub-total .grand b { color: var(--navy); }
.pub-main .btn-block { margin: 0 16px 16px; width: calc(100% - 32px); }
.pub-contact { display: flex; gap: 8px; } .pub-contact .btn { flex: 1; justify-content: center; } .pub-contact .wa { color: #128C4A; }
.pub-foot { text-align: center; color: var(--muted); font-size: calc(12px * var(--fz, 1)); padding: 0 16px 24px; }
.public-ui .invoice-card { padding: 12px; } .public-ui .tax-invoice { min-width: 560px; }
@media print { .pub-top, .pub-foot, .tech-back, .public-ui .btn { display: none !important; } .public-ui .invoice-card { border: 0; box-shadow: none; } }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.vars button { border: 1px dashed var(--line-2); background: var(--bg); border-radius: 8px; padding: 4px 9px; font: inherit; font-size: calc(12.5px * var(--fz, 1)); cursor: pointer; direction: ltr; }
.vars button small { direction: rtl; color: var(--muted); } .vars button:hover { border-color: var(--amber); }
.tpl { padding: 12px 0; border-top: 1px dashed var(--line); } .tpl textarea { width: 100%; margin-top: 6px; }
.tpl-meta { color: var(--muted); font-size: calc(12px * var(--fz, 1)); } .link-btn { border: 0; background: none; color: var(--navy-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.track-link { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg); font-size: calc(13px * var(--fz, 1)); }
.track-link span { flex: 1; display: inline-flex; align-items: center; gap: 4px; }
/* بوابة العميل */
.portal-hello { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .portal-hello small { color: var(--muted); } .portal-hello h1 { font-size: calc(22px * var(--fz, 1)); }
.pub-h { font-size: calc(16px * var(--fz, 1)); margin: 6px 0 -4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .pub-h small { font-weight: 400; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); }
.portal-open { text-decoration: none; } .portal-open:hover { text-decoration: none; filter: brightness(1.05); } .portal-open > .icon { margin-inline-start: auto; }
.portal-cars { display: grid; gap: 8px; } .portal-car { display: flex; align-items: center; gap: 12px; padding: 12px 14px; } .portal-car b { display: block; color: var(--navy); } .portal-car small { color: var(--muted); }
.portal-visit { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.portal-visit:last-child { border-bottom: 0; } .portal-visit:hover { text-decoration: none; background: var(--bg); }
.portal-visit b { display: block; } .portal-visit small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); } .portal-visit > span { text-align: end; }
/* البصمة */
.pk-hero { display: flex; justify-content: center; gap: 14px; padding: 8px 0 14px; color: var(--amber-ink); }
.pk-hero .icon { width: 44px; height: 44px; stroke-width: 1.4; }
.pk-msg { margin: 10px 0 0; font-size: calc(13.5px * var(--fz, 1)); min-height: 20px; } .pk-msg.ok { color: var(--ok); } .pk-msg.bad { color: var(--bad); }
.pk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .pk-row b { display: inline-flex; align-items: center; gap: 6px; }
.bio-note.err { color: var(--bad); display: block; }

/* =========================================================================
   لوحة العميل الاحترافية: متابعة حية لكل مراحل الإصلاح
   ========================================================================= */
.pub-main { max-width: 760px; }
.live-hero { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: calc(var(--radius) + 6px); color: #fff; flex-wrap: wrap;
  background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.18), transparent 45%), linear-gradient(135deg, color-mix(in srgb, var(--sc) 75%, #fff), var(--sc) 60%, color-mix(in srgb, var(--sc) 80%, #000));
  box-shadow: 0 18px 34px -18px var(--sc); }
.ring { --deg: calc(var(--pct) * 3.6deg); width: 112px; height: 112px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff var(--deg), rgba(255,255,255,.22) 0); animation: ring-in 1.2s ease-out; }
.ring span { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: color-mix(in srgb, var(--sc) 88%, #000); }
.ring b { font-size: calc(28px * var(--fz, 1)); line-height: 1; } .ring small { font-size: calc(12px * var(--fz, 1)); opacity: .85; color: #fff; }
@keyframes ring-in { from { background: conic-gradient(#fff 0deg, rgba(255,255,255,.22) 0); } }
.lh-main { flex: 1; min-width: 220px; }
.lh-car { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; opacity: .95; }
.lh-car .ksa-plate { box-shadow: none; }
.lh-main h2 { color: #fff; font-size: calc(21px * var(--fz, 1)); margin: 8px 0; line-height: 1.4; }
.lh-live { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.18); font-weight: 600; font-size: calc(13.5px * var(--fz, 1)); margin-bottom: 8px; }
.lh-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: calc(13px * var(--fz, 1)); opacity: .95; } .lh-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.lh-meta .late b { color: #FFE2AE; } .lh-meta b[data-countdown-to] { margin-inline-start: 4px; background: rgba(255,255,255,.2); padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.live-steps { list-style: none; margin: 0; padding: 14px 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.live-steps li { position: relative; text-align: center; padding-top: 4px; color: var(--muted); }
.live-steps li::before { content: ""; position: absolute; top: 19px; inset-inline-start: 50%; width: 100%; height: 3px; background: var(--line); }
.live-steps li:last-child::before { display: none; }
.ls-dot { position: relative; z-index: 1; width: 32px; height: 32px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: calc(13px * var(--fz, 1)); background: #fff; border: 2px solid var(--line-2); }
.live-steps b { display: block; font-size: calc(12.5px * var(--fz, 1)); line-height: 1.3; } .live-steps small { font-size: calc(11px * var(--fz, 1)); }
.live-steps li.done { color: var(--ok); } .live-steps li.done::before { background: var(--ok); } .live-steps li.done .ls-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.live-steps li.on { color: var(--navy); } .live-steps li.on .ls-dot { background: var(--amber); border-color: color-mix(in srgb, var(--amber) 70%, #000); color: var(--navy); box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 22%, transparent); animation: pulse-amber 2s infinite; }
@keyframes pulse-amber { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--amber) 8%, transparent); } }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .live-grid .card + .card { margin-top: 0; }
.live-list { list-style: none; margin: 0; padding: 4px 16px 12px; }
.live-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.live-list li:last-child { border-bottom: 0; }
.live-list b { display: block; font-size: calc(14px * var(--fz, 1)); } .live-list small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.ll-ico { flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); }
.live-list li.done .ll-ico { color: var(--ok); } .live-list li.run .ll-ico .tt-pulse { background: #1E8449; width: 12px; height: 12px; }
.live-list li.run b { color: #1E8449; } .live-list li.wait .ll-ico { color: var(--warn); } .live-list li.wait small { color: var(--warn); }
.qc-badge { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); color: var(--warn); }
.qc-badge.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); color: var(--ok); }
.qc-badge > .icon { width: 34px; height: 34px; flex: none; } .qc-badge b { display: block; } .qc-badge small { color: var(--ink); opacity: .75; }
.pub-total .due { color: var(--bad); font-weight: 700; }
.stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; margin-bottom: 10px; }
.stars input { position: absolute; opacity: 0; }
.stars label, .stars span { font-size: calc(38px * var(--fz, 1)); color: var(--line-2); cursor: pointer; transition: color .15s, transform .15s; margin: 0; line-height: 1; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #F5B301; }
.stars label:hover { transform: scale(1.12); }
.stars.static { flex-direction: row; } .stars.static span.on { color: #F5B301; } .stars.static span { cursor: default; }
.rate-card textarea { width: 100%; margin-bottom: 10px; } .rate-card .btn-block { margin: 0; width: 100%; }
.stars-mini { color: #F5B301; letter-spacing: 1px; }
.portal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.portal-stats > * { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-align: center; }
.portal-stats > a:hover { text-decoration: none; border-color: var(--amber); }
.portal-stats .icon { color: var(--muted); } .portal-stats b { font-size: calc(20px * var(--fz, 1)); color: var(--navy); } .portal-stats small { font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); }
.portal-stats .hot { border-color: color-mix(in srgb, #F07A12 40%, var(--line)); } .portal-stats .hot .icon { color: #F07A12; }
.portal-stats .warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); } .portal-stats .warn b, .portal-stats .warn .icon { color: var(--warn); }
.portal-tabs { display: flex; gap: 6px; overflow-x: auto; } .portal-tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.portal-tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); } .portal-tabs a:hover { text-decoration: none; }
.car-book summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.car-book summary::-webkit-details-marker { display: none; }
.car-book summary > span:nth-child(2) { flex: 1; } .car-book summary b { display: block; color: var(--navy); } .car-book summary small { color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.car-book[open] summary { border-bottom: 1px solid var(--line); }
.portal-visit small.inline { display: inline; } .ok-t { color: var(--ok) !important; } .bad-t { color: var(--bad) !important; }
@media (max-width: 640px) {
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-stats { grid-template-columns: repeat(2, 1fr); }
  .live-steps { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } .live-steps li:nth-child(3)::before { display: none; }
  .ring { width: 96px; height: 96px; } .ring span { width: 74px; height: 74px; } .ring b { font-size: calc(23px * var(--fz, 1)); }
  .live-hero { padding: 16px; } .lh-main h2 { font-size: calc(18px * var(--fz, 1)); }
}

/* ===== 4.5: محادثة العميل مع الورشة، عارض الصور، سجل الصيانة ===== */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px 2px 10px; }
.msg { align-self: flex-end; max-width: 82%; background: var(--bg); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.msg.me { align-self: flex-start; background: color-mix(in srgb, var(--navy) 8%, #fff); border-color: color-mix(in srgb, var(--navy) 18%, var(--line)); border-radius: 14px 14px 4px 14px; }
.msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; } .msg small { display: block; margin-top: 3px; font-size: calc(11px * var(--fz, 1)); color: var(--muted); }
.chat-empty { margin: 0 0 10px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; } .chat-form textarea { flex: 1; min-width: 0; resize: vertical; } .chat-form .btn { flex: none; }
.chat-card.needs-reply { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 14%, transparent); }
.msg-badge { display: inline-flex; align-items: center; gap: 3px; animation: pulse-amber 2s infinite; }
.car-book-foot { padding: 10px 14px; border-top: 1px solid var(--line); text-align: center; }
.svc-book .jc-table td { vertical-align: top; } .svc-foot { margin-top: 18px; font-size: calc(12px * var(--fz, 1)); color: var(--muted); text-align: center; }
.gallery a { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(8,14,24,.92); display: grid; place-items: center; animation: lb-in .18s ease-out; touch-action: pan-y; }
.lb img { max-width: 94vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); user-select: none; }
.lb button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: calc(26px * var(--fz, 1)); line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb button:hover { background: rgba(255,255,255,.26); }
.lb .lb-x { top: 16px; inset-inline-end: 16px; } .lb .lb-prev { inset-inline-start: 14px; top: 50%; transform: translateY(-50%); } .lb .lb-next { inset-inline-end: 14px; top: 50%; transform: translateY(-50%); }
.lb .lb-cap { position: absolute; bottom: 18px; inset-inline: 0; text-align: center; color: #fff; font-size: calc(13px * var(--fz, 1)); opacity: .85; }
@keyframes lb-in { from { opacity: 0; } }

/* ===== 5.1: المشتريات والموردون ===== */
.chip-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.chip-filter a { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: calc(13px * var(--fz, 1)); }
.chip-filter a.on { background: var(--navy); border-color: var(--navy); color: #fff; } .chip-filter a:hover { text-decoration: none; border-color: var(--amber); }
.po-suggest { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .po-suggest .btn { margin-inline-start: auto; }
.po-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .po-actions form { margin: 0; }
.po-picker { margin-bottom: 10px; }
.po-lines input[type=number] { width: 110px; } .po-lines td { vertical-align: middle; }
.po-lines tr.flash { animation: po-flash 1s ease-out; } @keyframes po-flash { from { background: color-mix(in srgb, var(--amber) 30%, #fff); } }
.po-empty { text-align: center; padding: 14px; margin: 0; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.po-totals { margin: 14px 0 6px auto; max-width: 340px; display: grid; gap: 6px; }
.po-totals div { display: flex; justify-content: space-between; gap: 12px; } .po-totals .grand { border-top: 2px solid var(--navy); padding-top: 8px; font-size: calc(17px * var(--fz, 1)); color: var(--navy); }
.po-progress { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: calc(13px * var(--fz, 1)); color: var(--muted); }
.po-progress i { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; } .po-progress i b { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 60%, #fff)); }
.receive-card .qty-in { width: 100px; } .receive-foot { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .receive-foot .field { margin: 0; min-width: 200px; }
.po-meta { display: grid; gap: 4px; } .po-meta small { color: var(--muted); }
.po-cancel { margin-top: 8px; } .po-cancel summary { cursor: pointer; color: var(--bad); font-size: calc(13px * var(--fz, 1)); } .po-cancel form { display: flex; gap: 6px; margin-top: 8px; } .po-cancel input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .po-lines thead { display: none; } .po-lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); } .po-lines td { border: 0; padding: 2px 4px; } .po-lines td:first-child { grid-column: 1 / -1; } .po-lines input[type=number] { width: 100%; } }

/* ===== 5.2: التقارير ===== */
.rep-period { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; } .rep-period .chip-filter { margin: 0; }
.rep-custom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: calc(13px * var(--fz, 1)); color: var(--muted); } .rep-custom label { display: flex; align-items: center; gap: 6px; margin: 0; } .rep-custom input { padding: 6px 8px; min-height: 0; }
.wo-stats > * small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); margin-top: 2px; }
.rep-top { align-items: start; margin-bottom: 16px; } .rep-top .card { margin: 0; }
.rep-cols { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding: 16px 16px 0; border-bottom: 1px solid var(--line-2); }
.rep-cols.dense { gap: 1px; }
.rep-cols .rc { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.rep-cols .rc i { display: block; width: 100%; background: var(--navy); border-radius: 4px 4px 0 0; transition: opacity .15s; min-height: 0; }
.rep-cols:hover .rc i { opacity: .45; } .rep-cols .rc:hover i { opacity: 1; }
.rep-cols .rc:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: calc(12px * var(--fz, 1)); padding: 5px 9px; border-radius: 6px; z-index: 5; pointer-events: none; }
.rep-cols .rc:first-child:hover::after { left: auto; right: 0; transform: none; } .rep-cols .rc:last-child:hover::after { left: 0; transform: none; }
.rep-axis { display: flex; justify-content: space-between; padding: 6px 16px 14px; font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); }
.rep-bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: calc(13.5px * var(--fz, 1)); }
.rep-bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-bar i { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; } .rep-bar i b { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.rep-bar em { font-style: normal; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-bar.slim { grid-template-columns: 1fr auto; min-width: 160px; padding: 0; } .rep-bar.slim em { color: var(--ink); font-weight: 600; }
.rep-mix .hint-line { margin-top: 10px; }
tr.rep-low { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.rep-pct { display: inline-block; min-width: 56px; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 22%, transparent) var(--w), transparent var(--w)); }
[dir=rtl] .rep-pct { background: linear-gradient(270deg, color-mix(in srgb, var(--ok) 22%, transparent) var(--w), transparent var(--w)); }
@media (max-width: 640px) { .rep-cols { height: 130px; padding: 12px 8px 0; } .rep-bar { grid-template-columns: 1fr auto; } .rep-bar > span { grid-column: 1 / -1; } }

/* ===== 5.3: الموارد البشرية ===== */
.hr-alerts { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.att-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .att-head form { margin: 0; } .att-head b { color: var(--navy); }
.att-table select, .att-table input[type=time] { min-width: 0; width: 100%; max-width: 140px; } .att-table input[type=text] { width: 100%; min-width: 120px; }
tr.att-unset { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px 16px; }
.att-cal .ac { border-radius: 8px; padding: 6px 4px; text-align: center; border: 1px solid var(--line); background: #fff; cursor: default; }
.att-cal .ac b { display: block; font-size: calc(13px * var(--fz, 1)); } .att-cal .ac small { font-size: calc(11px * var(--fz, 1)); font-weight: 700; }
.ac-present { background: var(--ok-bg) !important; border-color: color-mix(in srgb, var(--ok) 30%, var(--line)) !important; color: var(--ok); }
.ac-late { background: var(--warn-bg) !important; color: var(--warn); } .ac-absent { background: var(--bad-bg, #FDECEA) !important; color: var(--bad); }
.ac-leave { background: var(--info-bg) !important; color: #1F5F99; } .ac-off { background: var(--bg) !important; color: var(--muted); }
.att-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 16px 14px; font-size: calc(12px * var(--fz, 1)); color: var(--muted); } .att-legend span { display: inline-flex; align-items: center; gap: 4px; background: none !important; }
.att-legend i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line-2); background: currentColor; opacity: .7; } .att-legend .ac-none i { background: #fff; }
.inline-month { margin-inline-start: auto; } .inline-month input { padding: 4px 8px; min-height: 0; }
.payroll-table input[type=number] { width: 96px; } .payroll-table .pl-note { width: 96px; margin-top: 4px; font-size: calc(12px * var(--fz, 1)); padding: 4px 6px; min-height: 0; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slip-net { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 14px 18px; border: 2px solid var(--navy); border-radius: 10px; font-size: calc(18px * var(--fz, 1)); } .slip-net b { font-size: calc(22px * var(--fz, 1)); color: var(--navy); }
@media (max-width: 640px) { .att-cal { gap: 4px; padding: 10px; } .slip-cols { grid-template-columns: 1fr; } }

/* ===== 5.4: التحليلات ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -16px rgba(16,32,58,.45); }
.kpi > span { color: var(--muted); font-size: calc(13px * var(--fz, 1)); } .kpi > b { font-size: calc(24px * var(--fz, 1)); color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi-d { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); font-weight: 600; }
.kpi-d.good { color: var(--ok); } .kpi-d.bad { color: var(--bad); } .kpi-d em { font-style: normal; font-weight: 400; color: var(--muted); }
.insights ul { list-style: none; margin: 0; padding: 6px 16px 14px; display: grid; gap: 8px; }
.insights li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.6; }
.insights li .icon { flex: none; margin-top: 4px; } .in-up .icon { color: var(--ok); } .in-down .icon { color: var(--warn); } .in-flat .icon { color: var(--muted); }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; } .sm-grid .card { margin: 0; }
.sm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 16px 0; } .sm-head h3 { margin: 0; font-size: calc(14px * var(--fz, 1)); color: var(--muted); font-weight: 600; } .sm-head b { font-size: calc(18px * var(--fz, 1)); color: var(--navy); }
.sm-cols { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding: 12px 16px 0; border-bottom: 1px solid var(--line-2); }
.sm-cols .rc, .rep-cols .rc { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.sm-cols .rc i { display: block; width: 100%; background: color-mix(in srgb, var(--navy) 55%, #fff); border-radius: 4px 4px 0 0; transition: opacity .15s; }
.sm-cols .rc.cur i { background: var(--navy); }
.sm-cols:hover .rc i { opacity: .45; } .sm-cols .rc:hover i { opacity: 1; }
.sm-cols .rc:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: calc(12px * var(--fz, 1)); padding: 5px 9px; border-radius: 6px; z-index: 5; pointer-events: none; }
.sm-cols .rc:first-child:hover::after { left: auto; right: 0; transform: none; } .sm-cols .rc:last-child:hover::after { left: 0; transform: none; }
.branch-cmp td.best { font-weight: 700; color: var(--ok); background: var(--ok-bg); }
.data-table summary { cursor: pointer; padding: 14px 16px; font-weight: 600; display: flex; gap: 6px; align-items: center; } .data-table table td, .data-table table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi > b { font-size: calc(20px * var(--fz, 1)); } .sm-grid { grid-template-columns: 1fr; } }
.insights { margin-bottom: 16px; }

/* ===== التحليلات: بطاقات ملوّنة بخلفيات متدرجة وأيقونات ===== */
.tone-navy { --tone: var(--navy); } .tone-green { --tone: #1E8449; } .tone-amber { --tone: #D9822B; }
.tone-red { --tone: #C0392B; } .tone-teal { --tone: #148F86; } .tone-violet { --tone: #6C4AB6; }
.kpi[class*="tone-"], .card.sm[class*="tone-"] {
  position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--tone) 22%, var(--line));
  background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 55%),
              linear-gradient(160deg, color-mix(in srgb, var(--tone) 7%, #fff), #fff 70%);
}
.kpi[class*="tone-"]::before, .card.sm[class*="tone-"]::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 35%, #fff)); }
.kpi[class*="tone-"]::after { content: ""; position: absolute; inset-inline-start: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 7%, transparent); pointer-events: none; }
.kpi { padding-inline-end: 64px; }
.kpi-ico { position: absolute; top: 14px; inset-inline-end: 14px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 75%, #fff), var(--tone)); box-shadow: 0 8px 16px -8px var(--tone); }
.kpi > b { color: color-mix(in srgb, var(--tone) 55%, var(--ink)); }
.kpi:hover { border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); box-shadow: 0 14px 28px -18px var(--tone); }
.card.sm { transition: transform .15s, box-shadow .15s; } .card.sm:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -20px var(--tone); }
.sm-head { align-items: center; } .sm-ico { position: static; width: 30px; height: 30px; border-radius: 9px; flex: none; } .sm-head h3 { flex: 1; }
.sm-head b { color: color-mix(in srgb, var(--tone) 60%, var(--ink)); }
.card.sm .sm-cols .rc i { background: color-mix(in srgb, var(--tone) 45%, #fff); } .card.sm .sm-cols .rc.cur i { background: var(--tone); }
.sm-empty { height: 96px; margin: 12px 16px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: color-mix(in srgb, var(--tone) 45%, var(--muted)); font-size: calc(12.5px * var(--fz, 1));
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--tone) 5%, transparent) 0 8px, transparent 8px 16px); border-radius: 10px 10px 0 0; }
.sm-empty .icon { width: 26px; height: 26px; opacity: .55; }
.insights { background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 9%, #fff), #fff 60%); border-color: color-mix(in srgb, var(--amber) 28%, var(--line)); }
.insights .card-head .icon { color: var(--amber); }

/* ===== بلاطات الأرقام في كل الموديولات: خلفية متدرجة وشريط لوني وزخرفة خفيفة ===== */
.wo-stats > div, .wo-stats > a { --tone: var(--navy); position: relative; overflow: hidden; padding: 14px 18px;
  border-color: color-mix(in srgb, var(--tone) 18%, var(--line));
  background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--tone) 12%, transparent), transparent 55%), linear-gradient(160deg, color-mix(in srgb, var(--tone) 6%, #fff), #fff 70%);
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.wo-stats > .warn { --tone: #D9822B; } .wo-stats > .ok { --tone: #1E8449; }
.wo-stats > :nth-child(4n+2):not(.warn):not(.ok) { --tone: #148F86; } .wo-stats > :nth-child(4n+3):not(.warn):not(.ok) { --tone: #6C4AB6; }
.wo-stats > div::before, .wo-stats > a::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 30%, #fff)); }
.wo-stats > div::after, .wo-stats > a::after { content: ""; position: absolute; inset-inline-start: -26px; bottom: -36px; width: 100px; height: 100px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 8%, transparent); pointer-events: none; }
.wo-stats > div:hover, .wo-stats > a:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); box-shadow: 0 14px 26px -18px var(--tone); text-decoration: none; }
.wo-stats b { color: color-mix(in srgb, var(--tone) 60%, var(--ink)); position: relative; }

/* ===== الإشعار الدائن ===== */
.credit-grid { align-items: start; } .credit-totals { border: 1px solid var(--line); border-radius: var(--radius); }
.refund-box { margin-top: 12px; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--bad) 40%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--bad) 4%, #fff); }
.credit-doc .ti-title h1 { color: var(--bad); }
.order-mini li.refund-row b[dir=ltr] { color: var(--bad); }
.data-table th small { color: var(--muted); font-weight: 400; font-size: calc(11px * var(--fz, 1)); }
.data-table .yr-start { border-inline-start: 2px solid color-mix(in srgb, var(--amber) 70%, transparent); }

/* تسجيل جهاز الفنيين من شاشة الدخول */
.device-setup { border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--amber) 12%, #fff), #fff 70%); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.ds-head { display: flex; gap: 10px; align-items: flex-start; } .ds-head > .icon { width: 30px; height: 30px; color: #B86E12; flex: none; }
.ds-head b { display: block; color: var(--navy); } .ds-head small { color: var(--muted); }
.device-setup ol { margin: 10px 0 12px; padding-inline-start: 22px; font-size: calc(13.5px * var(--fz, 1)); line-height: 1.9; }
.device-setup .auth2-btn { display: flex; justify-content: center; align-items: center; gap: 8px; text-decoration: none; margin: 0; }
.inline-form { display: inline; }

/* ===== لوحة الفني ===== */
.tech-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; margin-bottom: 14px; border-radius: calc(var(--radius) + 6px); color: #fff;
  background: radial-gradient(circle at 12% 0%, rgba(255,255,255,.16), transparent 50%), linear-gradient(135deg, color-mix(in srgb, var(--navy) 80%, #3a5a8c), var(--navy) 55%, color-mix(in srgb, var(--navy) 85%, #000));
  box-shadow: 0 18px 34px -22px var(--navy); position: relative; overflow: hidden; }
.tech-hero::after { content: ""; position: absolute; inset-inline-start: -40px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%; background: color-mix(in srgb, var(--amber) 22%, transparent); }
.th-main { position: relative; z-index: 1; } .th-main small { opacity: .8; } .th-main h1 { color: #fff; margin: 4px 0 6px; font-size: calc(24px * var(--fz, 1)); display: flex; align-items: center; gap: 8px; } .th-main h1 .icon { color: var(--amber); width: 26px; height: 26px; }
.th-main p { margin: 0; opacity: .9; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.th-tag { padding: 1px 8px; border-radius: 999px; font-size: calc(12px * var(--fz, 1)); background: rgba(255,255,255,.18); } .th-tag.warn { background: color-mix(in srgb, var(--amber) 45%, transparent); }
.th-ring { --deg: calc(var(--pct) * 3.6deg); position: relative; z-index: 1; flex: none; width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--amber) var(--deg), rgba(255,255,255,.18) 0); }
.th-ring span { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: color-mix(in srgb, var(--navy) 90%, #000); }
.th-ring b { font-size: calc(22px * var(--fz, 1)); line-height: 1; font-variant-numeric: tabular-nums; } .th-ring small { font-size: calc(11px * var(--fz, 1)); opacity: .8; }
.tech-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px; }
.tech-kpis .kpi > b { font-size: calc(26px * var(--fz, 1)); }
.tech-cols2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; } .tech-cols2 aside .card { margin-top: 22px; } .tech-cols2 aside .card + .card { margin-top: 14px; }
.tt-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: calc(13px * var(--fz, 1)); color: var(--muted); margin: 0 0 8px; } .tt-meta span { display: inline-flex; align-items: center; gap: 4px; } .warn-t { color: var(--warn) !important; }
.tt-complaint { margin: 0 0 10px; color: var(--muted); font-size: calc(13.5px * var(--fz, 1)); background: var(--bg); padding: 6px 10px; border-radius: 8px; }
.tech-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 16px; border-radius: calc(var(--radius) + 4px); color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--amber) 45%, var(--line)); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--amber) 5%, #fff) 0 10px, #fff 10px 20px); }
.tech-empty > .icon { width: 34px; height: 34px; color: #D9822B; } .tech-empty b { color: var(--navy); font-size: calc(16px * var(--fz, 1)); }
.tech-week .tw-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 14px 16px 10px; }
.tw { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.tw i { display: block; width: 100%; max-width: 30px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, #D9822B 45%, #fff); }
.tw.today i { background: #D9822B; } .tw em { font-style: normal; font-size: calc(11px * var(--fz, 1)); color: var(--muted); } .tw small { font-size: calc(11px * var(--fz, 1)); color: var(--muted); }
.tw:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; white-space: nowrap; background: var(--ink); color: #fff; font-size: calc(12px * var(--fz, 1)); padding: 5px 9px; border-radius: 6px; z-index: 5; }
.tw:first-child:hover::after { right: 0; } .tw:last-child:hover::after { left: 0; }
@media (max-width: 1000px) { .tech-cols2 { grid-template-columns: minmax(0, 1fr); } .tech-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tech-hero { padding: 16px; } .th-main h1 { font-size: calc(20px * var(--fz, 1)); } .th-ring { width: 88px; height: 88px; } .th-ring span { width: 68px; height: 68px; } .th-ring b { font-size: calc(17px * var(--fz, 1)); } }
.tt-stale { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: calc(12.5px * var(--fz, 1)); font-weight: 600; }

/* ===== صفحة مهمة الفني ===== */
.to-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "car ring" "facts ring"; gap: 10px 18px; align-items: center; padding: 16px 20px; margin-bottom: 14px; border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--sc) 10%, #fff), #fff 65%); border: 1px solid color-mix(in srgb, var(--sc) 25%, var(--line)); border-top: 4px solid var(--sc); }
.to-car { grid-area: car; display: flex; gap: 14px; align-items: center; } .to-car h1 { margin: 0; font-size: calc(22px * var(--fz, 1)); } .to-car h1 small { color: var(--muted); font-size: calc(14px * var(--fz, 1)); font-weight: 500; } .to-car p { margin: 4px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.to-facts { grid-area: facts; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: calc(13.5px * var(--fz, 1)); color: var(--muted); } .to-facts span { display: inline-flex; align-items: center; gap: 4px; }
.to-facts .late { color: var(--bad); } .to-facts b[data-countdown-to] { color: var(--navy); background: color-mix(in srgb, var(--sc) 12%, #fff); padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.to-ring { grid-area: ring; --sc2: var(--sc); background: conic-gradient(var(--sc) calc(var(--pct) * 3.6deg), var(--line) 0); width: 96px; height: 96px; }
.to-ring span { background: #fff; width: 76px; height: 76px; } .to-ring b { color: var(--navy); font-size: calc(22px * var(--fz, 1)); } .to-ring small { color: var(--muted); }
.tech-items li.run { background: color-mix(in srgb, #1E8449 6%, #fff); } .tech-items li.run .ti-state .tt-pulse { background: #1E8449; }
.ti-main { flex: 1; min-width: 0; } .ti-bar { display: block; height: 5px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; max-width: 260px; }
.ti-bar b { display: block; height: 100%; background: #1E8449; border-radius: 99px; } .ti-bar b.over { background: var(--warn); }
.quick-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.quick-notes button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: calc(12.5px * var(--fz, 1)); cursor: pointer; color: var(--ink); }
.quick-notes button:hover { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, #fff); }
@media (max-width: 640px) { .to-hero { grid-template-columns: 1fr; grid-template-areas: "car" "facts" "ring"; } .to-ring { justify-self: start; } .to-car h1 { font-size: calc(18px * var(--fz, 1)); } }

/* ===== الموديول 12: الاقتراحات الذكية والكاميرات ===== */
.smart-sugs { margin: 0 16px 14px; padding: 12px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, #6C4AB6 25%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, #6C4AB6 8%, #fff), #fff 70%); }
.ss-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; } .ss-head .icon { color: #6C4AB6; } .ss-head b { color: var(--navy); } .ss-head small { color: var(--muted); }
.ss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ss-item { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; border-inline-start: 3px solid #6C4AB6; transition: transform .15s, box-shadow .15s; }
.ss-item:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -14px #6C4AB6; }
.ss-item.ss-due { border-inline-start-color: #D9822B; } .ss-item.ss-knowledge { border-inline-start-color: #148F86; }
.ss-src { font-size: calc(11px * var(--fz, 1)); font-weight: 700; color: #6C4AB6; } .ss-due .ss-src { color: #D9822B; } .ss-knowledge .ss-src { color: #148F86; }
.ss-item small { color: var(--muted); font-size: calc(12px * var(--fz, 1)); line-height: 1.5; }
.ss-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .ss-foot em { font-style: normal; font-size: calc(12px * var(--fz, 1)); color: var(--muted); } .ss-foot em b { color: var(--ink); }
.clips li { display: grid; gap: 4px; } .clip-links { display: flex; flex-wrap: wrap; gap: 4px; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 16px; } .cam-grid .card { margin: 0; }
.cam { overflow: hidden; } .cam-view { position: relative; aspect-ratio: 16 / 9; background: #0E1726; display: grid; place-items: center; }
.cam-view img, .cam-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-off, .cam-err { display: grid; justify-items: center; gap: 6px; color: #9AA5B4; font-size: calc(13px * var(--fz, 1)); } .cam-off .icon, .cam-err .icon { width: 30px; height: 30px; }
.cam-err { display: none; position: absolute; inset: 0; place-content: center; background: #0E1726; } .cam-view.err .cam-err { display: grid; } .cam-view.err img { visibility: hidden; }
.cam-live { position: absolute; top: 10px; inset-inline-start: 10px; display: inline-flex; align-items: center; gap: 5px; color: #fff; font-size: calc(12px * var(--fz, 1)); font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.cam-live i { width: 8px; height: 8px; border-radius: 50%; background: #E74C3C; animation: pulse-amber 1.5s infinite; }
.cam-foot { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 14px; flex-wrap: wrap; } .cam-foot b { display: block; } .cam-foot small { color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.cam-edit { width: 100%; } .cam-edit summary { cursor: pointer; color: var(--muted); font-size: calc(13px * var(--fz, 1)); } .cam-edit form { margin-top: 10px; }
.cam-help { margin-top: 12px; font-size: calc(13px * var(--fz, 1)); } .cam-help summary { cursor: pointer; color: var(--navy); font-weight: 600; } .cam-help li { margin: 6px 0; line-height: 1.7; } .cam-help .mono { font-size: calc(11.5px * var(--fz, 1)); word-break: break-all; }
.sel-all { margin-inline-start: auto; font-size: calc(13px * var(--fz, 1)); }

/* ===== إعدادات النظام: قائمة جانبية وحقول بوصف ووحدة ===== */
.settings-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: 90px; display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); padding: 8px; box-shadow: var(--shadow); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); border-inline-start: 3px solid transparent; }
.settings-nav a:hover { background: var(--bg); text-decoration: none; }
.settings-nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 14%, #fff), #fff); border-inline-start-color: var(--amber); }
.settings-nav a > .icon:first-child { width: 22px; height: 22px; flex: none; color: var(--muted); } .settings-nav a.active > .icon:first-child { color: #B86E12; }
.settings-nav a span { flex: 1; min-width: 0; } .settings-nav b { display: block; font-size: calc(14px * var(--fz, 1)); } .settings-nav small { display: block; font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-nav .sn-sep { font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); padding: 10px 12px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.settings-nav a.ext > .icon:last-child { color: var(--muted); }
.settings-body > .card:first-child, .settings-body > form.card:first-child { margin-top: 0; }
.set-fields { display: grid; gap: 4px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 6px 20px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.set-row label b, .set-toggle b { display: block; font-size: calc(14.5px * var(--fz, 1)); } .set-row label small, .set-toggle small { display: block; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); margin-top: 2px; font-weight: 400; }
.set-input { position: relative; display: flex; align-items: center; } .set-input input { width: 100%; } .set-input .unit { position: absolute; inset-inline-end: 12px; color: var(--muted); font-size: calc(12.5px * var(--fz, 1)); pointer-events: none; }
.set-input input[type=number] { padding-inline-end: 64px; }
.set-row .error-text { grid-column: 1 / -1; }
.set-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px dashed var(--line); cursor: pointer; margin: 0; }
.set-toggle input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.set-toggle .tg { flex: none; width: 44px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; margin-top: 2px; }
.set-toggle .tg::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.set-toggle input:checked + .tg { background: #1E8449; } .set-toggle input:checked + .tg::after { inset-inline-start: 23px; }
.set-toggle input:focus-visible + .tg { outline: 2px solid var(--amber); outline-offset: 2px; }
.ti-note { margin: 12px 0 0; padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: 8px; font-size: calc(12.5px * var(--fz, 1)); text-align: center; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: minmax(0, 1fr); } .settings-nav { position: static; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .set-row { grid-template-columns: minmax(0, 1fr); } }
.settings-nav { grid-template-columns: minmax(0, 1fr); overflow: hidden; } .settings-nav a { min-width: 0; }
.settings-layout > * { min-width: 0; }

/* ===== استوديو المظهر: أقسام واضحة بأيقونات ملونة ===== */
.studio-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: visible; padding: 8px; }
.studio-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink); white-space: normal; min-width: 0; transition: transform .15s, box-shadow .15s, border-color .15s; }
.studio-nav a i { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 70%, #fff), var(--tone)); box-shadow: 0 6px 12px -8px var(--tone); }
.studio-nav a i .icon { width: 20px; height: 20px; }
.studio-nav a span { min-width: 0; } .studio-nav a b { display: block; font-size: calc(13.5px * var(--fz, 1)); color: var(--navy); } .studio-nav a small { display: block; font-size: calc(11.5px * var(--fz, 1)); color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-nav a:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); }
.studio-nav a.on { border-color: var(--tone); background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 10%, #fff), #fff); box-shadow: 0 8px 18px -14px var(--tone); }
@media (max-width: 1100px) { .studio-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .studio-nav a small { display: none; } .studio-nav a i { width: 30px; height: 30px; } }
.portal-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
.portal-themes .choice { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.portal-themes .choice:has(input:checked) { border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 20%, transparent); }
.portal-themes input { position: absolute; opacity: 0; } .portal-themes small { color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.tt-prev { display: grid; grid-template-rows: 10px 1fr; gap: 4px; height: 58px; padding: 5px; border-radius: 8px; background: #EEF1F5; }
.tt-prev i { display: block; border-radius: 4px; background: #fff; } .tt-prev i:first-child { background: var(--navy); } .tt-prev i:nth-child(3) { display: none; }
.tech-theme-dark .tt-prev { background: #0F1622; } .tech-theme-dark .tt-prev i { background: #1B2536; } .tech-theme-dark .tt-prev i:first-child { background: #070B12; }
.tech-theme-auto .tt-prev { background: linear-gradient(90deg, #EEF1F5 50%, #0F1622 50%); }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; }
.portal-color { margin: 6px 0 10px; }
.pub-welcome { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--navy) 8%, #fff); border: 1px solid color-mix(in srgb, var(--navy) 18%, var(--line)); color: var(--navy); font-weight: 600; }

/* ===== بوابة الفنيين: الثيم الداكن والأزرار الكبيرة ونمط الشريط ===== */
.tech-theme-dark, .tech-theme-dark body { color-scheme: dark; }
body.tech-theme-dark { --bg: #0F1622; --ink: #E6EDF5; --muted: #93A3B8; --line: #263247; --line-2: #33415A; --ok-bg: #12301F; --warn-bg: #3A2A10; --info-bg: #13283F; background: var(--bg); color: var(--ink); }
body.tech-theme-dark .card, body.tech-theme-dark .tech-task, body.tech-theme-dark .kpi, body.tech-theme-dark .order-mini, body.tech-theme-dark .to-hero,
body.tech-theme-dark .tech-stats > div, body.tech-theme-dark .tt-complaint, body.tech-theme-dark .quick-notes button { background: #182131; border-color: var(--line); color: var(--ink); }
body.tech-theme-dark .kpi[class*="tone-"] { background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--tone) 22%, transparent), transparent 55%), #182131; }
body.tech-theme-dark .tech-task.is-running { background: #14291F; } body.tech-theme-dark .tech-empty { background: #141C29; color: var(--muted); }
body.tech-theme-dark input, body.tech-theme-dark textarea, body.tech-theme-dark select { background: #0F1622; color: var(--ink); border-color: var(--line-2); }
body.tech-theme-dark .btn-light, body.tech-theme-dark .tech-btn.light { background: #22304A; color: var(--ink); border-color: var(--line-2); }
body.tech-theme-dark h1, body.tech-theme-dark h2, body.tech-theme-dark h3, body.tech-theme-dark .tech-h, body.tech-theme-dark .tt-car b, body.tech-theme-dark .tech-empty b, body.tech-theme-dark .ring b, body.tech-theme-dark .to-ring b { color: var(--ink); }
body.tech-theme-dark .to-ring span { background: #182131; } body.tech-theme-dark .complaint { background: #141C29; color: var(--ink); }
body.tech-theme-dark .kpi > b { color: color-mix(in srgb, var(--tone) 55%, #fff); } body.tech-theme-dark .ksa-plate { filter: brightness(.95); }
@media (prefers-color-scheme: dark) {
  body.tech-theme-auto { --bg: #0F1622; --ink: #E6EDF5; --muted: #93A3B8; --line: #263247; --line-2: #33415A; background: var(--bg); color: var(--ink); }
  body.tech-theme-auto .card, body.tech-theme-auto .tech-task, body.tech-theme-auto .kpi, body.tech-theme-auto .to-hero, body.tech-theme-auto .tt-complaint { background: #182131; border-color: var(--line); color: var(--ink); }
  body.tech-theme-auto input, body.tech-theme-auto textarea, body.tech-theme-auto select { background: #0F1622; color: var(--ink); border-color: var(--line-2); }
  body.tech-theme-auto h1, body.tech-theme-auto h2, body.tech-theme-auto .tech-h, body.tech-theme-auto .tt-car b { color: var(--ink); }
}
body.tech-big .tech-btn, body.tech-big .btn { min-height: 54px; font-size: calc(17px * var(--fz, 1)); padding-inline: 22px; }
body.tech-big .pin-pad button { min-height: 72px; font-size: calc(26px * var(--fz, 1)); }
body.tech-big .tt-desc b, body.tech-big .tech-task .tt-car b { font-size: calc(18px * var(--fz, 1)); }
.theader-solid .tech-top { background: var(--navy); }
.theader-gradient .tech-top { background: linear-gradient(100deg, var(--navy), color-mix(in srgb, var(--navy) 60%, var(--amber))); }
.theader-light .tech-top { background: #fff; color: var(--navy); box-shadow: 0 1px 0 var(--line); } .theader-light .tech-brand, .theader-light .tech-brand b { color: var(--navy); } .theader-light .tech-brand small { color: var(--muted); }

/* عناوين أقسام لوحة الفني: شريط ملون وعدد كبير */
.tech-h[class*="sec-"] { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; padding: 10px 14px; border-radius: 14px; font-size: calc(19px * var(--fz, 1)); font-weight: 800; color: var(--navy);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sec) 16%, #fff), color-mix(in srgb, var(--sec) 4%, #fff) 70%); border: 1px solid color-mix(in srgb, var(--sec) 30%, var(--line)); border-inline-start: 6px solid var(--sec); }
.sec-mine { --sec: var(--sec-mine, #E07B12); } .sec-inspect { --sec: var(--sec-inspect, #2E86C1); } .sec-available { --sec: var(--sec-available, #1E8449); }
.tech-h[class*="sec-"] > i { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--sec) 70%, #fff), var(--sec)); box-shadow: 0 8px 16px -10px var(--sec); }
.tech-h[class*="sec-"] > i .icon { width: 22px; height: 22px; }
.tech-h[class*="sec-"] > span { flex: 1; min-width: 0; } .tech-h[class*="sec-"] small { display: block; font-size: calc(12.5px * var(--fz, 1)); font-weight: 500; color: var(--muted); margin-top: 2px; }
.sec-count { flex: none; min-width: 48px; height: 48px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; font-size: calc(26px * var(--fz, 1)); font-weight: 800; line-height: 1;
  color: #fff; background: var(--sec); box-shadow: 0 8px 18px -10px var(--sec), inset 0 -3px 0 rgba(0,0,0,.12); font-variant-numeric: tabular-nums; }
body.tech-theme-dark .tech-h[class*="sec-"] { background: linear-gradient(90deg, color-mix(in srgb, var(--sec) 28%, #182131), #182131 70%); color: var(--ink); border-color: color-mix(in srgb, var(--sec) 40%, var(--line)); }
@media (max-width: 560px) { .tech-h[class*="sec-"] { font-size: calc(16px * var(--fz, 1)); padding: 8px 10px; } .tech-h[class*="sec-"] small { display: none; } .sec-count { min-width: 40px; height: 40px; font-size: calc(21px * var(--fz, 1)); } .tech-h[class*="sec-"] > i { width: 36px; height: 36px; } }

/* تحكم شاشات الفنيين من استوديو المظهر */
body.tech-text-large .tech-main { zoom: 1.1; } body.tech-text-xlarge .tech-main { zoom: 1.22; }
.tech-cols2.no-side { grid-template-columns: minmax(0, 1fr); }
.tech-notice { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, #FFF4DC, #FFFBF1); border: 1px solid #F1D08A; border-inline-start: 6px solid #D9822B; color: #5A3A06; }
.tech-notice > .icon { width: 26px; height: 26px; color: #D9822B; flex: none; } .tech-notice b { display: block; font-size: calc(12px * var(--fz, 1)); color: #A0620F; }
.tech-notice span { font-size: calc(16px * var(--fz, 1)); font-weight: 700; }
body.tech-theme-dark .tech-notice { background: linear-gradient(90deg, #3A2A10, #1B2536); border-color: #6B4A16; color: #F6DFAF; }
.tt-assign-note { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--fz, 1)); color: var(--muted); padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line-2, var(--line)); }
.tset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.tset-sel { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); }
.tset-sel small { display: block; color: var(--muted); font-size: calc(12px * var(--fz, 1)); }
.tsec-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.tsec-c { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 800;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sec) 16%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--sec) 30%, var(--line)); border-inline-start: 6px solid var(--sec); }
.tsec-c > i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--sec); flex: none; }
.tsec-c > b { flex: 1; min-width: 0; font-size: calc(14px * var(--fz, 1)); }
.tsec-c > em { font-style: normal; min-width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: var(--sec); font-size: calc(18px * var(--fz, 1)); }
.tsec-c input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.tsec-c:focus-within { outline: 3px solid color-mix(in srgb, var(--sec) 45%, transparent); outline-offset: 2px; }

/* إصلاح تخطيط استوديو المظهر داخل صفحة الإعدادات: يعتمد على العرض المتاح فعلاً لا عرض الشاشة */
.settings-body { container: setbody / inline-size; }
.studio-nav { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.studio-nav a b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container setbody (max-width: 1060px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .studio-preview { position: static; order: -1; }
  .studio-preview .card-body { max-height: 300px; overflow: auto; }
}
@container setbody (max-width: 820px) {
  .studio .grid-4, .studio .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container setbody (max-width: 520px) {
  .studio .grid-4, .studio .grid-5, .studio .toggle-grid { grid-template-columns: minmax(0, 1fr); }
}
.studio-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container setbody (max-width: 600px) { .studio-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* في تبويب المظهر تتحول قائمة الإعدادات إلى شريط أيقونات ليتسع الاستوديو والمعاينة */
@media (min-width: 901px) {
  .settings-layout.is-studio { grid-template-columns: 64px minmax(0, 1fr); }
  .settings-layout.is-studio .settings-nav { padding: 6px; }
  .settings-layout.is-studio .settings-nav a { justify-content: center; padding: 10px 0; }
  .settings-layout.is-studio .settings-nav a > span, .settings-layout.is-studio .settings-nav a > .icon-sm, .settings-layout.is-studio .settings-nav .sn-sep { display: none; }
  .settings-layout.is-studio .settings-nav .sn-sep + a { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; border-radius: 0; }
}

/* صفحات الطباعة (أمر التشغيل، أمر الشراء، قسيمة الراتب، الفاتورة) على الجوال: تتسع للشاشة بدل ورقة A4 ثابتة */
@media screen and (max-width: 820px) {
  .job-card { width: auto; min-height: 0; margin: 0 8px 20px; padding: 16px; font-size: calc(12.5px * var(--fz, 1)); overflow-x: auto; }
  .job-card header { flex-wrap: wrap; gap: 10px; }
  .jc-grid { grid-template-columns: minmax(0, 1fr); }
  .jc-sign { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .jc-table th, .jc-table td { padding: 5px 6px; }
}
/* رابط البوابة: الرابط الطويل ينكسر والأزرار تبقى داخل البطاقة */
.track-link { flex-wrap: wrap; } .track-link span { min-width: 0; word-break: break-all; }
@media screen and (max-width: 820px) { .print-sheet { width: auto; min-height: 0; margin: 0 8px 20px; padding: 14px; overflow-x: auto; } }

/* بوصلة: صفحة الموديول قيد البناء */
.mod-intro { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin: 6px 0 18px; border-radius: calc(var(--radius) + 4px); color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gc) 60%, #fff) 0%, var(--gc) 45%, color-mix(in srgb, var(--gc) 70%, #000) 100%); box-shadow: 0 18px 40px -24px var(--gc); }
.mod-intro::after { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 22px solid rgba(255,255,255,.08); }
.mi-ico { flex: none; width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(4px); }
.mi-ico .icon { width: 38px; height: 38px; }
.mi-text { position: relative; z-index: 1; min-width: 0; }
.mi-text h1 { color: #fff; font-size: calc(26px * var(--fz, 1)); margin: 6px 0 4px; } .mi-text h1 small { font-size: calc(14px * var(--fz, 1)); color: rgba(255,255,255,.8); font-weight: 500; margin-inline-start: 6px; }
.mi-text p { margin: 0; opacity: .92; }
.mi-tag { display: inline-flex; align-items: center; gap: 6px; font-size: calc(12px * var(--fz, 1)); font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.18); }
.mod-intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .mod-intro-grid { grid-template-columns: minmax(0, 1fr); } .mod-intro { flex-direction: column; align-items: flex-start; } }
.mi-features { list-style: none; margin: 0; padding: 8px 18px 18px; display: grid; gap: 10px; }
.mi-features li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-weight: 600; animation: miIn .4s both; animation-delay: calc(var(--i) * 60ms); }
.mi-features li span { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--navy); font-size: calc(14px * var(--fz, 1)); }
@keyframes miIn { from { opacity: 0; transform: translateY(6px); } }
.motion-reduced .mi-features li { animation: none; }
.mi-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.mi-siblings { list-style: none; margin: 0; padding: 6px; }
.mi-siblings a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.mi-siblings a:hover { background: var(--bg); text-decoration: none; } .mi-siblings span { flex: 1; } .mi-siblings em { font-style: normal; font-size: calc(11px * var(--fz, 1)); color: var(--muted); }
@container setbody (min-width: 1100px) { .studio-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- الموديول 04: البنوك والصناديق */
.money { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-weight: 600; }
.money.in { color: var(--ok); }
.money.out { color: var(--bad); }
.money small { font-size: .78em; color: var(--muted); font-weight: 500; margin-inline-start: 3px; }
.bnk-hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); padding: 22px 24px; color: #fff; margin-bottom: 18px;
  background: radial-gradient(circle at 85% -20%, color-mix(in srgb, var(--navy) 55%, #fff) 0%, var(--navy) 46%, color-mix(in srgb, var(--navy) 70%, #000) 100%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--navy) 28%, transparent); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.bnk-hero::after { content: ""; position: absolute; inset-inline-start: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 18px solid rgba(255,255,255,.06); }
.bnk-hero .lbl { color: color-mix(in srgb, #fff 78%, var(--navy)); font-size: calc(14px * var(--fz, 1)); }
.bnk-hero .big { font-size: calc(clamp(30px, 4.2vw, 44px) * var(--fz, 1)); font-weight: 700; line-height: 1.15; margin: 4px 0 6px; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; unicode-bidi: isolate; display: block; }
.bnk-hero .big small { font-size: calc(17px * var(--fz, 1)); font-weight: 500; opacity: .8; margin-inline-start: 6px; }
.bnk-hero .split { display: flex; flex-wrap: wrap; gap: 8px; }
.bnk-hero .split span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 12px; font-size: calc(13px * var(--fz, 1)); }
.bnk-hero .warn { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; background: color-mix(in srgb, var(--amber) 22%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); padding: 6px 12px; border-radius: 10px; font-size: calc(13.5px * var(--fz, 1)); }
.bnk-spark { position: relative; z-index: 1; }
.bnk-spark svg { width: 100%; height: 120px; display: block; }
.bnk-spark .cap { display: flex; justify-content: space-between; font-size: calc(12px * var(--fz, 1)); color: color-mix(in srgb, #fff 70%, var(--navy)); margin-top: 4px; }
.bnk-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.bnk-kpis .kpi-body b { font-size: calc(22px * var(--fz, 1)); direction: ltr; unicode-bidi: isolate; display: block; text-align: start; font-variant-numeric: tabular-nums; }
.bnk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.bnk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bnk-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.bnk-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--ac); }
a.bnk-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,42,74,.10); }
.bnk-card .top { display: flex; align-items: center; gap: 10px; }
.bnk-card .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, #fff); flex: none; }
.bnk-card .nm { font-weight: 700; color: var(--navy); line-height: 1.3; }
.bnk-card .sub { font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); }
.bnk-card .bal { font-size: calc(24px * var(--fz, 1)); font-weight: 700; color: var(--navy); direction: ltr; text-align: start; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.bnk-card .bal small { font-size: calc(13px * var(--fz, 1)); color: var(--muted); font-weight: 500; margin-inline-start: 4px; }
.bnk-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.bnk-card.off { opacity: .6; }
.bnk-add { display: grid; place-items: center; gap: 6px; min-height: 160px; border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); font-weight: 600; text-align: center; padding: 16px; }
.bnk-add:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; background: #fff; }
.bnk-bars { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.bnk-bars .r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: calc(13.5px * var(--fz, 1)); }
.bnk-bars .t { grid-column: 1 / -1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bnk-bars .t i { display: block; height: 100%; border-radius: 4px; background: var(--c); }
.bnk-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 20px 4px; }
.bnk-flow div { border-radius: 12px; padding: 12px; background: var(--bg); }
.bnk-flow span { display: block; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); }
.bnk-flow b { font-size: calc(18px * var(--fz, 1)); }
.bnk-recon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bnk-recon > div { border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.bnk-recon span { display: block; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); }
.bnk-recon b { font-size: calc(18px * var(--fz, 1)); }
.bnk-recon .ok { background: var(--ok-bg); }
.bnk-recon .bad { background: var(--bad-bg); }
.bnk-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.bnk-filters .field { margin: 0; }
.bnk-tx .src { font-size: calc(11.5px * var(--fz, 1)); }
.bnk-tx .cat { display: inline-flex; align-items: center; gap: 6px; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); }
.bnk-tx .cat i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.bnk-tx .desc { max-width: 360px; }
.bnk-tx .desc small { display: block; color: var(--muted); }
.bnk-tx td.num { text-align: end; }
.bnk-tx .ok-dot { color: var(--ok); }
.bnk-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bnk-quick .full { grid-column: 1 / -1; }
.bnk-drop { display: grid; place-items: center; text-align: center; gap: 8px; padding: 34px 20px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.bnk-drop:hover, .bnk-drop.over { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 4%, #fff); }
.bnk-drop .icon { width: 44px; height: 44px; color: var(--navy); }
.bnk-drop input[type=file] { max-width: 100%; }
.bnk-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bnk-map .field select { width: 100%; }
.bnk-sample { font-size: calc(12.5px * var(--fz, 1)); }
.bnk-sample th { background: color-mix(in srgb, var(--navy) 6%, #fff); }
.bnk-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.bnk-stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bnk-stats span { display: block; font-size: calc(12.5px * var(--fz, 1)); color: var(--muted); }
.bnk-stats b { font-size: calc(20px * var(--fz, 1)); color: var(--navy); }
.bnk-stats .g b { color: var(--ok); } .bnk-stats .w b { color: var(--warn); } .bnk-stats .r b { color: var(--bad); }
tr.dup td { opacity: .55; }
@media (max-width: 1100px) {
  .bnk-layout { grid-template-columns: minmax(0, 1fr); }
  .bnk-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bnk-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bnk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bnk-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .bnk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bnk-filters, .bnk-map, .bnk-quick { grid-template-columns: minmax(0, 1fr); }
  .bnk-recon { grid-template-columns: minmax(0, 1fr); }
  .bnk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bnk-tx .desc { max-width: none; }
}
