:root{
  --mf-font:"Cairo",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mf-bg:#f5f7fb;
  --mf-surface:#ffffff;
  --mf-surface-2:#f8fafc;
  --mf-border:rgba(148,163,184,.28);
  --mf-text:#0f172a;
  --mf-text-muted:#64748b;
  --mf-primary:#2563eb;
  --mf-primary-2:#0ea5e9;
  --mf-primary-contrast:#ffffff;
  --mf-shadow:0 10px 30px rgba(15,23,42,.08);
  --mf-shadow-soft:0 2px 10px rgba(15,23,42,.06);
}

body.mf-theme,
body.clinic-body,
body.patient-body{
  font-family:var(--mf-font);
  background: radial-gradient(circle at top, rgba(37,99,235,.10), transparent 45%),
              radial-gradient(circle at bottom left, rgba(14,165,233,.10), transparent 45%),
              var(--mf-bg);
  color:var(--mf-text);
}

.mf-card, .card{
  border:1px solid var(--mf-border);
  border-radius:18px;
  background:var(--mf-surface);
  box-shadow:var(--mf-shadow-soft);
}

.mf-card-header{
  background:linear-gradient(135deg, rgba(37,99,235,.08), rgba(14,165,233,.06));
  border-bottom:1px solid var(--mf-border);
}

.btn-primary{
  background: linear-gradient(135deg, var(--mf-primary-2), var(--mf-primary));
  border:none;
  color:var(--mf-primary-contrast);
}
.btn-primary:hover{
  filter:brightness(.95);
}

.form-control, .form-select{
  border-radius:14px;
  border-color:rgba(148,163,184,.55);
}
.form-control:focus, .form-select:focus{
  border-color:rgba(37,99,235,.8);
  box-shadow:0 0 0 .2rem rgba(37,99,235,.15);
}

.table{
  color:var(--mf-text);
}

/* Admin layout tweaks */
.sidebar{
  background: linear-gradient(180deg, #0b1220, #111827 55%, #0b1220);
}
.sidebar-link.active{
  background: linear-gradient(135deg, var(--mf-primary-2), var(--mf-primary));
}
.topbar{
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}

/* Public website */
.mf-public-hero{
  background: radial-gradient(circle at top, rgba(37,99,235,.14), transparent 50%),
              linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.55));
  border:1px solid var(--mf-border);
  border-radius:22px;
  box-shadow:var(--mf-shadow);
}

.mf-pill{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.35rem .75rem;
  border-radius:999px;
  background:rgba(37,99,235,.08);
  border:1px solid rgba(37,99,235,.18);
  color:#1d4ed8;
  font-size:.85rem;
}


/* ===== Dashboard Premium (v8) ===== */
.dashboard-premium{padding-bottom:1rem;}
.premium-hero{
  background: radial-gradient(1200px 600px at 20% 0%, rgba(37,99,235,.10), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(16,185,129,.10), transparent 55%),
              #ffffff;
  border: 1px solid var(--mf-border);
}
.stat-card{border:1px solid var(--mf-border);}
.stat-value{font-size:1.6rem;font-weight:800;letter-spacing:.2px;}
.stat-icon{
  width:44px;height:44px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  font-size:1.25rem;
  border:1px solid var(--mf-border);
}
.bg-soft-primary{background:rgba(37,99,235,.10);color:#1d4ed8;}
.bg-soft-success{background:rgba(16,185,129,.12);color:#047857;}
.bg-soft-warning{background:rgba(245,158,11,.14);color:#92400e;}
.bg-soft-danger{background:rgba(239,68,68,.12);color:#991b1b;}

.premium-table thead th{border-bottom:1px solid rgba(148,163,184,.25)!important;}
.premium-table tbody td{border-color:rgba(148,163,184,.18)!important;}

.mini-bar{
  width:100%;height:10px;border-radius:999px;
  background:rgba(148,163,184,.22);
  overflow:hidden;
}
.mini-bar-fill{
  display:block;height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(37,99,235,.85), rgba(16,185,129,.85));
}

.soft-box{
  border:1px solid rgba(148,163,184,.25);
  background:rgba(248,250,252,.75);
  border-radius:14px;
  padding:12px 14px;
}
.min-w-0{min-width:0;}

/* Quick Actions (square buttons) */
.mf-quick{
  display:block;
  background:var(--mf-surface);
  border:1px solid var(--mf-border);
  border-radius:18px;
  padding:14px 10px;
  text-align:center;
  text-decoration:none;
  box-shadow:var(--mf-shadow-soft);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  height:100%;
  color:var(--mf-text);
}
.mf-quick:hover{
  transform:translateY(-2px);
  box-shadow:var(--mf-shadow);
  border-color:rgba(148,163,184,.45);
  color:var(--mf-text);
}
.mf-quick-icon{
  width:44px;height:44px;
  border-radius:14px;
  margin:0 auto 10px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(37,99,235,.10);
  border:1px solid rgba(37,99,235,.18);
  color:#1d4ed8;
  font-size:1.25rem;
}
.mf-quick-title{font-size:.85rem;font-weight:800;}



/* Dashboard KPI links */
.stat-card{position:relative; overflow:hidden;}
.stat-card .card-body{padding-bottom:2.4rem;}
.stat-link{
  position:absolute;
  bottom:12px;
  inset-inline-start:14px; /* RTL: right */
  font-size:.8rem;
  font-weight:800;
  text-decoration:none;
  color:var(--mf-primary);
}
.stat-link:hover{ text-decoration:underline; }


/* ===== Latest Operations Summary (Dashboard) ===== */
.mf-ops-list{display:flex;flex-direction:column;gap:10px}
.mf-ops-item{padding:10px 12px;border:1px solid rgba(0,0,0,.06);border-radius:14px;background:#fff}
.mf-ops-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mf-ops-patient{font-weight:800;color:#111}
.mf-ops-sub{margin-top:6px;display:flex;gap:12px;flex-wrap:wrap;color:#555;font-size:12px}
.mf-ops-hospital,.mf-ops-opname{display:inline-flex;align-items:center;gap:6px}
.mf-badge{font-size:12px;font-weight:800;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.06);white-space:nowrap}
.mf-badge-good{background:rgba(25,135,84,.10);color:#198754;border-color:rgba(25,135,84,.20)}
.mf-badge-mid{background:rgba(255,193,7,.12);color:#b58100;border-color:rgba(255,193,7,.25)}
.mf-badge-bad{background:rgba(220,53,69,.10);color:#dc3545;border-color:rgba(220,53,69,.20)}
.mf-badge-neutral{background:rgba(13,110,253,.08);color:#0d6efd;border-color:rgba(13,110,253,.18)}
