/**
 * ==========================================================================
 * Milestone Metrics Automated Intake Platform
 * Global Stylesheet (single source of truth)
 * --------------------------------------------------------------------------
 * Purpose:
 * - centralize the design system for shared use across the platform
 * - keep page templates lighter and easier to maintain
 * - provide reusable classes for cards, alerts, buttons, layout, and status UI
 *
 * Notes:
 * - facility palette follows the attached purple/violet dashboard direction
 * - status colors match the requested mapping:
 *   Pending   = orange
 *   Scheduled = blue
 *   Completed = green
 *   Attention = red
 * ==========================================================================
 */

/* ==========================================================================
   1) DESIGN TOKENS
   ========================================================================== */
:root {
  /* Typography */
  --font-display: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Brand */
  --mm-primary-900: #2d1674;
  --mm-primary-800: #42229a;
  --mm-primary-700: #5b34c8;
  --mm-primary-600: #6d49dd;
  --mm-primary-500: #7f5af0;
  --mm-primary-400: #9a7cff;
  --mm-primary-300: #c2b3ff;
  --mm-accent-500: #2f9fdb;
  --mm-accent-400: #55b7eb;
  --mm-mint-500: #1dbfaf;
  --mm-mint-400: #6adbcf;

  /* App background and surfaces */
  --app-bg: #f4f4fb;
  --app-bg-alt: #edeefe;
  --surface: #ffffff;
  --surface-soft: #f8f8ff;
  --surface-tint: #f4f1ff;
  --border-soft: #dedcf0;
  --border-strong: #c8c4e6;

  /* Text */
  --ink-900: #201c36;
  --ink-800: #312a4e;
  --ink-700: #534a76;
  --ink-600: #71698f;
  --ink-500: #8a84a5;

  /* Status colors */
  --status-pending: #f59e0b;
  --status-pending-bg: #fff4df;
  --status-scheduled: #2f80ed;
  --status-scheduled-bg: #eaf3ff;
  --status-completed: #18a56f;
  --status-completed-bg: #e9fbf3;
  --status-attention: #e5485d;
  --status-attention-bg: #ffecef;
  --status-progress: #7f5af0;
  --status-progress-bg: #f0ebff;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, var(--mm-primary-700) 0%, var(--mm-primary-500) 58%, var(--mm-accent-500) 100%);
  --gradient-facility-hero: linear-gradient(90deg, rgba(60, 33, 147, 0.96) 0%, rgba(104, 66, 219, 0.90) 46%, rgba(104, 66, 219, 0.34) 78%, rgba(104, 66, 219, 0.00) 100%);
  --gradient-page: linear-gradient(135deg, var(--app-bg) 0%, var(--app-bg-alt) 100%);

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;

  /* Shadows */
  --shadow-xs: 0 4px 14px rgba(35, 26, 74, 0.06);
  --shadow-sm: 0 10px 30px rgba(35, 26, 74, 0.08);
  --shadow-md: 0 18px 40px rgba(35, 26, 74, 0.10);
  --shadow-lg: 0 24px 56px rgba(35, 26, 74, 0.14);

  /* Layout */
  --site-max-width: 1200px;
  --container-x: 1.25rem;
}

/* ==========================================================================
   2) RESET + BASE
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink-900);
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(47, 159, 219, 0.20), transparent 55%),
    radial-gradient(900px 500px at 80% 20%, rgba(29, 191, 175, 0.18), transparent 55%),
    var(--gradient-page);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding: 2rem 0;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--container-x);
}

.page-section-title,
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.section-title {
  font-size: 1.48rem;
  margin: 0 0 0.95rem;
}

.panel-title {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
}

.mm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   3) GLOBAL BUTTONS
   ========================================================================== */
.btn,
.hero-btn,
.attention-btn {
  appearance: none;
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.btn:focus-visible,
.hero-btn:focus-visible,
.attention-btn:focus-visible,
.menu-btn:focus-visible,
.mobile-link:focus-visible {
  outline: 3px solid rgba(47, 159, 219, 0.35);
  outline-offset: 3px;
}

.btn {
  padding: 0.86rem 1.05rem;
  border-radius: 14px;
  font-size: 0.96rem;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.10);
  white-space: nowrap;
}

.btn-primary {
  color: #fff;
  background: var(--gradient-brand);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(47, 159, 219, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(47, 159, 219, 0.25);
  color: #0b3b55;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.08);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 159, 219, 0.45);
}

/* ==========================================================================
   4) SHARED SURFACES + STATUS
   ========================================================================== */
.panel,
.stat-card,
.attention-card,
.helper-box,
.hero-summary-card,
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

.panel {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-sub {
  color: var(--ink-600);
  font-weight: 600;
  margin: -0.15rem 0 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.status-pill.pending {
  color: #b86b00;
  background: var(--status-pending-bg);
  border-color: #ffdca0;
}

.status-pill.scheduled {
  color: #2469c9;
  background: var(--status-scheduled-bg);
  border-color: #cfe0ff;
}

.status-pill.ready {
  color: #0d8e5b;
  background: var(--status-completed-bg);
  border-color: #bcefd5;
}

.status-pill.progress {
  color: #5b34c8;
  background: var(--status-progress-bg);
  border-color: #d9cfff;
}

/* ==========================================================================
   5) SHARED HEADER / NAVIGATION
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(248, 250, 252, 0.78);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  min-width: 230px;
}

.logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  position: relative;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(47, 159, 219, 0.20);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.10);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
}

.logo-badge::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(47, 159, 219, 0.22), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(29, 191, 175, 0.18), transparent 60%);
  transform: rotate(18deg);
  pointer-events: none;
  z-index: 0;
}

.logo-badge img {
  width: 54px;
  height: 54px;
  position: relative;
  z-index: 1;
  border-radius: 12px;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.92rem;
  color: var(--ink-600);
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.nav-actions.nav-compact .btn {
  padding: 0.62rem 0.72rem;
  font-size: 0.84rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(2, 6, 23, 0.08);
}

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.08);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ink-900);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--border-soft);
  background: rgba(248, 250, 252, 0.86);
}

.mobile-panel-inner {
  padding: 0.9rem 0 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mobile-link {
  text-decoration: none;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 800;
  color: #0b3b55;
}

/* ==========================================================================
   6) LOADING OVERLAY
   ========================================================================== */
#mm-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 1;
  transition: opacity 0.35s ease;
}

#mm-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.mm-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--mm-accent-500);
  border-right-color: var(--mm-mint-500);
  border-radius: 50%;
  animation: mm-spin 0.75s linear infinite;
}

@keyframes mm-spin {
  to {
    transform: rotate(360deg);
  }
}

.mm-loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mm-loader-logo {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: var(--mm-accent-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-loader-msg {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  text-align: center;
  max-width: 280px;
  line-height: 1.55;
  min-height: 24px;
  transition: opacity 0.2s;
}

.mm-loader-dots {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.mm-loader-dots span {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--mm-accent-500), var(--mm-mint-500));
  border-radius: 50%;
  animation: mm-dot-bounce 1.3s ease-in-out infinite;
}

.mm-loader-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.mm-loader-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes mm-dot-bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

/* ==========================================================================
   7) FACILITY DASHBOARD PAGE
   ========================================================================== */
.dashboard-shell {
  padding: 1.1rem 0 2rem;
}

.facility-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.9fr);
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
}

.facility-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 240px at 12% 18%, rgba(255, 255, 255, 0.16), transparent 48%);
  pointer-events: none;
}

.hero-panel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  min-height: 230px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 62%;
  padding: 1.45rem;
  color: #fff;
  background: var(--gradient-facility-hero);
}

.hero-copy .mm-eyebrow {
  width: max-content;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0.7rem 0 0.25rem;
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.hero-credit-card {
  width: max-content;
  min-width: 160px;
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.hero-credit-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.3rem;
}

.hero-credit-value {
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.hero-credit-note {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.84);
}

.hero-image {
  position: absolute;
  inset: 0 0 0 auto;
  width: 54%;
  background-image: var(--facility-hero-image, none);
  background-size: cover;
  background-position: center right;
  filter: saturate(1.03) contrast(1.02);
}

.hero-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  width: min(100%, 430px);
  margin-top: 1rem;
}

.hero-btn {
  min-height: 46px;
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}

.hero-btn:hover {
  transform: translateY(-1px);
}

.hero-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 28px rgba(29, 14, 75, 0.22);
}

.hero-btn-primary:hover {
  box-shadow: 0 16px 34px rgba(29, 14, 75, 0.28);
}

.hero-btn-secondary {
  color: var(--ink-900);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(125, 111, 186, 0.28);
  box-shadow: 0 8px 20px rgba(35, 26, 74, 0.12);
}

.hero-btn-secondary:hover {
  border-color: rgba(125, 111, 186, 0.46);
}

.hero-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
}

.hero-summary-card {
  padding: 1.1rem 1.1rem 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f7f3ff 0%, #ffffff 100%);
  box-shadow: var(--shadow-xs);
}

.hero-summary-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--ink-900);
  margin: 0.55rem 0 0.2rem;
}

.hero-summary-text {
  color: var(--ink-700);
  font-weight: 600;
  line-height: 1.55;
}

.hero-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.mini-stat {
  padding: 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.mini-stat-label {
  margin-bottom: 0.25rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-600);
}

.mini-stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ink-900);
}

.mini-stat-note {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--ink-600);
  font-weight: 600;
}

.attention-card {
  padding: 1.15rem 1.2rem 1.2rem;
  margin-bottom: 1.35rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.attention-pending {
  background: linear-gradient(180deg, #fff9ef 0%, #ffffff 100%);
  border-color: #f9ddb3;
}

.attention-scheduled {
  background: linear-gradient(180deg, #eef5ff 0%, #ffffff 100%);
  border-color: #d6e5ff;
}

.attention-completed {
  background: linear-gradient(180deg, #eefdf5 0%, #ffffff 100%);
  border-color: #ccefdc;
}

.attention-attention {
  background: linear-gradient(180deg, #fff1f3 0%, #ffffff 100%);
  border-color: #ffcdd5;
}

.attention-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.attention-kicker {
  margin-bottom: 0.35rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-700);
}

.attention-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 900;
  color: var(--ink-900);
  margin-bottom: 0.22rem;
}

.attention-text {
  max-width: 760px;
  color: var(--ink-700);
  font-weight: 600;
  line-height: 1.55;
}

.attention-btn {
  min-height: 44px;
  padding: 0.78rem 1rem;
  border-radius: 12px;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 10px 22px rgba(91, 52, 200, 0.18);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.stat-card {
  padding: 1.15rem 1.15rem 1.1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--ink-600);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ink-900);
}

.stat-desc {
  margin-top: 0.34rem;
  font-size: 0.9rem;
  color: var(--ink-600);
  font-weight: 600;
  line-height: 1.45;
}

.stat-card.stat-brand .stat-badge {
  color: var(--mm-primary-800);
  background: #efe9ff;
}

.stat-card.stat-brand .stat-value {
  color: var(--mm-primary-700);
}

.stat-card.stat-pending .stat-badge {
  color: #b86b00;
  background: var(--status-pending-bg);
}

.stat-card.stat-pending .stat-value {
  color: #c27800;
}

.stat-card.stat-scheduled .stat-badge {
  color: #2469c9;
  background: var(--status-scheduled-bg);
}

.stat-card.stat-scheduled .stat-value {
  color: #2469c9;
}

.stat-card.stat-completed .stat-badge {
  color: #0d8e5b;
  background: var(--status-completed-bg);
}

.stat-card.stat-completed .stat-value {
  color: #0d8e5b;
}

.stat-card.stat-attention .stat-badge {
  color: #bb2535;
  background: var(--status-attention-bg);
}

.stat-card.stat-attention .stat-value {
  color: #bb2535;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1rem;
}

.case-list,
.action-list {
  display: grid;
  gap: 0.82rem;
}

.case-item,
.action-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.case-item:hover,
.action-card:hover {
  border-color: #b6a6f0;
  box-shadow: 0 12px 28px rgba(35, 26, 74, 0.10);
  transform: translateY(-1px);
}

.case-name,
.action-title {
  font-weight: 900;
  color: var(--ink-900);
}

.case-meta,
.action-desc {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--ink-600);
  font-weight: 600;
  line-height: 1.5;
}

.case-status-wrap {
  margin-top: 0.5rem;
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.1rem;
  white-space: nowrap;
  font-weight: 800;
  color: var(--mm-primary-700);
  text-decoration: none;
}

.case-link:hover {
  text-decoration: underline;
}

.action-card {
  justify-content: flex-start;
}

.action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #efe9ff;
  color: var(--mm-primary-700);
  font-size: 1.35rem;
  box-shadow: inset 0 0 0 1px rgba(108, 73, 221, 0.08);
}

.helper-box {
  margin-top: 1rem;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f8f5ff 0%, #ffffff 100%);
  box-shadow: var(--shadow-xs);
}

.helper-title {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
}

.helper-text {
  color: var(--ink-700);
  font-weight: 600;
  line-height: 1.6;
}

/* ==========================================================================
   8) RESPONSIVE RULES
   ========================================================================== */
@media (max-width: 1120px) {
  .nav-actions {
    display: none;
  }

  .menu-btn {
    display: inline-grid;
    place-items: center;
  }

  .brand {
    min-width: unset;
  }

  .logo-badge {
    width: 56px;
    height: 56px;
  }

  .logo-badge img {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 1080px) {
  .facility-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 60%;
  }

  .hero-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .dashboard-shell {
    padding-top: 0.8rem;
  }

  .facility-hero {
    padding: 1rem;
  }

  .hero-panel {
    display: block;
    min-height: unset;
  }

  .hero-copy {
    max-width: none;
    min-height: 240px;
  }

  .hero-image {
    inset: auto 0 0 auto;
    width: 46%;
    height: 100%;
    opacity: 0.42;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .hero-btn {
    width: 100%;
  }

  .attention-header {
    flex-direction: column;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 1rem;
  }

  .hero-credit-card {
    min-width: 100%;
    width: 100%;
  }

  .hero-image {
    width: 56%;
    opacity: 0.34;
  }

  .hero-mini-stats,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .case-item {
    flex-direction: column;
  }

  .case-link {
    padding-top: 0;
  }
}


/* ==========================================================================
   Password Visibility Controls
   --------------------------------------------------------------------------
   Reusable wrapper for login/reset/profile password fields.
   To disable visibility on any page, remove the button with data-password-toggle.
   ========================================================================== */
.password-field-wrap {
  position: relative;
  display: block
}

.password-field-wrap input {
  padding-right: 3.4rem !important
}

.password-toggle {
  position: absolute;
  right: .55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: .8rem;
  background: rgba(91, 52, 200, .10);
  color: #42229a;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center
}

.password-toggle:hover {
  background: rgba(91, 52, 200, .18)
}

.password-toggle[aria-pressed="true"] {
  background: rgba(47, 159, 219, .16);
  color: #124dc5
}

/* Admin / Facility confirmation banners */
.alert-success,
.success-banner,
.fc-alert-success {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #047857 !important
}

.alert-error,
.fc-alert-error {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #b91c1c !important
}


/* ========================================================================== */
/* 11) FACILITY PAGES POLISH PATCH - 2026-04-23 */
/* ========================================================================== */
.facility-page-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: center;
  margin: 0 0 1.5rem;
  padding: 1.45rem 1.65rem;
  border-radius: 24px;
  background: radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .76), transparent 32%), linear-gradient(135deg, rgba(109, 79, 215, .16), rgba(47, 159, 219, .16), rgba(29, 191, 175, .12));
  border: 1px solid rgba(109, 79, 215, .18);
  box-shadow: 0 16px 40px rgba(40, 31, 89, .08)
}

.facility-page-banner::after {
  content: '';
  position: absolute;
  inset: auto -8% -45% 45%;
  height: 160px;
  border-radius: 999px;
  background: rgba(47, 159, 219, .12);
  filter: blur(10px)
}

.facility-page-kicker {
  position: relative;
  z-index: 1;
  margin-bottom: .25rem;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(31, 41, 55, .68)
}

.facility-page-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -.025em;
  color: var(--ink-900)
}

.facility-page-subtitle {
  position: relative;
  z-index: 1;
  margin: .35rem 0 0;
  color: var(--ink-600);
  font-weight: 650;
  line-height: 1.45
}

.facility-credit-card {
  position: relative;
  z-index: 1;
  min-width: 190px;
  padding: 1rem 1.15rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
  text-align: center
}

.facility-credit-card .credit-label {
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-600)
}

.facility-credit-card .credit-value {
  margin: .25rem 0 .15rem;
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 950;
  color: var(--brand-purple)
}

.facility-credit-card .credit-link {
  color: var(--brand-purple);
  font-weight: 900;
  text-decoration: none
}

.facility-credit-card .credit-link:hover {
  text-decoration: underline
}

.hero-actions {
  grid-template-columns: 1fr;
  width: min(100%, 265px);
  align-items: stretch
}

.hero-btn {
  justify-content: flex-start;
  text-align: left;
  min-height: 52px;
  padding: .86rem 1.05rem;
  font-size: .98rem
}

.children-action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: .48rem;
  min-width: 150px
}

.children-action-buttons .child-action-btn,
.child-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: .45rem .72rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .88rem;
  line-height: 1.1;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  text-align: center
}

.child-action-primary {
  background: rgba(79, 70, 229, .10);
  color: #4338ca;
  border-color: rgba(79, 70, 229, .16)
}

.child-action-edit {
  background: rgba(47, 159, 219, .10);
  color: #075985;
  border-color: rgba(47, 159, 219, .16)
}

.child-action-muted {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0
}

.child-action-danger {
  background: rgba(220, 38, 38, .08);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, .15)
}

.child-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, .08)
}

.facility-record-shell {
  max-width: 1080px;
  margin: 0 auto 2.5rem
}

.record-page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 950;
  letter-spacing: -.035em;
  color: var(--ink-900)
}

.record-page-subtitle {
  margin: .35rem 0 0;
  font-size: 1.14rem;
  color: var(--ink-600);
  font-weight: 650
}

.record-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  padding: 1.65rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08)
}

.record-card h2,
.record-section-title {
  font-size: 1.25rem;
  font-weight: 950;
  color: var(--ink-900)
}

.record-warning {
  font-size: 1.16rem;
  line-height: 1.42;
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 18px;
  padding: 1.25rem 1.35rem;
  margin: 1rem 0 1.2rem
}

.record-btn-row {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: 1.1rem
}

.record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  padding: .9rem 1.15rem;
  font-size: 1rem;
  font-weight: 950;
  text-decoration: none;
  border: 0;
  cursor: pointer
}

.record-btn-danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 12px 24px rgba(220, 38, 38, .2)
}

.record-btn-secondary {
  background: #fff;
  color: var(--ink-900);
  border: 1px solid #d1d5db;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06)
}

.record-btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 12px 24px rgba(79, 70, 229, .18)
}

@media (max-width:820px) {
  .facility-page-banner {
    grid-template-columns: 1fr
  }

  .facility-credit-card {
    width: 100%;
    text-align: left
  }

  .hero-actions {
    width: 100%;
    max-width: none
  }
}

.fc-action-stack {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 100%;
  min-width: 170px;
}

.fc-action-stack .fc-link,
.fc-action-stack button.fc-link {
  width: 100%;
  min-height: 42px;
  padding: .7rem .85rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 800;
  text-decoration: none;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  cursor: pointer;
}

.fc-action-stack .fc-link-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}