:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0f766e;
  --primary-2: #14b8a6;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(15,23,42,.08);
}
* { box-sizing: border-box; }
body { margin:0; font-family: Inter, Arial, sans-serif; color:#0f172a; background:linear-gradient(180deg,#ecfeff 0,#f8fafc 180px,#f8fafc 100%); }
a { color: var(--primary); text-decoration: none; }
.container { width:min(1200px,92%); margin:0 auto; }
.topbar { position:sticky; top:0; z-index:10; background:rgba(15,23,42,.86); backdrop-filter: blur(10px); margin-bottom:26px; }
.topbar-inner { display:flex; gap:20px; justify-content:space-between; align-items:center; padding:16px 0; }
.brand { display:flex; gap:14px; align-items:center; color:#fff; }
.brand-mark { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; background:linear-gradient(135deg,var(--primary),var(--primary-2)); font-weight:700; }
.brand small { display:block; opacity:.75; }
.main-nav { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.main-nav a { color:#dbeafe; padding:10px 12px; border-radius:999px; }
.main-nav a:hover { background:rgba(255,255,255,.08); }
.nav-user { color:#cbd5e1; padding:0 8px; }
.page-shell { padding-bottom:30px; }
.hero { display:grid; grid-template-columns:1.3fr 1fr; gap:24px; align-items:stretch; }
.card { background:var(--panel); border:1px solid rgba(226,232,240,.9); box-shadow:var(--shadow); border-radius:var(--radius); padding:24px; margin-bottom:20px; }
.card h1,.card h2,.card h3,.card h4 { margin-top:0; }
.glass-card { background:linear-gradient(135deg, rgba(15,118,110,.92), rgba(20,184,166,.82)); color:#fff; }
.grid { display:grid; gap:20px; }
.grid-2 { grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
.grid-3 { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.compact-grid { align-items:start; }
.kpi { display:flex; flex-direction:column; gap:8px; }
.kpi strong { font-size:2rem; }
label { display:block; font-size:.92rem; font-weight:600; margin-bottom:6px; }
input, select, textarea, button { width:100%; padding:12px 14px; border-radius:14px; border:1px solid var(--line); margin-bottom:14px; font:inherit; background:#fff; }
input:focus, select:focus, textarea:focus { outline:none; border-color:#5eead4; box-shadow:0 0 0 4px rgba(45,212,191,.18); }
textarea { min-height:100px; resize:vertical; }
button, .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; width:auto; border:none; background:linear-gradient(135deg,var(--primary),var(--primary-2)); color:#fff; cursor:pointer; padding:12px 18px; border-radius:999px; font-weight:600; }
.btn-secondary { background:#334155; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-sm { padding:9px 12px; font-size:.92rem; }
.actions { display:flex; flex-wrap:wrap; gap:8px; }
.stack-inline textarea { min-height:76px; }
.table-wrap { overflow:auto; }
.table { width:100%; border-collapse:separate; border-spacing:0; min-width:720px; }
.table th, .table td { border-bottom:1px solid var(--line); padding:14px 12px; vertical-align:top; }
.table th { background:#f8fafc; text-align:left; font-size:.9rem; color:#475569; position:sticky; top:0; }
.badge { display:inline-block; padding:6px 10px; border-radius:999px; font-size:.8rem; font-weight:700; text-transform: capitalize; }
.badge-approved,.badge-paid,.badge-completed,.badge-active,.badge-verified { background:#dcfce7; color:#166534; }
.badge-pending,.badge-partial,.badge-unpaid,.badge-issued { background:#fef3c7; color:#92400e; }
.badge-confirmed { background:#e8f1ff; color:#2f6fed; }
.badge-rejected,.badge-cancelled,.badge-void { background:#fee2e2; color:#991b1b; }
.alert { padding:14px 18px; border-radius:14px; margin-bottom:16px; }
.alert.success { background:#dcfce7; color:#166534; }
.alert.error { background:#fee2e2; color:#991b1b; }
.stat-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:18px; }
.muted { color:var(--muted); }
.calendar { display:grid; grid-template-columns:repeat(7,1fr); gap:12px; }
.calendar-cell { border:1px solid var(--line); border-radius:16px; padding:12px; min-height:120px; background:#fff; }
.calendar-cell small { display:block; color:var(--muted); margin-bottom:8px; }
.slot-pill { display:block; background:#ecfeff; color:#115e59; border-radius:999px; padding:7px 10px; margin:6px 0; font-size:.88rem; }
.split-hero { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; }
.mini-card { padding:12px 14px; background:#f8fafc; border:1px solid var(--line); border-radius:14px; margin-bottom:10px; }
.footer { padding:30px 0 40px; color:#475569; }
.footer-inner { display:flex; justify-content:space-between; gap:20px; align-items:center; }

/* Shared KPI count size across ALL role dashboards */
.card-number,
.dashboard-kpi-link,
.kpi-number-link,
.profile-name-link,
.perkeso-kpi-number {
  display: inline-block;
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.15;
}
.card-number:hover,
.dashboard-kpi-link:hover,
.kpi-number-link:hover,
.profile-name-link:hover,
.perkeso-kpi-number:hover {
  color: var(--primary);
  text-decoration: underline;
}
.kpi-icon,
.stat-icon,
.dashboard-kpi-icon,
.perkeso-kpi-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.kpi-card,
.dashboard-kpi-card,
.perkeso-kpi-card {
  min-height: 170px;
}
.dashboard-kpi-head {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:4px;
}
.dashboard-kpi-meta,
.perkeso-kpi-note {
  color: var(--muted);
  font-size: .95rem;
}
.alert-card .card-number {
  margin: 4px 0 8px;
}

/* Branch dashboard */
.dashboard-stat-strip,
.dashboard-alert-grid { margin-bottom: 20px; }
.dashboard-kpi-link { line-height: 1.05; }
.dashboard-alert-card p { margin-top: 0; }
.dashboard-alert-title-row,
.dashboard-reporting-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.dashboard-alert-icon { font-size: 1.5rem; line-height: 1; }
.dashboard-alert-eyebrow { color:var(--muted); font-size:.85rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.dashboard-alert-card-warning { border-color:#fde68a; }
.dashboard-alert-card-ok { border-color:#bbf7d0; }

/* Patient dashboard */
.patient-hero-card { margin-bottom: 20px; }
.patient-hero-content { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:20px; }
.hero-kicker { display:inline-block; margin-bottom:10px; font-size:.95rem; font-weight:700; opacity:.92; }
.patient-dashboard-grid,
.patient-stat-grid { margin-bottom: 20px; }
.kpi-link-card { position:relative; }
.patient-stat-grid { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.patient-stat-card {
  display:flex;
  flex-direction:column;
  gap:8px;
  color:#0f172a;
  text-decoration:none;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.patient-stat-card strong { font-size:2rem; line-height:1.1; }
.stat-hint { color:var(--muted); font-size:.92rem; }
.patient-stat-card:hover,
.patient-stat-card:focus {
  transform:translateY(-2px);
  border-color:#99f6e4;
  box-shadow:0 18px 42px rgba(15,23,42,.12);
}

/* Superadmin dashboard */
.superadmin-kpis,
.superadmin-alerts { margin-bottom: 20px; }
.superadmin-kpis .card-number,
.superadmin-alerts .card-number {
  display:block;
  margin:4px 0 8px;
}

/* Perkeso dashboard */
.perkeso-kpi-grid { align-items: stretch; }
.perkeso-kpi-card { position: relative; }
.perkeso-overview-card .actions { margin-top: 8px; }

@media (max-width: 860px) {
  .hero, .split-hero { grid-template-columns:1fr; }
  .topbar-inner, .footer-inner { flex-direction:column; align-items:flex-start; }
  .main-nav { width:100%; }
  .calendar { grid-template-columns:1fr; }
  .patient-hero-content { align-items:flex-start; }
  .profile-name-link { font-size:1.55rem; }
}


/* Required field indicator consistency */
.required,
.required-star,
label span.required,
label .required,
label .required-star {
  color: #e53935 !important;
  -webkit-text-fill-color: #e53935 !important;
  font-weight: 700;
}

.required-note,
.form-required-note {
  color: #e53935 !important;
  -webkit-text-fill-color: #e53935 !important;
}
