/* Shared pieces: page header, stats, tabs, cards, forms, buttons, filters, tables, leadership, the ID card
   Moved out of styles.css on 2026-11-05 (one big file split by section; the rules are unchanged and in the same order).
   Every page links this file right after css/components.css. */

/* ─── MAIN CONTENT ─── */
main { padding-top: 28px; padding-bottom: 36px; }
.page-container { display: flex; flex-direction: column; gap: 20px; }

/* Page Header */
.page-hdr { margin-bottom: 6px; }
.page-hdr h1, .page-hdr h2 { font-size: 22px; font-weight: 800; color: var(--t1); }
.page-hdr p { font-size: 13px; color: var(--t2); margin-top: 4px; }
.page-hdr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.page-hdr-row h1, .page-hdr-row h2 { font-size: 22px; font-weight: 800; color: var(--t1); }
.page-hdr-row p { font-size: 13px; color: var(--t2); margin-top: 4px; }

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 820px) { .stats-row { grid-template-columns: 1fr 1fr; } }

@media (max-width: 440px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-box { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 12px; }
  .stat-ico { width: 36px; height: 36px; font-size: 16px; }
  .stat-n { font-size: 22px; }
}

.stat-box {
  background: var(--card);
  border: 1px solid var(--b1);
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-ico.gold   { background: rgba(212, 160, 23, 0.12); color: var(--gold); }
.stat-ico.blue   { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.stat-ico.purple { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }
.stat-ico.red    { background: rgba(239, 68, 68, 0.12);  color: #f87171; }
.stat-ico.green  { background: rgba(34, 197, 94, 0.12);  color: #4ade80; }
.stat-n { font-size: 26px; font-weight: 900; color: var(--t1); line-height: 1; }
.stat-l { font-size: 12px; color: var(--t2); margin-top: 4px; font-weight: 600; }

/* ─── VERIFICATION GUIDELINES (INSIDE APPLY PAGE) ─── */
.verify-rules-card {
  background: rgba(212, 160, 23, 0.04);
  border: 1px solid rgba(212, 160, 23, 0.22);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.verify-rules-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}
.verify-rules-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 20px;
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
}
.verify-rules-list li span { color: var(--t1); font-weight: 700; }

/* ─── CARD ─── */
.card { background: var(--card); border: 1px solid var(--b1); border-radius: 14px; overflow: hidden; }
.card-hdr {
  padding: 16px 22px;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-hdr h2, .card-hdr h3 { font-size: 15px; font-weight: 800; color: var(--t1); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 0; }

/* ─── FORM CONTROLS ─── */
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg label { font-size: 12px; font-weight: 700; color: var(--t2); }
.fg input, .fg textarea, .fg select {
  background: var(--s);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--t1);
  padding: 11px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.fg input:focus, .fg textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
  outline: none;
}
.fg input::placeholder, .fg textarea::placeholder { color: var(--t3); }
/* قيمة الجائزة: علامة $ ثابتة، والخانة نفسها بلا حدود (الإطار على الغلاف) */
.money-input { display: flex; align-items: stretch; border: 1px solid var(--b2); border-radius: 8px; background: var(--s); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.money-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12); }
.money-input .money-sign { display: flex; align-items: center; padding: 0 12px; color: var(--t2); font-weight: 800; border-inline-end: 1px solid var(--b2); }
.money-input input { flex: 1; min-width: 0; border: none; background: transparent; padding: 11px 14px; font-size: 14px; color: var(--t1); }
.money-input input:focus { outline: none; box-shadow: none; }

.fg textarea { resize: vertical; min-height: 80px; }
.fsec {
  font-size: 11px;
  font-weight: 800;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.fsec:first-child { margin-top: 0; }
.fsec i { color: var(--gold); }

/* Radio Options */
.rg { display: flex; gap: 8px; flex-wrap: wrap; }
.ro {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--b2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  background: var(--s);
  transition: all .15s;
  user-select: none;
}
.ro:has(input:checked) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 160, 23, 0.07);
}
.ro input { display: none; }

/* ─── CAMERA CAPTURE BOX ─── */
.camera-box {
  border: 1.5px dashed var(--b2);
  border-radius: 12px;
  background: var(--s);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s;
}
.camera-box.captured { border-color: var(--green); background: rgba(34, 197, 94, 0.03); }

/* Upload zone fallback */
.upz {
  border: 1.5px dashed var(--b2);
  border-radius: 10px;
  background: var(--s);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upz:hover { border-color: var(--gold); background: rgba(212, 160, 23, 0.04); }
.upz.done { border-color: var(--green); background: rgba(34, 197, 94, 0.04); }
.upz-inner { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px; }
.upz-inner i { font-size: 22px; color: var(--t3); }
.upz-inner span { font-size: 12px; font-weight: 600; color: var(--t2); }
.upz-inner small { font-size: 11px; color: var(--t3); }
.upz-preview img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }
.upz-fname { font-size: 11px; color: var(--green); font-weight: 600; text-align: center; padding: 4px 8px; }

/* Age Box */
.age-box {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--b2);
  background: rgba(212, 160, 23, 0.06);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

/* Form Footer */
.form-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--b1);
  padding-top: 18px;
  margin-top: 22px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { opacity: .88; }

.btn-ghost { background: transparent; color: var(--t2); border: 1px solid var(--b2); }
.btn-ghost:hover { background: var(--card); color: var(--t1); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-success { background: var(--green); color: #000; }
.btn-success:hover { opacity: .88; }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ─── FILTER ROW ─── */
.frow { display: flex; gap: 6px; flex-wrap: wrap; }
.fbtn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--s);
  border: 1px solid var(--b1);
  color: var(--t2);
  cursor: pointer;
  transition: all .15s;
}
.fbtn:hover { border-color: var(--b2); color: var(--t1); }
.fbtn.active { background: rgba(212, 160, 23, 0.1); border-color: var(--gold); color: var(--gold); }

/* ─── TABLE ─── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; text-align: right; }
.tbl th {
  background: var(--s);
  padding: 12px 14px;
  color: var(--t2);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--b1);
  white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--b1); color: var(--t1); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--t2); }

/* phone: a wide admin table becomes one card per row (a label next to every value) instead of a sideways-scrolling strip */
@media (max-width: 700px) {
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
  .tbl-stack thead { display: none; }
  .tbl-stack tr { background: var(--card); border: 1px solid var(--b1); border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
  .tbl-stack tbody tr:hover { background: var(--card); }
  .tbl-stack td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--b1);
                  text-align: right !important; max-width: none !important; min-width: 0; overflow-wrap: anywhere; }
  .tbl-stack tr td:last-child { border-bottom: 0; }
  .tbl-stack td::before { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--t3); }
  .tbl-stack td[colspan]::before { content: none; }
  .tbl-stack td[colspan] { display: block; }
  .tbl-evreq td:nth-child(1):not([colspan])::before { content: 'المنظمة'; } .tbl-evreq td:nth-child(2):not([colspan])::before { content: 'الروستر'; }
  .tbl-evreq td:nth-child(3):not([colspan])::before { content: 'اللاعبين'; } .tbl-evreq td:nth-child(4):not([colspan])::before { content: 'الحالة'; }
  .tbl-evreq td:nth-child(5):not([colspan])::before { content: 'التوقيت'; } .tbl-evreq td:nth-child(6):not([colspan])::before { content: 'سبب الرفض'; }
  .tbl-evroom td:nth-child(1):not([colspan])::before { content: 'المركز'; } .tbl-evroom td:nth-child(2):not([colspan])::before { content: 'الفريق'; }
  .tbl-evroom td:nth-child(3):not([colspan])::before { content: 'كيل'; } .tbl-evroom td:nth-child(4):not([colspan])::before { content: 'نقاط'; }
  .tbl-orgs td:nth-child(1):not([colspan])::before { content: 'المنظمة'; }
  .tbl-orgs td:nth-child(2):not([colspan])::before { content: 'التصنيف'; }
  .tbl-orgs td:nth-child(3):not([colspan])::before { content: 'الحساب (UID)'; }
  .tbl-orgs td:nth-child(4):not([colspan])::before { content: 'فُتحت'; }
  .tbl-orgs td:nth-child(5):not([colspan])::before { content: 'الحالة'; }
  .tbl-orgs td:nth-child(6):not([colspan])::before { content: 'إجراءات'; }
  .tbl-blk td:nth-child(1):not([colspan])::before { content: 'الكود'; }
  .tbl-blk td:nth-child(2):not([colspan])::before { content: 'المخالف'; }
  .tbl-blk td:nth-child(3):not([colspan])::before { content: 'رقم الهاتف'; }
  .tbl-blk td:nth-child(4):not([colspan])::before { content: 'أرسله (Gmail)'; }
  .tbl-blk td:nth-child(5):not([colspan])::before { content: 'السبب'; }
  .tbl-blk td:nth-child(6):not([colspan])::before { content: 'صور الإثبات'; }
  .tbl-blk td:nth-child(7):not([colspan])::before { content: 'التاريخ'; }
  .tbl-blk td:nth-child(8):not([colspan])::before { content: 'الحالة'; }
  .tbl-blk td:nth-child(9):not([colspan])::before { content: 'إجراء'; }
  .tbl-audit td:nth-child(1):not([colspan])::before { content: 'الوقت'; }
  .tbl-audit td:nth-child(2):not([colspan])::before { content: 'الإجراء'; }
  .tbl-audit td:nth-child(3):not([colspan])::before { content: 'الجهة'; }
  .tbl-audit td:nth-child(4):not([colspan])::before { content: 'بواسطة'; }
  .tbl-audit td:nth-child(5):not([colspan])::before { content: 'ملاحظات'; }
}

/* admin: one scrim / tournament's full file (js/admin-events.js) */
.adm-ev { border: 1px solid var(--b1); border-radius: 14px; padding: 12px; margin-bottom: 14px; background: var(--card); }
.adm-ev-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.adm-ev-details { margin-top: 12px; border-top: 1px dashed var(--b2); padding-top: 12px; }
.adm-ev-sec { margin-bottom: 18px; }
.adm-ev-sec h4 { font-size: 14px; font-weight: 900; color: var(--gold); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.adm-ev-sec h5 { font-size: 13px; font-weight: 800; color: var(--t1); margin: 12px 0 6px; }
.adm-ev-sec details { margin-top: 8px; }
.adm-ev-sec summary { cursor: pointer; color: var(--t2); font-weight: 700; font-size: 13px; }
.adm-ev-banner img { width: 100%; max-width: 640px; border-radius: 10px; cursor: zoom-in; display: block; }
.adm-room { margin-top: 10px; }
.adm-ev-warn { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .1); color: #fca5a5; font-size: 13px; margin: 8px 0; }
.adm-ev-warn ul { margin: 6px 0 0; padding-inline-start: 18px; line-height: 1.9; }

/* an organization's leadership: the form in the panel settings and the strip on the public page */
.leaders-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.leader-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1.35fr) auto; gap: 8px; align-items: center; }
.leader-row.has-error > input, .leader-row.has-error .ph-input { border-color: rgba(239, 68, 68, 0.7); }
.leaders-grid:empty { display: none; }
[data-field="leaders"] .leaders-grid { margin-bottom: 10px; }
.leader-role { font-size: 12.5px; font-weight: 900; color: var(--gold); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 560px) {
  .leader-row { grid-template-columns: minmax(0, 1fr) auto; }
  .leader-row > .leader-role { grid-row: 1; grid-column: 1; }
  .leader-row > .link-x { grid-row: 1; grid-column: 2; }
  .leader-row > input { grid-row: 2; grid-column: 1 / -1; }
  .leader-row > [data-phone-field] { grid-row: 3; grid-column: 1 / -1; }
}
.org-leaders { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.org-leader { display: inline-flex; align-items: center; gap: 8px; }
.org-leader > i { color: var(--gold); }
