:root {
  --brand: #C8102E;          /* HHC-KSMC red */
  --brand-dark: #8E0B20;
  --brand-soft: #fbe9ec;
  --teal: #0E7C86;
  --teal-dark: #0a5b63;
  --ink: #1f2733;
  --muted: #64748b;
  --bg: #f6f8fb;
  --card: #ffffff;
  --line: #e6eaf0;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
body.rtl { direction: rtl; font-family: "Tajawal", "Segoe UI", system-ui, sans-serif; }

a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }

/* ---------- Layout helpers ---------- */
.container { width: min(1140px, 92vw); margin: 0 auto; }
.section { padding: 72px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 24px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logos { display: flex; align-items: center; gap: 18px; }
.logo-chip {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--ink);
}
.logo-chip img { height: 38px; width: auto; object-fit: contain; }
.logo-fallback {
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12px;
  border: 1px solid #f1c9d1; white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: none; border-radius: 12px; padding: 12px 20px; font-size: 15px; font-weight: 600;
  background: var(--brand); color: #fff; transition: transform .15s ease, box-shadow .2s ease, background .2s;
  box-shadow: 0 6px 16px rgba(200,16,46,.25);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(200,16,46,.32); }
.btn.secondary { background: var(--teal); box-shadow: 0 6px 16px rgba(14,124,134,.25); }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card-hover { transition: transform .25s ease, box-shadow .25s ease; }
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #344054; }
.input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s;
}
.input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { min-height: 90px; resize: vertical; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: start; border-bottom: 1px solid var(--line); }
th { background: #fafbfc; font-weight: 700; color: #475467; position: sticky; top: 0; }
tbody tr:hover { background: #fafcff; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 62vh; }

/* ---------- Badges & toasts ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.new { background: #eef2ff; color: #4338ca; }
.badge.reviewed { background: #ecfdf5; color: #047857; }
.badge.scheduled { background: #fef3c7; color: #b45309; }
.badge.contacted { background: #e0f2fe; color: #0369a1; }
.badge.closed { background: #f1f5f9; color: #475569; }

#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s; max-width: 360px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.ok { background: #15803d; }
#toast.err { background: #b91c1c; }
body.rtl #toast { right: auto; left: 24px; }

/* ---------- Animations ---------- */
@keyframes floatUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.14); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}
.reveal { opacity: 0; }
.reveal.in { animation: floatUp .7s ease forwards; }
.beat { animation: beat 1.6s ease-in-out infinite; transform-origin: center; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab {
  padding: 12px 18px; cursor: pointer; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; font-size: 15px;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.hidden { display: none !important; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stat-num { font-size: 34px; font-weight: 800; color: var(--brand); }
.stat-label { color: var(--muted); font-size: 14px; }

footer.site { padding: 28px 0; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 40px; }
