/* ==========================================================================
   MANARUS SABEEL — CORE DESIGN SYSTEM
   Shared variables, reset, and reusable components used across the public
   website and the management dashboard.
   ========================================================================== */

:root {
  /* Brand palette — inspired by the school flyer */
  --navy-900: #0c2a17;
  --navy-800: #123b21;
  --navy-700: #1a5230;
  --navy-600: #23683d;
  --purple-700: #2f633d;
  --purple-600: #3d8a52;
  --gold-500: #d9a441;
  --gold-400: #e8bd62;
  --gold-100: #fbf1dc;
  --white: #ffffff;
  --gray-50: #f6f9f6;
  --gray-100: #edf2ee;
  --gray-200: #dfe7e1;
  --gray-300: #cbd0e0;
  --gray-400: #9aa1b8;
  --gray-500: #6b7290;
  --gray-600: #4c5273;
  --gray-700: #363b56;
  --gray-800: #232741;
  --success: #1a9c62;
  --success-bg: #e6f8ef;
  --danger: #d3413f;
  --danger-bg: #fceaea;
  --warning: #c9821a;
  --warning-bg: #fdf1de;
  --info: #2461c9;
  --info-bg: #e8f0fd;

  --font-heading: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(12, 42, 23, 0.08);
  --shadow-md: 0 6px 20px rgba(12, 42, 23, 0.10);
  --shadow-lg: 0 16px 40px rgba(12, 42, 23, 0.16);

  --transition: 180ms ease;
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--navy-800);
  line-height: 1.25;
  margin: 0 0 .5em;
}
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.2em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}
.section-title .eyebrow {
  display: inline-block;
  color: var(--purple-600);
  background: var(--gold-100);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}
.section-title h2 { font-size: 2rem; margin-bottom: .5em; }
.section-title p { color: var(--gray-500); font-size: 1.05rem; }
.section-title.left { text-align: left; margin: 0 0 40px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold-500); color: var(--navy-900); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--gold-400); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--white); color: var(--navy-800); border-color: var(--gray-200); }
.btn-secondary:hover { border-color: var(--navy-700); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-navy { background: var(--navy-800); color: var(--white); }
.btn-navy:hover { background: var(--navy-700); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { opacity: .9; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; width: 38px; height: 38px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 24px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h3 { margin: 0; font-size: 1.05rem; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-purple { background: #e8f3ea; color: var(--purple-600); }
.badge-gold { background: var(--gold-100); color: #96700f; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
label, .form-label {
  display: block;
  font-weight: 600;
  font-size: .86rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}
label .req { color: var(--danger); }
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"], input[type="file"],
select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .92rem;
  color: var(--gray-800);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(29, 48, 120, .12);
}
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; display: none; }
.has-error .form-control, .has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.has-error .form-error { display: block; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th, .data-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  font-size: .88rem;
  white-space: nowrap;
}
.data-table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .05em;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table td.wrap { white-space: normal; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11, 21, 51, .55);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn .18s ease;
}
.modal.modal-lg { max-width: 780px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.3rem; color: var(--gray-400); line-height: 1; }
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------- Toasts ---------------- */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: var(--navy-900); color: var(--white);
  padding: 14px 18px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .2s ease;
  border-left: 4px solid var(--gold-500);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast.hide { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; padding: 12px 18px; font-weight: 600;
  font-size: .88rem; color: var(--gray-500); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }
.tab-panel { display: none; padding-top: 24px; }
.tab-panel.active { display: block; }

/* ---------------- Alerts ---------------- */
.alert { padding: 14px 18px; border-radius: var(--radius-md); font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--gray-500); flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--navy-700); }
.breadcrumbs .sep { color: var(--gray-300); }

/* ---------------- Pagination ---------------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200); background: var(--white);
  font-size: .82rem; font-weight: 600; color: var(--gray-600);
}
.page-btn.active { background: var(--navy-800); color: var(--white); border-color: var(--navy-800); }
.page-btn:hover:not(.active) { border-color: var(--navy-600); }

/* ---------------- Empty / Loading states ---------------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }
.empty-state i { font-size: 2.6rem; color: var(--gray-300); margin-bottom: 14px; display: block; }
.empty-state h4 { color: var(--gray-700); margin-bottom: 6px; }
.loading-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--gray-200); border-top-color: var(--navy-700);
  border-radius: 50%; margin: 0 auto 14px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Misc utilities ---------------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: .85rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-8{margin-top:8px;} .mt-16{margin-top:16px;} .mt-24{margin-top:24px;} .mt-32{margin-top:32px;}
.mb-8{margin-bottom:8px;} .mb-16{margin-bottom:16px;} .mb-24{margin-bottom:24px;}
.w-full { width: 100%; }
.divider { height: 1px; background: var(--gray-200); border: none; margin: 24px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy-700); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar-gold { background: var(--gold-500); color: var(--navy-900); }

/* Logo mark used everywhere */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-700), var(--purple-700));
  color: var(--gold-400); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.05rem; flex-shrink: 0;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-text .name { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: var(--navy-800); line-height: 1.1; }
.brand-text .tagline { font-size: .68rem; color: var(--gold-500); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

@media (max-width: 900px) {
  .form-row, .form-row-3, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   MANARUS SABEEL — brand additions
   ========================================================================== */
/* The logo is a round seal on white, so its badge is a white circle rather
   than the old coloured monogram tile. */
.brand-mark.has-logo { background: var(--white); border-radius: 50%; padding: 2px; box-shadow: 0 0 0 2px var(--gold-500); }
.brand-mark.has-logo img { border-radius: 50%; object-fit: contain; }
.arabic, [lang="ar"] { font-family: 'Amiri', 'Traditional Arabic', serif; direction: rtl; unicode-bidi: isolate; }
.brand-text .arabic { display: block; font-size: .82rem; color: var(--purple-700); line-height: 1.3; }
