/* =========================================================================
   العمدة للسفريات — لوحة التحكم (Admin)
   نفس هوية الموقع العام: كحلي الشعار + أصفر الخط العربي
   ========================================================================= */
:root {
  --ink-950: #011a27; --ink-900: #022b40; --ink-800: #033b54; --ink-700: #0a4f70;
  --ink-600: #2f5885; --ink-500: #4f7aa6; --sky-300: #9fbedc; --sky-200: #cfe0ee; --sky-100: #e8f1f8; --sky-50: #f3f8fc;
  --sun-400: #fdf428; --sun-500: #f0e414; --sun-100: #fffbd1;

  --bg: #f3f6f9; --surface: #fff; --surface-2: #f8fafc;
  --line: #e1e8ef; --line-strong: #c9d6e2;
  --text: #0d2433; --text-2: #3d5566; --text-3: #6a7f8e;

  --ok: #0f7a4a; --ok-bg: #e5f5ec;
  --warn: #9a5b00; --warn-bg: #fff3d6;
  --info: #0b5f8a; --info-bg: #e3f1fa;
  --danger: #b42323; --danger-bg: #fdecec;
  --violet: #5b3fb0; --violet-bg: #efeafd;
  --muted-bg: #edf1f5;
  --wa: #0e7c47; --wa-hover: #0b6a3c;

  /* type categories (orders) */
  --t-visa: #0a4f70; --t-flight: #2f5885; --t-hotel: #7a4b12; --t-umrah: #0e6b5c; --t-service: #5b3fb0; --t-trip: #9a3b6a;

  --font-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-callig: "Aref Ruqaa", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --sh-sm: 0 1px 2px rgba(2,43,64,.05), 0 1px 6px rgba(2,43,64,.04);
  --sh-md: 0 8px 24px rgba(2,43,64,.08);
  --sh-lg: 0 24px 60px -12px rgba(1,26,39,.3);
  --ease: cubic-bezier(.22,.8,.24,1);
  --fast: 150ms; --med: 260ms;

  --side-w: 268px; --side-w-mini: 80px; --top-h: 68px;
  --heading: var(--ink-900); --ink-text: var(--ink-800); --link: var(--ink-700); --icon: var(--ink-600);
  --grid: #eef2f6; --chart-ink: #033b54; --chart-mid: #2f5885; --chart-soft: #c9d6e2;
  --side-bg-end: #011a27; --topbar-bg: rgba(243,246,249,.86);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.35; color: var(--heading); font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--ink-500); outline-offset: 2px; border-radius: 6px; }
.sidebar :focus-visible { outline-color: var(--sun-400); }
::selection { background: var(--sun-400); color: var(--ink-900); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: .8125rem; }
[data-lucide], .lucide { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }

/* ======================= App shell ======================= */
.app {
  --side: var(--side-w);
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh;
  /* عمود الشريط الجانبي ممتد بطول الصفحة كاملًا حتى لو كان المحتوى أطول من الشاشة */
  background: linear-gradient(to left, var(--side-bg-end) var(--side), transparent var(--side));
}
@media (min-width: 1025px) { .side-mini .app { --side: var(--side-w-mini); } }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--ink-800) 0%, var(--ink-900) 38%, var(--ink-950) 100%); color: #c9dbe8;
  border-inline-start: 1px solid rgba(255,255,255,.04); z-index: 40;
}
.sidebar::after { content: "العمدة"; position: absolute; bottom: -40px; inset-inline-start: -30px; font-family: var(--font-callig); font-size: 9rem; color: #fff; opacity: .03; pointer-events: none; line-height: 1; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px; height: var(--top-h); border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand img { width: 34px; height: 46px; object-fit: contain; flex: none; }
.side-brand strong { display: block; color: #fff; font-family: var(--font-display); font-size: .95rem; white-space: nowrap; }
.side-brand span { display: block; font-size: .64rem; letter-spacing: .14em; color: var(--sun-400); direction: ltr; text-align: right; white-space: nowrap; }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-group { margin-top: 14px; }
.side-group:first-child { margin-top: 0; }
.side-label { font-size: .7rem; font-weight: 600; color: #7f9db3; padding: 6px 12px; letter-spacing: .02em; white-space: nowrap; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; margin: 2px 0;
  border-radius: 12px; color: #c9dbe8; font-family: var(--font-display); font-size: .86rem; font-weight: 500; white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.side-link svg { width: 19px; height: 19px; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link[aria-current="page"] { background: rgba(253,244,40,.1); color: var(--sun-400); }
.side-link[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sun-400); }
.side-link[aria-current="page"] svg { opacity: 1; }
.side-link .count { margin-inline-start: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-size: .7rem; display: grid; place-items: center; font-family: var(--font-body); }
.side-link .count.hot { background: var(--sun-400); color: var(--ink-900); font-weight: 700; }
.side-sub { padding-inline-start: 30px; }
.side-sub .side-link { min-height: 36px; font-size: .8rem; color: #9fbad0; }
.side-sub .side-link::after { content: ""; position: absolute; inset-inline-start: -14px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; transform: translateY(-50%); }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.side-collapse { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; color: #9fbad0; font-family: var(--font-display); font-size: .82rem; white-space: nowrap; }
.side-collapse:hover { background: rgba(255,255,255,.06); color: #fff; }
@media (min-width: 1025px) {
  .side-mini .side-brand div, .side-mini .side-label, .side-mini .side-link span, .side-mini .side-link .count, .side-mini .side-sub, .side-mini .side-collapse span, .side-mini .side-user .who { display: none; }
  .side-mini .side-link, .side-mini .side-collapse { justify-content: center; padding: 0; }
  .side-mini .side-brand { justify-content: center; padding: 0; }
  .side-mini .side-collapse svg { transform: scaleX(-1); }
  .side-mini .side-label { display: block; height: 1px; padding: 0; margin: 10px 8px; background: rgba(255,255,255,.08); font-size: 0; }
  .side-mini .side-link[aria-current="page"]::before { inset-inline-start: -12px; }
}

/* Main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--topbar-bg); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.cmd-trigger {
  flex: 0 1 460px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-3); font-size: .875rem; text-align: start; box-shadow: var(--sh-sm);
  transition: border-color var(--fast);
}
.cmd-trigger:hover { border-color: var(--line-strong); }
.cmd-trigger span { flex: 1; }
kbd { font-family: var(--font-mono); font-size: .7rem; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); direction: ltr; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--text-2); transition: background var(--fast), border-color var(--fast); }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--heading); }
.icon-btn .dot { position: absolute; top: 9px; inset-inline-end: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.user-chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 12px; padding-inline: 6px 12px; border-radius: 12px; border: 1px solid transparent; background: transparent; text-align: start; }
.user-chip:hover { background: var(--surface); border-color: var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ink-800); color: var(--sun-400); font-family: var(--font-display); font-weight: 700; font-size: .85rem; flex: none; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.4rem; }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: .72rem; }
.avatar.c1 { background: #e3f1fa; color: var(--link); } .avatar.c2 { background: #efeafd; color: var(--violet); } .avatar.c3 { background: #e5f5ec; color: var(--ok); } .avatar.c4 { background: #fff3d6; color: var(--warn); } .avatar.c5 { background: #fdecef; color: #9a3b6a; }
.user-chip strong { display: block; font-family: var(--font-display); font-size: .82rem; color: var(--heading); line-height: 1.3; }
.user-chip small { display: block; font-size: .72rem; color: var(--text-3); line-height: 1.3; }

.content { padding: 24px; max-width: 1560px; width: 100%; margin-inline: auto; flex: 1; }

/* Popover (notifications / user menu) */
.pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-lg); z-index: 60; opacity: 0; transform: translateY(-6px); visibility: hidden; transition: opacity var(--fast), transform var(--fast), visibility 0s linear var(--fast); }
.pop.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; }
.pop-list { max-height: 360px; overflow: auto; }
.pop-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.pop-item:hover { background: var(--surface-2); }
.pop-item:last-child { border-bottom: 0; }
.pop-item .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.pop-item small { display: block; color: var(--text-3); font-size: .74rem; }
.menu-list { padding: 6px; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: none; font-size: .86rem; text-align: start; color: var(--text); }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-list .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-list .danger { color: var(--danger); }
.anchor { position: relative; }

/* ======================= Page header ======================= */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.5rem; }
.page-head p { color: var(--text-3); font-size: .9rem; margin-top: 4px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--text-3); margin-bottom: 6px; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .5; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ======================= Buttons ======================= */
.btn {
  --bg: var(--ink-800); --fg: #fff; --bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font-family: var(--font-display); font-size: .84rem; font-weight: 600; white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.btn:hover { box-shadow: var(--sh-sm); }
.btn:active { transform: scale(.98); }
.btn-primary:hover { --bg: var(--ink-700); }
.btn-sun { --bg: var(--sun-400); --fg: var(--ink-900); }
.btn-sun:hover { --bg: var(--sun-500); }
.btn-ghost { --bg: var(--surface); --fg: var(--heading); --bd: var(--line); }
.btn-ghost:hover { --bd: var(--line-strong); --bg: var(--surface-2); }
.btn-soft { --bg: var(--sky-100); --fg: var(--ink-text); }
.btn-soft:hover { --bg: var(--sky-200); }
.btn-wa { --bg: var(--wa); --fg: #fff; }
.btn-wa:hover { --bg: var(--wa-hover); }
.btn-danger { --bg: var(--danger-bg); --fg: var(--danger); --bd: #f5caca; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .78rem; border-radius: 10px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.spinner { width: 16px; height: 16px; border: 2.4px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wa-icon { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ======================= Cards & panels ======================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg, .card-head h3 svg { color: var(--icon); }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .82rem; color: var(--text-3); }
.grid { display: grid; gap: 16px; }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

/* Hero greeting */
.welcome {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 24px 28px; color: #d8e6f0;
  background: radial-gradient(80% 120% at 0% 0%, rgba(159,190,220,.35), transparent 60%), linear-gradient(120deg, var(--ink-700), var(--ink-800) 45%, var(--ink-900));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
}
.welcome::after { content: "أهلًا"; position: absolute; inset-inline-start: 18%; bottom: -46px; font-family: var(--font-callig); font-size: 9rem; color: #fff; opacity: .05; line-height: 1; pointer-events: none; }
.welcome h1 { color: #fff; font-size: 1.45rem; }
.welcome p { margin-top: 6px; color: #b9cfdf; font-size: .9rem; }
.welcome .date { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.welcome .date span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: .78rem; }
.welcome .actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.welcome .btn-ghost { --bg: rgba(255,255,255,.08); --fg: #fff; --bd: rgba(255,255,255,.2); }

/* Action board (needs attention) */
.attn { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.attn-card { position: relative; display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-sm); transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast); }
.attn-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
.attn-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.attn-card .ic svg { width: 22px; height: 22px; }
.attn-card b { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; color: var(--heading); }
.attn-card span { font-size: .8rem; color: var(--text-2); }
.attn-card .go { position: absolute; inset-inline-end: 14px; top: 14px; color: var(--text-3); width: 16px; height: 16px; }
.tone-warn .ic { background: var(--warn-bg); color: var(--warn); }
.tone-info .ic { background: var(--info-bg); color: var(--info); }
.tone-danger .ic { background: var(--danger-bg); color: var(--danger); }
.tone-violet .ic { background: var(--violet-bg); color: var(--violet); }
.tone-ok .ic { background: var(--ok-bg); color: var(--ok); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 140px; position: relative; overflow: hidden; }
.kpi .label { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-2); font-weight: 500; }
.kpi .label svg { color: var(--icon); width: 16px; height: 16px; }
.kpi .value { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--heading); direction: ltr; text-align: end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: .9rem; color: var(--text-3); font-weight: 500; }
.kpi .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; direction: ltr; }
.delta.up { background: var(--ok-bg); color: var(--ok); }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.delta svg { width: 13px; height: 13px; }
.spark { width: 110px; height: 36px; }
.kpi.feature { background: var(--ink-800); border-color: var(--ink-800); color: #cfe0ee; }
.kpi.feature .label { color: #b9cfdf; } .kpi.feature .label svg { color: var(--sun-400); }
.kpi.feature .value { color: var(--sun-400); }
.kpi.feature .value small { color: #9fbedc; }
.kpi.feature .muted { color: #9fbedc; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-3); }

/* Pipeline */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.pipe-stage { position: relative; padding: 14px 16px 16px; border-inline-start: 1px solid var(--line); }
.pipe-stage:first-child { border-inline-start: 0; }
.pipe-stage .name { font-size: .78rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.pipe-stage .name i { width: 8px; height: 8px; border-radius: 50%; }
.pipe-stage b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--heading); margin: 4px 0 8px; }
.pipe-bar { height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.pipe-bar span { display: block; height: 100%; border-radius: inherit; }
.pipe-stage:not(:last-child)::after { content: ""; position: absolute; top: 50%; inset-inline-end: -9px; width: 16px; height: 16px; background: var(--surface); border-top: 1px solid var(--line); border-inline-end: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 1; }
[dir="rtl"] .pipe-stage:not(:last-child)::after { transform: translateY(-50%) rotate(-135deg); }

.chart-wrap { position: relative; height: 290px; }
.chart-wrap.sm { height: 240px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--muted-bg); gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 30px; padding: 0 12px; border-radius: 8px; font-size: .76rem; font-family: var(--font-display); color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--heading); box-shadow: var(--sh-sm); }

/* Type bars */
.type-bars { display: grid; gap: 14px; }
.type-bar .top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 6px; }
.type-bar .top span { display: flex; gap: 8px; align-items: center; }
.type-bar .top b { font-family: var(--font-display); direction: ltr; }
.type-bar .track { height: 8px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.type-bar .track span { display: block; height: 100%; border-radius: inherit; }

/* Activity feed */
.feed { display: grid; }
.feed li { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.feed li:last-child { border-bottom: 0; }
.feed .t { color: var(--text-3); font-size: .74rem; margin-top: 2px; }

/* Team load */
.team li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.team .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.team .bar span { display: block; height: 100%; background: var(--ink-600); border-radius: inherit; }
.team .who { width: 120px; font-size: .84rem; }
.team b { font-family: var(--font-display); font-size: .85rem; width: 28px; text-align: end; }

/* ======================= Chips / status ======================= */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--muted-bg); color: var(--text-2); }
.chip svg { width: 13px; height: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-new { background: var(--violet-bg); color: var(--violet); }
.s-received, .s-progress { background: var(--info-bg); color: var(--info); }
.s-final { background: var(--warn-bg); color: var(--warn); }
.s-done { background: var(--ok-bg); color: var(--ok); }
.s-needs { background: #fff0e0; color: #a14c00; }
.s-rejected { background: var(--danger-bg); color: var(--danger); }
.s-paused { background: var(--muted-bg); color: #4a5b68; }
.type-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.type-tag .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.type-tag .ti svg { width: 14px; height: 14px; }
.tt-visa .ti { background: var(--t-visa); } .tt-flight .ti { background: var(--t-flight); } .tt-hotel .ti { background: var(--t-hotel); }
.tt-umrah .ti { background: var(--t-umrah); } .tt-service .ti { background: var(--t-service); } .tt-trip .ti { background: var(--t-trip); }
.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-progress .track { flex: 1; height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.mini-progress .track span { display: block; height: 100%; background: var(--ink-600); border-radius: inherit; }
.mini-progress .track span.full { background: var(--ok); }
.mini-progress b { font-size: .74rem; font-family: var(--font-display); width: 34px; text-align: end; direction: ltr; color: var(--text-2); }

/* ======================= Toolbar / filters ======================= */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 0; background: none; font-family: var(--font-display); font-size: .84rem; color: var(--text-2); white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--heading); }
.tabs [aria-selected="true"] { color: var(--heading); font-weight: 600; }
.tabs [aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ink-800); }
.tabs .n { font-size: .7rem; padding: 0 7px; border-radius: 99px; background: var(--muted-bg); color: var(--text-2); font-family: var(--font-body); }
.tabs [aria-selected="true"] .n { background: var(--sun-400); color: var(--ink-900); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; }
.toolbar .grow { flex: 1 1 260px; }
.type-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.type-filters button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-family: var(--font-display); color: var(--text-2); }
.type-filters button svg { width: 14px; height: 14px; }
.type-filters button[aria-pressed="true"] { background: var(--ink-800); color: #fff; border-color: var(--ink-800); }
.type-filters button[aria-pressed="true"] svg { color: var(--sun-400); }

/* ======================= Forms ======================= */
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-family: var(--font-display); font-size: .8rem; font-weight: 600; color: var(--heading); }
.field .req { color: var(--danger); }
.field .hint { font-size: .74rem; color: var(--text-3); }
.field .err { display: none; font-size: .74rem; color: var(--danger); }
.field.has-error .input { border-color: var(--danger); }
.field.has-error .err { display: block; }
.input { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .875rem; transition: border-color var(--fast), box-shadow var(--fast); }
.input:hover { border-color: var(--ink-500); }
.input:focus { outline: none; border-color: var(--ink-700); box-shadow: 0 0 0 3px rgba(10,79,112,.14); }
.input::placeholder { color: #93a5b3; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233d5566' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; padding-left: 34px; padding-right: 12px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 17px; height: 17px; pointer-events: none; }
.input-icon .input { padding-inline-start: 38px; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.input-affix:focus-within { border-color: var(--ink-700); box-shadow: 0 0 0 3px rgba(10,79,112,.14); }
.input-affix .input { border: 0; border-radius: 0; box-shadow: none !important; }
.input-affix .affix { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--text-3); font-size: .8rem; border-inline-start: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink-800); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .84rem; min-height: 32px; }
.switch input { position: absolute; opacity: 0; }
.switch .tr { width: 40px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background var(--fast); flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform var(--fast); }
.switch input:checked + .tr { background: var(--ok); }
.switch input:checked + .tr::after { transform: translateX(-18px); }
.switch input:focus-visible + .tr { outline: 3px solid var(--ink-500); outline-offset: 2px; }
.range { width: 100%; accent-color: var(--ink-800); }

/* ======================= Tables ======================= */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: start; font-family: var(--font-display); font-weight: 600; font-size: .74rem; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th button { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; }
.table th button:hover { color: var(--heading); }
.table th button svg { width: 13px; height: 13px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--sky-50); }
.table tbody tr.is-selected { background: var(--sun-100); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .code { font-family: var(--font-mono); font-weight: 700; color: var(--ink-text); direction: ltr; unicode-bidi: isolate; }
.table .code:hover { text-decoration: underline; }
.table .cust strong { display: block; font-weight: 600; color: var(--heading); }
.table .cust small { color: var(--text-3); font-size: .74rem; direction: ltr; unicode-bidi: isolate; }
.table .money { font-family: var(--font-display); font-weight: 600; direction: ltr; text-align: end; white-space: nowrap; }
.table .money.due { color: var(--danger); }
.table .money.zero { color: var(--text-3); font-weight: 400; }
.table .row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.table .row-actions .icon-btn { width: 34px; height: 34px; border-radius: 9px; }
.th-check, .td-check { width: 40px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink-800); color: #fff; font-size: .84rem; }
.bulkbar .btn-ghost { --bg: rgba(255,255,255,.08); --fg: #fff; --bd: rgba(255,255,255,.2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--text-3); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; }
.pager .pages button[aria-current="page"] { background: var(--ink-800); color: #fff; border-color: var(--ink-800); }
.pager .pages button:disabled { opacity: .45; cursor: not-allowed; }

/* Mobile card list (tables → cards) */
.m-list { display: none; }
.m-card { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.m-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.m-card .mid { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: .84rem; }

/* Kanban board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding: 16px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; max-height: 70vh; }
.lane-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-family: var(--font-display); font-weight: 600; font-size: .84rem; }
.lane-head .n { font-size: .72rem; padding: 0 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.lane-body { display: grid; gap: 8px; padding: 0 10px 10px; overflow-y: auto; min-height: 80px; }
.lane-body.drop-hint { outline: 2px dashed var(--ink-500); outline-offset: -4px; border-radius: 12px; }
.k-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; cursor: grab; box-shadow: var(--sh-sm); transition: box-shadow var(--fast), transform var(--fast); }
.k-card:hover { box-shadow: var(--sh-md); }
.k-card.dragging { opacity: .5; transform: rotate(2deg); }
.k-card .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; }
.k-card strong { font-size: .86rem; color: var(--heading); font-weight: 600; }

/* ======================= Order details ======================= */
.order-hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 20px; }
.order-hero .code-xl { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 800; color: var(--heading); direction: ltr; letter-spacing: .03em; }
.order-hero .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: .82rem; color: var(--text-2); }
.order-hero .meta span { display: inline-flex; gap: 6px; align-items: center; }
.order-hero .meta svg { width: 15px; height: 15px; color: var(--text-3); }
.steps-track { display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 20px 22px; gap: 0; }
.steps-track li { position: relative; text-align: center; font-size: .74rem; color: var(--text-3); padding-top: 38px; }
.steps-track li .d { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; z-index: 1; color: transparent; }
.steps-track li .d svg { width: 14px; height: 14px; }
.steps-track li:not(:first-child)::before { content: ""; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--line-strong); }
.steps-track li.done { color: var(--heading); font-weight: 600; }
.steps-track li.done .d { background: var(--ink-800); border-color: var(--ink-800); color: var(--sun-400); }
.steps-track li.done::before { background: var(--ink-800); }
.steps-track li.cur { color: var(--heading); font-weight: 700; }
.steps-track li.cur .d { background: var(--sun-400); border-color: var(--ink-800); box-shadow: 0 0 0 5px rgba(253,244,40,.35); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: .84rem; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 600; color: var(--heading); text-align: end; }
.dl.one { grid-template-columns: 1fr; }
.money-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.money-tile { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.money-tile small { display: block; font-size: .74rem; color: var(--text-3); }
.money-tile b { font-family: var(--font-display); font-size: 1.15rem; direction: ltr; display: block; text-align: end; color: var(--heading); }
.money-tile.profit { background: var(--ok-bg); border-color: #bfe5d1; } .money-tile.profit b { color: var(--ok); }
.money-tile.due { background: var(--danger-bg); border-color: #f5caca; } .money-tile.due b { color: var(--danger); }
.tl { position: relative; display: grid; }
.tl::before { content: ""; position: absolute; top: 6px; bottom: 6px; inset-inline-start: 15px; width: 2px; background: var(--line); }
.tl li { position: relative; padding-inline-start: 44px; padding-bottom: 18px; font-size: .84rem; }
.tl li .node { position: absolute; inset-inline-start: 4px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: grid; place-items: center; }
.tl li .node svg { width: 12px; height: 12px; color: var(--icon); }
.tl li:first-child .node { background: var(--sun-400); border-color: var(--ink-800); }
.tl .who { color: var(--text-3); font-size: .74rem; }
.tl .note { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.tl .note.internal { background: #fffbea; border-color: #f2e7a3; }
.tl .badge-pub { font-size: .68rem; padding: 1px 8px; border-radius: 99px; background: var(--info-bg); color: var(--info); margin-inline-start: 6px; }
.tl .badge-int { font-size: .68rem; padding: 1px 8px; border-radius: 99px; background: #fff3c4; color: #7a5a00; margin-inline-start: 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: .74rem; font-family: var(--font-display); }
.presets button[aria-pressed="true"] { background: var(--ink-800); color: #fff; border-color: var(--ink-800); }
.pct-badge { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--heading); direction: ltr; padding: 2px 10px; border-radius: 8px; background: var(--sun-100); border: 1px solid #f0e58a; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; padding-inline: 12px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; font-family: var(--font-mono); font-size: .76rem; color: var(--link); }
.portal-card { position: relative; overflow: hidden; }
.portal-card .card-head { background: linear-gradient(120deg, var(--ink-800), var(--ink-900)); border-bottom: 0; color: #fff; }
.portal-card .card-head h3 { color: #fff; }
.portal-card .card-head h3 svg { color: var(--sun-400); }
.stat-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--text-3); }
.stat-line span { display: inline-flex; gap: 4px; align-items: center; }
.stat-line svg { width: 14px; height: 14px; }
.dropzone { display: grid; place-items: center; gap: 6px; text-align: center; padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-size: .84rem; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.dropzone:hover, .dropzone.over { border-color: var(--ink-600); background: var(--sky-50); }
.dropzone .icw { width: 44px; height: 44px; border-radius: 12px; background: var(--sky-100); color: var(--link); display: grid; place-items: center; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.file-row .ft { width: 38px; height: 44px; border-radius: 8px; background: var(--ink-800); color: var(--sun-400); display: grid; place-items: center; font-size: .62rem; font-weight: 800; font-family: var(--font-display); flex: none; }
.file-row .ft.img { background: var(--ink-600); color: #fff; }
.file-row .info { flex: 1; min-width: 0; }
.file-row .info strong { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .info small { color: var(--text-3); font-size: .72rem; }
.files { display: grid; gap: 8px; }
.cust-card { display: flex; gap: 14px; align-items: center; }
.cust-card strong { display: block; font-family: var(--font-display); color: var(--heading); }
.quick-contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }

/* Wizard */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.wz-steps { display: flex; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.wz-steps li { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--text-3); }
.wz-steps li .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); font-family: var(--font-display); font-weight: 700; font-size: .8rem; flex: none; background: var(--surface); }
.wz-steps li.done { color: var(--heading); }
.wz-steps li.done .n { background: var(--ink-800); border-color: var(--ink-800); color: var(--sun-400); }
.wz-steps li.cur { color: var(--heading); font-weight: 700; }
.wz-steps li.cur .n { background: var(--sun-400); border-color: var(--ink-800); color: var(--ink-900); }
.wz-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line); min-width: 12px; }
.wz-steps li.done:not(:last-child)::after { background: var(--ink-800); }
.wz-body { padding: 22px 20px; min-height: 380px; }
.wz-body h2 { font-size: 1.1rem; margin-bottom: 4px; }
.wz-body > p { color: var(--text-3); font-size: .86rem; margin-bottom: 18px; }
.wz-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.type-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.type-opt { position: relative; display: grid; gap: 8px; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); text-align: start; transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast); }
.type-opt:hover { border-color: var(--ink-500); transform: translateY(-2px); }
.type-opt[aria-checked="true"] { border-color: var(--ink-800); box-shadow: 0 0 0 3px rgba(253,244,40,.6); }
.type-opt[aria-checked="true"]::after { content: ""; position: absolute; top: 12px; inset-inline-end: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-800) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fdf428' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/13px no-repeat; }
.type-opt .ti { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.type-opt strong { font-family: var(--font-display); font-size: .95rem; color: var(--heading); }
.type-opt small { font-size: .76rem; color: var(--text-3); }
.cust-results { display: grid; gap: 8px; margin-top: 12px; }
.cust-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: start; width: 100%; }
.cust-opt:hover { border-color: var(--ink-500); }
.cust-opt[aria-checked="true"] { border-color: var(--ink-800); background: var(--sun-100); }
.cust-opt .info { flex: 1; }
.cust-opt strong { display: block; font-size: .88rem; }
.cust-opt small { color: var(--text-3); font-size: .76rem; }
.summary { position: sticky; top: calc(var(--top-h) + 16px); }
.summary .sum-head { padding: 18px 20px; background: var(--ink-800); color: #cfe0ee; border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative; overflow: hidden; }
.summary .sum-head::after { content: "طلب"; position: absolute; inset-inline-start: 10px; bottom: -36px; font-family: var(--font-callig); font-size: 6rem; opacity: .07; color: #fff; }
.summary .sum-head small { color: #9fbedc; }
.summary .sum-head .code-xl { font-family: var(--font-mono); font-weight: 800; color: var(--sun-400); font-size: 1.15rem; direction: ltr; display: block; text-align: end; }
.wa-preview { background: #e9ddd0; border-radius: 14px; padding: 14px; background-image: radial-gradient(rgba(0,0,0,.04) 1px, transparent 1px); background-size: 10px 10px; }
.wa-bubble { background: #dcf8c6; border-radius: 12px 12px 4px 12px; padding: 10px 12px; font-size: .82rem; line-height: 1.7; color: #1b2a20; box-shadow: 0 1px 1px rgba(0,0,0,.1); white-space: pre-line; max-width: 92%; margin-inline-start: auto; }
.wa-bubble .t { display: block; text-align: start; font-size: .66rem; color: #6b7c70; margin-top: 4px; direction: ltr; }
.profit-calc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }

/* Customer profile */
.profile-hero { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 20px; }
.profile-hero .info { flex: 1; min-width: 220px; }
.profile-hero h1 { font-size: 1.3rem; }
.profile-hero .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: .82rem; color: var(--text-2); }
.profile-hero .meta span { display: inline-flex; gap: 6px; align-items: center; }
.profile-hero .meta svg { width: 15px; height: 15px; color: var(--text-3); }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.mini-stats div { padding: 14px 20px; border-inline-start: 1px solid var(--line); }
.mini-stats div:first-child { border-inline-start: 0; }
.mini-stats small { display: block; font-size: .74rem; color: var(--text-3); }
.mini-stats b { font-family: var(--font-display); font-size: 1.2rem; color: var(--heading); direction: ltr; display: inline-block; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--sun-100); color: #6a5d00; border: 1px solid #efe38b; }

/* Empty / skeleton */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .icw { width: 56px; height: 56px; border-radius: 16px; background: var(--sky-100); color: var(--link); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { font-size: 1rem; margin-bottom: 4px; }
.empty p { font-size: .85rem; color: var(--text-3); }

/* ======================= Overlays ======================= */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(1,26,39,.55); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity var(--med), visibility 0s linear var(--med); }
.overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.cmdk { position: fixed; z-index: 110; top: 12vh; left: 50%; width: min(640px, calc(100vw - 24px)); transform: translate(-50%, -8px); background: var(--surface); border-radius: 18px; box-shadow: var(--sh-lg); overflow: hidden; opacity: 0; visibility: hidden; transition: opacity var(--fast), transform var(--fast), visibility 0s linear var(--fast); }
.cmdk.is-open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; height: 58px; border: 0; outline: none; font-size: 1rem; background: transparent; }
.cmdk-list { max-height: 50vh; overflow: auto; padding: 8px; }
.cmdk-group { font-size: .7rem; color: var(--text-3); padding: 8px 10px 4px; font-weight: 600; }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 10px; border: 0; background: none; text-align: start; font-size: .86rem; }
.cmdk-item .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sky-100); color: var(--link); flex: none; }
.cmdk-item small { display: block; color: var(--text-3); font-size: .74rem; }
.cmdk-item[aria-selected="true"] { background: var(--sky-100); }
.cmdk-item .go { margin-inline-start: auto; color: var(--text-3); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .72rem; color: var(--text-3); background: var(--surface-2); }

.drawer { position: fixed; z-index: 110; top: 0; bottom: 0; inset-inline-end: 0; width: min(480px, 100vw); background: var(--surface); box-shadow: var(--sh-lg); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform var(--med) var(--ease); }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.05rem; }
.drawer-body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 16px; align-content: start; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }

.toast-stack { position: fixed; z-index: 200; bottom: 20px; left: 20px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ink-900); color: #fff; box-shadow: var(--sh-lg); font-size: .85rem; animation: toastIn .3s var(--ease); max-width: 380px; }
.toast svg { color: var(--sun-400); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* Demo role banner */
.demo-role { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--text-3); }
[data-perm-hidden] { display: none !important; }

/* ======================= Login ======================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; color: #cfe0ee; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(90% 70% at 80% 0%, rgba(159,190,220,.55), transparent 60%), linear-gradient(180deg, #2f5885 0%, var(--ink-800) 45%, var(--ink-950) 100%); }
.login-art .letters { position: absolute; inset: 0; pointer-events: none; }
.login-art .letters span { position: absolute; font-family: var(--font-callig); color: #fff; opacity: .05; line-height: 1; }
.login-art .mark { position: relative; z-index: 1; width: 170px; filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }
.login-art h2 { color: #fff; font-size: 1.9rem; position: relative; z-index: 1; margin-top: 28px; max-width: 16ch; line-height: 1.4; }
.login-art h2 em { font-style: normal; color: var(--sun-400); }
.login-art p { position: relative; z-index: 1; margin-top: 12px; max-width: 42ch; color: #b9cfdf; }
.login-art ul { position: relative; z-index: 1; display: grid; gap: 10px; font-size: .88rem; }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art li svg { color: var(--sun-400); }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: min(400px, 100%); }
.login-box h1 { font-size: 1.6rem; }
.login-box > p { color: var(--text-3); margin: 6px 0 28px; }
.login-box .field + .field { margin-top: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 46px; }
.pw-wrap button { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--text-3); border-radius: 8px; display: grid; place-items: center; }
.login-meta { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 22px; font-size: .82rem; }
.login-meta a { color: var(--link); font-weight: 600; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .84rem; margin-bottom: 16px; }
.alert-danger { background: var(--danger-bg); color: #861818; border: 1px solid #f6c9c9; }
.alert-warn { background: var(--warn-bg); color: #6b4000; border: 1px solid #f4dba1; }
.alert-info { background: var(--info-bg); color: #08486a; border: 1px solid #c3e0f0; }
.alert-ok { background: var(--ok-bg); color: #0b5a37; border: 1px solid #bfe5d1; }
.alert strong { display: block; font-family: var(--font-display); }
.login-foot { margin-top: 28px; display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--text-3); }
.demo-note { margin-top: 16px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: .76rem; color: var(--text-3); }

/* ======================= Responsive ======================= */
@media (max-width: 1280px) {
  .attn, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
  .layout-2, .wizard { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); transform: translateX(100%); transition: transform var(--med) var(--ease); z-index: 120; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--sh-lg); }
  .side-collapse { display: none !important; }
  .menu-btn { display: grid; }
  .layout-2, .wizard { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .span-6, .span-3 { grid-column: span 12; }
  .user-chip .who { display: none; }
  .pipeline { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; }
}
@media (max-width: 760px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .cmd-trigger { flex: 1; }
  .cmd-trigger kbd, .cmd-trigger .hide-sm { display: none; }
  .top-actions .btn-new span { display: none; }
  .top-actions .btn-new { width: 44px; padding: 0; }
  .attn { grid-template-columns: 1fr 1fr; gap: 10px; }
  .attn-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { min-height: 120px; padding: 14px; }
  .kpi .value { font-size: 1.3rem; }
  .spark { display: none; }
  .table-wrap.responsive { display: none; }
  .m-list { display: block; }
  .form-grid, .form-grid.cols-3, .dl, .profit-calc { grid-template-columns: 1fr; }
  .money-grid, .mini-stats { grid-template-columns: 1fr 1fr; }
  .mini-stats div:nth-child(3) { border-inline-start: 0; }
  .mini-stats div { border-top: 1px solid var(--line); }
  .type-picker { grid-template-columns: 1fr 1fr; }
  .steps-track li { font-size: .66rem; }
  .welcome { padding: 20px; }
  .page-head h1 { font-size: 1.25rem; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .toast-stack { left: 12px; right: 12px; }
  .wz-steps li span.lb { display: none; }
  .wz-steps li { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .head-actions, .toast-stack { display: none !important; }
  .app { display: block; }
}
.side-nav span[data-perm] { display: block; }
.table .code, .table .cust strong, .table td .type-tag { white-space: nowrap; }
.table .cust small { white-space: nowrap; }

.table td.nowrap, .table .due-cell { white-space: nowrap; }
.table .money small { display: block; font-family: var(--font-body); font-weight: 600; font-size: .72rem; color: var(--danger); }
.table .money small.paid { color: var(--ok); font-weight: 500; }
.table .money small { direction: rtl; }
#ordersTable td, #ordersTable th { padding-inline: 10px; }
#ordersTable .mini-progress { min-width: 92px; }
#ordersTable .type-tag { max-width: 230px; }
#ordersTable .type-tag > :last-child, #ordersTable .type-tag { overflow: hidden; text-overflow: ellipsis; }
.type-tag .tl-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.portal-card .card-body { grid-template-columns: minmax(0, 1fr); }
.portal-card .card-body > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
.portal-card .btn { white-space: normal; text-align: center; line-height: 1.3; padding-block: 6px; }
.steps-track li.cur::before { background: var(--ink-800); }
.layout-2 > *, .wizard > *, .stack, .stack > *, .grid > * { min-width: 0; }
.stack { grid-template-columns: minmax(0, 1fr); }
.cmd-trigger > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cmd-trigger { min-width: 0; }
.cust-opt small { white-space: nowrap; }

/* =========================================================================
   الدفعة الثانية
   ========================================================================= */
/* Catalog cards */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; padding: 16px; }
.cat-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); transition: box-shadow var(--fast), transform var(--fast); }
.cat-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.cat-card.is-off { opacity: .72; }
.cat-cover { position: relative; height: 104px; padding: 12px 14px; display: flex; align-items: flex-end; justify-content: space-between; color: #fff; overflow: hidden; background: linear-gradient(135deg, var(--ink-700), var(--ink-900)); }
.cat-cover.k-service { background: linear-gradient(135deg, #3a4f66, #13263a); }
.cat-cover.k-umrah { background: linear-gradient(135deg, #0e5a52, #022b40); }
.cat-cover .word { position: absolute; inset-inline-start: 12px; top: -4px; font-family: var(--font-callig); font-size: 3.6rem; color: rgba(255,255,255,.13); white-space: nowrap; line-height: 1.3; }
.cat-cover .id { font-family: var(--font-mono); font-size: .72rem; background: rgba(255,255,255,.14); padding: 2px 8px; border-radius: 6px; direction: ltr; position: relative; }
.cat-cover .flags { display: flex; gap: 6px; position: relative; }
.cat-cover .flags span { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.16); }
.cat-cover .flags .feat { background: var(--sun-400); color: var(--ink-900); }
.cat-body { padding: 14px; display: grid; gap: 10px; flex: 1; }
.cat-body h3 { font-size: .95rem; line-height: 1.5; }
.cat-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .76rem; color: var(--text-3); }
.cat-meta span { display: inline-flex; gap: 5px; align-items: center; }
.cat-meta svg { width: 14px; height: 14px; }
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.price-row .p { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--heading); direction: ltr; }
.price-row .m { font-size: .74rem; color: var(--ok); font-weight: 600; direction: ltr; }
.cat-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.req-editor { display: grid; gap: 8px; }
.req-editor .row { display: flex; gap: 6px; }
.req-editor .row .input { flex: 1; }
.web-preview { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.web-preview .lbl { font-size: .72rem; color: var(--text-3); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }

/* Umrah groups */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; padding: 16px; }
.group-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 16px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.group-card::after { content: "عمرة"; position: absolute; inset-inline-start: 10px; bottom: -34px; font-family: var(--font-callig); font-size: 5.5rem; color: var(--ink-text); opacity: .04; line-height: 1; pointer-events: none; }
.group-top { display: flex; gap: 14px; align-items: center; }
.ring { --p: 50; --c: var(--ink-700); width: 74px; height: 74px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--muted-bg) 0); }
.ring > div { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring b { font-family: var(--font-display); font-size: 1rem; color: var(--heading); }
.ring small { font-size: .62rem; color: var(--text-3); }
.group-top h3 { font-size: 1rem; }
.group-top .sub { font-size: .76rem; color: var(--text-3); font-family: var(--font-mono); direction: ltr; text-align: end; }
.group-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.group-facts div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: .74rem; color: var(--text-3); }
.group-facts b { display: block; font-family: var(--font-display); font-size: .86rem; color: var(--heading); }
.visa-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--muted-bg); }
.visa-bar span { display: block; height: 100%; }
.visa-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .72rem; color: var(--text-2); margin-top: 6px; }
.visa-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 4px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--sun-100); color: #6a5d00; border: 1px solid #efe38b; }

/* Ledger */
.ledger td.debit { color: var(--danger); font-family: var(--font-display); direction: ltr; text-align: end; }
.ledger td.credit { color: var(--ok); font-family: var(--font-display); direction: ltr; text-align: end; }
.ledger td.bal { font-family: var(--font-display); font-weight: 700; direction: ltr; text-align: end; }
.bal-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; direction: ltr; font-family: var(--font-display); }
.bal-pill.owe { background: var(--danger-bg); color: var(--danger); }
.bal-pill.clear { background: var(--ok-bg); color: var(--ok); }

/* Expense category bars */
.cat-bars { display: grid; gap: 12px; }
.cat-bar { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.cat-bar .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.cat-bar .ic svg { width: 16px; height: 16px; }
.cat-bar .lb { font-size: .82rem; display: flex; justify-content: space-between; margin-bottom: 4px; }
.cat-bar .track { height: 7px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.cat-bar .track span { display: block; height: 100%; border-radius: inherit; }
.cat-bar b { font-family: var(--font-display); font-size: .86rem; direction: ltr; }

/* Invoice sheet (A4) */
.inv-page { background: #e9eef3; padding: 24px; border-radius: var(--r-lg); }
.sheet { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; box-shadow: var(--sh-lg); padding: 14mm 14mm 12mm; position: relative; overflow: hidden; color: #1a2a35; font-size: 13px; display: flex; flex-direction: column; }
.sheet::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; background: linear-gradient(90deg, var(--sun-400) 0 22%, var(--ink-800) 22%); }
.sheet .wm { position: absolute; inset: 40% 0 auto 0; text-align: center; font-family: var(--font-callig); font-size: 140px; color: var(--ink-text); opacity: .035; pointer-events: none; }
.sheet .wm.void { font-family: var(--font-display); font-weight: 800; font-size: 120px; color: var(--danger); opacity: .12; transform: rotate(-18deg); }
.sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--ink-800); }
.sh-brand { display: flex; gap: 12px; align-items: center; }
.sh-brand .logo { width: 62px; height: 62px; border-radius: 14px; background: var(--ink-800); display: grid; place-items: center; padding: 6px; }
.sh-brand .logo img { max-height: 50px; }
.sh-brand strong { display: block; font-family: var(--font-display); font-size: 16px; color: var(--heading); }
.sh-brand span { display: block; font-size: 10px; letter-spacing: .12em; color: var(--icon); direction: ltr; text-align: right; font-weight: 600; }
.sh-brand small { display: block; font-size: 10.5px; color: #5b6c78; margin-top: 2px; }
.sh-title { text-align: end; }
.sh-title h1 { font-size: 24px; color: var(--heading); }
.sh-title .en { font-size: 10px; letter-spacing: .3em; color: var(--icon); font-weight: 700; }
.sh-title .no { font-family: var(--font-mono); font-weight: 800; font-size: 14px; direction: ltr; display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 6px; background: var(--sky-100); color: var(--ink-text); }
.sh-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.sh-box { border: 1px solid #dde6ee; border-radius: 10px; padding: 10px 12px; }
.sh-box h4 { font-size: 10.5px; color: #5b6c78; font-weight: 600; margin-bottom: 6px; font-family: var(--font-body); }
.sh-box p { line-height: 1.75; }
.sh-box b { color: var(--heading); }
.sh-meta { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #dde6ee; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.sh-meta div { padding: 8px 10px; border-inline-start: 1px solid #dde6ee; }
.sh-meta div:first-child { border-inline-start: 0; }
.sh-meta small { display: block; font-size: 10px; color: #6a7f8e; }
.sh-meta b { font-size: 12px; color: var(--heading); }
.sh-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sh-table th { background: var(--ink-800); color: #fff; font-family: var(--font-display); font-weight: 600; padding: 8px 10px; text-align: start; font-size: 11.5px; }
.sh-table th:first-child { border-start-start-radius: 8px; } .sh-table th:last-child { border-start-end-radius: 8px; }
.sh-table td { padding: 10px; border-bottom: 1px solid #e6edf3; }
.sh-table .n { text-align: end; direction: ltr; font-family: var(--font-display); white-space: nowrap; }
.sh-bottom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 16px; align-items: start; }
.sh-totals { border: 1px solid #dde6ee; border-radius: 10px; overflow: hidden; }
.sh-totals div { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #e6edf3; }
.sh-totals div:last-child { border-bottom: 0; }
.sh-totals .grand { background: var(--ink-800); color: #fff; font-family: var(--font-display); font-size: 14px; }
.sh-totals .grand b { color: var(--sun-400); }
.sh-totals .due b { color: var(--danger); }
.sh-totals b { direction: ltr; font-family: var(--font-display); }
.sh-words { font-size: 11.5px; color: #3d5566; padding: 8px 12px; border-radius: 8px; background: #f6f9fb; border: 1px dashed #cfdbe5; margin-bottom: 10px; }
.sh-terms { font-size: 10.5px; color: #5b6c78; line-height: 1.8; }
.sh-terms h4 { font-size: 11px; color: var(--heading); margin-bottom: 4px; }
.sh-stamp { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 20px; }
.sh-sign { text-align: center; font-size: 11px; color: #5b6c78; min-width: 160px; }
.sh-sign .ln { border-top: 1px solid #b9c7d3; margin-top: 40px; padding-top: 4px; }
.sh-seal { width: 96px; height: 96px; border-radius: 50%; border: 3px double var(--ink-700); display: grid; place-items: center; text-align: center; font-family: var(--font-display); font-size: 10px; font-weight: 700; color: var(--link); transform: rotate(-10deg); line-height: 1.4; opacity: .85; }
.sh-seal.paid { border-color: var(--ok); color: var(--ok); }
.sh-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e6edf3; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 10px; color: #6a7f8e; }
.sh-foot span { display: inline-flex; gap: 4px; align-items: center; }
.sh-foot svg { width: 12px; height: 12px; }
.verify { display: flex; gap: 10px; align-items: center; font-size: 10.5px; color: #5b6c78; }
.verify .code { font-family: var(--font-mono); font-weight: 700; color: var(--ink-text); direction: ltr; letter-spacing: .08em; }
.sheet.receipt { min-height: auto; }
.inv-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 16px; }

@media (max-width: 760px) {
  .inv-page { padding: 0; background: none; }
  .sheet { padding: 18px 14px; min-height: 0; font-size: 12px; }
  .sh-parties, .sh-bottom { grid-template-columns: 1fr; }
  .sh-meta { grid-template-columns: 1fr 1fr; }
  .sh-meta div:nth-child(3) { border-inline-start: 0; }
  .sh-meta div:nth-child(n+3) { border-top: 1px solid #dde6ee; }
  .group-facts { grid-template-columns: 1fr 1fr; }
}
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .main, .content { padding: 0 !important; max-width: none; }
  .inv-toolbar, .page-head, .no-print { display: none !important; }
  .inv-page { padding: 0; background: none; border-radius: 0; }
  .sheet { box-shadow: none; width: 210mm; min-height: 297mm; margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sh-table th, .sh-totals .grand, .sh-brand .logo, .sheet::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.price-row .m, .price-row .p { unicode-bidi: isolate; display: inline-block; }
.sh-table .n, .sh-table th.n { text-align: left; }
#eTable td:nth-child(1), #eTable td:nth-child(4), #eTable td:nth-child(5), #iTable td:nth-child(4), #iTable td:nth-child(5) { white-space: nowrap; }
.sh-title .no { white-space: nowrap; }
@media (max-width: 760px) {
  .sh-head { flex-direction: column-reverse; align-items: stretch; }
  .sh-title { display: flex; justify-content: space-between; align-items: center; text-align: start; }
  .sh-table th:nth-child(3), .sh-table td:nth-child(3), .sh-table th:nth-child(1), .sh-table td:nth-child(1) { display: none; }
  .sh-stamp { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* =========================================================================
   الدفعة الثالثة
   ========================================================================= */
/* Settings-style layout: vertical nav + panels */
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.vnav { position: sticky; top: calc(var(--top-h) + 16px); padding: 8px; display: grid; gap: 2px; }
.vnav button, .vnav a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; text-align: start; font-family: var(--font-display); font-size: .84rem; color: var(--text-2); }
.vnav button:hover { background: var(--surface-2); color: var(--heading); }
.vnav button[aria-current="true"] { background: var(--ink-800); color: #fff; }
.vnav button[aria-current="true"] svg { color: var(--sun-400); }
.vnav .sep { height: 1px; background: var(--line); margin: 6px 8px; }
.panel-sec { scroll-margin-top: calc(var(--top-h) + 16px); }
.panel-sec + .panel-sec { margin-top: 16px; }
.sec-desc { font-size: .82rem; color: var(--text-3); margin-top: 2px; font-weight: 400; font-family: var(--font-body); }
/* شريط الحفظ: عائم أسفل الشاشة بمحاذاة منطقة المحتوى؛ لا يضيف ارتفاعًا للصفحة وهو مخفي */
.save-bar { position: fixed; bottom: 16px; inset-inline-start: calc(var(--side, 0px) + 24px); inset-inline-end: 24px; max-width: 1180px; margin-inline: auto; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--ink-900); color: #d8e6f0; box-shadow: 0 18px 50px rgba(1,26,39,.35); transform: translateY(calc(100% + 24px)); opacity: 0; visibility: hidden; pointer-events: none; transition: transform var(--med) var(--ease), opacity var(--med), visibility 0s linear var(--med); }
.save-bar.show { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
#content:has(.save-bar.show) { padding-bottom: 96px; }
@media (max-width: 1024px) { .save-bar { inset-inline-start: 12px; inset-inline-end: 12px; bottom: 12px; } }
.save-bar .btn-ghost { --bg: rgba(255,255,255,.08); --fg: #fff; --bd: rgba(255,255,255,.2); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { display: block; font-size: .88rem; font-family: var(--font-display); font-weight: 600; color: var(--heading); }
.setting-row small { display: block; font-size: .78rem; color: var(--text-3); }
.logo-box { display: flex; gap: 16px; align-items: center; }
.logo-box .prev { width: 88px; height: 88px; border-radius: 18px; background: var(--ink-800); display: grid; place-items: center; padding: 10px; flex: none; }
.logo-box .prev img { max-height: 70px; }
.color-dot { display: inline-block; width: 18px; height: 18px; border-radius: 6px; vertical-align: -4px; border: 1px solid rgba(0,0,0,.1); }

/* Users & roles */
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; padding: 16px; }
.role-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface); display: grid; gap: 10px; text-align: start; transition: border-color var(--fast), box-shadow var(--fast); }
.role-card:hover { border-color: var(--ink-500); }
.role-card[aria-pressed="true"] { border-color: var(--ink-800); box-shadow: 0 0 0 3px rgba(253,244,40,.55); }
.role-card .top { display: flex; justify-content: space-between; align-items: center; }
.role-card strong { font-family: var(--font-display); font-size: .95rem; color: var(--heading); }
.role-card .meter { height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.role-card .meter span { display: block; height: 100%; background: var(--ink-700); border-radius: inherit; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-inline-start: -8px; }
.avatars .avatar:first-child { margin-inline-start: 0; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.matrix th, .matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.matrix thead th { position: sticky; top: var(--top-h); background: var(--surface-2); z-index: 2; font-family: var(--font-display); font-size: .76rem; color: var(--text-2); text-align: center; white-space: nowrap; }
.matrix thead th:first-child { text-align: start; }
.matrix td:not(:first-child) { text-align: center; width: 120px; }
.matrix tr.grp td { background: var(--sky-50); font-family: var(--font-display); font-weight: 600; color: var(--heading); }
.matrix tr.grp td .gtoggle { font-size: .72rem; font-weight: 500; color: var(--link); border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; margin-inline-start: 8px; min-height: 32px; }
.matrix .lock { color: var(--text-3); }
.matrix tbody tr:not(.grp):hover td { background: var(--sun-100); }
.pchk { width: 20px; height: 20px; accent-color: var(--ink-800); cursor: pointer; }
.sensitive { font-size: .68rem; padding: 1px 7px; border-radius: 99px; background: var(--danger-bg); color: var(--danger); margin-inline-start: 6px; font-weight: 600; }
.user-off td { opacity: .55; }
.log-row .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.log-row .ic svg { width: 16px; height: 16px; }
.res-ok { color: var(--ok); font-weight: 600; } .res-bad { color: var(--danger); font-weight: 600; }
.strength { display: flex; gap: 4px; margin-top: 6px; }
.strength span { flex: 1; height: 5px; border-radius: 99px; background: var(--muted-bg); }
.strength[data-s="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-s="2"] span:nth-child(-n+2) { background: var(--warn); }
.strength[data-s="3"] span:nth-child(-n+3) { background: #7fae2c; }
.strength[data-s="4"] span { background: var(--ok); }

/* CMS */
.cms-preview { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cms-preview .bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .72rem; color: var(--text-3); direction: ltr; }
.cms-preview .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.cms-hero { position: relative; overflow: hidden; padding: 26px 22px; color: #d8e6f0; background: radial-gradient(90% 70% at 80% 0%, rgba(159,190,220,.55), transparent 60%), linear-gradient(180deg, #2f5885, var(--ink-800) 50%, var(--ink-900)); }
.cms-hero .badge { display: inline-block; font-size: .68rem; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); margin-bottom: 10px; }
.cms-hero h3 { color: #fff; font-size: 1.35rem; line-height: 1.35; }
.cms-hero h3 em { font-style: normal; color: var(--sun-400); }
.cms-hero p { font-size: .78rem; color: #b9cfdf; margin-top: 8px; line-height: 1.7; }
.cms-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ink-800); }
.cms-stats div { text-align: center; padding: 10px 6px; color: #b9cfdf; font-size: .66rem; border-inline-start: 1px solid rgba(255,255,255,.1); }
.cms-stats div:first-child { border-inline-start: 0; }
.cms-stats b { display: block; color: var(--sun-400); font-family: var(--font-display); font-size: 1rem; direction: ltr; }
.list-edit { display: grid; gap: 8px; }
.le-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.le-row.off { background: var(--surface-2); }
.le-row.off .le-main { opacity: .6; }
.le-row .handle { color: var(--text-3); cursor: grab; display: grid; place-items: center; height: 28px; }
.le-row.dragging { opacity: .5; }
.le-main strong { display: block; font-size: .88rem; color: var(--heading); }
.le-main p { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.le-main .meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.le-actions { display: flex; gap: 2px; align-items: center; }
.t-mod { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: var(--surface); }
.t-mod.pending { border-color: #f0d58a; background: #fffcf0; }
.t-mod blockquote { margin: 0; font-size: .86rem; line-height: 1.8; color: var(--text); }
.t-mod .who { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-3); }
.t-mod .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.input-prefix { display: flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.input-prefix:focus-within { border-color: var(--ink-700); box-shadow: 0 0 0 3px rgba(10,79,112,.14); }
.input-prefix .pre { display: grid; place-items: center; width: 44px; background: var(--surface-2); border-inline-end: 1px solid var(--line); color: var(--link); flex: none; }
.input-prefix .pre svg { width: 18px; height: 18px; }
.input-prefix .input { border: 0; box-shadow: none !important; border-radius: 0; }
.serp { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; direction: rtl; }
.serp .u { font-size: .74rem; color: #188038; direction: ltr; text-align: right; }
.serp .t { color: #1a0dab; font-size: 1.02rem; margin: 2px 0; }
.serp .d { font-size: .8rem; color: #4d5156; line-height: 1.6; }
.counter { font-size: .72rem; color: var(--text-3); text-align: end; }
.counter.over { color: var(--danger); font-weight: 600; }

/* Reports */
.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rank { display: grid; gap: 10px; }
.rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .84rem; }
.rank li .n { width: 26px; height: 26px; border-radius: 8px; background: var(--sky-100); color: var(--link); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .78rem; }
.rank li:first-child .n { background: var(--sun-400); color: var(--ink-900); }
.rank li .track { height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; margin-top: 4px; }
.rank li .track span { display: block; height: 100%; background: var(--ink-600); border-radius: inherit; }
.rank li b { font-family: var(--font-display); direction: ltr; font-size: .84rem; }
.margin-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.margin-cell .track { width: 70px; height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.margin-cell .track span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.score { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-family: var(--font-display); }

@media (max-width: 1024px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .vnav { position: sticky; top: var(--top-h); z-index: 15; display: flex; overflow-x: auto; background: var(--surface); scrollbar-width: none; }
  .vnav button { width: auto; flex: none; white-space: nowrap; }
  .vnav .sep { display: none; }
}
@media (max-width: 760px) {
  .cms-stats { grid-template-columns: 1fr 1fr; }
  .matrix td:not(:first-child) { width: 70px; }
  .matrix th, .matrix td { padding: 8px 6px; }
  .setting-row { flex-direction: column; align-items: flex-start; }
}
.table td.money { text-align: left; }
.matrix thead th { top: 0; }
.counter { direction: ltr; text-align: left; }
.cms-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .cms-2 { grid-template-columns: minmax(0, 1fr); } .cms-2 > :last-child { order: -1; } .save-bar { flex-wrap: wrap; } }

/* =========================================================================
   التنقل السلس + الوضع الليلي
   ========================================================================= */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: 120ms ease both vt-out; }
::view-transition-new(root) { animation: 200ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
/* شريط تحميل رفيع أعلى الصفحة أثناء التنقل */
html.is-navigating .topbar::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--sun-400), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: navbar 0.9s linear infinite; }
@keyframes navbar { from { background-position: 150% 0; } to { background-position: -50% 0; } }
#content:focus { outline: none; }

.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* المستند المطبوع يبقى بألوان الورق دائمًا */
.sheet { --heading: var(--ink-900); --ink-text: var(--ink-800); --link: var(--ink-700); --icon: var(--ink-600); --text: #1a2a35; color-scheme: light; }

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08141d; --surface: #0e1f2b; --surface-2: #122737; --line: #1d3a4f; --line-strong: #2a4d66;
  --text: #e2ecf4; --text-2: #b3c6d5; --text-3: #8aa3b7;
  --heading: #f1f6fa; --ink-text: #a9d4f3; --link: #8fc8ef; --icon: #8bb8db;
  --muted-bg: #1a3446; --sky-50: #11283a; --sky-100: #163249; --sky-200: #1f4262;
  --sun-100: rgba(253,244,40,.1);
  --ok: #52d394; --ok-bg: rgba(15,122,74,.22);
  --warn: #f2b84b; --warn-bg: rgba(186,116,0,.22);
  --info: #72c2ef; --info-bg: rgba(11,95,138,.3);
  --danger: #ff8f8f; --danger-bg: rgba(180,35,35,.24);
  --violet: #b9a6ff; --violet-bg: rgba(91,63,176,.3);
  --sh-sm: 0 1px 2px rgba(0,0,0,.35); --sh-md: 0 8px 24px rgba(0,0,0,.35); --sh-lg: 0 24px 60px -12px rgba(0,0,0,.6);
  --topbar-bg: rgba(8,20,29,.82); --side-bg-end: #010f17;
  --grid: #1b3546; --chart-ink: #5fa3d6; --chart-mid: #3f7fb4; --chart-soft: #2b4a61;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #032a3d 0%, #021d2b 38%, #010f17 100%); }
[data-theme="dark"] .welcome { background: radial-gradient(80% 120% at 0% 0%, rgba(95,163,214,.25), transparent 60%), linear-gradient(120deg, #0a3b56, #062c41 45%, #031b29); }
[data-theme="dark"] .kpi.feature { background: linear-gradient(140deg, #0a4566, #05283b); border-color: #0d4b6d; }
[data-theme="dark"] .btn-primary { --bg: #1d6a98; }
[data-theme="dark"] .btn-primary:hover { --bg: #237aad; }
[data-theme="dark"] .avatar.c1 { background: rgba(114,194,239,.18); color: #8fd0f5; }
[data-theme="dark"] .avatar.c2 { background: rgba(185,166,255,.18); color: #c9b9ff; }
[data-theme="dark"] .avatar.c3 { background: rgba(82,211,148,.16); color: #6fe0a8; }
[data-theme="dark"] .avatar.c4 { background: rgba(242,184,75,.16); color: #f5c76f; }
[data-theme="dark"] .avatar.c5 { background: rgba(255,143,190,.16); color: #ffa6cb; }
[data-theme="dark"] .s-needs { background: rgba(217,119,6,.22); color: #f6b26b; }
[data-theme="dark"] .s-paused { color: #b3c6d5; }
[data-theme="dark"] .alert-danger { color: #ffc1c1; border-color: rgba(255,143,143,.3); }
[data-theme="dark"] .alert-warn { color: #ffd896; border-color: rgba(242,184,75,.3); }
[data-theme="dark"] .alert-info { color: #b9e2fa; border-color: rgba(114,194,239,.3); }
[data-theme="dark"] .alert-ok { color: #a8f0cb; border-color: rgba(82,211,148,.3); }
[data-theme="dark"] .tag, [data-theme="dark"] .countdown, [data-theme="dark"] .pct-badge { background: rgba(253,244,40,.12); color: #f7ef7a; border-color: rgba(253,244,40,.3); }
[data-theme="dark"] .tl .note.internal, [data-theme="dark"] #uInt { background: rgba(253,244,40,.07) !important; border-color: rgba(253,244,40,.22); }
[data-theme="dark"] .tl .badge-int { background: rgba(253,244,40,.16); color: #f7ef7a; }
[data-theme="dark"] .t-mod.pending { background: rgba(253,244,40,.06); border-color: rgba(253,244,40,.25); }
[data-theme="dark"] .money-tile.profit { border-color: rgba(82,211,148,.3); }
[data-theme="dark"] .money-tile.due { border-color: rgba(255,143,143,.3); }
[data-theme="dark"] .table tbody tr.is-selected { background: rgba(253,244,40,.08); }
[data-theme="dark"] .inv-page { background: #050e15; }
[data-theme="dark"] .wa-preview { background-color: #0b1e1a; }
[data-theme="dark"] .wa-bubble { background: #144d37; color: #e4f7ec; }
[data-theme="dark"] .serp { background: #0e1f2b; }
[data-theme="dark"] .serp .t { color: #8ab4f8; } [data-theme="dark"] .serp .d { color: #bdc1c6; } [data-theme="dark"] .serp .u { color: #6fd08c; }
[data-theme="dark"] .login-form { background: var(--bg); }
[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b3c6d5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] .bulkbar { background: #164e70; }
[data-theme="dark"] .cat-cover { filter: saturate(1.1) brightness(1.05); }
[data-theme="dark"] .icon-btn .dot { border-color: var(--bg); }
[data-theme="dark"] .matrix tbody tr:not(.grp):hover td { background: rgba(253,244,40,.05); }
[data-theme="dark"] .portal-card .card-head { background: linear-gradient(120deg, #0a3b56, #052233); }

/* =========================================================================
   محرر الكتالوج
   ========================================================================= */
.cat-cover.k-flight { background: linear-gradient(135deg, #2f5885, #0a4f70 55%, #033b54); }
.cat-cover.k-hotel { background: linear-gradient(135deg, #6b4a1f, #3d2a12 60%, #1d140a); }
.cat-cover.k-trip { background: linear-gradient(135deg, #8a3a64, #4a1f3a 60%, #22101c); }
.cat-cover .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-cover .cover-img ~ * { position: relative; }
a.cat-cover:hover .word { transform: translateX(6px); }
.cat-cover .word { transition: transform .5s var(--ease); }
.cat-body h3 a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.add-card { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 260px; border: 2px dashed var(--line-strong); background: transparent; text-align: center; color: var(--text-2); padding: 20px; }
.add-card:hover { border-color: var(--ink-500); background: var(--surface); }
.add-card .icw { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--sun-400); color: var(--ink-900); }
.add-card strong { font-family: var(--font-display); color: var(--heading); }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ce-aside { position: sticky; top: calc(var(--top-h) + 16px); }
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.cat-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-family: var(--font-display); font-size: .78rem; color: var(--text-2); transition: all var(--fast); min-height: 74px; }
.cat-pick button svg { width: 22px; height: 22px; color: var(--icon); }
.cat-pick button:hover { border-color: var(--ink-500); color: var(--heading); }
.cat-pick button[aria-checked="true"] { border-color: var(--ink-800); background: var(--ink-800); color: #fff; box-shadow: 0 0 0 3px rgba(253,244,40,.45); }
.cat-pick button[aria-checked="true"] svg { color: var(--sun-400); }
.le-row.compact { grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; padding: 8px; }
.le-row.compact.obj { align-items: start; }
.le-row .day { font-size: .66rem; font-family: var(--font-display); font-weight: 700; color: var(--link); background: var(--sky-100); border-radius: 8px; padding: 4px 4px; white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); }
.date-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.media-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cover-drop { position: relative; min-height: 190px; overflow: hidden; }
.cover-drop.has-img { color: #fff; }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-drop.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(1,26,39,.75)); }
.cover-drop.has-img > :not(img):not(input) { position: relative; }
.cover-drop.has-img .icw { background: rgba(255,255,255,.18); color: #fff; }
.cover-drop.has-img .muted { color: #e3edf5; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.g-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-item .icon-btn { position: absolute; top: 4px; inset-inline-end: 4px; width: 30px; height: 30px; background: rgba(1,26,39,.6); color: #fff; }
.g-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: var(--text-3); cursor: pointer; }
.g-add:hover { border-color: var(--ink-500); color: var(--heading); }

.pv-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--sh-md); }
.pv-cover { position: relative; aspect-ratio: 16 / 8.5; display: flex; align-items: flex-end; padding: 12px 14px; color: #fff; overflow: hidden; background: linear-gradient(135deg, #0a4f70, #033b54 60%, #022b40); }
.pv-cover.k-flight { background: linear-gradient(135deg, #2f5885, #0a4f70 55%, #033b54); } .pv-cover.k-hotel { background: linear-gradient(135deg, #24506b, #123e57 60%, #022b40); }
.pv-cover.k-umrah { background: linear-gradient(135deg, #0e5a52, #0a4048 60%, #022b40); } .pv-cover.k-trip { background: linear-gradient(135deg, #3d6e9a, #1f4f7a 55%, #033b54); }
.pv-cover.k-docs, .pv-cover.k-insure { background: linear-gradient(135deg, #3a4f66, #23384d 60%, #13263a); }
.pv-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-cover .word { position: absolute; inset-inline-start: 12px; top: 0; font-family: var(--font-callig); font-size: 3.4rem; line-height: 1.25; color: rgba(255,255,255,.14); white-space: nowrap; }
.pv-cover .pv-ic { position: absolute; top: 12px; inset-inline-end: 12px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.14); color: var(--sun-400); }
.pv-cover .pv-chip { position: relative; font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.16); }
.pv-body { padding: 14px 16px; display: grid; gap: 8px; }
.pv-body h4 { font-size: .95rem; line-height: 1.55; color: var(--heading); }
.pv-body p { font-size: .8rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pv-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .72rem; color: var(--text-3); }
.pv-meta span { display: inline-flex; gap: 4px; align-items: center; }
.pv-meta svg { width: 13px; height: 13px; }
.pv-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px dashed var(--line); }
.pv-price { font-family: var(--font-display); font-weight: 700; color: var(--heading); direction: ltr; text-align: end; }
.pv-price small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .68rem; color: var(--text-3); direction: rtl; }
.pv-link { font-size: .78rem; font-weight: 600; color: var(--link); font-family: var(--font-display); }
.ready { font-family: var(--font-display); font-weight: 700; font-size: .85rem; padding: 2px 10px; border-radius: 99px; }
.ready.ok { background: var(--ok-bg); color: var(--ok); } .ready.mid { background: var(--warn-bg); color: var(--warn); } .ready.low { background: var(--danger-bg); color: var(--danger); }
.meter { height: 8px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; margin-bottom: 12px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ok), #7fd1a6); transition: width var(--med) var(--ease); }
.checklist { display: grid; gap: 6px; font-size: .8rem; color: var(--text-3); }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist li svg { width: 16px; height: 16px; }
.checklist li.ok { color: var(--text); }
.checklist li.ok svg { color: var(--ok); }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: minmax(0, 1fr); } .ce-aside { position: static; } }
@media (max-width: 760px) { .media-grid, .date-row { grid-template-columns: 1fr; } .cat-pick { grid-template-columns: repeat(3, 1fr); } }
.stack > .panel-sec + .panel-sec { margin-top: 0; }
.le-row textarea.input { min-height: 56px; }
.vnav a.vnav-link { color: var(--link); }
.vnav a.vnav-link:hover { background: var(--surface-2); }
details.sub-edit { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface-2); }
details.sub-edit[open] { padding-bottom: 14px; }
details.sub-edit > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 50px; font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--heading); }
details.sub-edit > summary::-webkit-details-marker { display: none; }
details.sub-edit > summary::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border-inline-end: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform var(--fast); }
details.sub-edit[open] > summary::after { transform: rotate(-135deg); }
details.sub-edit > summary svg { color: var(--icon); width: 17px; height: 17px; }
.num-badge { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--sky-100); color: var(--link); font-family: var(--font-display); font-weight: 700; font-size: .75rem; }
.ann-preview { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px; border-radius: 12px; font-size: .82rem; font-family: var(--font-display); }
.ann-preview b { text-decoration: underline; text-underline-offset: 3px; }
.ann-preview svg { width: 16px; height: 16px; opacity: .7; margin-inline-start: 8px; }
.ann-preview.tone-sun { background: var(--sun-400); color: var(--ink-900); }
.ann-preview.tone-ink { background: var(--ink-800); color: #fff; }
.ann-preview.tone-wa { background: var(--wa); color: #fff; }

/* المصروفات: البطاقة الجانبية بارتفاعها الطبيعي وتبقى ظاهرة أثناء التمرير */
.exp-layout { align-items: start; }
@media (min-width: 1025px) { .exp-side { position: sticky; top: calc(var(--top-h) + 16px); } }

/* الشريط الجانبي على الشاشات الكبيرة مثبت على الشاشة نفسها (fixed) وليس لاصقًا (sticky):
   يبقى بطول الشاشة كاملًا مهما كان طول الصفحة أو أي عنصر يتجاوز حدودها */
@media (min-width: 1025px) {
  .app > .sidebar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--side); height: auto; }
  .app > .main { grid-column: 2; }
}

/* أزرار على شكل شارة (المرفق في جدول المصروفات) */
.chip-btn { border: 0; cursor: pointer; font: inherit; transition: filter var(--fast), box-shadow var(--fast); }
.chip-btn:hover { filter: brightness(.95); box-shadow: 0 0 0 2px currentColor inset; }
.chip-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
/* عارض المرفق */
.att-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.att-view { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 14px; display: grid; place-items: center; }
.att-img { max-width: 100%; max-height: 60vh; border-radius: 10px; object-fit: contain; }
.att-file { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.att-file > div { flex: 1; min-width: 0; } .att-file b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file .icw { width: 40px; height: 40px; border-radius: 10px; background: var(--sky-100); color: var(--link); display: grid; place-items: center; flex: none; }
.receipt-paper { position: relative; width: min(320px, 100%); background: #fffef7; color: #22323d; padding: 20px 18px 18px; border-radius: 6px; box-shadow: 0 10px 30px rgba(1,26,39,.12); font-size: .85rem;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) 50% 100% / 16px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) 50% 100% / 16px 100% repeat-x; padding-bottom: 26px; }
.rp-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px dashed #c9c3a6; padding-bottom: 10px; margin-bottom: 10px; }
.rp-head b { font-family: var(--font-display); font-size: 1rem; }
.rp-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; } .rp-row span { color: #6b7a84; }
.rp-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 10px; border-top: 1.5px dashed #c9c3a6; font-size: 1rem; } .rp-total b { font-family: var(--font-display); }
.rp-stamp { position: absolute; bottom: 70px; inset-inline-start: 18px; transform: rotate(-14deg); border: 2px solid #0f7a4a; color: #0f7a4a; padding: 2px 10px; border-radius: 6px; font-family: var(--font-display); font-weight: 700; opacity: .55; }
.receipt-paper .muted { color: #6b7a84 !important; }
.pick-list { display: grid; gap: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.pick-row:has(input:checked) { border-color: var(--ink-700, var(--link)); background: var(--sky-50); }
.pick-row input { accent-color: var(--ink-800); }
.att-pdf { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.doc-ghost { width: min(260px, 100%); aspect-ratio: 3/4; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-md, 0 8px 24px rgba(1,26,39,.08)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; }
.doc-ghost .dg-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--sky-100); color: var(--link); display: grid; place-items: center; }
.doc-ghost .dg-lines { width: 100%; display: grid; gap: 7px; margin-top: 10px; }
.doc-ghost .dg-lines i { height: 7px; border-radius: 4px; background: var(--line); } .doc-ghost .dg-lines i:nth-child(2) { width: 80%; } .doc-ghost .dg-lines i:nth-child(4) { width: 60%; }
.tmp-pass { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.tmp-pass code { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-text); }
