/* ============================================================
   kafala.css — النمط العام لجميع صفحات المستخدم
   جمعية القطيف الخيرية
   ============================================================ */

/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #1a6b4a;
  --green-mid:  #228b5e;
  --green-lt:   #e8f5ee;
  --green-dk:   #0f4a33;
  --gold:       #c8972a;
  --gold-lt:    #fdf6e3;
  --gold-dk:    #8a6010;
  --purple:     #6b3fa0;
  --purple-lt:  #f3eeff;
  --blue:       #1e5fa8;
  --blue-lt:    #eaf1fb;
  --red:        #c0392b;
  --red-lt:     #fdf0ee;
  --text:       #1a1f1c;
  --text-mute:  #6b7b72;
  --text-hint:  #9aada5;
  --border:     #d4e2d9;
  --bg:         #f0f6f3;
  --white:      #ffffff;
  --radius:     14px;
  --radius-lg:  20px;
  --shadow:     0 2px 20px rgba(26,107,74,.08);
  --shadow-md:  0 4px 28px rgba(26,107,74,.13);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  direction: rtl;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-weight: 700; color: var(--text); }
a { color: var(--green); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }

/* ===== NAVBAR ===== */
.navbar {
  background: var(--green-dk);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.18);
}
.navbar .brand { display: flex; align-items: center; gap: 12px; }
.navbar .brand-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.navbar .brand-icon svg { width: 22px; height: 22px; fill: #fff; }
.navbar .brand-name { font-size: 16px; font-weight: 700; color: #fff; }
.navbar .brand-sub  { font-size: 11px; color: rgba(255,255,255,.6); margin-top: -2px; }
.navbar .nav-right  { display: flex; align-items: center; gap: 16px; }
.navbar .greeting   { font-size: 13.5px; color: rgba(255,255,255,.8); }
.navbar .greeting strong { color: #fff; }

/* ===== CONTAINER ===== */
.container { max-width: 1040px; margin: 0 auto; padding: 36px 24px 60px; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 36px 24px 60px; }
.container-md { max-width: 840px; margin: 0 auto; padding: 36px 24px 60px; }

/* ===== CARD ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26,107,74,.07);
  margin-bottom: 22px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--green-lt);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  border: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; flex-shrink: 0; }
.btn-primary   { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(26,107,74,.28); }
.btn-primary:hover { background: var(--green-mid); box-shadow: 0 6px 18px rgba(26,107,74,.35); }
.btn-gold      { background: var(--gold); color: #fff; box-shadow: 0 4px 14px rgba(200,151,42,.30); }
.btn-gold:hover { filter: brightness(1.08); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-outline   { background: var(--white); color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-sm        { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn:active    { transform: scale(.98); }

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-green  { background: var(--green-lt);  color: var(--green); }
.badge-gold   { background: var(--gold-lt);   color: var(--gold-dk); }
.badge-red    { background: var(--red-lt);    color: var(--red); }
.badge-gray   { background: #f0f0ef;          color: var(--text-mute); }
.badge-blue   { background: var(--blue-lt);   color: var(--blue); }

/* ===== FORM ===== */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 7px; }
.form-label .req { color: var(--red); margin-right: 2px; }
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: 'Tajawal', sans-serif;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  direction: rtl;
}
.form-input:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(34,139,94,.1); }
.form-input.is-error { border-color: var(--red); background: var(--red-lt); }
.form-input.is-error:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.1); }
select.form-input { background: var(--white); }
textarea.form-input { resize: vertical; min-height: 90px; }

/* ===== ALERTS ===== */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.55;
}
.alert-success { background: var(--green-lt); color: var(--green);   border: 1px solid rgba(26,107,74,.2); }
.alert-error   { background: var(--red-lt);   color: var(--red);     border: 1px solid rgba(192,57,43,.2); }
.alert-warning { background: var(--gold-lt);  color: var(--gold-dk); border: 1px solid rgba(200,151,42,.2); }
.alert-info    { background: var(--blue-lt);  color: var(--blue);    border: 1px solid rgba(30,95,168,.2); }

/* ===== TABLE ===== */
.table-wrap { overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid rgba(26,107,74,.07); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--green-lt);
  font-size: 13px; font-weight: 600;
  color: var(--green);
  padding: 12px 18px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid rgba(212,226,217,.45);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(232,245,238,.38); }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(26,107,74,.07);
}
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; }
.stat-icon.green  { background: var(--green-lt); color: var(--green); }
.stat-icon.gold   { background: var(--gold-lt);  color: var(--gold); }
.stat-icon.red    { background: var(--red-lt);   color: var(--red); }
.stat-icon.blue   { background: var(--blue-lt);  color: var(--blue); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-mute); margin-top: 4px; }

/* ===== SECTION HEADING ===== */
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before { content: ''; width: 4px; height: 20px; background: var(--green); border-radius: 4px; }

/* ===== LOGOUT BTN ===== */
.btn-logout {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-logout:hover { background: rgba(255,255,255,.22); }
.btn-logout svg   { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.8);
  font-size: 14px;
  text-decoration: none;
  transition: color .2s;
}
.back-link:hover { color: #fff; }
.back-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; justify-content: center; padding-top: 20px; }
.page-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  text-decoration: none;
  color: var(--text);
  transition: all .18s;
}
.page-btn:hover  { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-mute); }
.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: .4; }
.empty-state p { font-size: 15px; line-height: 1.6; }
.empty-state a { color: var(--green); font-weight: 600; }

/* ===== HERO BANNER ===== */
.page-hero {
  border-radius: var(--radius-lg);
  padding: 36px;
  color: #fff;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.page-hero.green { background: linear-gradient(135deg, var(--green-dk) 0%, var(--green-mid) 100%); }
.page-hero.gold  { background: linear-gradient(135deg, #7a5010 0%, var(--gold) 100%); }
.page-hero h1    { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.page-hero p     { font-size: 14px; opacity: .85; line-height: 1.65; max-width: 520px; }
.page-hero .hero-emoji {
  position: absolute;
  left: 28px; top: 50%;
  transform: translateY(-50%);
  font-size: 80px; opacity: .12;
  pointer-events: none;
}

/* ===== NOTICE BAR ===== */
.notice-bar {
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 20px;
}
.notice-bar svg { flex-shrink: 0; width: 18px; height: 18px; }
.notice-bar.gold   { background: var(--gold-lt);  color: #7a5a10; border: 1px solid rgba(200,151,42,.25); }
.notice-bar.gold svg { stroke: var(--gold); }
.notice-bar.green  { background: var(--green-lt); color: var(--green); border: 1px solid rgba(26,107,74,.2); }
.notice-bar.green svg { stroke: var(--green); }

/* ===== DETAIL ROW ===== */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(212,226,217,.4);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .dk { color: var(--text-mute); }
.detail-row .dv { font-weight: 600; color: var(--text); text-align: left; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container, .container-sm, .container-md { padding: 20px 16px 40px; }
  .navbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
  .card { padding: 20px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn { padding: 9px 16px; font-size: 13px; }
  .navbar .greeting { display: none; }
}
