@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Noto+Kufi+Arabic:wght@500;600;700;800&family=Amiri:wght@700&display=swap");

/* =====================================================================
   الهوية اللونية
   أخضر مائل للفيروزي #0e7366 + درجاته الداكنة، مع ذهبي رملي مستوحى من
   تطريز كسوة الكعبة كلون زخرفي (للخطوط والأرقام على الخلفيات الداكنة).
   ===================================================================== */
:root {
  --g-950: #031f1b;
  --g-900: #05302b;
  --g-800: #0a5048;
  --g-700: #0b5e54;
  --g-600: #0e7366;
  --g-500: #14907f;
  --g-200: #a8e8dd;
  --g-100: #d2f5ef;
  --g-50: #ebfaf7;

  --gold: #b8935a;
  --gold-300: #d9bf8c;
  --gold-200: #e9d8b4;
  --gold-50: #f8f2e6;
  --gold-ink: #85652f;

  /* ذهب معدني متدرّج: للحدود الدقيقة والأختام والنصوص المميزة */
  --gold-metal: linear-gradient(135deg, #f6e7c1 0%, #d6b47a 38%, #a47c3b 62%, #e9d29d 82%, #c9a463 100%);
  --gold-foil: linear-gradient(100deg, #c9a463 0%, #f6e7c1 18%, #b8935a 36%, #ead49f 54%, #a47c3b 72%, #f3e2bc 90%, #c9a463 100%);
  --emerald-deep: linear-gradient(160deg, #0b5e54 0%, #05302b 60%, #031f1b 100%);
  --octagon: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%);
  --icon-accent: var(--gold-ink);
  --font-callig: "Amiri", "Noto Kufi Arabic", serif;

  /* محايدات دافئة بلون الورق العاجي بدل الرمادي البارد */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --surface-sunken: #f4f1ea;
  --ink: #13201a;
  --ink-2: #39463f;
  --ink-3: #6a746e;
  --line: #e8e2d4;
  --line-2: #f1ede4;

  --primary: var(--g-600);
  --primary-hover: var(--g-700);
  --primary-ink: var(--g-700);
  --primary-soft: var(--g-50);
  --primary-soft-2: var(--g-100);
  --on-primary: #ffffff;
  --focus: rgba(14, 115, 102, .32);

  --info: #175cd3;   --info-50: #eff4ff;
  --warn: #b54708;   --warn-50: #fef6e7;
  --ok: #067647;     --ok-50: #ecfdf3;
  --danger: #b42318; --danger-50: #fef3f2;
  --muted: #4d5761;  --muted-50: #f3f4f6;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(5, 48, 43, .06);
  --shadow: 0 1px 1px rgba(5, 48, 43, .04), 0 2px 4px -1px rgba(5, 48, 43, .05), 0 10px 24px -10px rgba(5, 48, 43, .14);
  --shadow-lg: 0 2px 4px rgba(5, 48, 43, .05), 0 12px 24px -8px rgba(5, 48, 43, .14), 0 40px 72px -24px rgba(5, 48, 43, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* ليلي بلون أخضر مزرق دافئ بدل الأسود: كل سطح أفتح من الذي تحته بدرجة واضحة حتى تنفصل البطاقات،
     والنصوص والألوان الدلالية لا يقل تباينها عن 4.5:1 على أي سطح */
  --bg: #1a2f2c; --surface: #24403b; --surface-2: #2b4a45; --surface-sunken: #152825;
  --ink: #f1f6f4; --ink-2: #d3dedb; --ink-3: #a9bcb8; --line: #3d5e58; --line-2: #33514c;
  --primary: #128072; --primary-hover: #15907f; --primary-ink: #7ee8d7;
  --primary-soft: #21524b; --primary-soft-2: #286058; --focus: rgba(126, 232, 215, .4);
  --gold: #dcbb85; --gold-50: #3d3220; --gold-ink: #e6c994; --icon-accent: #e6c994;
  --info: #a6c3ff; --info-50: #233558; --warn: #fdc75e; --warn-50: #463518;
  --ok: #6bdea4; --ok-50: #1c4733; --danger: #ff9a91; --danger-50: #4a2622;
  --muted: #c9d2d8; --muted-50: #2e4642;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .16), 0 8px 20px -8px rgba(0, 0, 0, .3);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .16), 0 24px 48px -16px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
/* بطاقات الاختيار داخل النموذج: سطح أفتح من البطاقة الحاضنة حتى تبرز */
:root[data-theme="dark"] .cat:not([aria-checked="true"]) { background: var(--surface-2); }

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: var(--primary-ink); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.display { font-family: var(--font-display); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--gold-200); color: var(--g-950); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- pattern (زخرفة النجمة الثمانية) */
.pattern { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pattern .p-line { fill: none; stroke: var(--gold-300); stroke-width: .8; }
.pattern-fade { -webkit-mask-image: radial-gradient(120% 90% at 20% 30%, #000 10%, transparent 75%); mask-image: radial-gradient(120% 90% at 20% 30%, #000 10%, transparent 75%); opacity: .38; }

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--line) 50%, var(--ink-3)); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: var(--primary); border-color: transparent; color: var(--on-primary);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px -6px rgba(14, 115, 102, .55);
}
.btn-primary:hover { background: var(--primary-hover); border-color: transparent; }
.btn-gold { background: var(--gold); border-color: transparent; color: #1b1406; }
.btn-gold:hover { background: var(--gold-300); }
.btn-glass { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-sunken); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(-4px); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 600; font-size: 14px; color: var(--ink); }
.label .opt { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.hint { font-size: 13px; color: var(--ink-3); }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--ink-3) 75%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--line) 40%, var(--ink-3)); }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--focus); }
textarea.input { min-height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.75; }
select.input { padding-left: 34px; }
.input-sm { min-height: 40px; font-size: 14px; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 28px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15.5px; font-weight: 700; }
.card-body { padding: 18px 22px; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--warn-50); color: var(--warn); }
.st-in_progress { background: var(--warn-50); color: var(--warn); }
.st-on_hold { background: var(--muted-50); color: var(--muted); }
.st-resolved { background: var(--ok-50); color: var(--ok); }
.st-closed { background: var(--ok-50); color: var(--ok); }
.pr { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.pr::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.pr-low { color: var(--ink-3); }
.pr-medium { color: var(--info); }
.pr-high { color: var(--warn); }
.pr-urgent { color: var(--danger); }

/* =====================================================================
   الواجهة العامة
   ===================================================================== */
.site-header { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.site-header-inner { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--g-600), var(--g-800)); color: var(--gold-300);
  box-shadow: 0 0 0 1px rgba(217, 191, 140, .35) inset, 0 6px 14px -6px rgba(3, 31, 27, .6);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; opacity: .72; }
.site-header .brand { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.hero {
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(20, 144, 127, .38), transparent 60%),
    radial-gradient(700px 400px at 0% 110%, rgba(184, 147, 90, .22), transparent 60%),
    linear-gradient(160deg, var(--g-800) 0%, var(--g-900) 55%, var(--g-950) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 191, 140, .6), transparent);
}
.hero-inner {
  position: relative; max-width: 1180px; margin: 0 auto; padding: 120px 24px 132px;
  display: grid; grid-template-columns: 1.25fr .9fr; gap: 48px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--gold-300);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.4; margin-top: 14px; letter-spacing: -.2px; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--gold-300); }
.hero-lead { margin-top: 14px; font-size: 18px; color: rgba(255, 255, 255, .8); max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; font-size: 14px; color: rgba(255, 255, 255, .82); }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust svg { width: 18px; height: 18px; color: var(--gold-300); }

/* بطاقة الوقت الحي */
.clock-card {
  position: relative; padding: 26px 26px 22px; border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.clock-card::before {
  content: ""; position: absolute; inset: 10px; border-radius: 18px; pointer-events: none;
  border: 1px solid rgba(217, 191, 140, .22);
}
.clock-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.clock-time { font-family: var(--font-display); font-size: 54px; font-weight: 700; line-height: 1.2; margin-top: 8px; letter-spacing: 1px; }
.clock-time .sec { font-size: 22px; color: var(--gold-300); margin-inline-start: 6px; }
.clock-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); }
.clock-dates small { display: block; font-size: 12px; color: rgba(255, 255, 255, .6); }
.clock-dates b { font-weight: 600; font-size: 15px; }
.clock-note { margin-top: 16px; font-size: 13px; color: rgba(255, 255, 255, .72); display: flex; gap: 8px; align-items: flex-start; }
.clock-note svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--gold-300); }

.public-main { position: relative; z-index: 2; max-width: 980px; margin: -72px auto 0; padding: 0 20px 56px; }

.tabs { display: inline-flex; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.tab {
  min-height: 44px; padding: 0 20px; border: 0; background: transparent; border-radius: 10px;
  font-weight: 600; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(14, 115, 102, .6); }

.form-card { padding: 0; overflow: hidden; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.stepper-item { display: flex; align-items: center; gap: 10px; padding: 16px 22px; font-size: 14px; color: var(--ink-3); font-weight: 500; position: relative; }
.stepper-item + .stepper-item { border-inline-start: 1px solid var(--line-2); }
.stepper-item::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 2px; background: transparent; transition: background .3s var(--ease); }
.stepper-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1.5px solid var(--line); background: var(--surface); transition: all .25s var(--ease); flex: none; }
.stepper-no svg { width: 15px; height: 15px; }
.stepper-item.active { color: var(--ink); }
.stepper-item.active .stepper-no { border-color: var(--primary); color: var(--primary-ink); }
.stepper-item.active::after { background: var(--primary); }
.stepper-item.done { color: var(--ink-2); }
.stepper-item.done .stepper-no { background: var(--primary); border-color: var(--primary); color: #fff; }

.form-body { padding: 30px; display: flex; flex-direction: column; gap: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.section-head .hint { flex: none; }

/* رقم الطلب مع زر اللصق */
.req { color: var(--danger); font-family: var(--font); }
.reqno { position: relative; display: flex; align-items: stretch; gap: 0; }
.reqno-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--ink-3); pointer-events: none; z-index: 1; }
.reqno-icon svg { width: 22px; height: 22px; }
/* في الاتجاه من اليمين: الحقل يمينًا بحواف دائرية يمنى، وزر اللصق يسارًا */
.reqno .input {
  flex: 1; min-height: 58px; padding-right: 50px; font-size: 19px; font-weight: 600; letter-spacing: .6px; text-align: right;
  border-radius: 0 14px 14px 0;
}
.reqno .input:focus { position: relative; z-index: 1; }
.reqno-paste { min-height: 58px; border-radius: 14px 0 0 14px; padding: 0 22px; }
.reqno.ok .input { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); background: var(--primary-soft); }
.reqno.ok .reqno-icon { color: var(--primary-ink); }
.reqno.flash .input { animation: flash .7s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--focus); } 40% { box-shadow: 0 0 0 6px var(--focus); } 100% { box-shadow: 0 0 0 0 transparent; } }
.reqno-help { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.reqno-help b { color: var(--primary-ink); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 118px; padding: 16px; text-align: right; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.cat:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink); transition: background .2s, color .2s;
}
.cat-icon svg { width: 22px; height: 22px; }
.cat-name { font-weight: 600; font-size: 15px; line-height: 1.45; }
.cat-check {
  position: absolute; top: 12px; left: 12px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; transition: all .2s var(--ease);
}
.cat-check svg { width: 13px; height: 13px; }
.cat[aria-checked="true"] { border-color: var(--primary); background: linear-gradient(180deg, var(--primary-soft), var(--surface)); box-shadow: 0 0 0 4px var(--focus); }
.cat[aria-checked="true"] .cat-icon { background: var(--primary); color: #fff; }
.cat[aria-checked="true"] .cat-check { background: var(--gold); border-color: var(--gold); color: #fff; transform: scale(1.05); }
.cat-skel { min-height: 118px; border-radius: 16px; background: linear-gradient(90deg, var(--surface-sunken), var(--surface-2), var(--surface-sunken)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ختم الوقت */
.stamp {
  position: relative; display: flex; align-items: center; gap: 18px; padding: 18px 20px;
  border-radius: 16px; border: 1.5px dashed var(--line); background: var(--surface-2);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.stamp-seal {
  width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-3); border: 1.5px solid var(--line); background: var(--surface);
}
.stamp-seal svg { width: 26px; height: 26px; }
.stamp-main { flex: 1; min-width: 0; }
.stamp-title { font-size: 13px; color: var(--ink-3); }
.stamp-value { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 2px; }
.stamp-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stamp.set { border-style: solid; border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); background: var(--primary-soft); }
.stamp.set .stamp-seal { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 18%, transparent); }
.stamp.set .stamp-value { color: var(--primary-ink); }
.stamp.pop .stamp-seal { animation: stampIn .55s var(--ease); }
@keyframes stampIn { 0% { transform: scale(1.6) rotate(-18deg); opacity: 0; } 60% { transform: scale(.92) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.stamp-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.stamp-edit .input { width: auto; min-width: 240px; }

.desc-wrap { position: relative; }
.counter { position: absolute; bottom: 10px; left: 14px; font-size: 12px; color: var(--ink-3); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.suggest button {
  min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all .15s;
}
.suggest button:hover { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); }
.suggest-wrap { margin-top: 12px; }
.suggest-label { font-size: 13px; color: var(--ink-3); }
.suggest button.specific { border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); color: var(--primary-ink); background: var(--primary-soft); font-weight: 500; }
.suggest button.specific::before { content: "+"; margin-inline-end: 6px; font-weight: 700; }
.suggest button[aria-pressed="true"] { opacity: .5; cursor: default; text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.suggest button[aria-pressed="true"]::before { content: "✓"; }
.suggest button { animation: rise .3s var(--ease) both; }

details.optional { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
details.optional summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14.5px; list-style: none;
  display: flex; align-items: center; gap: 10px; min-height: 52px;
}
details.optional summary::-webkit-details-marker { display: none; }
details.optional summary svg { width: 18px; height: 18px; color: var(--primary-ink); }
details.optional summary .chev { margin-inline-start: auto; transition: transform .2s var(--ease); color: var(--ink-3); }
details.optional[open] summary .chev { transform: rotate(180deg); }
details.optional .optional-body { padding: 4px 18px 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.form-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 30px; border-top: 1px solid var(--line-2); background: var(--surface-2);
}
.privacy { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.privacy svg { width: 16px; height: 16px; color: var(--primary-ink); }
/* تنبيه الخطأ بأسلوب المنصات الحكومية: شريط جانبي بلون الحالة، وأيقونة صغيرة داخل دائرة، ونص داكن مقروء */
.form-error {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px;
  background: var(--danger-50); color: var(--danger-ink, #7a271a); font-size: 14px; font-weight: 500; line-height: 1.6;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); border-inline-start: 4px solid var(--danger);
}
.form-error > svg {
  width: 30px; height: 30px; flex: none; padding: 6px; border-radius: 50%; margin-top: -3px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.form-error > span { padding-top: 1px; }
:root[data-theme="dark"] .form-error { --danger-ink: #fecdca; }
.field-error { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: 13px; font-weight: 500; margin-top: 8px; }
.field-error::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5M12 16.2h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5M12 16.2h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* تذكرة النجاح — بطاقة على هيئة تذكرة رسمية */
.success-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 10px 0 0; }
.success-head { text-align: center; }
.success-head .ok-ring {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-50); color: var(--ok); animation: popIn .5s var(--ease);
}
.success-head .ok-ring svg { width: 34px; height: 34px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.success-head p { color: var(--ink-3); margin-top: 6px; }

.ticket {
  position: relative; width: 100%; max-width: 720px; display: grid; grid-template-columns: 1fr 220px;
  border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); animation: rise .6s var(--ease);
  background: var(--surface); border: 1px solid var(--line);
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.ticket-main { padding: 26px 28px; }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-kicker { font-size: 12.5px; color: var(--ink-3); letter-spacing: .3px; }
.ticket-no { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--primary-ink); margin-top: 4px; letter-spacing: 1px; }
.ticket-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.ticket-rows small { display: block; font-size: 12px; color: var(--ink-3); }
.ticket-rows b { font-weight: 600; font-size: 14.5px; }
.ticket-stub {
  position: relative; color: #fff; padding: 26px 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  background: linear-gradient(160deg, var(--g-700), var(--g-900)); overflow: hidden;
}
.ticket-stub::before, .ticket-stub::after {
  content: ""; position: absolute; right: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); z-index: 2;
}
.ticket-stub::before { top: -13px; }
.ticket-stub::after { bottom: -13px; }
.ticket-perf { position: absolute; right: 0; top: 18px; bottom: 18px; border-right: 2px dashed rgba(255, 255, 255, .28); z-index: 2; }
.ticket-stub .pattern { opacity: .3; }
.ticket-stub > :not(.pattern):not(.ticket-perf) { position: relative; z-index: 1; }
.ticket-stub .seal { width: 54px; height: 54px; color: var(--gold-300); }
.ticket-stub .stub-label { font-size: 12px; color: rgba(255, 255, 255, .7); }
.ticket-stub .stub-status { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--gold-300); }
.success-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* متابعة الطلب */
.track-card { padding: 30px; }
.track-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.track-head p { color: var(--ink-3); margin-top: 4px; font-size: 14.5px; }
.track-form { display: flex; gap: 10px; margin-top: 18px; }
.track-input { position: relative; flex: 1; }
.track-input svg { position: absolute; top: 50%; right: 14px; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.track-input .input { padding-right: 44px; min-height: 54px; font-size: 17px; letter-spacing: .5px; }
.recent { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recent-label { font-size: 13px; color: var(--ink-3); }
.recent-list { display: contents; }
.track-result { margin-top: 22px; }
.track-result:empty { display: none; }

.t-result { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; animation: rise .45s var(--ease); }
.t-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.t-result-head .ticket-kicker { margin: 0; }
.t-result-head .no { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--primary-ink); }
.t-result-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 22px; }

.journey { display: flex; flex-direction: column; }
.j-step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; padding-bottom: 20px; }
.j-step:last-child { padding-bottom: 0; }
.j-step::before { content: ""; position: absolute; right: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.j-step:last-child::before { display: none; }
.j-step.done::before { background: var(--primary); }
.j-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--surface); color: var(--ink-3); z-index: 1; }
.j-dot svg { width: 15px; height: 15px; }
.j-step.done .j-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.j-step.current .j-dot { border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 6px var(--focus); }
.j-title { font-weight: 600; padding-top: 4px; }
.j-step:not(.done):not(.current) .j-title { color: var(--ink-3); font-weight: 500; }
.j-sub { font-size: 13px; color: var(--ink-3); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; font-size: 14.5px; align-content: start; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }

.site-footer { position: relative; overflow: hidden; color: rgba(255, 255, 255, .78); background: var(--g-950); font-size: 13.5px; }
.site-footer-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--gold-300); }
.site-footer .pattern { opacity: .14; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 10px;
  background: var(--g-900); color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(217, 191, 140, .25); animation: toastIn .3s var(--ease);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-300); }
.toast.err { background: #7a1b12; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------------------------------------------------------------- entrance motion */
.reveal { animation: rise .6s var(--ease) both; }
.reveal-2 { animation-delay: .08s; }
.reveal-3 { animation-delay: .16s; }
.reveal-4 { animation-delay: .24s; }

/* =====================================================================
   لوحة الإدارة
   ===================================================================== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(20, 144, 127, .35), transparent 60%),
    linear-gradient(160deg, var(--g-800), var(--g-950));
}
.login-art .pattern { opacity: .3; }
.login-art > :not(.pattern) { position: relative; }
.login-art h2 { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1.45; max-width: 460px; }
.login-art h2 em { font-style: normal; color: var(--gold-300); }
.login-art p { color: rgba(255, 255, 255, .75); margin-top: 12px; max-width: 420px; }
.login-art .brand { color: #fff; }
.login-feats { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; color: rgba(255, 255, 255, .85); }
.login-feats span { display: flex; align-items: center; gap: 10px; }
.login-feats svg { width: 18px; height: 18px; color: var(--gold-300); }
.login-side { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.login-card > p { color: var(--ink-3); margin: 6px 0 26px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-links { justify-content: space-between; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 48px; }
.pw-toggle { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); }

.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden; color: #fff; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(180deg, var(--g-800), var(--g-950));
}
.sidebar .pattern { opacity: .16; }
.sidebar > :not(.pattern) { position: relative; }
.sidebar .brand { color: #fff; padding: 4px 8px 22px; }
.nav-title { font-size: 11.5px; letter-spacing: .4px; color: rgba(255, 255, 255, .5); padding: 10px 14px 6px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500; transition: background .18s, color .18s;
}
.nav-link svg { width: 19px; height: 19px; flex: none; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.nav-link[aria-current="page"]::before {
  content: ""; position: absolute; right: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px 0 0 4px; background: var(--gold-300);
}
.nav-link[aria-current="page"] svg { color: var(--gold-300); }
.nav-foot { margin-top: auto; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-300), var(--gold)); color: #241a08; font-weight: 700; font-family: var(--font-display);
}
.me-name { font-weight: 600; font-size: 14px; }
.me-role { font-size: 12px; color: rgba(255, 255, 255, .6); }
.nav-foot-actions { display: flex; gap: 6px; margin-top: 12px; }
.nav-foot-actions .btn { flex: 1; }
.sidebar .btn-glass.btn-danger { color: #fecdca; }

.main { min-width: 0; }
.topline { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 32px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 32px 0; }
.page-head .eyebrow { color: var(--gold-ink); font-size: 13px; }
.page-head h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 4px; }
.page-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
.page-body { padding: 22px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar > .input { width: auto; }
.range { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.range .input { border: 0; min-height: 36px; background: transparent; width: auto; }
.range .input:focus { box-shadow: none; }
.range span { color: var(--ink-3); font-size: 13px; }

/* مؤشرات */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  position: relative; display: block; padding: 18px 20px; text-decoration: none; color: inherit; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-label { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; margin-top: 12px; line-height: 1.2; }
.kpi-value small { font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--ink-3); margin-inline-start: 6px; }
.kpi-foot { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.kpi.hero-kpi { color: #fff; border-color: transparent; background: linear-gradient(150deg, var(--g-600), var(--g-900)); }
.kpi.hero-kpi .pattern { opacity: .25; }
.kpi.hero-kpi > :not(.pattern) { position: relative; }
.kpi.hero-kpi .kpi-label, .kpi.hero-kpi .kpi-foot { color: rgba(255, 255, 255, .75); }
.kpi.hero-kpi .kpi-icon { background: rgba(255, 255, 255, .14); color: var(--gold-300); }
.kpi.alert .kpi-icon { background: var(--danger-50); color: var(--danger); }
.kpi.alert .kpi-value { color: var(--danger); }
.kpi.warn .kpi-icon { background: var(--warn-50); color: var(--warn); }
.kpi.ok .kpi-icon { background: var(--ok-50); color: var(--ok); }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--g-500), var(--g-600)); transform-origin: right; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

.charts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.charts-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 44px; align-items: center; gap: 12px; font-size: 13.5px; text-decoration: none; color: inherit; border-radius: 8px; }
a.bar-row:hover .bar-name { color: var(--primary-ink); }
.bar-row .bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-track { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 5px; transform-origin: right; animation: grow .9s var(--ease) both; }
.bar-fill.open { background: var(--gold); border-radius: 0; }
.bar-val { text-align: left; font-weight: 700; }

.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.donut { width: 150px; height: 150px; }
.donut circle { fill: none; stroke-width: 16; }
.donut .d-total { font-family: var(--font-display); font-size: 26px; font-weight: 700; fill: var(--ink); }
.donut .d-label { font-size: 11px; fill: var(--ink-3); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.legend a, .legend span { display: flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; }
.legend a:hover { color: var(--primary-ink); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.legend b { margin-inline-start: auto; color: var(--ink); font-weight: 700; }
.legend-inline { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.legend-inline b { margin: 0; }

.c-new { background: #3b7be0; }
.c-in_progress { background: #e8a33d; }
.c-on_hold { background: #98a2b3; }
.c-resolved { background: #0e7366; }
.c-closed { background: #4d5761; }

.trend svg { width: 100%; height: 220px; display: block; overflow: visible; }
.trend .axis { font-size: 11px; fill: var(--ink-3); }
.trend .grid { stroke: var(--line-2); }
.trend .bar { fill: var(--primary); opacity: .9; transition: opacity .15s; }
.trend .bar:hover { opacity: 1; fill: var(--g-500); }
.trend .area { fill: url(#goldFade); }
.trend .line { stroke: var(--gold); }
.trend-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend i { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }

.aging { display: flex; flex-direction: column; }
.aging-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 8px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; cursor: pointer; border-radius: 10px; transition: background .15s;
}
.aging-row:last-child { border-bottom: 0; }
.aging-row:hover { background: var(--surface-2); }
.aging-age { font-weight: 700; color: var(--warn); font-size: 13px; }
.empty { color: var(--ink-3); text-align: center; padding: 32px 16px; font-size: 14px; }
.empty svg { width: 36px; height: 36px; display: block; margin: 0 auto 10px; color: var(--gold); }

/* فلاتر وجدول */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto auto; gap: 12px; align-items: end; }
.filters .field { gap: 4px; }
.filters .label { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
/* الغلافان لا يغيّران شبكة الفلاتر على الشاشات الكبيرة، وزر «التصفية» للجوال فقط */
.filters-search, .filters-more { display: contents; }
.filters-toggle { display: none; }
.filters-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
.search-input { position: relative; }
.search-input svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search-input .input { padding-right: 38px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: right; font-weight: 600; font-size: 12.5px; color: var(--ink-3);
  background: var(--surface-2); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { cursor: pointer; transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:hover .t-no { text-decoration: underline; text-underline-offset: 3px; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .desc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
table.data .t-no { font-weight: 700; color: var(--primary-ink); white-space: nowrap; }
table.data .t-date { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
table.static tbody tr { cursor: default; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; font-size: 13.5px; color: var(--ink-3); border-top: 1px solid var(--line-2); }

/* لوحة التفاصيل الجانبية */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(3, 31, 27, .45); backdrop-filter: blur(2px); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(660px, 100%); background: var(--surface);
  z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .32s var(--ease);
}
@keyframes slideIn { from { transform: translateX(-40px); opacity: 0; } }
.drawer-head { position: relative; overflow: hidden; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 26px; color: #fff; background: linear-gradient(150deg, var(--g-700), var(--g-900)); }
.drawer-head .pattern { opacity: .2; }
.drawer-head > :not(.pattern) { position: relative; }
.drawer-head h2 { font-family: var(--font-display); font-size: 22px; color: #fff; }
.drawer-head .hint { color: rgba(255, 255, 255, .75); }
.drawer-head .btn-ghost { color: #fff; }
.drawer-head .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.drawer-body { padding: 22px 26px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 22px; }
.drawer-foot { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--surface-2); }
.desc-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; font-size: 15px; line-height: 1.8; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); margin-bottom: 10px; }
.section-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--gold); }
.manage-box { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface); }

.status-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.status-picker button {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all .15s;
}
.status-picker button i { width: 8px; height: 8px; border-radius: 50%; }
.status-picker button:hover { border-color: var(--ink-3); }
.status-picker button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); box-shadow: 0 0 0 3px var(--focus); }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 14px 1fr; gap: 14px; padding-bottom: 16px; position: relative; }
.tl-item::before { content: ""; position: absolute; right: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); margin-top: 5px; }
.tl-item.note .tl-dot { border-color: var(--gold); }
.tl-text { font-size: 14px; }
.tl-meta { font-size: 12px; color: var(--ink-3); }
.tl-note { white-space: pre-wrap; background: var(--gold-50); border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); border-radius: 10px; padding: 10px 12px; margin-top: 6px; font-size: 14px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 31, 27, .45); backdrop-filter: blur(2px); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { width: 100%; max-width: 440px; animation: rise .3s var(--ease); }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal h3 { font-family: var(--font-display); font-size: 18px; }

.inline-form { display: grid; grid-template-columns: 1fr 1fr 150px 1fr auto; gap: 12px; align-items: end; }
.switch-active { color: var(--ok); font-weight: 600; font-size: 13px; }
.switch-inactive { color: var(--ink-3); font-weight: 600; font-size: 13px; }

.mobile-nav { display: none; }

/* =====================================================================
   طبقة التأثيرات الرسمية
   ===================================================================== */
@property --beam-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* شريط التقدّم العلوي */
.top-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; pointer-events: none;
  background: linear-gradient(270deg, var(--g-500), var(--gold-300), var(--g-600));
  transform-origin: right; transform: scaleX(0); opacity: 0;
}
.top-progress.run { opacity: 1; animation: progressRun 2.4s cubic-bezier(.1, .7, .2, 1) forwards; }
.top-progress.end { animation: none; transform: scaleX(1); opacity: 0; transition: opacity .35s .1s, transform .2s; }
@keyframes progressRun { from { transform: scaleX(0); } to { transform: scaleX(.88); } }

/* ترويسة ثابتة تتحول لزجاجية عند التمرير */
.site-header { position: fixed; z-index: 30; transition: background .3s var(--ease), box-shadow .3s var(--ease); }
.site-header.scrolled {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 1px 0 var(--line), 0 8px 24px -16px rgba(5, 48, 43, .35);
}
.site-header-inner { transition: padding .3s var(--ease); }
.site-header.scrolled .site-header-inner { padding-top: 10px; padding-bottom: 10px; }
.site-header.scrolled .brand { color: var(--ink); }
.site-header.scrolled .btn-glass { color: var(--ink); background: var(--surface); border-color: var(--line); backdrop-filter: none; }
.site-header.scrolled .btn-glass:hover { background: var(--surface-2); }

/* خلفية شفقية متحركة ببطء في الواجهة */
.hero::before {
  content: ""; position: absolute; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(28% 34% at 22% 30%, rgba(20, 144, 127, .55), transparent 70%),
    radial-gradient(24% 30% at 78% 20%, rgba(217, 191, 140, .28), transparent 70%),
    radial-gradient(30% 36% at 60% 80%, rgba(10, 80, 72, .9), transparent 70%);
  filter: blur(30px); animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.08); }
  100% { transform: translate3d(-3%, 4%, 0) rotate(-6deg) scale(1.02); }
}
.hero-inner { z-index: 1; }

/* لمعة تعبر الأزرار الرئيسية عند المرور */
.btn-primary, .btn-gold { overflow: hidden; isolation: isolate; }
.btn-primary::before, .btn-gold::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%; right: -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: skewX(-18deg); transition: right .7s var(--ease);
}
.btn-primary:hover::before, .btn-gold:hover::before { right: 120%; }
.btn-gold { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 10px 24px -10px rgba(184, 147, 90, .8); }

/* إضاءة تتبع المؤشر داخل البطاقات */
.spotlight { position: relative; }
.spotlight::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--primary) 12%, transparent), transparent 65%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.spotlight:hover::after { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }
.spotlight > .cat-check, .spotlight > .pattern { position: absolute; }
.kpi.hero-kpi.spotlight::after { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(217, 191, 140, .22), transparent 65%); }

/* شعاع ذهبي يدور على حدود البطاقات المميزة */
.beam { position: relative; }
.beam::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--beam-angle), transparent 0 72%, rgba(217, 191, 140, .95) 86%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam 7s linear infinite;
}
@keyframes beam { to { --beam-angle: 360deg; } }

/* شارات الحالة بأيقونة */
.badge.has-icon::before { display: none; }
.badge svg { width: 14px; height: 14px; flex: none; }

/* ظهور تدريجي عند التمرير */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in-view { opacity: 1; transform: none; }

/* هياكل تحميل */
.skeleton {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-sunken), var(--surface-2), var(--surface-sunken));
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.skel-row td { padding: 18px 16px; }

/* رسائل التنبيه */
.toast { padding: 12px 16px 14px; overflow: hidden; }
.toast::before { display: none; }
.toast-icon { display: grid; place-items: center; color: var(--gold-300); }
.toast-icon svg { width: 18px; height: 18px; }
.toast.err .toast-icon { color: #fecdca; }
.toast-bar { position: absolute; inset: auto 0 0 0; height: 2px; background: var(--gold-300); transform-origin: right; animation: toastBar 3.2s linear forwards; opacity: .7; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); transition: opacity .25s, transform .25s; }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ختم ذهبي على كعب التذكرة */
.ticket-stub .seal { animation: sealIn .9s .35s var(--ease) both; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
@keyframes sealIn { 0% { transform: scale(2.2) rotate(-35deg); opacity: 0; } 60% { transform: scale(.9) rotate(6deg); opacity: 1; } 100% { transform: none; } }

/* تفاصيل تفاعلية */
.cat:active { transform: translateY(0) scale(.985); }
table.data tbody tr:not(.skel-row):hover td:first-child { box-shadow: inset -3px 0 0 var(--primary); }
.brand-mark, .brand-mark svg { transition: transform .6s var(--ease); }
.brand:hover .brand-mark svg { transform: rotate(45deg); }
.eyebrow::before { animation: lineGrow .9s .2s var(--ease) both; transform-origin: right; }
@keyframes lineGrow { from { transform: scaleX(0); } }
.hero::after { animation: shine 6s ease-in-out infinite; }
@keyframes shine { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* اختصار لوحة المفاتيح */
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  font: 600 11.5px/1 var(--font); direction: ltr; color: var(--ink-3);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface);
}

/* لوحة الأوامر السريعة (Ctrl+K) */
.cmdk-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(3, 31, 27, .42); backdrop-filter: blur(4px); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; animation: fade .15s; }
.cmdk {
  width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(217, 191, 140, .15); overflow: hidden; animation: cmdkIn .22s var(--ease);
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line-2); }
.cmdk-input svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.cmdk-input input { flex: 1; min-height: 58px; border: 0; outline: none; background: transparent; font-size: 16.5px; }
.cmdk-list { max-height: min(56vh, 420px); overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 10px 12px 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; text-align: right; cursor: pointer; color: var(--ink); font-size: 14.5px;
}
.cmdk-item svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.cmdk-item .meta { margin-inline-start: auto; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.cmdk-item[aria-selected="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.cmdk-item[aria-selected="true"] svg { color: var(--primary-ink); }
.cmdk-empty { padding: 28px; text-align: center; color: var(--ink-3); font-size: 14px; }
.cmdk-foot { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; color: var(--ink-3); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }
.cmdk-trigger { gap: 10px; color: var(--ink-3); min-width: 230px; justify-content: space-between; }
.cmdk-trigger > span { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .cmdk-trigger { min-width: 0; } .cmdk-trigger kbd { display: none; } }

/* =====================================================================
   الطبقة الفاخرة — زمرّد عميق وذهب معدني
   أيقونات ثنائية الطبقة داخل ميداليات مثمّنة مذهّبة، حدود ذهبية دقيقة،
   نصوص بورق الذهب، ولحظة احتفال بالنجوم الثمانية عند نجاح الإرسال.
   ===================================================================== */

/* ---- نظام الأيقونات */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg .d { fill: currentColor; stroke: none; opacity: var(--icon-duo, .14); }
svg .a { stroke: var(--icon-accent, currentColor); }
svg .af { fill: var(--icon-accent, currentColor); stroke: none; }
/* السياقات الداكنة والدلالية: الذهب الفاتح، أو لون الحالة نفسه */
.hero, .site-footer, .sidebar, .mobile-nav, .login-art, .drawer-head, .ticket-stub, .kpi.hero-kpi, .toast,
.btn-primary, .tab[aria-selected="true"], .btn-glass { --icon-accent: var(--gold-300); }
.site-header.scrolled .btn-glass { --icon-accent: var(--gold-ink); }
.btn-gold, .badge, .btn-danger, .form-error, .field-error, .kpi.alert, .kpi.warn, .kpi.ok, .cmdk-item[aria-selected="true"] { --icon-accent: currentColor; }
.btn-primary, .tab[aria-selected="true"], .sidebar, .mobile-nav, .hero { --icon-duo: .2; }

/* ---- الشعار: نجمة بخط ذهبي معدني داخل ميدالية زمرّدية بإطار مذهّب */
.brand-mark {
  border: 1px solid transparent; border-radius: 14px;
  background: linear-gradient(150deg, #0e7366, #05302b 70%) padding-box, var(--gold-metal) border-box;
  box-shadow: 0 0 0 3px rgba(184, 147, 90, .12), 0 10px 22px -10px rgba(3, 31, 27, .75);
}
.brand-mark svg { stroke: url(#lux-gold); --icon-accent: url(#lux-gold); animation: brandIn 1.4s var(--ease) both; }
.brand-mark svg .af { fill: url(#lux-gold); }
.brand-mark svg .d { fill: #f6e7c1; opacity: .1; }
@keyframes brandIn { from { transform: rotate(-135deg) scale(.4); opacity: 0; } }
.brand-name { letter-spacing: .1px; }

/* ---- ميدالية مثمّنة مذهّبة للأيقونات (أنواع المشاكل والمؤشرات والختم) */
.cat-icon, .kpi-icon, .stamp-seal {
  position: relative; isolation: isolate; background: none !important; border: 0; border-radius: 0; box-shadow: none !important;
}
.cat-icon::before, .kpi-icon::before, .stamp-seal::before,
.cat-icon::after, .kpi-icon::after, .stamp-seal::after {
  content: ""; position: absolute; z-index: -1; clip-path: var(--octagon);
  transition: transform .8s var(--ease), background .35s var(--ease), opacity .35s var(--ease);
}
.cat-icon::before, .kpi-icon::before, .stamp-seal::before { inset: 0; background: var(--gold-metal); opacity: .75; }
.cat-icon::after, .kpi-icon::after, .stamp-seal::after { inset: 1.5px; background: linear-gradient(160deg, var(--surface), var(--primary-soft)); }
.cat-icon { width: 48px; height: 48px; color: var(--primary-ink); }
.cat-icon svg { width: 23px; height: 23px; }
.cat:hover .cat-icon::before, .cat:hover .cat-icon::after,
a.kpi:hover .kpi-icon::before, a.kpi:hover .kpi-icon::after { transform: rotate(45deg); }
.cat[aria-checked="true"] .cat-icon { color: #fff; --icon-accent: var(--gold-300); --icon-duo: .22; }
.cat[aria-checked="true"] .cat-icon::before { opacity: 1; }
.cat[aria-checked="true"] .cat-icon::after { background: var(--emerald-deep); }
.kpi-icon { width: 42px; height: 42px; }
.kpi.hero-kpi .kpi-icon::after { background: rgba(3, 31, 27, .55); }
.kpi.alert .kpi-icon::after { background: var(--danger-50); }
.kpi.warn .kpi-icon::after { background: var(--warn-50); }
.kpi.ok .kpi-icon::after { background: var(--ok-50); }
.stamp-seal { width: 60px; height: 60px; }
.stamp-seal::before { opacity: .45; }
.stamp-seal::after { background: var(--surface); }
.stamp.set .stamp-seal { color: #fff; --icon-accent: var(--gold-300); }
.stamp.set .stamp-seal::before { opacity: 1; }
.stamp.set .stamp-seal::after { background: var(--emerald-deep); }
.stamp.pop .stamp-seal::before { animation: sealSpin 1s var(--ease); }
@keyframes sealSpin { from { transform: rotate(-90deg) scale(1.25); } }

/* ---- نص بورق الذهب */
.gold-text, .hero h1 em, .login-art h2 em, .clock-time .sec, .ticket-stub .stub-status {
  background: var(--gold-foil); background-size: 220% auto; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: foil 7s linear infinite;
}
@keyframes foil { to { background-position: -220% center; } }
.hero h1 em, .login-art h2 em { font-family: var(--font-callig); font-weight: 700; font-size: 1.12em; padding: 0 .06em; }

/* ---- الأزرار */
.btn { border-color: var(--line); }
.btn:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.btn-primary {
  background: linear-gradient(180deg, #11806f 0%, var(--g-600) 45%, var(--g-700) 100%);
  box-shadow: inset 0 1px 0 rgba(246, 231, 193, .28), inset 0 0 0 1px rgba(3, 31, 27, .25), 0 10px 22px -12px rgba(10, 80, 72, .8);
}
.btn-primary:hover { background: linear-gradient(180deg, #14907f 0%, #0f7a6b 45%, var(--g-700) 100%); }
.btn-gold {
  background: var(--gold-metal); color: #241805; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(90, 64, 24, .3), 0 14px 30px -14px rgba(184, 147, 90, .95);
}
.btn-gold:hover { background: var(--gold-metal); filter: brightness(1.07) saturate(1.05); }
.btn-glass { border-color: rgba(217, 191, 140, .3); }
.btn-glass:hover { border-color: rgba(217, 191, 140, .55); }

/* ---- البطاقات: حدّ ذهبي دقيق أعلى البطاقة الرئيسية */
.card { border-color: var(--line); }
.form-card, .track-card { position: relative; }
.form-card::before, .track-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; z-index: 2; background: var(--gold-foil); background-size: 200% auto;
  animation: foil 9s linear infinite;
}

/* ---- التبويبات */
.tabs { border-color: var(--line); box-shadow: var(--shadow-lg); }
.tab[aria-selected="true"] {
  background: var(--emerald-deep); position: relative;
  box-shadow: inset 0 0 0 1px rgba(217, 191, 140, .35), 0 10px 20px -10px rgba(3, 31, 27, .8);
}

/* ---- خطوات النموذج */
.stepper-item::after { height: 2px; }
.stepper-item.active::after { background: var(--gold-metal); }
.stepper-item.active .stepper-no { border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 4px rgba(184, 147, 90, .14); }
.stepper-item.done .stepper-no { background: var(--emerald-deep); border-color: var(--gold); color: var(--gold-300); }

/* ---- الحقول */
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus), 0 0 0 5px rgba(184, 147, 90, .22); }

/* ---- بطاقات أنواع المشاكل */
.cat { border-radius: 18px; }
.cat:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.cat[aria-checked="true"] {
  border-color: var(--gold); background: linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 80%, var(--gold-50)), var(--surface));
  box-shadow: 0 0 0 4px rgba(184, 147, 90, .16), 0 18px 36px -20px rgba(10, 80, 72, .55);
}
.cat[aria-checked="true"] .cat-check { background: var(--gold-metal); border-color: transparent; color: #241805; }
.spotlight::after { background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(184, 147, 90, .14), transparent 65%); }

/* ---- ختم الوقت */
.stamp.set { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: linear-gradient(90deg, var(--primary-soft), var(--gold-50)); }

/* ---- التذكرة: إطار شهادة داخلي وختم مذهّب */
.ticket-main { position: relative; }
.ticket-main::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 14px; pointer-events: none;
}
.ticket-no { color: var(--g-800); }
:root[data-theme="dark"] .ticket-no { color: var(--primary-ink); }
.ticket-stub { background: var(--emerald-deep); }
.ticket-stub .seal { stroke: url(#lux-gold); --icon-accent: url(#lux-gold); }
.ticket-stub .seal .d { fill: #f6e7c1; opacity: .12; }

/* ---- لحظة النجاح: ميدالية زمرّدية وتموّج ذهبي ونثر نجوم */
.success-head .ok-ring {
  position: relative; width: 84px; height: 84px; color: var(--gold-300); --icon-accent: var(--gold-300);
  background: var(--emerald-deep); box-shadow: inset 0 0 0 1.5px rgba(217, 191, 140, .6), 0 18px 36px -14px rgba(3, 31, 27, .7);
}
.success-head .ok-ring::before, .success-head .ok-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--gold); opacity: 0;
  animation: ripple 2.4s .5s var(--ease) 2;
}
.success-head .ok-ring::after { animation-delay: 1.1s; }
@keyframes ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; animation: burst 1.25s var(--delay, 0ms) cubic-bezier(.12, .7, .3, 1) both; }
.burst i.lg { left: -9px; top: -9px; width: 18px; height: 18px; }
.burst svg { display: block; width: 100%; height: 100%; fill: url(#lux-gold); filter: drop-shadow(0 2px 4px rgba(164, 124, 59, .45)); }
@keyframes burst {
  0% { transform: translate(0, 0) scale(.2) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---- مسار المتابعة */
.j-step.done .j-dot { background: var(--emerald-deep); border-color: var(--gold); color: var(--gold-300); }
.j-step.done::before { background: linear-gradient(180deg, var(--gold), var(--primary)); }
.j-step.current .j-dot { border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 6px rgba(184, 147, 90, .16); }

/* ---- القائمة الجانبية */
.sidebar { background: linear-gradient(180deg, #0a5048 0%, #05302b 55%, #031f1b 100%); box-shadow: inset 1px 0 0 rgba(217, 191, 140, .12); }
.nav-link[aria-current="page"] {
  background: linear-gradient(270deg, rgba(217, 191, 140, .16), rgba(217, 191, 140, .03));
  box-shadow: inset 0 0 0 1px rgba(217, 191, 140, .18);
}
.nav-link[aria-current="page"]::before { background: var(--gold-metal); box-shadow: 0 0 12px rgba(217, 191, 140, .6); }
.nav-link svg { transition: transform .35s var(--ease); }
.nav-link:hover svg { transform: scale(1.08); }
.avatar { background: var(--gold-metal); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 14px -8px rgba(0, 0, 0, .6); clip-path: var(--octagon); border-radius: 0; }

/* ---- المؤشرات */
.kpi.hero-kpi { background: var(--emerald-deep); box-shadow: inset 0 0 0 1px rgba(217, 191, 140, .25), var(--shadow-lg); }
.kpi.hero-kpi .kpi-label { color: var(--gold-300); }
.meter i { background: linear-gradient(270deg, var(--g-600), var(--gold)); }

/* ---- التنبيهات والدرج */
.toast { background: var(--emerald-deep); border-color: rgba(217, 191, 140, .4); }
.toast-bar { background: var(--gold-metal); }
.drawer-head { background: var(--emerald-deep); box-shadow: inset 0 -1px 0 rgba(217, 191, 140, .35); }
.section-title::before { background: var(--gold-metal); }

/* ---- التذييل */
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 191, 140, .7), transparent); }

/* ---- اسم المشروع: شارة بإطار ذهبي في الواجهة وصفحة الدخول، وسطر أعلى التذكرة */
.project-chip {
  display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 10px; margin-bottom: 18px; padding: 6px 16px 6px 8px; border-radius: 999px;
  border: 1px solid transparent; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.4;
  background: linear-gradient(rgba(3, 31, 27, .55), rgba(3, 31, 27, .55)) padding-box, var(--gold-metal) border-box;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); backdrop-filter: blur(6px);
}
.project-chip > svg {
  width: 30px; height: 30px; flex: none; padding: 6px; border-radius: 50%;
  background: var(--gold-metal); color: #241805; --icon-accent: #241805; --icon-duo: .18;
}
.project-chip small { display: block; font-size: 11px; font-weight: 500; color: var(--gold-300); letter-spacing: .3px; }
.project-chip b { font-weight: 600; color: var(--gold-300); }
.login-art .project-chip { margin-bottom: 22px; }
.ticket-project {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--gold-ink);
}
.ticket-project svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 640px) {
  .brand-sub { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .project-chip { font-size: 13px; }
}

/* ---- تحديث الحالة من صفحة المتابعة */
.t-result .badge { position: relative; }
.status-update { display: flex; flex-direction: column; gap: 12px; padding: 18px 22px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.status-update .section-title { margin: 0; }
.su-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.su-opt {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; text-align: right; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
}
.su-opt:hover { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.su-opt:active { transform: scale(.98); }
.su-opt b { display: block; font-size: 14.5px; }
.su-opt small { display: block; font-size: 12.5px; color: var(--ink-3); }
.su-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-3); transition: background .2s, color .2s; }
.su-icon svg { width: 20px; height: 20px; }
.su-closed[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-50); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent); }
.su-closed[aria-pressed="true"] .su-icon { background: var(--ok); color: #fff; --icon-accent: #fff; }
.su-new[aria-pressed="true"] { border-color: var(--warn); background: var(--warn-50); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 14%, transparent); }
.su-new[aria-pressed="true"] .su-icon { background: var(--warn); color: #fff; --icon-accent: #fff; }
.status-update > .btn { align-self: flex-start; animation: rise .3s var(--ease); }
.su-lock { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.su-lock > svg { width: 34px; height: 34px; flex: none; padding: 8px; border-radius: 50%; background: var(--gold-50); color: var(--gold-ink); }
@media (max-width: 640px) {
  .su-opts { grid-template-columns: 1fr; }
  .status-update { padding: 16px; }
  .status-update > .btn { align-self: stretch; }
}

/* ---- شريط التمرير */
html { scrollbar-color: color-mix(in srgb, var(--gold) 55%, transparent) transparent; scrollbar-width: thin; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .charts, .charts-2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters-search > .field { grid-column: 1 / -1; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 104px; gap: 28px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav {
    display: flex; gap: 4px; overflow-x: auto; padding: 10px 14px; position: sticky; top: 0; z-index: 10;
    background: linear-gradient(180deg, var(--g-800), var(--g-900));
  }
  .mobile-nav .nav-link { flex: none; min-height: 40px; }
  .mobile-nav .nav-link[aria-current="page"]::before { display: none; }
  .page-head, .page-body, .topline { padding-left: 16px; padding-right: 16px; }
  .t-result-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  /* أهداف لمس لا تقل عن 44px على الجوال */
  .btn-sm, .suggest button { min-height: 44px; }
  .btn-sm.btn-icon { width: 44px; }
  .site-header-inner { padding: 14px 16px; }
  .header-actions .btn-label { display: none; }
  .hero-inner { padding: 92px 16px 110px; }
  .hero-lead { font-size: 16px; }
  .clock-time { font-size: 42px; }
  .public-main { padding: 0 12px 40px; margin-top: -64px; }
  .tabs { display: flex; }
  .tab { flex: 1; justify-content: center; padding: 0 10px; }
  .stepper-item { padding: 12px 4px; font-size: 12px; gap: 6px; flex-direction: column; text-align: center; }
  .reqno .input { font-size: 17px; }
  .reqno-paste { padding: 0 16px; }
  .form-body { padding: 22px 16px; gap: 28px; }
  .form-foot { padding: 16px; }
  .form-foot .btn { width: 100%; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat { min-height: 104px; padding: 14px; }
  .stamp { flex-wrap: wrap; }
  .stamp-edit .input { width: 100%; min-width: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .ticket { grid-template-columns: 1fr; }
  .ticket-stub { flex-direction: row; align-items: center; padding: 18px 22px; }
  .ticket-stub::before, .ticket-stub::after { display: none; }
  .ticket-perf { display: none; }
  .ticket-rows { grid-template-columns: 1fr; }
  .ticket-no { font-size: 24px; }
  .track-card { padding: 20px 16px; }
  .track-form { flex-direction: column; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .filters { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 36px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .inline-form { grid-template-columns: 1fr; }
  .card-pad { padding: 20px; }
}

/* =====================================================================
   تجربة التطبيق على الجوال
   شريط تبويبات سفلي، ونوافذ منبثقة من الأسفل، وهوامش المناطق الآمنة
   (النوتش وشريط الإيماءات)، واستجابة لمس فورية.
   ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }
button, a, .cat, .app-tab { touch-action: manipulation; }
.mobile-only { display: none !important; }
.app-tabbar { display: none; }

/* شريط التبويبات السفلي (واجهة الجمهور، وقائمة لوحة الإدارة على الجوال) */
.app-tabbar, .shell .mobile-nav {
  position: fixed; inset: auto 0 0 0; z-index: 35;
  grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; box-sizing: border-box; width: 100%;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--gold) 30%, var(--line)), 0 -12px 30px -18px rgba(5, 48, 43, .45);
}
.app-tab, .shell .mobile-nav .nav-link {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; padding: 4px 2px 2px; border: 0; border-radius: 14px; background: none;
  color: var(--ink-3); font: 600 11.5px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: color .2s var(--ease), transform .15s var(--ease);
}
.app-tab:active, .shell .mobile-nav .nav-link:active { transform: scale(.92); }
.app-tab-icon, .shell .mobile-nav .nav-link svg { transition: transform .35s var(--ease); }
.app-tab-icon { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .25s var(--ease), transform .35s var(--ease); }
.app-tab svg, .shell .mobile-nav .nav-link svg { width: 22px; height: 22px; }
.app-tab[aria-current], .shell .mobile-nav .nav-link[aria-current="page"] { color: var(--primary-ink); background: none; box-shadow: none; }
.app-tab[aria-current] .app-tab-icon { background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent); }
.app-tab[aria-current] svg, .shell .mobile-nav .nav-link[aria-current="page"] svg { transform: translateY(-1px); --icon-accent: var(--gold); }
.app-tab[aria-current]::before, .shell .mobile-nav .nav-link[aria-current="page"]::before {
  content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--gold-metal); display: block; width: auto; bottom: auto;
}
.shell .mobile-nav .nav-link:hover { background: none; color: var(--primary-ink); }

/* نافذة منبثقة من الأسفل (إرشاد التثبيت على الآيفون) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; align-items: end; background: rgba(3, 31, 27, .5); backdrop-filter: blur(3px); animation: fade .2s; }
.sheet {
  position: relative; width: min(520px, 100%); margin: 0 auto; padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; background: var(--surface); color: var(--ink);
  border-radius: 26px 26px 0 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5); animation: sheetUp .38s var(--ease);
}
.sheet::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; border-radius: 26px 26px 0 0; background: var(--gold-foil); }
.sheet h3 { font-family: var(--font-display); font-size: 19px; }
.sheet-handle { position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--line); }
.ios-steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.ios-steps b { color: var(--primary-ink); }
@keyframes sheetUp { from { transform: translateY(100%); } }

/* صفحة انقطاع الاتصال */
.offline-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--emerald-deep); color: #fff; }
.offline-card { max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.offline-card img { border-radius: 22px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7); }
.offline-card h1 { font-family: var(--font-display); font-size: 22px; }
.offline-card p { color: rgba(255, 255, 255, .78); }

@media (max-width: 900px) {
  .mobile-only { display: inline-flex !important; }
  /* لوحة الإدارة: القائمة تنتقل إلى شريط سفلي ثابت */
  .shell .mobile-nav { display: grid; top: auto; overflow: visible; }
  .shell .main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .topline { padding-top: max(14px, env(safe-area-inset-top)); }
  .shell .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .app-tabbar { display: grid; }
  body:has(.app-tabbar) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:has(.app-tabbar) .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  /* الحقول بحجم 16px حتى لا يكبّر سفاري الصفحة عند الكتابة */
  .input, .cmdk-input input { font-size: 16px; }
  .site-header-inner { padding-top: max(14px, env(safe-area-inset-top)); padding-inline: max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-left)); }
  .header-actions [data-install] { width: 44px; padding: 0; }
  /* الواجهة: رأس مختصر، والتنقل في الشريط السفلي بدل الأزرار والتبويبات */
  .hero-inner { padding: calc(84px + env(safe-area-inset-top)) 16px 96px; gap: 20px; }
  .hero h1 { font-size: 27px; line-height: 1.5; margin-top: 8px; }
  .hero-lead { font-size: 15px; margin-top: 8px; }
  .hero-cta, .trust { display: none; }
  .project-chip { margin-bottom: 12px; }
  .clock-card { padding: 16px 18px; border-radius: 20px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; }
  .clock-card::before { inset: 6px; border-radius: 15px; }
  .clock-label { grid-column: 1 / -1; }
  .clock-time { font-size: 36px; margin: 0; }
  .clock-dates { margin: 0; padding: 0; border: 0; grid-template-columns: 1fr; gap: 2px; }
  .clock-dates b { font-size: 13.5px; }
  .clock-note { display: none; }
  .public-main > .tabs { display: none; }
  #start { scroll-margin-top: calc(76px + env(safe-area-inset-top)); }
  .public-main { margin-top: -56px; }
  .form-card, .track-card { border-radius: 22px; }
  .site-footer { display: none; }
  [role="tabpanel"]:not([hidden]) { animation: rise .35s var(--ease); }
  /* لوحة التفاصيل والنوافذ: تنبثق من الأسفل كأوراق التطبيقات */
  .drawer {
    inset: auto 0 0 0; width: 100%; max-height: calc(100dvh - 24px); height: calc(100dvh - 24px);
    border-radius: 24px 24px 0 0; overflow: hidden; animation: sheetUp .4s var(--ease);
  }
  .drawer-head { padding-top: 26px; }
  .drawer-head::after { content: ""; position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: rgba(255, 255, 255, .35); }
  .drawer-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 24px 24px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); animation: sheetUp .38s var(--ease); }
  .cmdk-backdrop { padding-top: max(16px, env(safe-area-inset-top)); }
  .page-head h1 { font-size: 22px; }
  /* شريط الفترة الزمنية يلتف بدل أن يدفع الصفحة للتمرير الأفقي */
  .page-head > .toolbar { width: 100%; }
  .range { flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
  .range .input { flex: 1 1 120px; min-width: 0; }
  body { overflow-x: clip; }
  /* صفوف المخططات قابلة للضغط، فتأخذ ارتفاع هدف لمس كامل */
  .bar-row { min-height: 44px; }
}

/* عند التشغيل كتطبيق مثبّت: لا حاجة لزر التثبيت، وتمرير بلا ارتداد للصفحة كاملة */
.standalone [data-install] { display: none !important; }
.standalone body { overscroll-behavior-y: none; }
.is-offline .site-header::after {
  content: "غير متصل"; position: absolute; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  padding: 2px 10px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* طباعة التذكرة فقط */
@media print {
  body { background: #fff; }
  .site-header, .hero, .tabs, .success-actions, .success-head p, .site-footer, .toast { display: none !important; }
  .public-main { margin: 0; padding: 0; }
  .ticket { box-shadow: none; border: 1px solid #999; }
  .ticket-stub { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- فلاتر التذاكر على الجوال: البحث وزر «التصفية» أولًا، وبقية الفلاتر تُفتح عند الطلب */
@media (max-width: 900px) {
  .filters { display: flex; flex-direction: column; gap: 12px; }
  .filters-search { display: flex; align-items: end; gap: 8px; }
  .filters-search > .field { flex: 1; min-width: 0; }
  .filters-toggle { display: inline-flex; flex: none; min-height: 44px; }
  .filters-toggle[aria-expanded="true"] { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); }
  .filters-more { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .filters-more .field { min-width: 0; }
  .filters-more .input { width: 100%; min-width: 0; }
  .filters-card:not(.is-open) .filters-foot { display: none !important; }
  .filters-card.is-open .filters-more { display: grid; animation: rise .25s var(--ease); }
}

/* ---- قائمة التذاكر على الجوال: بطاقات بدل الجدول */
.tcards { display: none; list-style: none; margin: 0; padding: 12px; gap: 10px; }
.tcard {
  width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; text-align: right; cursor: pointer;
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
}
.tcard:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.tcard:active { transform: scale(.985); background: var(--surface-2); }
.tcard-top, .tcard-meta, .tcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.tcard .t-no { font-weight: 700; color: var(--primary-ink); font-size: 15.5px; }
.tcard-meta { font-size: 13.5px; color: var(--ink-2); }
.tcard-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; line-height: 1.6; color: var(--ink-2);
}
.tcard-foot { padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); }
.tcard-foot .t-date { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) {
  .tcards { display: grid; }
  .tickets-table-wrap { display: none; }
  .pager { flex-direction: column; gap: 10px; padding: 12px 16px 16px; }
  .pager .toolbar { width: 100%; }
  .pager .toolbar .btn { flex: 1; }
}

/* =====================================================================
   لوحة المؤشرات التنفيذية: ترويسة رسمية، وجدول أداء الأنواع، وفرز سريع للتذاكر
   ===================================================================== */
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ---- ترويسة التقرير التنفيذي: شريط زمردي بحافة ذهبية وختم ومؤشر دائري */
.exec-band {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 28px; border-radius: var(--radius-xl); color: #fff;
  background: var(--emerald-deep);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent);
}
.exec-band::before {
  /* حافة ذهبية رفيعة أعلى الشريط */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold-foil); z-index: 1;
}
.exec-band::after {
  /* لمعة هادئة تمر مرة واحدة عند الظهور */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(246, 231, 193, .12) 50%, transparent 65%);
  transform: translateX(120%); animation: exec-sheen 2.4s .4s var(--ease) 1 both;
}
@keyframes exec-sheen { to { transform: translateX(-120%); } }
.exec-band > .pattern { position: absolute; inset: 0; opacity: .14; z-index: 0; }
.exec-band > :not(.pattern) { position: relative; z-index: 1; }
.exec-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.exec-seal {
  flex: none; width: 64px; height: 64px; display: grid; place-items: center; clip-path: var(--octagon);
  background: var(--gold-metal); color: var(--g-900);
  --icon-accent: var(--g-900);
}
.exec-seal svg { width: 34px; height: 34px; }
.exec-eyebrow { font-size: 12.5px; letter-spacing: 0; color: var(--gold-200); font-weight: 600; }
.exec-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-top: 4px; }
.exec-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, .78); }
.exec-health {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 5px 12px 5px 14px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
}
.exec-health i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.exec-health.good { color: #8ff0bf; }
.exec-health.fair { color: #ffd88a; }
.exec-health.low { color: #ffb4ab; }
.exec-health.idle { color: rgba(255, 255, 255, .8); }
.exec-side { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: none; }
.exec-print { color: #fff; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); }
.exec-print:hover { background: rgba(255, 255, 255, .16); border-color: var(--gold-300); }

.gauge { width: 128px; height: 128px; display: block; }
.gauge circle { fill: none; stroke-width: 10; }
.gauge-track { stroke: rgba(255, 255, 255, .14); }
.gauge-arc { stroke-linecap: round; transition: stroke-dasharray 1.2s var(--ease); filter: drop-shadow(0 0 6px rgba(214, 180, 122, .45)); }
.gauge-val { fill: #fff; font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.gauge-label { fill: rgba(255, 255, 255, .72); font-size: 10.5px; }

/* ---- جدول أداء أنواع التذاكر */
.matrix-card .card-head { align-items: flex-start; }
table.matrix { font-size: 14px; }
table.matrix thead th { padding: 0; white-space: nowrap; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 16px;
  border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: inherit; text-align: right;
}
.sort-btn:hover { color: var(--primary-ink); }
.sort-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.sort-ind { font-size: 10px; opacity: .45; }
.sort-btn.is-active { color: var(--primary-ink); }
.sort-btn.is-active .sort-ind { opacity: 1; color: var(--gold-ink); }
table.matrix tbody th { text-align: right; font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line-2); min-width: 170px; }
table.matrix tbody tr { cursor: pointer; }
.mx-name { color: var(--ink); text-decoration: none; font-weight: 600; }
.mx-name:hover, .mx-name:focus-visible { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }
.mx-share { display: block; height: 4px; margin-top: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.mx-share i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--primary)); }
.mx-strong { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.mx-pill { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.mx-pill.warn { background: var(--warn-50); color: var(--warn); }
.mx-pill.ok { background: var(--ok-50); color: var(--ok); }
.mx-pill.alert { background: var(--danger-50); color: var(--danger); }
.mx-rate { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.mx-rate .meter { flex: 1; margin: 0; }
.mx-sort-mobile { display: none; }

/* ---- فرز سريع في صفحة التذاكر */
.sort-rail { display: flex; flex-direction: column; gap: 12px; }
.seg { display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-sunken); border: 1px solid var(--line); }
.seg-btn, .type-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.seg-btn { border: 0; border-radius: 10px; background: transparent; }
.seg-btn b, .type-chip b {
  min-width: 24px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px;
  font-size: 12px; background: var(--line-2); color: var(--ink-2);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--primary-ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg-btn[aria-pressed="true"] b { background: var(--primary); color: #fff; }
.seg-btn.st-new[aria-pressed="true"] b { background: var(--warn); color: #fff; }
.chips-rail { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.type-chip { scroll-snap-align: start; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.type-chip:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.type-chip[aria-pressed="true"] {
  border-color: var(--gold); color: var(--ink); font-weight: 600;
  background: linear-gradient(180deg, var(--gold-50), var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.type-chip[aria-pressed="true"] b { background: var(--gold); color: #fff; }
:root[data-theme="dark"] .seg-btn[aria-pressed="true"] b, :root[data-theme="dark"] .type-chip[aria-pressed="true"] b { color: var(--g-950); }

/* ---- شارة الدور في الشريط الجانبي */
.me-role.role-developer { color: var(--gold-300); font-weight: 600; }

@media (max-width: 900px) {
  .exec-band { flex-direction: column; align-items: stretch; padding: 22px 18px; }
  .exec-side { flex-direction: row; justify-content: space-between; }
  .gauge { width: 104px; height: 104px; }
}
@media (max-width: 640px) {
  .exec-main { align-items: flex-start; }
  .exec-seal { width: 48px; height: 48px; }
  .exec-seal svg { width: 26px; height: 26px; }
  .exec-title { font-size: 18px; }
  .seg { align-self: stretch; }
  .seg-btn { flex: 1; justify-content: center; min-height: 44px; padding: 0 8px; }
  .type-chip { min-height: 44px; }
  /* جدول الأنواع يتحول إلى بطاقات: كل خلية بعنوانها */
  .mx-sort-mobile { display: flex; padding: 14px 16px 4px; }
  table.matrix thead { display: none; }
  table.matrix, table.matrix tbody, table.matrix tr, table.matrix th, table.matrix td { display: block; }
  table.matrix tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 16px; border-bottom: 1px solid var(--line-2); }
  table.matrix tbody th { grid-column: 1 / -1; padding: 0; border: 0; min-width: 0; font-size: 15px; }
  table.matrix tbody td { padding: 0; border: 0; }
  table.matrix tbody td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-bottom: 2px; }
}

/* ---- طباعة التقرير من لوحة المؤشرات */
@media print {
  .sidebar, .mobile-nav, .topline, .page-head .toolbar, .exec-print, .toast, .drawer, .drawer-backdrop { display: none !important; }
  .shell { display: block; }
  .main { padding: 0 !important; }
  .exec-band, .kpi.hero-kpi, .mx-share i, .meter i, .mx-pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .exec-band::after { display: none; }
  .card, .kpi { box-shadow: none !important; break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .exec-band::after { display: none; }
  .gauge-arc { transition: none; }
}
