/* =====================================================================
   بلقاس الخيرية — نظام التصميم
   مستوحى من هوية Medical App: teal ناعم + لمسات كهرمانية/كورال
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  /* الألوان الأساسية */
  --teal-900: #19514c;
  --teal-700: #2a8c83;
  --teal-600: #34a99e;
  --teal-500: #44b8ad;
  --teal-400: #6fc9c0;
  --teal-200: #b8e6e1;
  --teal-100: #d7f0ed;
  --teal-50:  #e9f6f5;

  --amber:    #f5a623;
  --amber-dk: #d98e12;
  --coral:    #ff8a6b;
  --coral-dk: #f06a48;

  --ink:      #1c3b3d;   /* نص أساسي */
  --ink-soft: #4a6b6d;   /* نص ثانوي */
  --muted:    #8aa3a3;   /* نص خافت */
  --line:     #e3eeed;   /* الحدود */
  --bg:       #e6f4f3;   /* خلفية الصفحة */
  --card:     #ffffff;

  --ok:       #2fae7a;
  --warn:     #f5a623;
  --danger:   #ec5b56;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --shadow-sm: 0 4px 14px rgba(42,140,131,.07);
  --shadow:    0 10px 34px rgba(42,140,131,.10);
  --shadow-lg: 0 18px 48px rgba(42,140,131,.16);

  --font: 'Tajawal', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ====================== أدوات عامة ====================== */
.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  padding: 12px 26px; border-radius: 999px; border: none;
  cursor: pointer; transition: .2s; white-space: nowrap;
}
.btn-primary { background: var(--teal-600); color: #fff; box-shadow: 0 8px 20px rgba(52,169,158,.32); }
.btn-primary:hover { background: var(--teal-700); transform: translateY(-2px); }
.btn-amber { background: var(--amber); color: #fff; box-shadow: 0 8px 20px rgba(245,166,35,.32); }
.btn-amber:hover { background: var(--amber-dk); transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--teal-700); border: 1.5px solid var(--teal-200); }
.btn-ghost:hover { border-color: var(--teal-500); background: var(--teal-50); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #f6cecb; }
.btn-danger:hover { background: #fdeceb; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px;
}
.badge-teal  { background: var(--teal-100); color: var(--teal-700); }
.badge-amber { background: #fdeecc; color: var(--amber-dk); }
.badge-ok    { background: #d8f5e8; color: #1e8a5c; }
.badge-warn  { background: #fdeecc; color: var(--amber-dk); }
.badge-danger{ background: #fbdedc; color: #c63c37; }
.badge-muted { background: #eef3f3; color: var(--ink-soft); }

/* ألوان مستويات التقييم */
.lvl-1 { background: #fbdedc; color: #c63c37; }
.lvl-2 { background: #fde2cf; color: #c96a1e; }
.lvl-3 { background: #fdeecc; color: var(--amber-dk); }
.lvl-4 { background: #def0e6; color: #2a8a5e; }
.lvl-5 { background: #d8f5e8; color: #1e8a5c; }
.lvl-0 { background: #eef3f3; color: var(--muted); }

/* ====================== الصفحة العامة (Landing) ====================== */
.public-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(233,246,245,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.public-nav .inner {
  max-width: 1180px; margin: 0 auto; padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; color: var(--teal-700); }
.brand .logo {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--teal-600); color: #fff;
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 8px 18px rgba(52,169,158,.35);
}
.nav-links { display: flex; align-items: center; gap: 28px; font-weight: 500; }
.nav-links a { color: var(--ink-soft); transition: .2s; }
.nav-links a:hover { color: var(--teal-700); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 70px 0 90px; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(111,201,192,.30), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(184,230,225,.40), transparent 40%);
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 52px; line-height: 1.25; font-weight: 800; color: var(--teal-900); margin-bottom: 18px; }
.hero h1 span { color: var(--amber); }
.hero p { font-size: 18px; color: var(--ink-soft); margin-bottom: 30px; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art {
  background: var(--card); border-radius: var(--r-lg); padding: 28px;
  box-shadow: var(--shadow-lg);
}
.stat-row { display: flex; gap: 16px; margin-top: 26px; }
.stat {
  flex: 1; background: var(--card); border-radius: var(--r-md); padding: 18px;
  box-shadow: var(--shadow-sm); text-align: center;
}
.stat .num { font-size: 30px; font-weight: 800; color: var(--teal-600); }
.stat .lbl { font-size: 13.5px; color: var(--muted); }

/* أقسام عامة */
.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; }
.section-head .eyebrow { color: var(--amber); font-weight: 700; letter-spacing: .5px; margin-bottom: 8px; }
.section-head h2 { font-size: 36px; font-weight: 800; color: var(--teal-900); }
.section-head p { color: var(--ink-soft); margin-top: 10px; }

/* الخدمات */
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.service-card {
  background: var(--card); border-radius: var(--r-md); padding: 30px 26px;
  box-shadow: var(--shadow-sm); transition: .25s; border: 1px solid transparent;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--teal-100); }
.service-card .ico {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  font-size: 28px; margin-bottom: 18px; background: var(--teal-50); color: var(--teal-600);
}
.service-card:nth-child(2) .ico { background: #fdeecc; color: var(--amber-dk); }
.service-card:nth-child(3) .ico { background: #ffe9e2; color: var(--coral-dk); }
.service-card:nth-child(5) .ico { background: #fdeecc; color: var(--amber-dk); }
.service-card:nth-child(6) .ico { background: #ffe9e2; color: var(--coral-dk); }
.service-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--teal-900); }
.service-card p { color: var(--ink-soft); font-size: 15px; }

/* المشاريع */
.projects-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.project-card {
  background: var(--card); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: .25s; display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project-card .cover {
  height: 150px; background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  display: grid; place-items: center; color: #fff; font-size: 46px; position: relative;
}
.project-card:nth-child(2) .cover { background: linear-gradient(135deg, var(--amber), var(--coral)); }
.project-card:nth-child(3) .cover { background: linear-gradient(135deg, var(--coral), var(--coral-dk)); }
.project-card .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.project-card h3 { font-size: 19px; font-weight: 700; color: var(--teal-900); margin-bottom: 8px; }
.project-card p { color: var(--ink-soft); font-size: 14.5px; flex: 1; }
.progress { margin: 16px 0 6px; }
.progress-bar { height: 9px; background: var(--teal-50); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); border-radius: 999px; }
.project-card:nth-child(2) .progress-fill { background: linear-gradient(90deg, var(--amber), var(--coral)); }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; margin-top: 8px; }
.progress-meta .col { color: var(--teal-700); font-weight: 700; }
.progress-meta .tg { color: var(--muted); }

/* نموذج الإبلاغ العام */
.report-section { background: var(--teal-600); position: relative; overflow: hidden; }
.report-section::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.12), transparent 40%);
}
.report-wrap { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: 44px; align-items: center; }
.report-info { color: #fff; }
.report-info h2 { font-size: 34px; font-weight: 800; margin-bottom: 16px; }
.report-info p { opacity: .92; font-size: 16px; margin-bottom: 22px; }
.report-info .point { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.report-info .point .n { width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex-shrink: 0; font-weight: 700; }
.report-card { background: #fff; border-radius: var(--r-lg); padding: 34px; box-shadow: var(--shadow-lg); }
.report-card h3 { font-size: 22px; font-weight: 800; color: var(--teal-900); margin-bottom: 6px; }
.report-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* فورم */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field label .req { color: var(--danger); }
.input, .textarea, .select {
  width: 100%; font-family: var(--font); font-size: 15px; color: var(--ink);
  padding: 12px 15px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fafdfc; transition: .2s; outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--teal-500); background: #fff; box-shadow: 0 0 0 4px rgba(68,184,173,.12); }
.textarea { resize: vertical; min-height: 90px; }

/* تنبيهات */
.alert { padding: 14px 18px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: 14.5px; font-weight: 500; }
.alert-success { background: #d8f5e8; color: #1e7a52; border: 1px solid #aee6cd; }
.alert-error   { background: #fbdedc; color: #c33;     border: 1px solid #f3c3c0; }
.alert-info    { background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-100); }
.alert-warn    { background: #fdeecc; color: var(--amber-dk); border: 1px solid #f6dca0; }

/* footer */
.footer { background: var(--teal-900); color: #cfe7e4; padding: 40px 0; text-align: center; }
.footer .brand { justify-content: center; color: #fff; margin-bottom: 12px; }
.footer .brand .logo { background: var(--teal-600); }
.footer p { opacity: .8; font-size: 14px; }

/* ====================== لوحة التحكم (Admin) ====================== */
.admin-body { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; background: var(--teal-700); color: #fff; flex-shrink: 0;
  padding: 24px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .s-brand { display: flex; align-items: center; gap: 11px; padding: 0 24px 24px; font-weight: 800; font-size: 19px; }
.sidebar .s-brand .logo { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 20px; }
.sidebar .s-section { padding: 14px 24px 6px; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; opacity: .55; }
.sidebar a {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  color: rgba(255,255,255,.82); font-weight: 500; font-size: 15px; transition: .15s;
  border-right: 3px solid transparent;
}
.sidebar a .i { width: 20px; text-align: center; }
.sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar a.active { background: rgba(255,255,255,.14); color: #fff; border-right-color: var(--amber); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; padding: 16px 30px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 22px; font-weight: 800; color: var(--teal-900); }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .user .av { width: 42px; height: 42px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center; font-weight: 800; }
.topbar .user .meta { text-align: left; line-height: 1.3; }
.topbar .user .meta .nm { font-weight: 700; font-size: 14.5px; }
.topbar .user .meta .rl { font-size: 12px; color: var(--muted); }

.content { padding: 30px; flex: 1; }

/* بطاقات الإحصائيات */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 26px; }
.kpi {
  background: #fff; border-radius: var(--r-md); padding: 22px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
}
.kpi .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }
.kpi .ico.t { background: var(--teal-50); color: var(--teal-600); }
.kpi .ico.a { background: #fdeecc; color: var(--amber-dk); }
.kpi .ico.c { background: #ffe9e2; color: var(--coral-dk); }
.kpi .ico.g { background: #d8f5e8; color: #1e8a5c; }
.kpi .num { font-size: 28px; font-weight: 800; color: var(--teal-900); line-height: 1.1; }
.kpi .lbl { font-size: 13.5px; color: var(--muted); }

/* بطاقة محتوى */
.panel { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-sm); margin-bottom: 24px; overflow: hidden; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 18px; font-weight: 700; color: var(--teal-900); }
.panel-body { padding: 24px; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

/* جدول */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--teal-50); }
.table .name { font-weight: 700; color: var(--teal-900); }
.table .nid { font-family: monospace; color: var(--ink-soft); direction: ltr; display: inline-block; }

/* بحث كبير */
.search-hero { background: #fff; border-radius: var(--r-lg); padding: 40px; box-shadow: var(--shadow); text-align: center; margin-bottom: 26px; }
.search-hero .ico { width: 70px; height: 70px; border-radius: 22px; background: var(--teal-50); color: var(--teal-600); display: grid; place-items: center; font-size: 32px; margin: 0 auto 18px; }
.search-hero h2 { font-size: 26px; font-weight: 800; color: var(--teal-900); margin-bottom: 6px; }
.search-hero p { color: var(--ink-soft); margin-bottom: 24px; }
.search-box { display: flex; gap: 12px; max-width: 560px; margin: 0 auto; }
.search-box .input { text-align: center; font-size: 18px; letter-spacing: 2px; font-family: monospace; direction: ltr; }

/* تفاصيل الحالة */
.case-head {
  background: #fff; border-radius: var(--r-md); padding: 26px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 22px; margin-bottom: 24px;
}
.case-head .av { width: 76px; height: 76px; border-radius: 24px; background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center; font-size: 32px; font-weight: 800; flex-shrink: 0; }
.case-head .info { flex: 1; }
.case-head .info h2 { font-size: 24px; font-weight: 800; color: var(--teal-900); }
.case-head .info .sub { color: var(--ink-soft); font-size: 14.5px; margin-top: 4px; }
.case-head .info .nid { font-family: monospace; direction: ltr; display: inline-block; }

.info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.info-item { background: var(--teal-50); border-radius: var(--r-sm); padding: 14px 16px; }
.info-item .k { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.info-item .v { font-weight: 700; color: var(--teal-900); font-size: 15px; }

/* خط زمني */
.timeline { position: relative; padding-right: 24px; }
.timeline::before { content: ''; position: absolute; right: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--teal-100); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before { content: ''; position: absolute; right: -21px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--teal-500); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--teal-200); }
.tl-item .tl-date { font-size: 12.5px; color: var(--muted); }
.tl-item .tl-title { font-weight: 700; color: var(--teal-900); margin: 2px 0; }
.tl-item .tl-desc { font-size: 14px; color: var(--ink-soft); }

/* tabs */
.tabs { display: flex; gap: 8px; border-bottom: 2px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab { padding: 11px 20px; font-weight: 700; font-size: 14.5px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: .2s; }
.tab.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fade .3s; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* صفحة دخول */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, var(--teal-50), var(--teal-100)); position: relative; overflow: hidden; }
.login-wrap::before { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: rgba(111,201,192,.25); top: -120px; right: -120px; }
.login-wrap::after { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(245,166,35,.16); bottom: -100px; left: -80px; }
.login-card { position: relative; z-index: 1; background: #fff; border-radius: var(--r-lg); padding: 44px 40px; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; }
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card .welcome { text-align: center; color: var(--muted); margin-bottom: 28px; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ico { font-size: 48px; margin-bottom: 12px; opacity: .5; }

.helper { font-size: 13px; color: var(--muted); margin-top: 5px; }
.mt { margin-top: 18px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ====================== استجابة الموبايل ====================== */
@media (max-width: 980px) {
  .hero .container, .report-wrap, .grid-2 { grid-template-columns: 1fr; }
  .services-grid, .projects-grid, .kpi-grid, .info-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 38px; }
  .sidebar { position: fixed; right: -260px; z-index: 100; transition: .3s; }
  .sidebar.open { right: 0; }
}
@media (max-width: 600px) {
  .services-grid, .projects-grid, .kpi-grid, .info-grid, .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero h1 { font-size: 32px; }
  .content { padding: 18px; }
}
