/* ============================================================
   MediCore / RosterX - Prestigious Hospital Enterprise Suite 2026
   (المنظومة التنفيذية العالمية لإدارة المستشفيات والمراكز الكبرى)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800;900&family=Readex+Pro:wght@300;400;500;600;700;800&family=Cairo:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  --hosp-font-main: 'Alexandria', 'Readex Pro', 'Cairo', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --hosp-canvas: #080d1a;
  --hosp-surface: #0f172a;
  --hosp-surface-card: #111c35;
  --hosp-surface-inset: #0b1120;
  --hosp-surface-hover: #162242;
  
  --hosp-border: #1e293b;
  --hosp-border-subtle: rgba(255, 255, 255, 0.08);
  --hosp-border-accent: #2563eb;
  --hosp-border-glow: rgba(37, 99, 235, 0.4);
  
  --hosp-text-white: #ffffff;
  --hosp-text-title: #f8fafc;
  --hosp-text-body: #cbd5e1;
  --hosp-text-muted: #8191a6;
  
  --hosp-blue-start: #2563eb;
  --hosp-blue-end: #1d4ed8;
  --hosp-emerald-start: #059669;
  --hosp-emerald-end: #047857;
  --hosp-amber-start: #d97706;
  --hosp-amber-end: #b45309;
  --hosp-rose-start: #e11d48;
  --hosp-rose-end: #be123c;
}

/* --- Global Base Canvas & Typography --- */
html, body {
  font-family: var(--hosp-font-main) !important;
  background-color: var(--hosp-canvas) !important;
  color: var(--hosp-text-body) !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
  letter-spacing: -0.01em;
}

body {
  background: 
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(13, 148, 136, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.3) 0%, transparent 70%),
    var(--hosp-canvas) !important;
  background-attachment: fixed !important;
  min-height: 100vh;
}

/* --- Top Header / Global Navigation Bar --- */
header,
nav.sticky,
.glass-effect.sticky,
.bg-slate-900\/80,
.backdrop-blur-md,
.bg-slate-800\/90 {
  background-color: rgba(9, 14, 28, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--hosp-border) !important;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.65) !important;
}

header h1, header h2, header h3,
header span, header p,
header .text-slate-100,
header .text-slate-200 {
  color: var(--hosp-text-white) !important;
  font-weight: 700;
}

/* --- Top Hospital Executive Hero Banner --- */
#rx-hospital-hero-banner {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35) 0%, rgba(15, 23, 42, 0.95) 50%, rgba(13, 148, 136, 0.2) 100%) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  border-top: 3px solid #2563eb !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.55), 0 0 20px rgba(37, 99, 235, 0.1) !important;
  padding: 22px 26px !important;
  margin-bottom: 24px !important;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

#rx-hospital-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.18), transparent 70%);
  pointer-events: none;
}

/* --- Top KPI Metric Cards (بطاقات المؤشرات القيادية) --- */
.rx-kpi-card {
  background: linear-gradient(145deg, #111c35 0%, #0d1426 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.18) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.45) !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  overflow: hidden;
}

.rx-kpi-card:hover {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(59, 130, 246, 0.2) !important;
  transform: translateY(-2px);
}

.rx-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  opacity: 0.7;
}

/* --- Segmented Floating Pill Tab Bar (شريط التبويبات الفاخر المريح) --- */
div[class*="bg-slate-800/50"][class*="rounded-2xl"],
nav[aria-label="Tabs"] {
  background: rgba(13, 20, 36, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid var(--hosp-border) !important;
  border-radius: 16px !important;
  padding: 6px !important;
  gap: 6px !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
  margin-bottom: 24px !important;
}

nav[aria-label="Tabs"] button,
div[class*="bg-slate-800/50"] button {
  padding: 9px 18px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--hosp-text-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

nav[aria-label="Tabs"] button:hover:not(.bg-indigo-600),
div[class*="bg-slate-800/50"] button:hover:not(.bg-indigo-600) {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

nav[aria-label="Tabs"] button.bg-indigo-600,
div[class*="bg-slate-800/50"] button.bg-indigo-600,
.bg-indigo-900\/40,
button[class*="bg-indigo-900/40"] {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  font-weight: 800 !important;
}

nav[aria-label="Tabs"] button.bg-indigo-600 *,
div[class*="bg-slate-800/50"] button.bg-indigo-600 *,
.bg-indigo-900\/40 *,
button[class*="bg-indigo-900/40"] * {
  color: #ffffff !important;
}

/* --- Hospital Modules & Cards Mold Styling (قوالب البطاقات ولوحات العمل) --- */
.bg-slate-800,
div[class*="bg-slate-800"]:not(.bg-transparent):not(.fixed):not(nav),
app-calendar > div,
app-delegation-management > div {
  background-color: var(--hosp-surface) !important;
  border: 1px solid var(--hosp-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

.bg-slate-800.hover\:bg-slate-700\/50:hover,
.hover\:scale-\[1\.02\]:hover,
.bg-slate-800.cursor-pointer:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(59, 130, 246, 0.2) !important;
  transform: translateY(-2px) !important;
}

.bg-slate-900\/50,
.bg-slate-900\/60,
.bg-slate-900\/80,
.bg-slate-900,
.bg-slate-700\/50,
.bg-slate-700\/30,
.glass-effect {
  background-color: var(--hosp-surface-inset) !important;
  border-color: var(--hosp-border) !important;
}

/* --- Typography Colors & Hierarchy --- */
h1, h2, h3, h4, h5, h6,
.text-slate-100,
.text-slate-200 {
  color: var(--hosp-text-title) !important;
  font-weight: 700;
}

.text-slate-300 {
  color: var(--hosp-text-body) !important;
}

.text-slate-400 {
  color: var(--hosp-text-muted) !important;
}

.text-slate-500 {
  color: #64748b !important;
}

.border-slate-700,
.border-slate-600,
.border-slate-700\/50 {
  border-color: var(--hosp-border) !important;
}

/* --- Action Buttons (الأزرار التنفيذية الفاخرة) --- */
button.bg-indigo-600,
button[class*="bg-indigo-600"],
.bg-indigo-600:not(.rounded-full):not(span):not(div) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  transition: all 0.18s ease !important;
}

button.bg-indigo-600:hover,
button[class*="bg-indigo-600"]:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55) !important;
  transform: translateY(-1px) !important;
}

button.bg-green-600,
button[class*="bg-green-600"] {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  border: 1px solid #10b981 !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 12px rgba(5, 150, 105, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  font-weight: 700 !important;
  transition: all 0.18s ease !important;
}

button.bg-green-600:hover,
button[class*="bg-green-600"]:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.55) !important;
  transform: translateY(-1px) !important;
}

button.bg-red-600,
button[class*="bg-red-600"] {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
  color: #ffffff !important;
  border: 1px solid #f43f5e !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 12px rgba(225, 29, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  font-weight: 700 !important;
  transition: all 0.18s ease !important;
}

button.bg-red-600:hover,
button[class*="bg-red-600"]:hover {
  background: linear-gradient(135deg, #be123c 0%, #9f1239 100%) !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.55) !important;
  transform: translateY(-1px) !important;
}

button.bg-slate-600,
button.bg-slate-700,
button[class*="bg-slate-600"],
button[class*="bg-slate-700"] {
  background: #192338 !important;
  color: #f1f5f9 !important;
  border: 1px solid #2e3c57 !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  transition: all 0.18s ease !important;
}

button.bg-slate-600:hover,
button.bg-slate-700:hover {
  background: #23314d !important;
  border-color: #3b82f6 !important;
}

/* --- Form Inputs & Dropdowns --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
textarea,
select {
  background-color: #0b1120 !important;
  border: 1px solid #26354f !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-family: inherit !important;
  padding: 0.65rem 0.95rem !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb !important;
  background-color: #111c35 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  outline: none !important;
}

/* --- Tables & Schedule Data Grids --- */
table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

thead th {
  background-color: #0b1120 !important;
  color: var(--hosp-text-muted) !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 0.9rem 1.1rem !important;
  border-bottom: 2px solid var(--hosp-border) !important;
}

tbody tr {
  background-color: var(--hosp-surface) !important;
  border-bottom: 1px solid #1a2336 !important;
  transition: background-color 0.14s ease !important;
}

tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.08) !important;
}

tbody td {
  padding: 0.9rem 1.1rem !important;
  color: var(--hosp-text-body) !important;
}

/* --- Modals & Overlays --- */
.fixed.inset-0,
div[class*="fixed inset-0"] {
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  background: rgba(4, 7, 15, 0.85) !important;
}

.fixed.inset-0 > div[class*="bg-slate-800"],
div[class*="fixed inset-0"] > div[class*="bg-slate-800"] {
  background: #111c35 !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-top: 4px solid #2563eb !important;
  border-radius: 18px !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85), 0 0 30px rgba(37, 99, 235, 0.15) !important;
}

/* --- Status Badges (شارات الحالة الطبية المضيئة) --- */
.rounded-full.bg-green-500\/20,
.rounded-full[class*="bg-green-500"] {
  background-color: rgba(5, 150, 105, 0.2) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #34d399 !important;
  font-weight: 700 !important;
}

.rounded-full.bg-red-500\/20,
.rounded-full[class*="bg-red-500"] {
  background-color: rgba(225, 29, 72, 0.2) !important;
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
  color: #fb7185 !important;
  font-weight: 700 !important;
}

.rounded-full.bg-indigo-500\/20,
.rounded-full.bg-indigo-900\/50 {
  background-color: rgba(37, 99, 235, 0.2) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  color: #93c5fd !important;
  font-weight: 700 !important;
}

.rounded-full.bg-orange-500\/20,
.rounded-full[class*="bg-orange-500"] {
  background-color: rgba(217, 119, 6, 0.2) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  color: #fcd34d !important;
  font-weight: 700 !important;
}

/* --- Custom Luxury Scrollbars --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #080d1a;
}

::-webkit-scrollbar-thumb {
  background: #1e283d;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #1e283d #080d1a;
}
