/* ==========================================================================
   MedWebDesk Master Design System - Smashed Light Theme
   Palette: Soft Whites, Deep Charcoals, and Fire Red
   Zero CDN Dependencies - 100% Local Vanilla CSS
   ========================================================================== */

:root {
  /* Canvas & Elevated Light Surfaces */
  --bg-canvas: #edf4ff;
  --bg-surface: rgba(255, 255, 255, 0.82);
  --bg-subtle: #f4f8ff;
  --bg-card: rgba(255, 255, 255, 0.76);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  
  /* Charcoals */
  --charcoal-900: #11141a;
  --charcoal-800: #1b2433;
  --charcoal-700: #28364c;
  --charcoal-600: #3c4e69;
  --charcoal-card: rgba(255, 255, 255, 0.78);
  
  /* Fire Red Accents */
  --fire-red: #e31218;
  --fire-red-hover: #c90d14;
  --fire-red-light: #fff0f1;
  --fire-red-border: rgba(227, 18, 24, 0.22);
  --fire-red-glow: rgba(227, 18, 24, 0.22);
  --fire-gradient: linear-gradient(135deg, #ed2027 0%, #cf080f 100%);
  
  /* Typography Colors */
  --text-primary: #11141a;
  --text-secondary: #53647f;
  --text-muted: #71809a;
  --text-dim: #93a0b4;
  --text-white: #ffffff;
  
  /* Borders & Dividers */
  --border-subtle: rgba(93, 121, 164, 0.14);
  --border-card: rgba(255, 255, 255, 0.94);
  --border-focus: var(--fire-red);
  
  /* Status Colors */
  --emerald: #10b981;
  --emerald-light: #ecfdf5;
  --emerald-border: rgba(16, 185, 129, 0.3);
  --cyan: #0284c7;
  --cyan-light: #f0f9ff;
  --amber: #f59e0b;
  --amber-light: #fffbeb;
  
  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 20px 54px -8px rgba(71, 105, 159, 0.10), 0 3px 12px rgba(71, 105, 159, 0.04);
  --shadow-card-hover: 0 24px 56px -7px rgba(57, 91, 145, 0.15), 0 8px 22px rgba(57, 91, 145, 0.05);
  --shadow-charcoal: 0 16px 36px -4px rgba(17, 20, 26, 0.28);
  --shadow-red: 0 8px 22px rgba(227, 18, 24, 0.20);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse at 13% 3%, rgba(255,255,255,.96) 0px, transparent 36%),
    radial-gradient(ellipse at 86% 8%, rgba(215,230,255,.84) 0px, transparent 40%),
    radial-gradient(ellipse at 18% 92%, rgba(255,219,227,.36) 0px, transparent 34%),
    linear-gradient(135deg, #edf4ff 0%, #e9f1ff 55%, #f2f6ff 100%);
  background-attachment: fixed;
}

/* The outer content area is a flex item. Let page layouts shrink to the viewport
   even when a wide table or tool panel lives inside them. */
body > main {
  min-width: 0;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Header & Floating Navigation Island (Smashed Image 1 + 2)
   ========================================================================== */
.navbar-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 100;
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}

.navbar {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--charcoal-900);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  box-shadow: 0 12px 36px rgba(17, 20, 26, 0.22);
  color: var(--text-white);
  transition: all var(--transition-normal);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fire-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-red);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--fire-gradient);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 46, 67, 0.35);
  filter: brightness(1.05);
}

.btn-charcoal {
  background: var(--charcoal-900);
  color: #ffffff;
  border: 1px solid var(--charcoal-700);
}

.btn-charcoal:hover {
  background: var(--charcoal-700);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.04);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-full);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1.02rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Elevated Light Cards & Containers (Smashed Image 1 & 2)
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-shell {
  padding: 3rem 1.5rem 5rem;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(15, 23, 42, 0.12);
}

/* Dark Floating Summary Card (Image 1 & 2 Smash) */
.charcoal-card {
  background: var(--charcoal-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  color: #ffffff;
  box-shadow: var(--shadow-charcoal);
}

/* ==========================================================================
   Badges, Pills & Indicators
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.badge-red {
  background: var(--fire-red-light);
  color: var(--fire-red);
  border: 1px solid var(--fire-red-border);
}

.badge-charcoal {
  background: var(--charcoal-900);
  color: #ffffff;
  border: 1px solid var(--charcoal-700);
}

.badge-emerald {
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.badge-cyan {
  background: var(--cyan-light);
  color: var(--cyan);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.badge-amber {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Heat dots (Image 1 style hot client score) */
.heat-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.heat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e2e8f0;
}

.heat-dot.active-red {
  background: var(--fire-red);
  box-shadow: 0 0 5px var(--fire-red-glow);
}

.heat-dot.active-orange {
  background: #f97316;
}

.heat-dot.active-emerald {
  background: var(--emerald);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fire-red);
  box-shadow: 0 0 8px var(--fire-red);
  display: inline-block;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ==========================================================================
   Typography Helpers
   ========================================================================== */
.title-gradient {
  background: linear-gradient(135deg, var(--charcoal-900) 40%, var(--fire-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-red {
  background: var(--fire-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -0.025em; color: var(--charcoal-900); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; color: var(--charcoal-900); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 700; color: var(--charcoal-900); }

/* Table Container */
.data-table-container {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-card);
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 46, 67, 0.3) #f1f3f7;
}

.data-table-container::-webkit-scrollbar {
  height: 8px;
}

.data-table-container::-webkit-scrollbar-track {
  background: #f1f3f7;
  border-radius: var(--radius-sm);
}

.data-table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 46, 67, 0.3);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  min-width: 820px;
}

.data-table th {
  background: #f8fafc;
  padding: 0.95rem 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.data-table tr:hover td {
  background: #fafbfd;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
  padding: 3.5rem 0 2rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--charcoal-900);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--fire-red);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

/* ==========================================================================
   Mobile Navigation Drawer
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: #ffffff;
  padding: 0.45rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 75px;
  left: 1rem;
  right: 1rem;
  background: var(--charcoal-900);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  z-index: 150;
  padding: 1.75rem;
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.2s ease forwards;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fire-red);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .navbar-wrapper { top: 0.5rem; padding: 0 0.75rem; }
  .navbar { padding: 0.65rem 1rem; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .mobile-menu-btn { display: flex; }
  .container { padding: 0 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .btn-lg { padding: 0.8rem 1.4rem; font-size: 0.95rem; width: 100%; }
}

/* Shared application chrome: cool glass surfaces, clear ink and medical red. */
.navbar-wrapper {
  top: 0;
  padding: 0 clamp(18px, 3.4vw, 58px);
  margin: 0;
  background: rgba(237, 244, 255, 0.70);
  border-bottom: 1px solid rgba(103, 130, 173, 0.12);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.navbar {
  width: 100%;
  max-width: 1680px;
  min-height: 78px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-primary);
}

.nav-brand {
  gap: 0.65rem;
  flex: none;
  color: var(--text-primary);
  font-size: 1.18rem;
  font-weight: 780;
  letter-spacing: -0.045em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: transparent;
  color: var(--fire-red);
  box-shadow: none;
}

.brand-icon .icon-svg { fill: currentColor; }
.brand-badge { display: none; }

.nav-links {
  flex: 1;
  justify-content: center;
  gap: clamp(0.1rem, 1.25vw, 1.35rem);
  margin: 0 clamp(0.5rem, 2vw, 2rem);
}

.nav-link {
  color: var(--text-primary);
  padding: 0.58rem 1rem;
  font-size: 0.91rem;
  font-weight: 570;
  white-space: nowrap;
}

.nav-link:hover { color: var(--fire-red); background: rgba(255,255,255,.56); }
.nav-link-current { color: var(--fire-red); background: rgba(227,18,24,.12); font-weight: 700; }
.nav-link-current:hover { background: rgba(227,18,24,.17); }

.nav-cta { gap: 0.65rem; flex: none; }

.nav-icon-btn, .nav-avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  color: var(--text-primary);
  box-shadow: 0 5px 15px rgba(80,110,160,.05);
}

.nav-icon-btn:hover { background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm); }
.nav-icon-btn .icon-svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-avatar { background: linear-gradient(145deg, #d7e8ff, #f8e3e5); color: #74424a; font-size: .72rem; font-weight: 800; }

.btn-charcoal {
  color: var(--text-primary);
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.btn-charcoal:hover { background: #fff; color: var(--fire-red); }
.badge-charcoal { background: #eff3fa; color: var(--text-secondary); border-color: var(--border-subtle); }

.glass-card, .data-table-container, .footer, .charcoal-card {
  border-color: rgba(255,255,255,.92);
  box-shadow: var(--shadow-card);
}
.charcoal-card { background: rgba(255,255,255,.74); color: var(--text-primary); }
.footer { background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.data-table th { background: rgba(232,240,252,.78); }
.data-table tr:hover td { background: rgba(237,244,255,.56); }

.mobile-menu-btn {
  color: var(--text-primary);
  background: rgba(255,255,255,.56);
  border-color: rgba(255,255,255,.88);
}
.mobile-nav-drawer {
  top: 84px;
  background: rgba(249,252,255,.96);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--shadow-card-hover);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.mobile-nav-link { color: var(--text-primary); }
.mobile-nav-link:hover { background: rgba(227,18,24,.08); color: var(--fire-red); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(227,18,24,.42);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .navbar-wrapper { padding: 0 1rem; }
  .navbar { min-height: 70px; }
  .nav-links { display: none; }
  .nav-cta { display: flex; margin-left: auto; }
  .mobile-menu-btn { display: flex; margin-left: .55rem; }
}

@media (max-width: 520px) {
  .navbar-wrapper { padding: 0 .8rem; }
  .navbar { min-height: 64px; }
  .nav-brand { font-size: 1rem; }
  .brand-icon { width: 29px; height: 29px; }
  .brand-icon .icon-svg { width: 27px !important; height: 27px !important; }
  .nav-cta { gap: .35rem; }
  .nav-icon-btn, .nav-avatar { width: 35px; height: 35px; }
  .nav-cta .nav-icon-btn:first-child { display: none; }
  .mobile-nav-drawer { top: 70px; left: .7rem; right: .7rem; padding: 1.15rem; }
}
