/* ==========================================================================
   هوية فيلوكس: زجاج أخضر عميق، لمسات برتقالية، حبوب بيضاء
   ========================================================================== */
:root {
  --font: 'Readex Pro', 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif;
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- الثيم الغامق (الأساسي) ---------- */
:root, :root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #08110e;
  --bg-2: #0d1a16;
  --glow-a: rgba(64, 170, 136, .22);
  --glow-b: rgba(31, 94, 76, .38);
  --glow-c: rgba(245, 128, 60, .06);
  --surface: rgba(255, 255, 255, .042);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-3: rgba(255, 255, 255, .11);
  --surface-solid: #12221d;
  --surface-solid-2: #182c26;
  --chart-surface: #101f1b;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f1f6f3;
  --text-2: #b6c8c1;
  --text-3: #8da59c;
  --primary: #f4f8f6;
  --on-primary: #0b1a15;
  --accent: #f5803c;
  --accent-strong: #ff8f4b;
  --on-accent: #1b0d03;
  --accent-soft: rgba(245, 128, 60, .16);
  --mint: #7fe3c1;
  --mint-soft: rgba(127, 227, 193, .13);
  --good: #6fdcab; --good-soft: rgba(111, 220, 171, .14);
  --warn: #eec35f; --warn-soft: rgba(238, 195, 95, .14);
  --bad: #ff8d7c; --bad-soft: rgba(255, 141, 124, .14);
  --info: #86b8f6; --info-soft: rgba(134, 184, 246, .14);
  --muted-soft: rgba(255, 255, 255, .08);
  --c1: #27A581; --c2: #DE691C; --c3: #4E93EC; --c4: #AE8B22; --c5: #A47BE8; --c6: #D95F8B;
  --map-dot: rgba(255, 255, 255, .17);
  --seat-free: rgba(255, 255, 255, .09);
  --seat-line: rgba(255, 255, 255, .28);
  --seat-taken: rgba(255, 255, 255, .05);
  --fuselage-a: #5fbf9f;
  --fuselage-b: #1b3b32;
  --fuselage-c: #12261f;
  --blur: blur(18px) saturate(130%);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ---------- الثيم الفاتح: نفس الروح على أرضية مريمية ---------- */
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #e9efeb;
  --bg-2: #f2f6f3;
  --glow-a: rgba(115, 204, 172, .34);
  --glow-b: rgba(167, 214, 197, .5);
  --glow-c: rgba(245, 128, 60, .08);
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(15, 53, 42, .045);
  --surface-3: rgba(15, 53, 42, .09);
  --surface-solid: #ffffff;
  --surface-solid-2: #f3f7f4;
  --chart-surface: #ffffff;
  --line: rgba(15, 53, 42, .1);
  --line-2: rgba(15, 53, 42, .2);
  --text: #0e2a22;
  --text-2: #3d5a50;
  --text-3: #587067;
  --primary: #0f3229;
  --on-primary: #f4f8f6;
  --accent: #e0620f;
  --accent-strong: #c95509;
  --on-accent: #ffffff;
  --accent-soft: rgba(224, 98, 15, .12);
  --mint: #0c7a5e;
  --mint-soft: rgba(12, 122, 94, .1);
  --good: #0b7a54; --good-soft: rgba(11, 122, 84, .11);
  --warn: #8f6400; --warn-soft: rgba(165, 118, 8, .14);
  --bad: #c0341f; --bad-soft: rgba(192, 52, 31, .1);
  --info: #235fb8; --info-soft: rgba(35, 95, 184, .1);
  --muted-soft: rgba(15, 53, 42, .07);
  --c1: #0E7F64; --c2: #D9600F; --c3: #2F6FD0; --c4: #A9790B; --c5: #8A5FD8; --c6: #C9447A;
  --map-dot: rgba(15, 53, 42, .22);
  --seat-free: #ffffff;
  --seat-line: rgba(15, 53, 42, .3);
  --seat-taken: rgba(15, 53, 42, .08);
  --fuselage-a: #8ed8bd;
  --fuselage-b: #cfe6dc;
  --fuselage-c: #e4f0ea;
  --blur: blur(18px) saturate(140%);
  --card-shadow: 0 1px 2px rgba(15, 53, 42, .05), 0 12px 30px -18px rgba(15, 53, 42, .18);
  --shadow-pop: 0 24px 60px -18px rgba(15, 53, 42, .35);
}

/* ---------- الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 350;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 72% -8%, var(--glow-b), transparent 70%),
    radial-gradient(620px 420px at 18% 2%, var(--glow-a), transparent 72%),
    radial-gradient(800px 600px at 50% 110%, var(--glow-c), transparent 70%);
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 500; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  backdrop-filter: var(--blur);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 500; letter-spacing: .2px; flex-shrink: 0; }
.logo-mark { width: 30px; height: 30px; color: var(--mint); }
.mainnav {
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  min-width: 0;
}
.nav-item { position: relative; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  border: 0; background: transparent; color: var(--text-2);
  cursor: pointer; white-space: nowrap; font-size: 13.5px;
  transition: background-color .15s, color .15s;
}
.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { background: var(--primary); color: var(--on-primary); font-weight: 450; }
.nav-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 0; z-index: 60;
  min-width: 250px; padding: 8px;
  background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  display: none;
}
.nav-item.open > .nav-menu { display: grid; gap: 2px; animation: pop .16s var(--ease); }
.nav-menu.cols-2 { grid-template-columns: 1fr 1fr; min-width: 440px; }
.menu-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer; background: none; border: 0; width: 100%; text-align: start;
}
.menu-link:hover, .menu-link.active { background: var(--surface-2); color: var(--text); }
.menu-link.active svg { color: var(--accent); }
.menu-link svg { color: var(--text-3); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-shrink: 0; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); cursor: pointer; flex-shrink: 0;
  transition: background-color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn .dot {
  position: absolute; top: -2px; inset-inline-end: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent); color: var(--on-accent); border-radius: 9px; font-size: 10px; font-weight: 500; display: grid; place-items: center;
}
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 4px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; color: inherit; max-width: 200px;
}
[dir='rtl'] .user-chip { padding: 3px 4px 3px 10px; }
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--mint-soft), var(--surface-3)); color: var(--text); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line);
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.user-chip small { display: block; color: var(--text-3); font-size: 10.5px; line-height: 1.2; }
.user-chip b { display: block; font-weight: 450; font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-anchor { position: relative; }
.popover {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60; width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 8px;
  animation: pop .16s var(--ease);
}
.branch-select {
  height: 38px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px; max-width: 180px; color: var(--text); cursor: pointer;
}
.branch-select option { background: var(--surface-solid); color: var(--text); }
.menu-toggle { display: none; }

/* ---------- محتوى الصفحة ---------- */
.view { padding: 22px; max-width: 1560px; margin-inline: auto; animation: fadein .25s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 400; letter-spacing: -.2px; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 1px; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.searchbox {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; min-width: 240px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); cursor: text;
}
.searchbox input { border: 0; background: transparent; outline: 0; width: 100%; color: var(--text); }
.searchbox input::placeholder { color: var(--text-3); }
.searchbox:focus-within { border-color: var(--line-2); }
.kbd { font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.dash-grid { display: grid; gap: 14px; grid-template-columns: 300px minmax(0, 1fr) 300px; align-items: start; }
.split-main { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); align-items: start; }
.split-side { grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); align-items: start; }
.sticky-summary { position: sticky; top: 76px; }

/* ---------- البطاقات ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px; backdrop-filter: var(--blur); box-shadow: var(--card-shadow); min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card.inner { background: var(--surface-2); border-radius: var(--r-md); backdrop-filter: none; box-shadow: none; padding: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card.flush > .card-head { padding: 14px 16px 0; }
.card-title { font-size: 15px; font-weight: 450; }
.card-sub { font-size: 12px; color: var(--text-3); }
.card-link { margin-inline-start: auto; font-size: 12.5px; color: var(--text-2); cursor: pointer; background: none; border: 0; padding: 0; white-space: nowrap; }
.card-link:hover { color: var(--text); text-decoration: underline; }

.stat { position: relative; display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat-value { font-size: 24px; font-weight: 400; letter-spacing: -.2px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-value small { font-size: 12px; color: var(--text-3); font-weight: 350; }
.stat-note { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 6px; border-radius: var(--r-pill); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--muted-soft); color: var(--text-2); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; font-size: 13.5px;
  transition: background-color .15s, transform .1s, filter .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; font-weight: 450; }
.btn.primary:hover { filter: brightness(.94); background: var(--primary); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 450; }
.btn.accent:hover { background: var(--accent-strong); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 22%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 31px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn.block { width: 100%; }

/* ---------- الحبوب والحالات ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px; white-space: nowrap; line-height: 1.6;
  background: var(--muted-soft); color: var(--text-2);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.mint { background: var(--mint-soft); color: var(--mint); }

/* ---------- الجداول ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; }
.toolbar .searchbox { height: 36px; min-width: 200px; flex: 0 1 280px; }
.filter-select {
  height: 36px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px; color: var(--text); max-width: 190px;
}
.filter-select option { background: var(--surface-solid); color: var(--text); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: start; font-weight: 400; color: var(--text-3); font-size: 12px; padding: 9px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line); user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th .sort { display: inline-block; margin-inline-start: 4px; color: var(--accent); font-size: 10px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .end { text-align: end; }
.table tfoot td { font-weight: 450; border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--surface-2); }
.table .row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.table .acts { width: 1%; white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.pager .spacer { margin-inline-start: auto; }
.empty { padding: 44px 20px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 34px; height: 34px; opacity: .55; }
.cell-main { font-weight: 420; }
.cell-sub { font-size: 12px; color: var(--text-3); }
.dim { opacity: .55; }

/* ---------- النماذج ---------- */
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; grid-column: span 3; min-width: 0; }
.field.s1 { grid-column: span 1; } .field.s2 { grid-column: span 2; } .field.s3 { grid-column: span 3; } .field.s4 { grid-column: span 4; } .field.s6 { grid-column: span 6; }
.field > label { font-size: 12.5px; color: var(--text-2); }
.field .req { color: var(--accent); margin-inline-start: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); outline: 0;
  transition: border-color .15s, background-color .15s;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input option { background: var(--surface-solid); color: var(--text); }
.input:focus { border-color: var(--accent); background: var(--surface-3); }
.input.invalid { border-color: var(--bad); }
.input::placeholder { color: var(--text-3); }
input[type='date'].input, input[type='time'].input, input[type='datetime-local'].input, input[type='month'].input { direction: ltr; text-align: right; }
input[type='number'].input { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 90; inset-inline: 0; top: calc(100% + 4px); max-height: 230px; overflow-y: auto; padding: 5px;
  background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow-pop);
}
.combo-opt { padding: 8px 10px; border-radius: var(--r-xs); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.combo-opt small { color: var(--text-3); white-space: nowrap; }
.combo-opt:hover, .combo-opt.active { background: var(--surface-3); }
.combo-empty { padding: 10px; color: var(--text-3); font-size: 12.5px; }

/* ---------- النوافذ ---------- */
dialog.modal {
  border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 0; background: var(--surface-solid); color: var(--text);
  width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-pop); overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modalin .2s var(--ease); }
dialog.modal.lg { width: min(880px, calc(100vw - 24px)); }
dialog.modal.xl { width: min(1140px, calc(100vw - 24px)); }
dialog.modal.sm { width: min(440px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(4, 12, 9, .62); backdrop-filter: blur(3px); }
@keyframes modalin { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-title { font-size: 16.5px; font-weight: 450; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); justify-content: flex-end; flex-wrap: wrap; flex-shrink: 0; }
.toast-host { position: fixed; inset: auto auto 20px 20px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible; z-index: 2000; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); display: none; }
.toast-host:popover-open { display: flex; }
.toast {
  padding: 11px 14px; border-radius: var(--r-md); background: var(--surface-solid-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); display: flex; align-items: flex-start; gap: 9px; animation: pop .2s var(--ease);
}
.toast.good svg { color: var(--good); } .toast.bad svg { color: var(--bad); } .toast.warn svg { color: var(--warn); }

/* ---------- التبويبات والقوائم ---------- */
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.tab { height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); cursor: pointer; white-space: nowrap; font-size: 13px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--primary); color: var(--on-primary); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--text-3); margin: 0; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list-row { display: flex; align-items: center; gap: 11px; padding: 9px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row.link { cursor: pointer; border-radius: var(--r-xs); padding-inline: 6px; margin-inline: -6px; }
.list-row.link:hover { background: var(--surface-2); }
.icon-tile { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); flex-shrink: 0; font-size: 12px; font-weight: 500; }
.icon-tile.accent { background: var(--accent-soft); color: var(--accent); }
.icon-tile.mint { background: var(--mint-soft); color: var(--mint); }
.progress { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--c1); border-radius: 4px; }
.progress > i.hot { background: var(--accent); }

/* ---------- لوحة التحكم: بطاقة المسار ---------- */
.route-card .codes { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 6px 0 14px; }
.route-code { font-size: 36px; font-weight: 400; letter-spacing: .5px; line-height: 1.1; direction: ltr; }
.swap-btn { background: transparent; border: 0; color: var(--text-3); padding-top: 12px; cursor: pointer; }
.route-divider { height: 1px; background: var(--line); margin: 12px 0; }
.ticket {
  position: relative; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); padding: 12px; cursor: pointer; transition: background-color .15s;
}
.ticket:hover { background: var(--surface-3); }
.ticket-codes { display: flex; align-items: center; justify-content: space-between; gap: 8px; direction: ltr; }
.ticket-code { font-size: 20px; font-weight: 450; }
.ticket-line { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--mint); min-width: 0; }
.ticket-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 9px; }
.airline-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; background: var(--surface-3); flex-shrink: 0; direction: ltr; }

/* ---------- الخريطة ---------- */
.map-card { position: relative; padding: 0; overflow: hidden; min-height: 286px; }
.map-svg { width: 100%; height: 100%; display: block; min-height: 240px; }
.map-tag {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px; font-size: 11.5px; white-space: nowrap;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(6px); transform: translate(-50%, -135%);
}
.map-foot { position: absolute; bottom: 12px; inset-inline: 16px; z-index: 2; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.map-ticks { flex: 1; height: 16px; min-width: 100px; display: flex; align-items: center; gap: 2px; overflow: hidden; direction: ltr; }
.map-ticks i { width: 2px; height: 12px; background: var(--line-2); border-radius: 1px; flex-shrink: 0; }
.map-ticks i.on { background: var(--mint); }

/* ---------- خريطة المقاعد ---------- */
.plane {
  position: relative; width: 100%; max-width: 310px; margin-inline: auto; padding: 96px 14px 16px; border-radius: 150px 150px 24px 24px / 170px 170px 24px 24px;
  background: linear-gradient(180deg, var(--fuselage-a) 0, var(--fuselage-b) 28%, var(--fuselage-c) 62%); border: 1px solid var(--line); overflow: hidden;
}
.plane::before {
  content: ''; position: absolute; top: 44px; inset-inline: 26%; height: 22px; border-radius: 50% 50% 8px 8px / 100% 100% 10px 10px; background: rgba(4, 22, 16, .55); box-shadow: inset 0 -2px 0 rgba(255,255,255,.15);
}
.plane-cabin-label { text-align: center; margin: 2px 0 8px; }
.plane-cabin-label span { display: inline-block; padding: 2px 12px; border-radius: var(--r-pill); font-size: 11.5px; background: color-mix(in srgb, var(--surface-solid) 70%, transparent); border: 1px solid var(--line); }
.seat-scroll { max-height: 400px; overflow-y: auto; padding-inline-end: 2px; direction: ltr; }
.seat-row { display: grid; grid-template-columns: repeat(3, 1fr) 16px repeat(3, 1fr); gap: 5px; margin-bottom: 5px; align-items: center; direction: ltr; }
.seat-row.head { color: var(--text-2); font-size: 11px; text-align: center; margin-bottom: 7px; position: sticky; top: 0; }
.seat-aisle { font-size: 10px; color: var(--text-2); text-align: center; }
.seat {
  height: 30px; border-radius: 7px; border: 1px solid var(--seat-line); background: var(--seat-free); color: var(--text); font-size: 10px; cursor: pointer; padding: 0; display: grid; place-items: center; transition: transform .1s, background-color .1s;
}
.seat:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); }
.seat.business { height: 36px; }
.seat.taken { background: var(--seat-taken); color: var(--text-3); border-color: transparent; cursor: not-allowed; }
.seat.selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.seat-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.seat-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-inline-end: 4px; border: 1px solid var(--seat-line); background: var(--seat-free); }
.seat-legend i.t { background: var(--seat-taken); border-color: transparent; }
.seat-legend i.s { background: var(--accent); border-color: var(--accent); }
.checkout-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-weight: 450;
}
[dir='rtl'] .checkout-bar { padding: 6px 14px 6px 6px; }

/* ---------- لوحة كانبان ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(235px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kan-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.kan-col.over { border-color: var(--accent); }
.kan-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 2px 4px; gap: 6px; }
.kan-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; cursor: grab; display: flex; flex-direction: column; gap: 4px; }
.kan-card:hover { background: var(--surface-3); }
.kan-card.dragging { opacity: .45; }

/* ---------- التقويم ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; }
.cal-head { background: var(--surface-solid-2); padding: 7px; text-align: center; font-size: 12px; color: var(--text-3); }
.cal-day { background: var(--surface-solid); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { opacity: .42; }
.cal-day.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-num { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cal-ev { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--mint-soft); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: block; border: 0; text-align: start; width: 100%; }
.cal-ev.trip { background: var(--accent-soft); }
.cal-ev.visa { background: var(--info-soft); }
.cal-ev.task { background: var(--warn-soft); }

/* ---------- الرسوم البيانية ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; direction: ltr; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--surface-solid-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 12px; box-shadow: var(--shadow-pop); white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px;
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.hbar-row { display: grid; gap: 4px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; background: var(--c1); transition: width .5s var(--ease); }
.segbar { display: flex; gap: 2px; height: 14px; border-radius: 5px; overflow: hidden; }
.segbar i { display: block; height: 100%; min-width: 3px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- الدخول ---------- */
.login-screen { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; border-inline-end: 1px solid var(--line); }
.login-art h1 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 350; line-height: 1.2; max-width: 14em; }
.login-art p { color: var(--text-2); max-width: 34em; margin-top: 10px; }
.login-map { position: absolute; inset: 22% -6% -4% -6%; opacity: .95; pointer-events: none; }
.login-form-wrap { display: grid; place-items: center; padding: 28px 18px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.demo-list { display: grid; gap: 3px; font-size: 12px; }
.demo-list button { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; color: var(--text-2); }
.demo-list button:hover { background: var(--surface-3); color: var(--text); }

.banner { display: flex; align-items: center; gap: 10px; padding: 9px 22px; font-size: 13px; background: var(--warn-soft); color: var(--warn); flex-wrap: wrap; }
.banner button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.perm-table td, .perm-table th { padding: 7px 10px; text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: start; }
.perm-table input { width: 16px; height: 16px; accent-color: var(--accent); }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline .t-item { position: relative; padding-inline-start: 18px; padding-bottom: 12px; }
.timeline .t-item::before { content: ''; position: absolute; inset-inline-start: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .t-item::after { content: ''; position: absolute; inset-inline-start: 6.5px; top: 18px; bottom: -4px; width: 1px; background: var(--line-2); }
.timeline .t-item:last-child::after { display: none; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.bubble { padding: 8px 12px; border-radius: 14px; background: var(--surface-2); max-width: 82%; align-self: flex-start; }
.bubble.me { background: var(--mint-soft); align-self: flex-end; }
.items-editor .item-row { display: grid; grid-template-columns: 130px minmax(0, 2fr) minmax(0, 1.3fr) 76px 106px 106px 34px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 8px; }
.items-editor .item-row .field { grid-column: auto; }
.steps { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; border-radius: var(--r-pill); color: var(--text-3); font-size: 13px; background: transparent; border: 0; cursor: pointer; }
[dir='rtl'] .step { padding: 5px 6px 5px 12px; }
.step b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 450; font-size: 12px; }
.step.active { color: var(--text); background: var(--surface-2); }
.step.active b { background: var(--accent); color: var(--on-accent); }
.step.done b { background: var(--mint-soft); color: var(--mint); }
.summary-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.summary-line.total { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 450; }
.flight-result { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(220px, 1.6fr) auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.flight-result:hover { background: var(--surface-2); }
.flight-time { font-size: 18px; font-weight: 420; font-variant-numeric: tabular-nums; }
.flight-path { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 60px; font-size: 11px; color: var(--text-3); }
.flight-path .bar { width: 100%; height: 1px; background: var(--line-2); position: relative; }
.flight-path .bar::after { content: ''; position: absolute; top: -3px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); transform: translateX(-50%); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r-md); min-height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- الأحجام المختلفة ---------- */
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .dash-seat { grid-column: 1 / -1; }
  .user-chip div { display: none; }
  .user-chip { padding: 3px !important; }
  .nav-btn { padding: 0 11px; }
}
@media (max-width: 1080px) {
  .menu-toggle { display: grid; }
  .mainnav {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 80; width: min(310px, 86vw); border-radius: 0; flex-direction: column; align-items: stretch; padding: 14px; gap: 4px; overflow-y: auto;
    background: var(--surface-solid); border: 0; border-inline-end: 1px solid var(--line-2); transform: translateX(100%); transition: transform .22s var(--ease); visibility: hidden;
  }
  [dir='rtl'] .mainnav { transform: translateX(100%); }
  .mainnav.open { transform: none !important; visibility: visible; box-shadow: var(--shadow-pop); }
  .nav-btn { width: 100%; justify-content: space-between; height: 40px; }
  .nav-menu { position: static; box-shadow: none; border: 0; background: var(--surface-2); margin-top: 3px; min-width: 0 !important; grid-template-columns: 1fr !important; }
  .nav-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(4, 12, 9, .55); }
  .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-main, .split-side { grid-template-columns: minmax(0, 1fr); }
  .sticky-summary { position: static; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .items-editor .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items-editor .item-row .wide { grid-column: span 2; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; gap: 8px; }
  .view { padding: 16px; }
  .banner { padding: 9px 16px; }
  .dash-grid, .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .page-title { font-size: 23px; }
  .page-actions { margin-inline-start: 0; width: 100%; }
  .searchbox { min-width: 0; flex: 1 1 100%; }
  .toolbar .searchbox { flex: 1 1 100%; }
  .filter-select { flex: 1 1 40%; max-width: none; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field, .field.s1, .field.s2, .field.s3, .field.s4, .field.s6 { grid-column: span 2; }
  .field.s1, .field.s2 { grid-column: span 1; }
  .branch-select { display: none; }
  .logo span { display: none; }
  .stat-value { font-size: 20px; }
  .flight-result { grid-template-columns: minmax(0, 1fr); }
  .cal-day { min-height: 66px; padding: 3px; }
  .cal-ev { font-size: 9.5px; padding: 0 3px; }
  .route-code { font-size: 30px; }
  .toast-host { inset: auto 16px 16px 16px; max-width: none; }
}
