@font-face { font-family: "NeoSans"; src: url("../fonts/NeoSansArabic.ttf") format("truetype"); font-display: swap; }
:root {
  --green: #077a3d; --green-d: #04502a; --green-l: #e7f5ec; --red: #d12128; --brown: #b5652a; --brown-l: #fbf0e6;
  --ink: #1d2721; --muted: #6b7570; --line: #e1e7e3; --bg: #f3f6f4; --card: #fff; --r: 14px;
  --shadow: 0 1px 2px rgba(16,40,26,.05), 0 6px 22px rgba(16,40,26,.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "NeoSans", Tahoma, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.75; font-size: 15px; }
a { color: var(--green); }
img { max-width: 100%; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- الشريط العلوي ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.topbar img { height: 60px; display: block; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: bold; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.on { background: var(--green-l); color: var(--green-d); }

/* ---------- الواجهة ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(255,255,255,.12), transparent 60%), linear-gradient(140deg, var(--green-d), var(--green) 70%); color: #fff; padding: 46px 0 120px; text-align: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6px; background: linear-gradient(90deg, var(--red) 0 33%, #fff 33% 66%, var(--brown) 66%); opacity: .9; }
.hero .kicker { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 4px 14px; border-radius: 999px; font-size: 13px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(22px, 4vw, 36px); margin-bottom: 10px; }
.hero p { max-width: 720px; margin: 0 auto; opacity: .92; }

.countdown { direction: ltr; display: flex; justify-content: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.countdown .u { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; min-width: 86px; padding: 10px 8px; backdrop-filter: blur(4px); }
.countdown .n { font-size: 34px; font-weight: bold; font-variant-numeric: tabular-nums; line-height: 1.2; }
.countdown .l { font-size: 12px; opacity: .85; }
.cd-title { margin-top: 22px; font-weight: bold; opacity: .95; }
.closed-banner { display: inline-block; margin-top: 24px; background: #fff; color: var(--red); padding: 10px 22px; border-radius: 999px; font-weight: bold; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: -84px; position: relative; z-index: 2; }
@media (max-width: 760px) { .choices { grid-template-columns: 1fr; } }
.choice { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.choice:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(16,40,26,.12); }
.choice .ic { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; background: var(--green-l); color: var(--green); margin-bottom: 14px; }
.choice.g .ic { background: var(--brown-l); color: var(--brown); }
.choice h2 { font-size: 21px; color: var(--green-d); }
.choice.g h2 { color: #8a4a1b; }
.choice ul { padding: 0 18px 0 0; margin: 6px 0 18px; color: #3a4640; flex: 1; }
.choice .btn { align-self: flex-start; }

.section { margin: 34px 0; }
.section > h2 { font-size: 20px; color: var(--green-d); display: flex; align-items: center; gap: 10px; }
.section > h2::before { content: ""; width: 6px; height: 22px; background: var(--brown); border-radius: 3px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; counter-reset: s; }
.steps div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: relative; padding-top: 44px; }
.steps div::before { counter-increment: s; content: counter(s); position: absolute; top: 12px; right: 16px; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: bold; }

/* ---------- عناصر عامة ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.two { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 10px 20px; font: inherit; font-weight: bold; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--green-d); }
.btn.brown { background: var(--brown); } .btn.brown:hover { background: #924f1f; }
.btn.light { background: #e9efeb; color: var(--green-d); } .btn.light:hover { background: #dce6e0; }
.btn.red { background: var(--red); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: var(--green-l); border-color: #a7d8b8; color: #0b5a2c; }
.alert.error { background: #fdeaea; border-color: #f0a9ab; color: #8d1217; }
.alert.info { background: #eaf2fb; border-color: #b4cdea; color: #174a7e; }
.alert.warn { background: #fff5e3; border-color: #f1cf8f; color: #7a4d00; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: bold; white-space: nowrap; }
.b-info { background: #e3eefa; color: #174a7e; } .b-ok { background: #dcf2e4; color: #0b5a2c; }
.b-danger { background: #fbdfe0; color: #8d1217; } .b-brown { background: var(--brown-l); color: #8a4a1b; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; font-size: 14px; vertical-align: middle; }
th { background: #f1f5f2; color: var(--green-d); font-size: 13px; position: sticky; top: 0; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }

/* ---------- النماذج ---------- */
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 18px; }
legend { font-weight: bold; color: var(--brown); padding: 0 8px; }
label { display: block; font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.req::after { content: " *"; color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #c9d2cd; border-radius: 9px; font: inherit; background: #fff; color: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(7,122,61,.15); border-color: var(--green); }
.err { color: var(--red); font-size: 12px; margin-top: 2px; }
.hint { color: var(--muted); font-size: 12px; }
.field { margin-bottom: 12px; }
.photo { width: 132px; height: 162px; border: 2px dashed #b9c4be; border-radius: 12px; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 13px; text-align: center; background: #fafcfb; cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.row { display: flex; gap: 18px; flex-wrap: wrap; } .row > .grow { flex: 1; min-width: 240px; }
.formhead { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.formhead .ic { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; background: var(--green-l); color: var(--green); flex: none; }
ol.docs { padding: 0 22px 0 0; margin: 0; }
ol.docs li { padding: 7px 4px; border-bottom: 1px dashed var(--line); }
ol.docs li:last-child { border: 0; }
.ref { font-size: 26px; font-weight: bold; color: var(--green-d); letter-spacing: 1px; direction: ltr; display: inline-block; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px; }

/* ---------- الإدارة ---------- */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--green-d); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { background: #fff; border-radius: 10px; padding: 6px; margin-bottom: 18px; }
.side .logo img { display: block; }
.side a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.85); text-decoration: none; padding: 9px 12px; border-radius: 9px; margin-bottom: 2px; font-weight: bold; font-size: 14px; }
.side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side a.on { background: #fff; color: var(--green-d); }
.side .who { font-size: 12px; opacity: .7; margin-top: 18px; padding: 0 12px; }
.content { padding: 22px; min-width: 0; }
.content > h1 { font-size: 22px; color: var(--green-d); }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .side .logo { width: 100%; margin-bottom: 6px; } .side .logo img { height: 40px; }
  .side .who { display: none; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .n { font-size: 30px; font-weight: bold; color: var(--green-d); line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi.accent .n { color: var(--brown); }
.bars td:first-child { width: 38%; } .bars td:last-child { width: 80px; white-space: nowrap; }
.bar { height: 10px; background: #e8eeea; border-radius: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.bar.b span { background: var(--brown); }
.daily { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.daily div { flex: 1; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.daily div:hover { background: var(--brown); }
.daily div:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; margin-bottom: 4px; }
.avatar { width: 36px; height: 44px; object-fit: cover; border-radius: 5px; background: #eee; display: block; }
.ph { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ph button { background: #eef3f0; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; color: var(--green-d); }
.counter { font-size: 12px; color: var(--muted); }
.preview { background: #f7faf8; border: 1px dashed #b9c4be; border-radius: 10px; padding: 12px; white-space: pre-wrap; font-size: 14px; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.info dt { color: var(--muted); font-size: 13px; } dl.info dd { margin: 0; font-weight: bold; }
.switch { display: flex; align-items: center; gap: 8px; font-weight: bold; }
.switch input { width: 20px; height: 20px; accent-color: var(--green); }
.region-choices { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.region-choices label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border: 1px solid #c9d2cd; border-radius: 9px; background: #fff; cursor: pointer; }
.region-choices label:has(input:checked) { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.region-choices input { width: 18px; height: 18px; accent-color: var(--green); }
.section-title { font-weight: bold; color: var(--brown); margin-bottom: 12px; font-size: 15px; }
.service-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.service-row .field { margin-bottom: 0; }
.dips { display: flex; flex-direction: column; gap: 8px; }
.dip-row { display: flex; gap: 8px; align-items: center; }
.dip-row input { flex: 1; }
.dip-del { flex: none; padding: 5px 12px; font-size: 16px; line-height: 1; }
.doc-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.doc-item { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; background: #f7faf8; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.doc-item label { flex: 1; min-width: 200px; margin: 0; }
.doc-item input[type=file] { flex: 0 1 300px; max-width: 100%; width: auto; }
.doc-item .err { flex-basis: 100%; }
.doc-note { background: var(--green-l); border: 1px solid #a7d8b8; color: #0b5a2c; border-radius: 10px; padding: 12px 16px; font-weight: bold; }

/* ---------- الاستدعاء ---------- */
.convoc { background: #fff; max-width: 820px; margin: 24px auto; padding: 40px 46px; border: 1px solid var(--line); }
.convoc .head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 3px solid var(--green); padding-bottom: 12px; margin-bottom: 20px; }
.convoc .head img { height: 74px; }
.convoc h1 { text-align: center; font-size: 30px; margin: 18px 0 24px; color: var(--green-d); }
@media print {
  .no-print, .topbar, .side, .footer { display: none !important; }
  body { background: #fff; } .admin { display: block; } .content { padding: 0; }
  .card, .convoc { border: 0; box-shadow: none; margin: 0; }
}
