/* ===== الأساسيات: ألوان، خطوط، أزرار، نماذج (مشترك مع لوحة التحكم) =====
   الفكرة البصرية: صينية أدوات معقّمة — أسطح فاتحة باردة، حبر أخضر مزرق داكن،
   وخطوط رفيعة مثل رسم الأدوات، مع لون واحد حار (أحمر) مخصص للعروض فقط. */
:root {
  color-scheme: light;
  --ink: #102A43;
  --ink-2: #173F68;
  --ink-3: #2367A8;
  --enamel: #F4F7FA;
  --paper: #FFFFFF;
  --steel: #D8E1EA;
  --steel-2: #AABBCD;
  --muted: #61758A;
  --text: #1D2D3D;
  --teal: #1769AA;
  --teal-dark: #0E4F87;
  --teal-soft: #E7F1FA;
  --hot: #F47B20;
  --hot-dark: #C85C0D;
  --hot-soft: #FFF0E5;
  --amber: #F6A623;
  --green: #18804B;
  --green-soft: #E2F4EA;
  --blue: #2367A8;
  --blue-soft: #E7F1FA;
  --violet: #4B63A8;
  --violet-soft: #E9EDFA;
  --amber-soft: #FFF3DC;
  --amber-dark: #9A6500;
  --radius: 5px;
  --radius-sm: 3px;
  --shadow: 0 2px 5px rgba(16, 42, 67, .07), 0 12px 28px rgba(16, 42, 67, .08);
  --font-body: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Noto Kufi Arabic', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  color: var(--text); background: var(--enamel);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg { max-width: 100%; }
img { display: block; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
s { text-decoration-thickness: 1.5px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.wrap.narrow, .narrow { max-width: 720px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 200; }
.skip:focus { top: 8px; }
.ico { flex: none; vertical-align: middle; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius);
  border: 1.5px solid transparent; background: var(--paper); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled):not(.is-disabled) { background: var(--teal-dark); }
.btn-hot { background: var(--hot); color: #fff; }
.btn-hot:hover:not(:disabled) { background: var(--hot-dark); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover:not(:disabled) { background: var(--ink); color: #fff; }
.btn-danger { background: var(--hot); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(11, 42, 46, .07); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 17px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.grow { flex: 1; }
.btn-link { background: none; border: 0; padding: 0; color: var(--teal-dark); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: rgba(11, 42, 46, .08); color: var(--ink); }

/* ---------- النماذج ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 13px; }
.field .err, .err { color: var(--hot-dark); font-size: 13px; font-weight: 500; min-height: 0; }
.input, .select, textarea.input {
  width: 100%; min-height: 46px; padding: 9px 14px; border: 1.5px solid var(--steel-2);
  border-radius: 6px; background: #fff; color: var(--text);
}
textarea.input { resize: vertical; line-height: 1.6; }
.input:hover, .select:hover { border-color: var(--ink-3); }
.input:focus, .select:focus { outline: 3px solid rgba(11, 122, 118, .28); border-color: var(--teal); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--hot); }
.select { appearance: none; padding-inline-end: 38px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23536A70' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: left 12px center; }
.file { padding: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-family: var(--font-display); font-size: 19px; font-weight: 600; padding: 0; margin-bottom: 14px; }
.row2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }

/* ---------- عناصر عامة ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.6; background: var(--enamel); color: var(--muted); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-teal { background: var(--teal-soft); color: var(--teal-dark); }
.pill-amber { background: var(--amber-soft); color: var(--amber-dark); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--hot-soft); color: var(--hot-dark); }
.pill-gray { background: #E9EEEF; color: var(--muted); }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--teal-soft); color: var(--teal-dark); margin-block: 16px; }
.notice > * { margin: 0; }
.notice p { flex-basis: 100%; }
.notice-warn { background: var(--amber-soft); color: #5F4500; }
.notice-bad { background: var(--hot-soft); color: var(--hot-dark); }
.warn { color: var(--hot-dark); font-size: 14px; font-weight: 500; }
.fine { color: var(--muted); font-size: 13px; }
.hint { display: flex; gap: 8px; align-items: center; color: var(--teal-dark); font-size: 14px; font-weight: 500; }

/* ---------- إشعارات ---------- */
#toasts { position: fixed; inset-inline: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 300; pointer-events: none; padding-inline: 16px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: 15px; max-width: 420px; animation: toast-in .2s ease-out; }
.toast-success { background: var(--teal-dark); }
.toast-error { background: var(--hot-dark); }
.toast.out { opacity: 0; transition: opacity .35s; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

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