/* ZR Express queue — shared design tokens and components */
:root {
  --accent: #FFD000;          /* ZR Express yellow */
  --accent-ink: #111111;      /* text on the yellow */
  --accent-soft: color-mix(in srgb, var(--accent) 18%, #fff);
  --chart: #1f2937;           /* bars: yellow is too light on white */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f3f5f9;
  --card: #ffffff;
  --ok: #16a34a;   --ok-soft: #dcfce7;
  --warn: #d97706; --warn-soft: #fef3c7;
  --bad: #dc2626;  --bad-soft: #fee2e2;
  --info: #2563eb; --info-soft: #dbeafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
/* responsive: grid/flex children may shrink below their content (wide tables scroll inside their card instead of widening the page) */
.card, .grid > *, .kpis > *, section, aside, main { min-width: 0; }
.scroll, .table-wrap { max-width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
img, video, svg { max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 640px) {
  /* key figures: two per row on phones */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .kpi { padding: 12px 14px !important; }
  .kpi b { font-size: 24px !important; }
  .card-h { padding: 12px 14px; flex-wrap: wrap; }
  .card-b { padding: 14px; }
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .modal-f { flex-wrap: wrap; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: #f8fafc; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(15, 23, 42, .05); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 22px; font-size: 18px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 64px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 99px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { inset-inline-start: 21px; }

/* cards, badges, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 16px; }
.card-b { padding: 16px 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #166534; }
.badge.warn { background: var(--warn-soft); color: #92400e; }
.badge.bad { background: var(--bad-soft); color: #991b1b; }
.badge.info { background: var(--info-soft); color: #1e40af; }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfd; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }

/* toast + modal */
#toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
[dir=rtl] #toasts { transform: translateX(50%); }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: toastIn .2s ease-out; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 900; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,.25); }
.modal .card-b { display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }

/* language switch */
.lang { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; }
.lang button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--muted); }
.lang button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.logo-img { display: block; height: 40px; width: auto; object-fit: contain; }
