/* style.css — تنسيق مكتوب يدويًا بالكامل (بدون أي إطار عمل أو اتصال خارجي) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Tahoma, "Cairo", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ---------- الألوان ---------- */
:root {
  --brand-50:#f5fbe9; --brand-100:#e8f6cf; --brand-200:#d3eeaa; --brand-300:#b9e47f;
  --brand-400:#92db5b; --brand-500:#6fc03e; --brand-600:#3f8420; --brand-700:#316a19;
  --brand-800:#274f15; --brand-900:#1d3a10;
  --gray-50:#fafafa; --gray-100:#f5f5f5; --gray-200:#e5e5e5; --gray-300:#d4d4d4;
  --gray-400:#a3a3a3; --gray-500:#737373; --gray-600:#525252; --gray-700:#404040;
  --gray-800:#262626; --gray-900:#171717;
  --red-50:#fef2f2; --red-200:#fecaca; --red-300:#fca5a5; --red-600:#dc2626; --red-700:#b91c1c; --red-800:#991b1b;
  --amber-50:#fffbeb; --amber-200:#fde68a; --amber-700:#b45309; --amber-800:#92400e;
}

.bg-white{background:#fff}
.bg-gray-50{background:var(--gray-50)}
.bg-gray-100{background:var(--gray-100)}
.bg-gray-900{background:var(--brand-700)}
.bg-brand-600{background:var(--brand-600)}
.bg-brand-50{background:var(--brand-50)}
.bg-red-50{background:var(--red-50)}
.bg-amber-50{background:var(--amber-50)}
.bg-gray-50\/badge{background:var(--gray-50)}
.hover\:bg-brand-700:hover{background:var(--brand-700)}
.hover\:bg-gray-700:hover{background:var(--brand-800)}
.hover\:bg-red-50:hover{background:var(--red-50)}

.text-white{color:#fff}
.text-gray-200{color:var(--gray-200)}
.text-gray-400{color:var(--gray-400)}
.text-gray-500{color:var(--gray-500)}
.text-gray-600{color:var(--gray-600)}
.text-gray-700{color:var(--gray-700)}
.text-gray-800{color:var(--gray-800)}
.text-gray-900{color:var(--gray-900)}
.text-brand-700{color:var(--brand-700)}
.text-brand-800{color:var(--brand-800)}
.text-red-600{color:var(--red-600)}
.text-red-800{color:var(--red-800)}
.text-amber-700{color:var(--amber-700)}
.text-amber-800{color:var(--amber-800)}
.hover\:text-brand-700:hover{color:var(--brand-700)}
.hover\:text-red-600:hover{color:var(--red-600)}
.hover\:border-brand-300:hover{border-color:var(--brand-300)}
.border-red-200{border-color:var(--red-200)}
.border-brand-200{border-color:var(--brand-200)}

/* ألوان ديناميكية للشارات والتنبيهات (brand / red / amber / gray) */
.badge-brand{background:var(--brand-50);color:var(--brand-700)}
.badge-red{background:var(--red-50);color:var(--red-800)}
.badge-amber{background:var(--amber-50);color:var(--amber-800)}
.badge-gray{background:var(--gray-100);color:var(--gray-700)}
.flash-brand{background:var(--brand-50);border-color:var(--brand-200);color:var(--brand-800)}
.flash-red{background:var(--red-50);border-color:var(--red-200);color:var(--red-800)}
.flash{border-radius:.75rem;padding:.75rem 1rem;font-size:.875rem;font-weight:600;border:1px solid transparent}
.badge{display:inline-block;font-size:.75rem;font-weight:700;padding:.375rem .625rem;border-radius:9999px}
.badge-brand{background:var(--brand-50);color:var(--brand-700)}
.badge-amber{background:var(--amber-50);color:var(--amber-800)}
.badge-gray{background:var(--gray-100);color:var(--gray-700)}
.badge-red{background:var(--red-50);color:var(--red-800)}

.border{border:1px solid var(--gray-200)}
.border-gray-100{border-color:var(--gray-100)}
.border-gray-200{border-color:var(--gray-200)}
.border-gray-300{border-color:var(--gray-300)}
.border-red-300{border-color:var(--red-300)}
.border-dashed{border-style:dashed}
.border-b{border-bottom:1px solid var(--gray-200)}
.border-t{border-top:1px solid var(--gray-100)}

.rounded-lg{border-radius:.5rem}
.rounded-xl{border-radius:.75rem}
.rounded-2xl{border-radius:1rem}
.rounded-full{border-radius:9999px}

/* ---------- التخطيط ---------- */
.block{display:block}
.inline-block{display:inline-block}
.hidden{display:none}
.flex{display:flex}
.flex-1{flex:1 1 0%}
.flex-col{flex-direction:column}
.grid{display:grid}
.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}
.items-center{align-items:center}
.justify-between{justify-content:space-between}
.justify-start{justify-content:flex-start}
.justify-end{justify-content:flex-end}
.gap-2{gap:.5rem}
.gap-3{gap:.75rem}
.gap-4{gap:1rem}
.gap-6{gap:1.5rem}
.space-y-2>*+*{margin-top:.5rem}
.space-y-3>*+*{margin-top:.75rem}
.space-y-4>*+*{margin-top:1rem}
.shrink-0{flex-shrink:0}
.sticky{position:sticky}
.top-0{top:0}
.z-30{z-index:30}
.overflow-x-auto{overflow-x:auto}
.overflow-y-auto{overflow-y:auto}
.transition{transition:all .15s ease}
.opacity-70{opacity:.7}

/* ---------- الأحجام ---------- */
.w-9{width:2.25rem} .h-9{height:2.25rem}
.h-16{height:4rem}
.h-36{height:9rem}
.max-h-96{max-height:24rem}
.object-cover{object-fit:cover}
.w-full{width:100%}
.min-h-screen{min-height:100vh}
.max-w-md{max-width:28rem}
.max-w-2xl{max-width:42rem}
.max-w-3xl{max-width:48rem}
.max-w-4xl{max-width:56rem}
.max-w-6xl{max-width:72rem}
.max-w-\[75\%\]{max-width:75%}
.h-\[65vh\]{height:65vh}

/* ---------- الهوامش والحشو ---------- */
.mx-auto{margin-left:auto;margin-right:auto}
.-mt-2{margin-top:-.5rem}
.mt-1{margin-top:.25rem} .mt-3{margin-top:.75rem} .mt-4{margin-top:1rem}
.mt-5{margin-top:1.25rem} .mt-8{margin-top:2rem} .mt-12{margin-top:3rem}
.mb-1{margin-bottom:.25rem} .mb-2{margin-bottom:.5rem} .mb-3{margin-bottom:.75rem}
.mb-4{margin-bottom:1rem} .mb-6{margin-bottom:1.5rem} .mb-8{margin-bottom:2rem} .mb-10{margin-bottom:2.5rem}
.p-4{padding:1rem} .p-5{padding:1.25rem} .p-6{padding:1.5rem} .p-7{padding:1.75rem}
.px-2\.5{padding-left:.625rem;padding-right:.625rem}
.px-3{padding-left:.75rem;padding-right:.75rem}
.px-4{padding-left:1rem;padding-right:1rem}
.px-5{padding-left:1.25rem;padding-right:1.25rem}
.px-6{padding-left:1.5rem;padding-right:1.5rem}
.py-1{padding-top:.25rem;padding-bottom:.25rem}
.py-2{padding-top:.5rem;padding-bottom:.5rem}
.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}
.py-3{padding-top:.75rem;padding-bottom:.75rem}
.py-8{padding-top:2rem;padding-bottom:2rem}
.py-10{padding-top:2.5rem;padding-bottom:2.5rem}
.py-14{padding-top:3.5rem;padding-bottom:3.5rem}
.py-16{padding-top:4rem;padding-bottom:4rem}
.py-20{padding-top:5rem;padding-bottom:5rem}
.pt-5{padding-top:1.25rem} .pt-10{padding-top:2.5rem}
.pb-3{padding-bottom:.75rem} .pb-8{padding-bottom:2rem} .pb-16{padding-bottom:4rem}

/* ---------- الطباعة ---------- */
.text-xs{font-size:.75rem;line-height:1rem}
.text-\[10px\]{font-size:10px}
.text-sm{font-size:.875rem;line-height:1.4}
.text-lg{font-size:1.125rem;line-height:1.6}
.text-xl{font-size:1.25rem;line-height:1.6}
.text-2xl{font-size:1.5rem;line-height:1.4}
.text-3xl{font-size:1.875rem;line-height:1.3}
.text-4xl{font-size:2.25rem;line-height:1.2}
.text-6xl{font-size:3.75rem;line-height:1}
.font-semibold{font-weight:600}
.font-bold{font-weight:700}
.font-extrabold{font-weight:800}
.font-black{font-weight:900}
.text-center{text-align:center}
.leading-6{line-height:1.5rem}
.leading-7{line-height:1.75rem}
.whitespace-pre-line{white-space:pre-line}
.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.line-clamp-3{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- عناصر النموذج ---------- */
.input, input[type=text], input[type=password], select, textarea {
  width:100%; border:1px solid var(--gray-300); border-radius:.5rem;
  padding:.625rem .75rem; font-size:.875rem; background:#fff;
}
.focus-ring:focus, input:focus, select:focus, textarea:focus {
  outline:none; box-shadow:0 0 0 2px var(--brand-500); border-color:transparent;
}

/* ---------- تدرّج الخلفية العلوية ---------- */
.bg-gradient-to-b.from-brand-50.to-transparent{background:linear-gradient(to bottom, var(--brand-50), rgba(255,255,255,0));}

/* ---------- التركيز (focus) على عناصر النموذج ---------- */
.focus\:outline-none:focus{outline:none}
.focus\:ring-2:focus, .focus\:ring-brand-500:focus{box-shadow:0 0 0 2px var(--brand-500)}

/* ---------- الظل عند التحويم ---------- */
.hover\:shadow-md:hover{box-shadow:0 4px 14px rgba(0,0,0,.08)}

/* ---------- الاستجابة ---------- */
@media (min-width:640px){
  .sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .sm\:col-span-2{grid-column:span 2 / span 2}
  .sm\:col-span-4{grid-column:span 4 / span 4}
  .sm\:flex-row{flex-direction:row}
  .sm\:inline{display:inline}
  .sm\:inline-block{display:inline-block}
  .sm\:text-4xl{font-size:2.25rem}
}
@media (min-width:768px){
  .md\:flex{display:flex}
  .md\:hidden{display:none}
}
@media (min-width:1024px){
  .lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* ---------- التعهد والعمولات ---------- */
.pledge-box{background:var(--brand-50);border:1px solid var(--brand-200);border-radius:1rem;padding:1rem;margin-top:1rem;color:var(--brand-800)}
.pledge-box summary{outline:none}
.pledge-form{display:flex;flex-direction:column;gap:.75rem;margin-top:.9rem;color:#262626}
.pledge-check{display:flex;gap:.6rem;align-items:flex-start;line-height:1.7}
.pledge-check input{margin-top:.35rem}
.pledge-table{width:100%;border-collapse:collapse;background:#fff;border:1px solid #e5e5e5;border-radius:.75rem;font-size:.875rem}
.pledge-table th,.pledge-table td{padding:.65rem .8rem;border-bottom:1px solid #f5f5f5;text-align:right;vertical-align:top}
.pledge-table th{background:#fafafa;font-weight:800;color:#525252}
.cursor-pointer{cursor:pointer}

/* ---------- حقل رمز التحقق ---------- */
.code-input{letter-spacing:.45em;text-align:center;font-size:1.35rem;font-weight:800;direction:ltr}

/* ---------- أصناف مستعملة في القوالب وناقصة ---------- */
.place-items-center{place-items:center}
.mt-2{margin-top:.5rem}
.mt-10{margin-top:2.5rem}
.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}

.btn-reset{background:none;border:0;padding:0}

/* ---------- الإدارة وإدارة المحتوى وترقيم الصفحات ---------- */
.hp{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.admin-nav{display:flex;gap:.5rem;margin-bottom:1.25rem;flex-wrap:wrap}
.admin-nav a{padding:.45rem .9rem;border-radius:.6rem;background:#fff;border:1px solid #e5e5e5;font-size:.85rem;font-weight:700;color:#525252}
.admin-nav a.on{background:var(--brand-600);border-color:var(--brand-600);color:#fff}
.admin-actions{display:flex;flex-direction:column;gap:.4rem;align-items:flex-start;min-width:9rem}
.admin-actions form{margin:0}
.admin-inline{display:flex;gap:.3rem;align-items:center}
.admin-inline input{width:6rem}
.pagination{display:flex;gap:.4rem;justify-content:center;margin-top:1.75rem;flex-wrap:wrap}
.page-link{padding:.45rem .85rem;border:1px solid #e5e5e5;border-radius:.6rem;background:#fff;font-size:.85rem;font-weight:700;color:#525252}
.page-link.on{background:var(--brand-600);border-color:var(--brand-600);color:#fff}
.report-box{margin-top:1rem;font-size:.85rem;color:#737373}
.report-box summary{cursor:pointer}
.settings-grid{display:grid;grid-template-columns:1fr;gap:1rem}
@media (min-width:900px){.settings-grid{grid-template-columns:repeat(3,1fr)}}
.settings-card{background:#fff;border:1px solid #e5e5e5;border-radius:1rem;padding:1rem;display:flex;flex-direction:column;gap:.6rem}
.bg-red-600{background:#dc2626}.hover\:bg-red-700:hover{background:#b91c1c}.text-red-700{color:#b91c1c}.mt-1{margin-top:.25rem}

/* نصوص المستخدمين الطويلة بلا مسافات لا تكسر التخطيط */
body{overflow-wrap:anywhere}
.bg-gray-700{background:#404040}
.flex-wrap{flex-wrap:wrap}
.px-2{padding-left:.5rem;padding-right:.5rem}

.owner-actions{display:flex;gap:1.25rem;align-items:center;flex-wrap:wrap;margin-bottom:1rem}.owner-actions form{margin:0}.owner-actions button{background:none;border:0;padding:0}
.hover\:text-red-700:hover{color:#b91c1c}.text-red-600{color:#dc2626}

/* ---------- علامات القراءة ---------- */
.msg-meta{display:flex;align-items:center;gap:.45rem;margin-top:.25rem;font-size:10px}
.msg-time{opacity:.7}
.ticks{font-weight:900;font-size:15px;letter-spacing:-.15em;line-height:1}
.ticks.sent{color:rgba(255,255,255,.6)}
.ticks.read{color:#d9f99d;text-shadow:0 0 1px rgba(0,0,0,.3)}

/* ---------- الشعار الرسمي ---------- */
.brand-logo{display:flex;align-items:center}
.brand-logo img{height:54px;width:auto;display:block}
@media (max-width:640px){.brand-logo img{height:44px}}
