:root {
  --brand: #0E7C86;
  --brand-dark: #0B5F67;
  --accent: #FF7A59;
  --bg: #F6FAFB;
  --card: #ffffff;
  --text: #1d2b2f;
  --muted: #6b7c80;
  --border: #e3ecee;
  --bs-primary: #0E7C86;
  --bs-primary-rgb: 14, 124, 134;
}

body { background: var(--bg); color: var(--text); font-family: "Cairo", system-ui, sans-serif; }
a { color: var(--brand); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.btn-accent { background: var(--accent); color: #fff; border: none; }
.btn-accent:hover { background: #f0623f; color: #fff; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--brand-dark); color: #fff; padding: 20px 14px; flex-shrink: 0; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; color: #fff; text-decoration: none; margin-bottom: 24px; }
.sidebar .brand img { width: 40px; height: 40px; }
.sidebar .nav-link { color: rgba(255,255,255,.82); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .who { font-size: .85rem; color: rgba(255,255,255,.7); border-top: 1px solid rgba(255,255,255,.15); margin-top: 20px; padding-top: 14px; }
.main { flex: 1; padding: 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }

.card { border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgba(16,40,45,.04); }
.stat { padding: 18px; }
.stat .value { font-size: 2rem; font-weight: 800; color: var(--brand); }
.stat .label { color: var(--muted); font-size: .9rem; }
.stat.ai .value { color: var(--accent); }

.table { --bs-table-bg: transparent; }
.table thead th { color: var(--muted); font-weight: 600; font-size: .85rem; border-bottom-width: 1px; }
.badge-status { padding: .35em .7em; border-radius: 999px; font-weight: 600; font-size: .78rem; }
.st-pending { background: #fff4e5; color: #b26a00; }
.st-confirmed { background: #e6f4ff; color: #0b63b6; }
.st-checkedIn, .st-approved, .st-activated { background: #e5f7ef; color: #13795b; }
.st-completed { background: #eef1f3; color: #44545a; }
.st-noShow, .st-rejected, .st-blocked, .st-cancelled, .st-suspended { background: #fdecec; color: #b42318; }
.st-new { background: #f0f4ff; color: #3949ab; }

.hero-ai { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; border-radius: 20px; padding: 22px; }
.hero-ai .chip { background: rgba(255,255,255,.15); border-radius: 999px; padding: 4px 12px; font-size: .85rem; display: inline-block; margin: 2px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { max-width: 420px; width: 100%; padding: 32px; }
.login-card .logo { width: 72px; height: 72px; }

.muted { color: var(--muted); }
.lang-switch a { color: inherit; text-decoration: none; font-weight: 600; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .main { padding: 16px; }
}

/* ----- Hospitals phase 3: ER triage colours, bed map, nursing ----- */
.tr { display: inline-block; min-width: 76px; text-align: center; padding: .3em .7em; border-radius: 999px; font-weight: 700; font-size: .8rem; }
.tr-red { background: #d32f2f; color: #fff; }
.tr-orange { background: #f57c00; color: #fff; }
.tr-yellow { background: #fbc02d; color: #222; }
.tr-green { background: #388e3c; color: #fff; }
.tr-blue { background: #1976d2; color: #fff; }
.tr-none { background: #e0e0e0; color: #444; }
.er-row td:first-child { border-inline-start: 6px solid transparent; }
.er-row.tr-row-red td:first-child { border-inline-start-color: #d32f2f; }
.er-row.tr-row-orange td:first-child { border-inline-start-color: #f57c00; }
.er-row.tr-row-yellow td:first-child { border-inline-start-color: #fbc02d; }
.er-row.tr-row-green td:first-child { border-inline-start-color: #388e3c; }
.er-row.tr-row-blue td:first-child { border-inline-start-color: #1976d2; }
.er-overdue td { background: #ffebee !important; }
.er-overdue .er-wait { color: #c62828; font-weight: 800; animation: er-blink 1.2s step-start infinite; }
@keyframes er-blink { 50% { opacity: .35; } }
.er-board { font-size: 1.02rem; }
.bed-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.bed-tile { width: 132px; min-height: 96px; border-radius: 12px; padding: 8px 10px; border: 2px solid; display: flex; flex-direction: column; gap: 2px;
    text-decoration: none; color: inherit; font-size: .85rem; }
.bed-tile .bed-label { font-weight: 800; font-size: 1.05rem; }
.bed-free { background: #e8f5e9; border-color: #66bb6a; }
.bed-occupied { background: #ffebee; border-color: #e53935; }
.bed-cleaning { background: #fff8e1; border-color: #ffb300; }
.bed-ooo { background: #eceff1; border-color: #78909c; }
.bed-reserved { background: #e3f2fd; border-color: #1e88e5; }
.bed-legend span { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 14px; font-size: .85rem; }
.bed-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 2px solid; }
.dose { border-radius: 10px; padding: 8px 10px; border: 1px solid #e0e0e0; }
.dose-late { background: #ffebee; border-color: #e57373; }
.dose-due { background: #fff8e1; border-color: #ffca28; }
.dose-done { background: #f1f8e9; border-color: #c5e1a5; }
.big-btn { min-height: 46px; font-size: 1rem; padding-inline: 16px; }
.nurse-card { border-radius: 14px; }
.allergy { background: #d32f2f; color: #fff; border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: .82rem; }
.kpi { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
