/* ==========================================================================
   HMS - Hospital Management System
   Professional Healthcare Theme (Bootstrap 5 override)
   ========================================================================== */

:root {
  --hms-navy: #12294d;
  --hms-navy-dark: #0b1c36;
  --hms-blue: #1d5fbf;
  --hms-green: #1a8a5e;
  --hms-orange: #e08a1e;
  --hms-red: #c0392b;
  --hms-grey-bg: #f4f6f9;
  --hms-border: #e2e6ec;
  --hms-text: #1f2937;
  --hms-text-muted: #6b7280;
  --hms-radius: 8px;
  --hms-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
}

body {
  background: var(--hms-grey-bg);
  color: var(--hms-text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 0.925rem;
}

a { color: var(--hms-blue); }
a:hover { color: var(--hms-navy); }

/* ---------- Layout shell ---------- */
.hms-shell { display: flex; min-height: 100vh; }

.hms-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--hms-navy);
  color: #dbe4f3;
  min-height: 100vh;
  position: sticky;
  top: 0;
  transition: margin-left .2s ease;
}
.hms-sidebar .brand {
  padding: 18px 20px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hms-sidebar .nav-link {
  color: #c7d3ea;
  padding: 10px 20px;
  font-size: .875rem;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hms-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.hms-sidebar .nav-link.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--hms-blue);
  font-weight: 600;
}
.hms-sidebar .nav-section-title {
  padding: 14px 20px 4px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #7f92b8;
}

.hms-main { flex: 1; min-width: 0; }

.hms-topbar {
  background: #fff;
  border-bottom: 1px solid var(--hms-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.hms-topbar .search-box { max-width: 340px; }

.hms-content { padding: 22px; }

/* ---------- Cards ---------- */
.hms-card {
  background: #fff;
  border: 1px solid var(--hms-border);
  border-radius: var(--hms-radius);
  box-shadow: var(--hms-shadow);
}
.hms-card .card-header {
  background: #fff;
  border-bottom: 1px solid var(--hms-border);
  font-weight: 600;
  padding: 14px 18px;
}
.hms-card .card-body { padding: 18px; }

.hms-stat-card {
  border-radius: var(--hms-radius);
  border: 1px solid var(--hms-border);
  background: #fff;
  padding: 18px;
  box-shadow: var(--hms-shadow);
}
.hms-stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--hms-navy); }
.hms-stat-card .stat-label { font-size: .8rem; color: var(--hms-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.hms-stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(29, 95, 191, .1); color: var(--hms-blue); font-size: 1.2rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background-color: var(--hms-blue);
  border-color: var(--hms-blue);
}
.btn-primary:hover { background-color: var(--hms-navy); border-color: var(--hms-navy); }
.btn-success { background-color: var(--hms-green); border-color: var(--hms-green); }
.btn-outline-primary { color: var(--hms-blue); border-color: var(--hms-blue); }

/* ---------- Tables ---------- */
.table thead th {
  background: #f8fafc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--hms-text-muted);
  border-bottom: 1px solid var(--hms-border);
  font-weight: 600;
}
.table td, .table th { vertical-align: middle; }

/* ---------- Badges ---------- */
.bg-orange { background-color: var(--hms-orange) !important; }
.badge { font-weight: 500; font-size: .74rem; padding: .4em .65em; }

/* ---------- Auth pages ---------- */
.hms-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--hms-navy) 0%, var(--hms-navy-dark) 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.hms-auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  padding: 34px 32px;
  position: relative;
  z-index: 2;
}
.hms-auth-card .brand-icon {
  width: 52px; height: 52px; border-radius: 10px;
  background: var(--hms-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 14px;
}

/* ---------- Floating medical-device decoration (auth pages) ---------- */
.hms-auth-icons {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hms-auth-icons .floating-icon {
  position: absolute;
  color: rgba(255, 255, 255, 0.38);
  text-shadow: 0 0 18px rgba(120, 170, 255, 0.35);
  animation-name: hms-float;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}
/* A generous, evenly-spread constellation of icons across the viewport. */
.hms-auth-icons .fi-1  { top: 8%;  left: 6%;  font-size: 3rem;   animation-duration: 9s;  animation-delay: 0s; }
.hms-auth-icons .fi-2  { top: 18%; left: 88%; font-size: 3.6rem; animation-duration: 11s; animation-delay: .5s; }
.hms-auth-icons .fi-3  { top: 62%; left: 4%;  font-size: 2.6rem; animation-duration: 8s;  animation-delay: 1.2s; }
.hms-auth-icons .fi-4  { top: 78%; left: 91%; font-size: 3.2rem; animation-duration: 10s; animation-delay: .8s; }
.hms-auth-icons .fi-5  { top: 4%;  left: 45%; font-size: 2.2rem; animation-duration: 7s;  animation-delay: 2s; }
.hms-auth-icons .fi-6  { top: 88%; left: 40%; font-size: 2.8rem; animation-duration: 9.5s; animation-delay: 1.6s; }
.hms-auth-icons .fi-7  { top: 34%; left: 12%; font-size: 2rem;   animation-duration: 6.5s; animation-delay: .3s; }
.hms-auth-icons .fi-8  { top: 42%; left: 82%; font-size: 2.4rem; animation-duration: 8.5s; animation-delay: 2.4s; }
.hms-auth-icons .fi-9  { top: 55%; left: 65%; font-size: 1.9rem; animation-duration: 7.5s; animation-delay: 1s; }
.hms-auth-icons .fi-10 { top: 12%; left: 68%; font-size: 2.1rem; animation-duration: 10.5s; animation-delay: 1.9s; }
@keyframes hms-float {
  0%   { transform: translateY(0) rotate(0deg); opacity: .55; }
  50%  { transform: translateY(-24px) rotate(8deg); opacity: 1; }
  100% { transform: translateY(0) rotate(0deg); opacity: .55; }
}
@media (max-width: 767.98px) {
  /* Keep the login card uncluttered on small screens - thin out the icons instead of shrinking them illegibly. */
  .hms-auth-icons .fi-5, .hms-auth-icons .fi-7, .hms-auth-icons .fi-9, .hms-auth-icons .fi-10 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hms-auth-icons .floating-icon { animation: none; }
}

/* ---------- Quick Actions floating button ---------- */
.hms-fab-wrapper {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.hms-fab-toggle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--hms-blue);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(29,95,191,.4);
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.hms-fab-toggle:hover { background: var(--hms-navy); }
.hms-fab-toggle.open { transform: rotate(45deg); background: var(--hms-navy); }
.hms-fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}
.hms-fab-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.hms-fab-item {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.hms-fab-item-label {
  background: #12294d;
  color: #fff;
  font-size: .8rem;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.hms-fab-item-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--hms-blue);
  border: 1px solid var(--hms-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  transition: background .15s ease, color .15s ease;
}
.hms-fab-item:hover .hms-fab-item-icon { background: var(--hms-blue); color: #fff; }
@media print { .hms-fab-wrapper { display: none !important; } }

/* ---------- Breadcrumbs ---------- */
.breadcrumb { background: transparent; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: #9ca3af; }
.breadcrumb-item a { color: var(--hms-text-muted); }
.breadcrumb-item a:hover { color: var(--hms-blue); }
.breadcrumb-item.active { color: var(--hms-text); font-weight: 500; }

/* ---------- Landing page ---------- */
.hms-landing-nav { background: #fff; border-bottom: 1px solid var(--hms-border); }
.hms-hero {
  background: linear-gradient(135deg, var(--hms-navy) 0%, var(--hms-blue) 120%);
  color: #fff;
  padding: 90px 0 100px;
}
.hms-hero h1 { font-weight: 700; font-size: 2.6rem; }
.hms-hero p.lead { color: #cfe0f7; }
.hms-feature-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: rgba(29, 95, 191, .1); color: var(--hms-blue);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.hms-pricing-card {
  border: 1px solid var(--hms-border);
  border-radius: var(--hms-radius);
  background: #fff;
  padding: 30px 26px;
  height: 100%;
}
.hms-pricing-card.featured { border: 2px solid var(--hms-blue); box-shadow: var(--hms-shadow); }
.hms-pricing-card .price { font-size: 2rem; font-weight: 700; color: var(--hms-navy); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .hms-sidebar { position: fixed; left: -260px; z-index: 1050; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .hms-sidebar.show { left: 0; }
  .hms-content { padding: 14px; }
}
