@import url('/fonts/amiri-quran/400.css');
@import url('/fonts/amiri/400.css');
@import url('/fonts/amiri/700.css');

:root {
  --brand-900: #0B3D31; --brand-800: #0E5A47; --brand-700: #0E6B47; --brand-600: #2E9D6A;
  --brand-300: #9CCBB2; --brand-200: #B9D3CA; --brand-100: #D6ECE3; --brand-50: #F1F8F4;
  --gold: #C9A94A; --gold-soft: #F3E6BE; --amber: #E2B33C;
  --ink: #14211C; --ink-2: #3E4B46; --muted: #4F5E58; --faint: #6B7A74;
  --line: #DDE3E0; --line-2: #E1E6E3; --bg: #F2F4F3; --card: #FFFFFF; --soft: #F6F8F7;
  --red: #A23A23; --red-strong: #B3261E; --red-bg: #FCECE9; --red-line: #D9776A;
  --blue: #1F5E9C; --blue-bg: #EEF4FB; --blue-line: #D2E1F2;
  --orange: #A8550F; --orange-bg: #FDF1E3;
  --v-green: #2E9D6A; --v-amber: #E39A2D; --v-red: #D04A35;
  --sans: 'Noto Kufi Arabic', system-ui, sans-serif; /* يُستبدل من /ui-font.css حسب اختيار المدير */
  --quran: 'Amiri Quran', 'Amiri', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #7FB89E; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }
.quran { font-family: var(--quran); }
[hidden] { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--brand-900); }
.kv { background: var(--soft); border-radius: 8px; padding: 8px 12px; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 600; }
.row-kv { display: flex; justify-content: space-between; gap: 10px; background: var(--soft); border-radius: 6px; padding: 6px 12px; font-size: 14px; }
.row-kv > :first-child { color: var(--brand-800); }

.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }
.btn-primary:hover:not(:disabled) { background: var(--brand-900); }
.btn-primary:disabled { background: var(--brand-300); border-color: var(--brand-300); }
.btn-danger-outline { border-color: #C2543C; color: var(--red); }
.btn-ghost:disabled, .btn:disabled:not(.btn-primary) { background: #E6EAE8; color: #5E6B66; border-color: #C9D2CE; }

/* شريط الإشعارات (أسفل اليسار) */
.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 6px 6px 6px 14px;
  border-radius: 10px; box-shadow: 0 6px 18px rgba(20,33,28,.18); font-size: 14px; animation: tin .2s ease-out; }
.toast .ic { width: 28px; height: 28px; flex: none; border-radius: 50%; background: #1F4A3A; display: flex; align-items: center; justify-content: center; }
.toast .tx { flex: 1; }
.toast .x { width: 36px; height: 36px; flex: none; border: 0; background: transparent; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.toast.err { background: #5C1F14; }
.toast.err .ic { background: #7E2A17; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* نوافذ */
.modal-back { position: fixed; inset: 0; background: rgba(20,33,28,.45); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; }
.modal header h3 { margin: 0; font-size: 17px; }
.modal .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal footer { display: flex; gap: 10px; justify-content: flex-start; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select { border: 1px solid #D5DCD9; border-radius: 10px; padding: 10px 12px; font-weight: 400; background: #fff; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; }

table.grid { width: 100%; border-collapse: collapse; text-align: center; font-size: 13.5px; }
table.grid th { background: #FAFBFB; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line-2); }
table.grid td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); }

.empty { color: var(--muted); text-align: center; padding: 24px; }
.conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70; background: #7E2A17; color: #fff; padding: 6px 16px; border-radius: 999px; font-size: 13px; }

a.btn { text-decoration: none; }
a.btn:not(.btn-primary) { color: var(--ink); }

/* ألوان SVG المكتوبة في الصفحات تتبع ثيمة النظام */
[stroke="#0B3D31" i] { stroke: var(--brand-900); } [fill="#0B3D31" i] { fill: var(--brand-900); }
[stroke="#0E5A47" i] { stroke: var(--brand-800); } [fill="#0E5A47" i] { fill: var(--brand-800); }
[stroke="#135A47" i] { stroke: var(--brand-800); } [fill="#135A47" i] { fill: var(--brand-800); }
[stroke="#0E6B47" i] { stroke: var(--brand-700); } [fill="#0E6B47" i] { fill: var(--brand-700); }
[stroke="#0B6B45" i] { stroke: var(--brand-700); } [fill="#0B6B45" i] { fill: var(--brand-700); }
[stroke="#2E9D6A" i] { stroke: var(--brand-600); } [fill="#2E9D6A" i] { fill: var(--brand-600); }
[stroke="#9CCBB2" i] { stroke: var(--brand-300); } [fill="#9CCBB2" i] { fill: var(--brand-300); }
[stroke="#9DB8AC" i] { stroke: var(--brand-300); } [fill="#9DB8AC" i] { fill: var(--brand-300); }
[stroke="#B9D3CA" i] { stroke: var(--brand-200); } [fill="#B9D3CA" i] { fill: var(--brand-200); }
[stroke="#C8D9CF" i] { stroke: var(--brand-200); } [fill="#C8D9CF" i] { fill: var(--brand-200); }
[stroke="#B9CFC5" i] { stroke: var(--brand-200); } [fill="#B9CFC5" i] { fill: var(--brand-200); }
[stroke="#D6ECE3" i] { stroke: var(--brand-100); } [fill="#D6ECE3" i] { fill: var(--brand-100); }
[stroke="#CFE8DB" i] { stroke: var(--brand-100); } [fill="#CFE8DB" i] { fill: var(--brand-100); }
[stroke="#D3E8DC" i] { stroke: var(--brand-100); } [fill="#D3E8DC" i] { fill: var(--brand-100); }
[stroke="#DDEAE5" i] { stroke: var(--brand-100); } [fill="#DDEAE5" i] { fill: var(--brand-100); }
[stroke="#F1F8F4" i] { stroke: var(--brand-50); } [fill="#F1F8F4" i] { fill: var(--brand-50); }
