/* =====================================================================
   Vetna — نظام التصميم للوحة التحكم
   ===================================================================== */
:root {
  /* هوية Vetna: أصفر ليموني على فحمي */
  --brand: #E9DB5A;
  --brand-strong: #D8C83C;
  --brand-soft: #FBF7DC;
  --brand-ink: #6B5F00;

  --ink: #16161A;
  --ink-2: #3F3F46;
  --muted: #71717A;
  --subtle: #A1A1AA;

  --bg: #F4F4F1;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --line: #EAEAE5;
  --line-strong: #DCDCD5;

  --sidebar: #111113;
  --sidebar-2: #1A1A1D;
  --sidebar-line: #26262A;
  --sidebar-text: #A1A1AA;

  --ok: #15803D;      --ok-soft: #E8F6EC;
  --info: #1D4ED8;    --info-soft: #E9EFFD;
  --warn: #C2410C;    --warn-soft: #FFF1E7;
  --danger: #DC2626;  --danger-soft: #FDECEC;
  --violet: #7C3AED;  --violet-soft: #F1EBFE;
  --slate: #475569;   --slate-soft: #EEF1F4;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, .04), 0 1px 3px rgba(16, 16, 20, .05);
  --shadow-md: 0 12px 32px -12px rgba(16, 16, 20, .18);
  --ring: 0 0 0 4px rgba(233, 219, 90, .35);

  /* أسماء قديمة تستخدمها بعض الصفحات */
  --primary: var(--brand);
  --primary-soft: var(--brand-soft);
  --gray: var(--line-strong);
  --card: var(--surface);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); font-weight: 600; text-decoration: none; }
a:hover { color: var(--brand-ink); }
b, strong { font-weight: 700; }
h1, h2, h3 { letter-spacing: -.01em; }
.i { flex-shrink: 0; vertical-align: middle; }
.num, td, .stat .n { font-variant-numeric: tabular-nums; }

/* =========================== Layout =========================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px; flex-shrink: 0; background: var(--sidebar); color: #EDEDED;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; }
.sidebar .brand .logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--brand);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.sidebar .brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar .brand b { display: block; font-size: 16px; color: #fff; line-height: 1.2; }
.sidebar .brand small { color: var(--sidebar-text); font-size: 12px; }

.sidebar .side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidebar nav { flex: 1; padding: 6px 12px 12px; overflow-y: auto; }
.nav-backdrop { display: none; }
.sidebar .nav-label {
  color: #5E5E66; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 16px 12px 6px;
}
.sidebar nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  color: var(--sidebar-text); padding: 9px 12px; border-radius: 10px; margin-bottom: 2px;
  font-weight: 500; font-size: 14px; transition: background .15s, color .15s;
}
.sidebar nav a .grow { flex: 1; }
.sidebar nav a:hover { background: var(--sidebar-2); color: #fff; }
.sidebar nav a.active { background: rgba(233, 219, 90, .1); color: var(--brand); font-weight: 600; }
.sidebar nav a.active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.badge-count {
  background: var(--brand); color: var(--ink); border-radius: 99px; font-size: 11.5px; font-weight: 700;
  padding: 0 7px; min-width: 22px; height: 20px; line-height: 20px; text-align: center;
}
.badge-count.zero { display: none; }

.sidebar .foot { padding: 12px; border-top: 1px solid var(--sidebar-line); }
.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.sidebar .me .avatar { background: var(--sidebar-2); color: var(--brand); }
.sidebar .me .who { flex: 1; min-width: 0; }
.sidebar .me .who b { display: block; font-size: 13.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me .who a { font-size: 12px; color: var(--sidebar-text); font-weight: 500; display: inline-flex; gap: 5px; align-items: center; }
.sidebar .me .who a:hover { color: var(--brand); }
.dev-credit { font-size: 11.5px; color: var(--muted); text-align: center; margin: 10px 0 0; }
.dev-credit b { font-weight: 600; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  color: var(--sidebar-text); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--sidebar-2); color: #fff; }

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; max-width: 1440px; }

/* ---------- رأس الصفحة ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.crumb:hover { color: var(--ink); }

/* =========================== Cards =========================== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h2 .i { color: var(--muted); }
.card h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card > .table-wrap { margin: 0 -20px; }
.card > .table-wrap:last-child { margin-bottom: -20px; }
.card > .table-wrap:first-child { margin-top: -20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .table-wrap { margin: 0; }
.panel { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface-2); }
.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1100px) { .grid.side { grid-template-columns: 1fr; } }

/* ---------- بطاقات الأرقام ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px;
  transition: transform .15s, box-shadow .15s; color: inherit;
}
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.stat .n { font-size: 30px; font-weight: 700; line-height: 1; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat.accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat.accent .ic { background: rgba(233, 219, 90, .14); border-color: transparent; color: var(--brand); }
.stat.accent .n { color: var(--brand); }
.stat.accent .l { color: #B4B4BB; }

/* =========================== Tables =========================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 13px 14px; text-align: right; vertical-align: middle; border-bottom: 1px solid var(--line); }
th {
  background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
th:first-child, td:first-child { padding-inline-start: 20px; }
th:last-child, td:last-child { padding-inline-end: 20px; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background .12s; }
tr:hover td { background: #FBFBF9; }
tr.unseen td { background: #FEFCEF; }
tr.unseen td:first-child { box-shadow: inset -3px 0 0 var(--brand); }
tr.total td { background: var(--surface-2); font-weight: 700; }
td .cell-title { font-weight: 600; color: var(--ink); }
td .cell-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
td.actions { text-align: left; white-space: nowrap; }
td.actions .btn + .btn { margin-inline-start: 4px; }
.id-link { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.id-link:hover { color: var(--brand-ink); }
.empty { text-align: center !important; color: var(--muted); padding: 44px 16px !important; }
.empty .i { display: block; margin: 0 auto 8px; color: var(--subtle); }

/* =========================== Forms =========================== */
.input, input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 8px 10px; height: auto; }
textarea { height: auto; padding: 10px 13px; resize: vertical; line-height: 1.6; }
select {
  appearance: none; -webkit-appearance: none; padding-inline-end: 13px; padding-inline-start: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
::placeholder { color: var(--subtle); }
.input:hover, input:hover, select:hover, textarea:hover { border-color: #C9C9C1; }
.input:focus, select:focus, textarea:focus, input:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.helptext, .help { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.errorlist { color: var(--danger); margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .auto { flex: 0 0 auto; }
.row.end { align-items: flex-end; }
.row label { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.search { position: relative; }
.search .i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search input { padding-inline-start: 38px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; }

/* =========================== Buttons =========================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px; background: var(--ink); color: #fff;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: #2A2A30; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.brand, .btn.primary { background: var(--brand); color: var(--ink); }
.btn.brand:hover, .btn.primary:hover { background: var(--brand-strong); color: var(--ink); }
.btn.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-2); border-color: #C9C9C1; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ok:hover { background: #116A33; }
.btn.info { background: var(--info); color: #fff; }
.btn.info:hover { background: #1A43BC; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; gap: 5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }

/* =========================== Status pills =========================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
  background: var(--slate-soft); color: var(--slate);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--brand-soft); color: var(--brand-ink); }
.st-new::before { background: #CDBB22; box-shadow: 0 0 0 3px rgba(233, 219, 90, .35); }
.st-reviewing { background: var(--warn-soft); color: var(--warn); }
.st-confirmed { background: var(--ok-soft); color: var(--ok); }
.st-on_screen { background: var(--info-soft); color: var(--info); }
.st-rest { background: var(--violet-soft); color: var(--violet); }
.st-cancelled { background: var(--danger-soft); color: var(--danger); }
.st-delivered { background: var(--slate-soft); color: var(--slate); }

/* ---------- الفلاتر (تبويبات) ---------- */
.filters {
  display: inline-flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.filters a {
  padding: 6px 13px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
}
.filters a:hover { color: var(--ink); background: var(--surface-2); }
.filters a.active { background: var(--ink); color: #fff; }
.filters .count { font-size: 11.5px; background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 0 7px; }
.filters a.active .count { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- حالات الطلبات في الرئيسية ---------- */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.status-grid a {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); transition: border-color .15s, background .15s;
}
.status-grid a:hover { border-color: var(--line-strong); background: var(--surface); color: inherit; }
.status-grid .n { font-size: 22px; font-weight: 700; }

/* =========================== Messages =========================== */
.messages { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.messages li {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
  font-weight: 500; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
}
.messages li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.messages .success { border-color: #CBEBD5; background: var(--ok-soft); color: #0F5A2B; }
.messages .success::before { background: var(--ok); }
.messages .error { border-color: #F8CFCF; background: var(--danger-soft); color: #9B1C1C; }
.messages .error::before { background: var(--danger); }
.messages .info, .messages .warning { border-color: #F0E6A6; background: var(--brand-soft); color: var(--brand-ink); }
.messages .info::before, .messages .warning::before { background: var(--brand-strong); }

.callout {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: var(--brand-soft); border: 1px solid #F0E6A6; color: #4A4200; margin-bottom: 16px;
}
.callout .i { color: var(--brand-ink); margin-top: 2px; }

/* =========================== Timeline =========================== */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 22px 16px 0; }
.timeline li::before {
  content: ""; position: absolute; right: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
}
.timeline li::after { content: ""; position: absolute; right: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li:last-child::before { background: var(--brand); border-color: var(--ink); }
.timeline small { color: var(--muted); display: block; font-size: 12px; }

/* ---------- قائمة معلومات ---------- */
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv li:last-child { border-bottom: 0; }
.kv .i { color: var(--subtle); }
.kv .k { color: var(--muted); font-size: 13px; min-width: 70px; }

.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 15px;
}
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.who-cell { display: flex; align-items: center; gap: 12px; }

.muted { color: var(--muted); }
.thumb {
  width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--subtle);
}
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { white-space: nowrap; display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 1px 8px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- مراحل الطلب ---------- */
.steps { display: flex; gap: 0; margin-bottom: 18px; counter-reset: step; }
.steps .step { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--subtle); font-weight: 600; font-size: 13px; }
.steps .step .dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  border: 2px solid var(--line-strong); background: var(--surface); font-size: 12px;
}
.steps .step::after { content: ""; flex: 1; height: 2px; background: var(--line); margin-inline-end: 10px; border-radius: 2px; }
.steps .step:last-child::after { display: none; }
.steps .step.done { color: var(--ink); }
.steps .step.done .dot { background: var(--ink); border-color: var(--ink); color: var(--brand); }
.steps .step.done::after { background: var(--ink); }
.steps .step.current { color: var(--ink); }
.steps .step.current .dot { border-color: var(--ink); box-shadow: var(--ring); }

/* =========================== Toast =========================== */
#toasts { position: fixed; left: 20px; bottom: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 14px; min-width: 280px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .45); animation: pop .3s cubic-bezier(.2, .9, .3, 1.2);
  border: 1px solid #2A2A30;
}
.toast a { color: var(--brand); font-weight: 700; }
@keyframes pop { from { transform: translateY(16px) scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }

/* =========================== Login =========================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth-side {
  position: relative; overflow: hidden; background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.auth-side::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 219, 90, .22), transparent 65%); top: -160px; left: -160px;
}
.auth-side::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side .logo { width: 72px; height: 72px; border-radius: 20px; background: var(--brand); overflow: hidden; display: grid; place-items: center; }
.auth-side .logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-side h1 { font-size: 36px; line-height: 1.3; margin: 0 0 12px; max-width: 420px; }
.auth-side h1 span { color: var(--brand); }
.auth-side p { color: #A1A1AA; margin: 0; max-width: 400px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 26px; margin: 0 0 6px; }
.auth-box .mobile-logo { display: none; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-box .mobile-logo { display: grid; width: 60px; height: 60px; border-radius: 16px; background: var(--brand); overflow: hidden; margin-bottom: 18px; }
  .auth-box .mobile-logo img { width: 100%; height: 100%; object-fit: contain; }
}

/* صفحة اختيار الشاشة */
.picker { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.picker-box { width: 100%; max-width: 520px; }
.picker-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.picker-list a {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.picker-list a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); color: inherit; }
.picker-list .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--brand); display: grid; place-items: center; }
.picker-list .grow { flex: 1; }

/* =========================== Mobile =========================== */
.menu-btn { display: none; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 50; }
  .sidebar .brand { padding: 12px 16px; }
  /* القائمة درج جانبي يفتح من اليمين تحت الشريط العلوي (68px) */
  .sidebar .side-panel { display: none; }
  .sidebar.open .side-panel {
    display: flex; position: fixed; top: 68px; bottom: 0; inset-inline-start: 0; z-index: 2;
    width: min(290px, 82vw); background: var(--sidebar); box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    animation: drawer-in .2s ease-out;
  }
  .sidebar.open .nav-backdrop { display: block; position: fixed; inset: 68px 0 0 0; z-index: 1; background: rgba(0, 0, 0, .45); }
  body.menu-open { overflow: hidden; }
  .menu-btn { display: inline-grid; margin-inline-start: auto; }
  .main { padding: 18px 16px 40px; }
  .topbar h1 { font-size: 21px; }
  .steps .step span.lbl { display: none; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .stat .n { font-size: 24px; }
  .topbar .actions { width: 100%; }
  .topbar .actions > * { flex: 1; }
  .card { padding: 16px; }
  .card > .table-wrap { margin: 0 -16px; }
  .card > .table-wrap:last-child { margin-bottom: -16px; }
  .card > .table-wrap:first-child { margin-top: -16px; }
  #toasts { left: 12px; right: 12px; }
}

/* =========================== Export / campaigns =========================== */
.export-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.export-bar span { margin-inline-end: auto; }
.card:not(.flush) > .export-bar { margin: 0 -20px; padding-inline: 20px; }
.picker { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.picker-list { max-height: 300px; overflow-y: auto; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0; font-weight: 400; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover { background: var(--surface-2); }
.picker-item[hidden] { display: none; }
.picker-item .grow { flex: 1; }
.tpl { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tpl:last-child { border-bottom: 0; padding-bottom: 0; }
.tpl .row > b { flex: 1; }
@media print { .export-bar { display: none; } }
@media (max-width: 640px) { .card:not(.flush) > .export-bar { margin: 0 -16px; padding-inline: 16px; } }
