/* ===== بوابة ظروف الرواتب — الأساس ===== */
:root {
  --mineral: #E9EEEC;   /* الخلفية */
  --paper: #FBFBF8;     /* الورق */
  --petrol: #123845;    /* اللون الرئيس */
  --petrol-2: #1C4E5E;
  --flare: #E3A72F;     /* شعلة الغاز */
  --seal: #8F2D24;      /* ختم الشمع */
  --ink: #16232B;
  --muted: #56666D;
  --line: #D3DCD9;
  --ok: #2F7A4F;
  --warn: #A86A12;
  --bad: #B3261E;
  --display: 'Readex Pro', 'IBM Plex Sans Arabic', Tahoma, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --shadow: 0 1px 0 rgba(18, 56, 69, .06), 0 10px 30px -18px rgba(18, 56, 69, .45);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body); font-size: 15px; line-height: 1.7; color: var(--ink);
  background: var(--mineral); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.3; margin: 0; font-weight: 600; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--petrol); }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- الأزرار ---- */
.btn {
  font: 500 .95rem var(--body); display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  padding: .55em 1.15em; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer;
  background: var(--petrol); color: #fff; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--petrol-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-flare { background: var(--flare); color: var(--ink); }
.btn-flare:hover { background: #EDB445; }
.btn-ghost { background: transparent; color: var(--petrol); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: var(--petrol); }
.btn-danger { background: transparent; color: var(--bad); border-color: #e6c3c0; }
.btn-danger:hover { background: #fbeeed; }
.btn-sm { font-size: .82rem; padding: .3em .75em; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

:focus-visible { outline: 3px solid var(--flare); outline-offset: 2px; }

/* ---- الحقول ---- */
.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.field > span { font-size: .85rem; color: var(--muted); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=month], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: .55em .8em; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(227, 167, 47, .35); }
label.check { display: flex; gap: .5rem; align-items: flex-start; cursor: pointer; }
label.check input { margin-top: .35em; accent-color: var(--petrol); }

/* ---- الإشعارات ---- */
.toasts { position: fixed; bottom: 20px; left: 20px; display: grid; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 40px)); }
.toast {
  background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: var(--r-sm); box-shadow: var(--shadow);
  border-inline-start: 4px solid var(--flare); animation: tin .25s ease-out;
}
.toast-bad { border-inline-start-color: #ff8b80; }
.toast-ok { border-inline-start-color: #7fd3a0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

.spinner { width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

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