/*
 * MedBridge institutional theme
 * A Mongolia.gov.mn-inspired civic portal system, adapted for cross-border care.
 */
:root {
  --portal-navy: #003087;
  --portal-blue: #006eb5;
  --portal-sky: #dcebf5;
  --portal-gold: #f4b400;
  --care-red: #ba432a;
  --civic-slate: #334353;
  --civic-gray: #75787b;
  --ink: #25313c;
  --green: var(--portal-navy);
  --deep: #001e54;
  --jade: var(--portal-blue);
  --gold: var(--portal-gold);
  --paper: #f5f7fa;
  --white: #fff;
  --muted: #596875;
  --line: #d9d9d6;
  --danger: #a33425;
  --official-red: var(--portal-navy);
  --official-red-dark: #001e54;
  --official-brick: var(--portal-blue);
  --official-gold: var(--portal-gold);
  --official-paper: #f5f7fa;
  --official-paper-deep: #e8eef3;
  --official-border: #d9d9d6;
  --official-ink: #18324a;
  --official-muted: #53616d;
  --shadow: 0 4px 14px rgba(0, 48, 135, .08);
  color-scheme: light;
}

html { scroll-behavior: smooth; }
body {
  background: #f4f6f8;
  color: var(--official-ink);
  font-family: Arial, "Noto Sans Mongolian", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(0, 48, 135, .018) 1px, transparent 1px);
  background-size: 100% 34px;
}
h1, h2, h3, .section-title, .hero-title {
  color: #102f4d;
  font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif;
  font-weight: 800;
  letter-spacing: -.015em;
}
a { color: var(--official-red); }
:focus-visible { outline: 3px solid rgba(244, 180, 0, .72); outline-offset: 2px; }
::selection { background: var(--portal-sky); color: var(--portal-navy); }

/* Official identity and navigation */
.official-bar { background: var(--portal-navy); border: 0; color: #fff; }
.official-bar .container { min-height: 34px; }
.official-bar-tools { display: flex; align-items: center; gap: 24px; }
.official-service-standard { color: #dceefa; font-size: .72rem; letter-spacing: .12em; }
.official-bar .languages { display: flex; gap: 0; }
.official-bar .languages a { border-left: 1px solid rgba(255,255,255,.18); border-radius: 0; color: #fff8ee; padding: 2px 9px; }
.site-header { background: rgba(255, 255, 255, .99); border-bottom: 5px solid var(--portal-navy); box-shadow: 0 2px 8px rgba(0, 48, 135, .08); }
.site-header::after { display: none; }
.brand { gap: 11px; color: var(--official-red-dark); }
.brand-mark { width: 42px; height: 48px; border-radius: 0; background: var(--portal-gold); color: var(--portal-navy); box-shadow: inset 5px 0 var(--portal-navy); }
.main-nav { gap: 2px; }
.main-nav > a, .main-nav .link-button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #173b60; padding: 24px 12px 20px; font-weight: 800; }
.main-nav > a:hover, .main-nav .link-button:hover { background: #eef5fa; color: var(--portal-blue); }
.main-nav > a.active { background: #e7f1f8; border-bottom-color: var(--portal-blue); color: var(--portal-navy); }
.main-nav > a.active::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 2px 0; background: var(--portal-gold); }
.main-nav .nav-login,
.main-nav .nav-login.active { border: 1px solid var(--official-red); margin-left: 7px; padding: 10px 15px; background: var(--official-red); color: #fff !important; }
.main-nav .nav-login:hover { background: var(--official-red); border-color: var(--official-red); color: #fff; }
.menu-button { border-radius: 2px; border-color: var(--official-border); }
@media (min-width: 981px) {
  .site-header:not(.admin-header) .nav-wrap { display: grid; grid-template-columns: auto minmax(300px, 440px); padding-top: 18px; }
  .site-header:not(.admin-header) .brand { justify-self: start; min-height: 56px; font-size: 1.22rem; letter-spacing: .01em; }
  .site-header:not(.admin-header) .main-nav { grid-column: 1 / -1; justify-content: flex-start; width: 100%; border-top: 1px solid #e2e6e9; }
  .site-header:not(.admin-header) .main-nav > a,
  .site-header:not(.admin-header) .main-nav .link-button { padding-top: 14px; padding-bottom: 12px; }
}
.header-search { display: flex; align-self: center; justify-self: end; width: min(440px, 100%); margin: 0; border: 1px solid #b9c5cf; border-radius: 999px; overflow: hidden; background: #fff; }
.header-search input { min-height: 44px; padding: 9px 16px; border: 0; box-shadow: none; }
.header-search input:focus { box-shadow: inset 0 0 0 2px var(--portal-blue); }
.header-search button { flex: 0 0 54px; min-height: 44px; padding: 0; border: 0; border-left: 1px solid #e3e7ea; border-radius: 0; background: #fff; color: var(--portal-navy); font-size: 1.2rem; }
.header-search button:hover { background: #edf5fa; }

/* Shared document language */
.panel, .card, .feature-card, .service-card, .news-card, .resource-card {
  border: 1px solid var(--official-border);
  border-radius: 2px;
  background: #fff;
  box-shadow: var(--shadow);
}
.panel { border-top: 3px solid var(--official-red); }
.button, button { border-radius: 2px; }
.button.primary, button.primary, button[type="submit"] { background: var(--official-red); border-color: var(--official-red-dark); color: #fff; box-shadow: none; }
.button.primary:hover, button.primary:hover, button[type="submit"]:hover { background: var(--official-red-dark); }
.auth-shell .form-card button.button.primary:hover,
.auth-shell .form-card button.button.primary:focus-visible { background: var(--official-red-dark); border-color: var(--official-red-dark); color: #fff; }
.button.ghost, .button.secondary { background: #fff; border-color: #aab5bf; color: var(--portal-navy); }
input, select, textarea { border-color: #aeb8c1; border-radius: 2px; background-color: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(0, 110, 181, .14); }
input::placeholder, textarea::placeholder { color: #65737f; opacity: 1; }
.eyebrow { color: var(--official-red); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .11em; }
.badge, .status { border-radius: 2px; }
.tabs { border-bottom-color: var(--official-border); }
.tabs button, .tabs a { border-radius: 0; }
.tabs .active, .tabs [aria-selected="true"] { color: var(--official-red-dark); border-bottom-color: var(--official-red); }
table { background: #fff; border: 1px solid var(--official-border); }
th { background: #e8eef3; color: #263f56; border-bottom-color: #b8c4ce; }
td { border-bottom-color: #e3e7ea; }
tbody tr:nth-child(even) { background: #f8fafb; }
tbody tr:hover { background: #edf5fa; }
footer { background: #001e54; border-top: 5px solid var(--portal-blue); color: #eef6fb; }
footer p, footer .disclaimer { color: #cbdce8; }
.hero, .hero-2, .hero-3, .page-hero, .dashboard-head { background: linear-gradient(110deg, var(--portal-navy), #004f82); }
.hero .button.primary { border-color: var(--portal-navy); background: var(--portal-navy); color: #fff; }
.back-to-top, .admin-body .back-to-top { border-color: #fff; background: var(--portal-navy); color: #fff; box-shadow: 0 8px 20px rgba(0,48,135,.28), 0 0 0 4px rgba(244,180,0,.35); }
.back-to-top:hover, .admin-body .back-to-top:hover { background: #001e54; }
.section h2,
.page-hero h1,
.dashboard-head h1,
.form-card h2,
.panel h2,
.news-card h2,
.news-page-heading h1,
.formatted-content h2,
.formatted-content h3,
.formatted-content h4 { font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif; font-weight: 800; }
.patient-portal-head h1 { font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif; font-weight: 800; }
.disease-command, .disease-index { --clinical-deep: #003087; --clinical-teal: #006eb5; --clinical-mint: #dcebf5; --clinical-frost: #f3f7fa; --clinical-cyan: #9bcce8; --clinical-amber: #f4b400; }

/* Direct heading colors must follow dark surfaces instead of the global light-surface rule. */
.hero h1,
.page-hero h1,
.dashboard-head h1,
.auth-aside h1,
.service-strip h2,
.service-strip h3,
.patient-portal-head h1,
.disease-command h1,
.disease-command h2,
.disease-command h3,
.home-support h2,
.home-support h3,
.home-final-cta h2,
.escort-practice h3 { color: #fff; }
.hero .button.primary,
.home-support-intro .button { color: #fff; }
.hero .button.ghost { color: #fff; }

/* Public homepage: a civic service lead and an operational information board. */
.home-hero { background: linear-gradient(90deg, #fff 0 64%, #eef3f7 64% 100%); border-bottom: 1px solid var(--official-border); }
.home-hero::before { background: var(--portal-blue); width: 6px; right: auto; opacity: 1; }
.home-hero-grid { grid-template-columns: minmax(0, 1.18fr) minmax(390px, .72fr); gap: clamp(40px, 6vw, 84px); min-height: 570px; padding-top: 48px; padding-bottom: 48px; }
.home-hero-copy h1 { max-width: 760px; color: #133451; font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif; font-size: clamp(2.65rem, 4.25vw, 4rem); font-weight: 800; line-height: 1.13; letter-spacing: -.035em; }
.home-hero { color: var(--official-ink); }
.home-hero-copy > p { color: #40566a; }
.home-assurances { border-top-color: #c8d4de; color: #40566a; }
.home-assurances li::before { color: #9a7000; }
.home-hero .button.primary,
.home-final-cta .button.primary { border-color: var(--portal-navy); background: var(--portal-navy); color: #fff; }
.home-hero .button.ghost { border-color: #758a9c; background: #fff; color: var(--portal-navy); }
.home-hero .button.ghost:hover { border-color: var(--portal-blue); background: #edf6fb; color: #004f82; }
.home-final-cta .button.ghost { color: #fff; }
.hero-actions .button { min-height: 46px; }
.care-passport { border: 0; border-top: 6px solid var(--portal-gold); border-radius: 0; background: var(--portal-navy); color: #fff; box-shadow: 0 10px 24px rgba(0, 48, 135, .14); }
.care-passport::after { content: "SERVICE DOSSIER"; position: absolute; right: 20px; top: 16px; color: #b9d5e8; font: 700 .66rem/1 ui-monospace, monospace; letter-spacing: .14em; }
.care-passport-head { border-bottom-color: rgba(255,255,255,.25); color: #fff; }
.care-passport-head i, .care-passport-head i::after { background: var(--portal-gold); color: var(--portal-gold); }
.care-passport-kicker { color: #c8dce9; }
.care-passport h2 { color: #fff; font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif; font-weight: 800; }
.care-passport li:not(:last-child)::after { background: #5076ab; }
.care-passport li > span { border-color: var(--portal-gold); background: var(--portal-gold); color: #17345b; }
.care-passport small { color: #d2e1eb; }
.care-passport-step, .escort-flow article { border-radius: 0; }
.care-passport-step span, .escort-flow article > span { background: var(--official-red); border-radius: 2px; color: #fff; }
.home-proof-strip, .home-discovery, .escort-showcase, .home-resource-section, .home-support-section, .home-news-section { border-color: var(--official-border); }
.home-proof-stat, .home-support-card, .home-resource-card, .home-news-card { border-radius: 2px; box-shadow: none; }
.home-discovery { background: #eef2f5; }
.home-search-heading h2,
.home-section-heading h2,
.escort-showcase-heading h2,
.home-faq h2,
.home-final-cta h2 { font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif; font-weight: 800; letter-spacing: -.025em; }
.home-proof dt,
.home-resource-title h3,
.home-doctor-card h3,
.escort-flow-heading h3 { font-family: "Arial Narrow", "Roboto Condensed", "Noto Sans Mongolian", "Microsoft YaHei", sans-serif; font-weight: 800; }
.home-proof-stat { border-left: 3px solid var(--portal-gold); }
.home-doctor-card { background: #f1f5f8; }
.escort-showcase { --escort-deep: #003087; --escort-jade: #006eb5; --escort-mist: #e2edf4; --escort-blue: #9ec9e2; --escort-gold: #f4b400; background: #f2f5f7; }
.home-support-intro .button { border-color: var(--portal-gold); background: var(--portal-gold); color: #17345b; }
.home-support-intro .button:hover { background: #ffd044; }
.escort-flow { position: relative; gap: 0; border: 1px solid var(--official-border); background: #fff; }
.escort-flow::before { content: ""; position: absolute; top: 31px; left: 8%; right: 8%; height: 2px; background: #b9cad8; }
.escort-flow article { position: relative; z-index: 1; border-right: 1px solid var(--official-border); background: transparent; }
.escort-flow article:last-child { border-right: 0; }
.faq-item, details { border-radius: 1px; }

/* Appointment intake: one continuous filing process */
.appointment-page, .appointment-form-page { background: transparent; }
.appointment-heading { border-left: 5px solid var(--portal-gold); padding-left: 20px; }
.appointment-form { border: 1px solid var(--official-border); border-top: 4px solid var(--portal-navy); border-radius: 2px; box-shadow: var(--shadow); }
.appointment-tabs { position: relative; gap: 0; background: #e8eef3; border: 1px solid var(--official-border); }
.appointment-tabs::before { content: ""; position: absolute; top: 29px; left: 11%; right: 11%; height: 2px; background: #b8c7d3; }
.appointment-tabs button { position: relative; z-index: 1; border: 0; border-right: 1px solid var(--official-border); border-bottom: 3px solid transparent; border-radius: 0; background: #f2f6f9; }
.appointment-tabs button:last-child { border-right: 0; }
.appointment-tabs button.active { background: #fff; border-bottom-color: var(--portal-blue); color: var(--portal-navy); }
.appointment-tabs button span, .appointment-resource-step::before { border-radius: 2px; background: #536b80; color: #fff; }
.appointment-tabs button.active span { background: var(--official-red); }
.appointment-resource-chain { border: 1px solid var(--official-border); border-left: 4px solid var(--portal-gold); border-radius: 0; background: #f4f8fb; }
.appointment-resource-step { border-radius: 0; }
.appointment-form-actions { border-top: 1px solid var(--official-border); background: #f2f6f9; }
.appointment-form-tabs button > span,
.appointment-visit-type small,
.appointment-resource-label small { color: #53636f; }
.appointment-form-tabs button.active > span { color: #e5f1f8; }
.appointment-page { background: #f3f6f9; }
.appointment-source { border-left-color: var(--portal-gold); background: #edf3f7; }
.appointment-source span { color: #4e6171; }
.appointment-form-tabs button:hover { background: #e5eff6; color: var(--portal-navy); }
.appointment-form-tabs button.active { background: var(--portal-navy); color: #fff; }
.appointment-visit-type input:checked + span { border-color: var(--portal-blue); background: #e7f2f8; box-shadow: inset 4px 0 var(--portal-blue); }
.appointment-resource-label b { background: var(--portal-navy); color: #fff; }
.appointment-form input:focus,
.appointment-form select:focus,
.appointment-form textarea:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(0,110,181,.14); }
.appointment-success-mark { background: var(--portal-navy); }

/* Favorites inherit the portal system instead of the earlier green product theme. */
.favorite-tabs button { color: var(--portal-navy); }
.favorite-tabs button.active { background: var(--portal-navy); color: #fff; }
.favorite-tabs button:focus-visible { outline-color: var(--portal-gold); }
.favorite-button:hover, .favorite-button.saved { border-color: var(--portal-gold); color: var(--portal-navy); }
.favorite-button span { color: var(--portal-gold); }
.favorite-group-head span, .favorite-card-icon { background: #e4eef5; color: var(--portal-navy); }
.favorite-card { border-color: var(--official-border); border-left-color: var(--portal-blue); }
.favorite-card h4 a:hover, .favorite-card-actions > a { color: var(--portal-navy); }
.favorite-card .favorite-no-note { color: var(--official-muted); }

/* Patient service ledger */
.patient-portal-layout { align-items: start; }
.patient-portal-head { background: var(--portal-navy); }
.patient-portal-head p { color: #d5e4ee; }
.patient-portal-nav { border: 1px solid var(--official-border); border-top: 4px solid var(--portal-navy); border-radius: 2px; background: #fff; box-shadow: var(--shadow); }
.patient-portal-nav::before { content: "SERVICE DESK"; display: block; padding: 13px 16px 10px; color: var(--official-muted); font: 700 .66rem/1 ui-monospace, monospace; letter-spacing: .14em; }
.patient-portal-nav a { border-radius: 0; border-left: 4px solid transparent; }
.patient-portal-nav a.active { background: #e6f1f8; border-left-color: var(--portal-gold); color: var(--portal-navy); }
.patient-service-flow, .admin-business-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 18px; padding: 0; list-style: none; border: 1px solid var(--official-border); background: #fff; box-shadow: var(--shadow); }
.patient-service-flow li, .admin-business-flow li { position: relative; display: flex; align-items: center; gap: 11px; min-height: 76px; padding: 13px 16px; border-right: 1px solid var(--official-border); }
.patient-service-flow li:last-child, .admin-business-flow li:last-child { border-right: 0; }
.patient-service-flow li::after, .admin-business-flow li::after { content: ""; position: absolute; right: -6px; z-index: 2; width: 10px; height: 10px; border-top: 1px solid var(--official-border); border-right: 1px solid var(--official-border); background: #fff; transform: rotate(45deg); }
.patient-service-flow li:last-child::after, .admin-business-flow li:last-child::after { display: none; }
.patient-service-flow li > span, .admin-business-flow li > span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border: 1px solid #8193a2; color: #445b70; font: 800 .72rem/1 ui-monospace, monospace; }
.patient-service-flow .complete > span, .admin-business-flow .complete > span { border-color: var(--official-red); background: var(--official-red); color: #fff; }
.admin-business-flow .current { background: #e8f2f8; }
.admin-business-flow .current > span { border-color: var(--portal-gold); background: var(--portal-gold); color: #17345b; }
.patient-service-flow div, .admin-business-flow div { display: grid; gap: 4px; }
.patient-service-flow strong, .admin-business-flow strong { font-size: .84rem; color: #273e52; }
.patient-service-flow small, .admin-business-flow small { color: var(--official-muted); font-size: .71rem; line-height: 1.45; }
.patient-section-panel { border-top-color: var(--official-red); }
.patient-appointment-record { border-radius: 0; border-color: var(--official-border); border-left: 4px solid #91a7b8; box-shadow: none; }
.patient-appointment-record:hover { border-left-color: var(--portal-blue); background: #f5faff; }
.patient-appointment-date { background: #e9f0f5; border-right-color: var(--official-border); }
.patient-appointment-status { border-radius: 2px; }
.patient-appointment-plan-link { border-radius: 2px; }
.patient-appointment-plan-link.has-unread { border-color: var(--care-red); background: #faece8; color: #903421; }

/* Admin: orderly, high-density operations console */
.admin-body {
  --admin-bg: #eef2f5;
  --admin-sidebar: #003087;
  --admin-sidebar-dark: #001e54;
  --admin-sidebar-line: #285497;
  --admin-blue: #006eb5;
  --admin-blue-dark: #004f82;
  --admin-text: #2c3945;
  --admin-muted: #53616d;
  --admin-border: #d2d9df;
  --admin-head: #e8eef3;
  background: var(--admin-bg);
}
.admin-body::before { background-image: linear-gradient(rgba(0,48,135,.022) 1px, transparent 1px); background-size: 100% 28px; }
.admin-body .admin-header { background: var(--portal-navy); border-top: 4px solid var(--portal-gold); border-bottom: 3px solid var(--portal-blue); box-shadow: 0 2px 8px rgba(0,30,84,.2); }
.admin-body .admin-header::after { display: none; }
.admin-body .admin-header .brand { color: #fff9ef; }
.admin-body .admin-header .brand > span:last-child { display: grid; gap: 1px; }
.admin-body .admin-header .brand small { color: #c5ddec; font-size: 10px; font-weight: 500; letter-spacing: .09em; }
.admin-body .admin-header .brand-mark { background: #fff; color: var(--portal-navy); }
.admin-body .admin-header .languages a, .admin-body .admin-header .nav-form .link-button { color: #f7ece0; }
.admin-body .admin-header .languages a:hover, .admin-body .admin-header .nav-form .link-button:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.admin-body .admin-workspace-context { display: flex; align-items: center; gap: 9px; min-height: 36px; margin: 0 0 14px; padding: 7px 12px; border-left: 4px solid var(--portal-gold); background: #e1e9ef; color: var(--admin-muted); font-size: 12px; }
.admin-body .admin-workspace-context strong { color: #294157; }
.admin-body .side-nav { border-top: 4px solid var(--portal-gold); box-shadow: 0 3px 10px rgba(0,30,84,.14); }
.admin-body .side-nav-overline { color: #bcd7e9; }
.admin-body .side-nav-group[open] summary::before { border-color: #7fc2e9; box-shadow: 0 0 0 3px rgba(0,110,181,.2); }
.admin-body .side-nav-children a.active { background: linear-gradient(90deg, var(--portal-gold) 0, var(--portal-gold) 4px, #06418a 4px); }
.admin-body .side-nav-children a.active::before { background: #8bd0f2; box-shadow: none; }
.admin-body .panel { border-radius: 1px; border-top: 3px solid var(--portal-navy); box-shadow: 0 2px 8px rgba(0,48,135,.06); }
.admin-body .panel > h2, .admin-body .panel > .admin-toolbar { background: var(--admin-head); border-bottom-color: #c2ccd5; }
.admin-body .panel > h2, .admin-body .panel > .admin-toolbar h2 { color: #263e53; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
.admin-body .button, .admin-body button, .admin-body input, .admin-body textarea, .admin-body select { border-radius: 2px; }
.admin-body input:focus, .admin-body textarea:focus, .admin-body select:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(0,110,181,.14); }
.admin-body th { background: #e5edf3; color: #29445b; border-bottom-color: #b7c5d0; }
.admin-body tbody tr:hover { background: #edf6fb; }
.admin-body .stats div { border-radius: 1px; border-left-color: var(--official-red); box-shadow: none; }
.admin-body .status, .admin-body .badge { background: #e2edf5; color: var(--portal-navy); }
.admin-body .muted-text,
.admin-body label > small,
.admin-body td small,
.admin-body .admin-appointment-section-head p,
.admin-body .admin-appointment-identity p { color: #53616d; }
.admin-body .modal { border: 1px solid #879baa; border-radius: 2px; }
.admin-body .modal-head { border-top: 4px solid var(--portal-navy); background: #e7eef3; }
.admin-body .admin-appointment-hero { border-left-color: var(--portal-gold); border-radius: 1px; background: #fff; }
.admin-body .admin-appointment-tabs { background: #e6edf2; }
.admin-body .admin-appointment-tabs button { border-radius: 0; border-right-color: var(--official-border); }
.admin-body .admin-appointment-tabs button.active { background: #fff; color: var(--portal-navy); box-shadow: inset 0 -3px var(--portal-blue); }
.admin-business-flow { margin-bottom: 18px; }
.admin-appointment-plan-card { border-radius: 1px; border-color: var(--official-border); border-left: 4px solid var(--portal-gold); box-shadow: none; }
.admin-appointment-plan-card-head { background: #edf3f7; }
.admin-appointment-plan-tabs button.active { color: var(--official-red-dark); border-bottom-color: var(--official-red); }
.admin-appointment-plan-status.status-confirmed { background: #e1eef6; color: #004f82; }
.admin-appointment-plan-status.status-draft { background: #ece9e4; color: #625e58; }
.admin-appointment-data-grid > div { border-radius: 0; border-color: var(--official-border); background: #fff; }

/* Appointment lifecycle: one shared, visible source of truth for patients and operators. */
.appointment-tracker { margin: 0 0 22px; border: 1px solid #b9c8d5; border-top: 5px solid var(--portal-blue); padding: 22px; background: #fff; box-shadow: var(--shadow); text-align: left; }
.appointment-tracker-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.appointment-tracker-head > div { display: grid; gap: 3px; }
.appointment-tracker-head span { color: #53677a; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.appointment-tracker-head strong { color: var(--portal-navy); font-size: 1.2rem; }
.appointment-tracker-head small { color: #596875; font-size: .72rem; }
.appointment-tracker ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.appointment-tracker li { position: relative; display: grid; grid-template-rows: 34px auto; min-width: 0; padding-right: 14px; }
.appointment-tracker li::before { content: ""; position: absolute; z-index: 0; top: 16px; left: 34px; right: 0; height: 2px; background: #d6dee5; }
.appointment-tracker li:last-child::before { display: none; }
.appointment-tracker li > span { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #afbbc5; border-radius: 50%; background: #fff; color: #647584; font: 800 .67rem/1 ui-monospace, monospace; }
.appointment-tracker li div { min-width: 0; padding: 10px 10px 0 0; }
.appointment-tracker li strong, .appointment-tracker li small { display: block; }
.appointment-tracker li strong { color: #526779; font-size: .8rem; line-height: 1.35; }
.appointment-tracker li small { margin-top: 3px; color: #6a7884; font-size: .7rem; line-height: 1.45; }
.appointment-tracker li.complete > span { border-color: var(--portal-blue); background: var(--portal-blue); color: #fff; }
.appointment-tracker li.complete::before { background: var(--portal-blue); }
.appointment-tracker li.current > span { border-color: var(--portal-gold); background: var(--portal-gold); color: #17345b; box-shadow: 0 0 0 4px rgba(244, 180, 0, .18); }
.appointment-tracker li.current strong { color: var(--portal-navy); }
.appointment-tracker-next, .appointment-tracker-cancelled { margin: 20px 0 0; border-left: 4px solid var(--portal-gold); padding: 10px 13px; background: #f3f7fa; color: #40566a; font-size: .82rem; }
.appointment-tracker-next strong { color: var(--portal-navy); }
.appointment-tracker.is-cancelled { border-top-color: var(--care-red); }
.appointment-tracker-cancelled { border-left-color: var(--care-red); background: #fbefec; color: #7d2e22; }
.appointment-tracker--compact { margin: 16px 0 0; border-top-width: 3px; padding: 13px 14px; box-shadow: none; }
.appointment-tracker--compact .appointment-tracker-head { align-items: center; margin-bottom: 12px; }
.appointment-tracker--compact .appointment-tracker-head strong { font-size: .9rem; }
.appointment-tracker--compact .appointment-tracker-head small, .appointment-tracker--compact li small, .appointment-tracker--compact .appointment-tracker-next { display: none; }
.appointment-tracker--compact li { grid-template-rows: 22px auto; padding-right: 5px; }
.appointment-tracker--compact li::before { top: 10px; left: 21px; }
.appointment-tracker--compact li > span { width: 22px; height: 22px; border-width: 1px; font-size: .55rem; }
.appointment-tracker--compact li div { padding-top: 7px; }
.appointment-tracker--compact li strong { font-size: .64rem; }
.admin-menu-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: auto; border-radius: 999px; padding: 0 6px; background: var(--care-red); color: #fff; font-size: .68rem; }
.side-nav-children > a { display: flex; align-items: center; gap: 8px; }
.patient-appointment-status.status-ready_for_visit, .admin-appointment-status.status-ready_for_visit { background: #fff0c7; color: #6e5000; }

@media (max-width: 980px) {
  .official-service-standard { display: none; }
  .header-search { display: none; }
  .home-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; min-height: auto; padding-top: 54px; padding-bottom: 54px; }
  .care-passport { width: 100%; max-width: 680px; }
  .main-nav > a, .main-nav .link-button { padding: 13px 12px 10px; }
  .patient-service-flow, .admin-business-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-service-flow li:nth-child(2), .admin-business-flow li:nth-child(2) { border-right: 0; }
  .patient-service-flow li:nth-child(2)::after, .admin-business-flow li:nth-child(2)::after { display: none; }
  .patient-service-flow li:nth-child(-n+2), .admin-business-flow li:nth-child(-n+2) { border-bottom: 1px solid var(--official-border); }
}
@media (max-width: 640px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .container, .nav-wrap, .home-hero-grid, .home-hero-copy, .care-passport { min-width: 0; max-width: 100%; }
  .official-bar .container { justify-content: flex-end; min-height: 38px; gap: 6px; padding-top: 5px; padding-bottom: 5px; }
  .official-bar .container > span:first-child { display: none; }
  .official-bar-tools { margin-left: auto; }
  .nav-wrap { min-height: 70px; }
  .brand { max-width: calc(100% - 52px); font-size: .82rem; }
  .brand-mark { width: 36px; height: 42px; font-size: 1.05rem; }
  .menu-button { color: var(--portal-navy); }
  .main-nav { top: 70px; }
  .home-hero { background: #fff; }
  .home-hero-grid { gap: 24px; padding-top: 42px; padding-bottom: 42px; }
  .home-hero-copy h1 { width: 100%; max-width: 100%; font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1.14; letter-spacing: -.025em; word-break: break-word; }
  .home-hero-copy > p { width: 100%; max-width: 100%; margin-top: 18px; font-size: 1rem; }
  .home-assurances { margin-top: 24px; }
  .care-passport { padding: 27px 22px; }
  .care-passport::after { display: none; }
  .escort-flow::before { display: none; }
  .escort-flow article { border-right: 0; border-bottom: 1px solid var(--official-border); }
  .patient-service-flow, .admin-business-flow { grid-template-columns: 1fr; }
  .patient-service-flow li, .admin-business-flow li { border-right: 0; border-bottom: 1px solid var(--official-border); }
  .patient-service-flow li::after, .admin-business-flow li::after { display: none; }
  .appointment-tabs::before { display: none; }
  .appointment-tracker { padding: 18px 16px; }
  .appointment-tracker-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .appointment-tracker ol { grid-template-columns: 1fr; gap: 0; }
  .appointment-tracker li { grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto; column-gap: 12px; min-height: 62px; padding: 0 0 13px; }
  .appointment-tracker li::before { top: 33px; bottom: 0; left: 16px; right: auto; width: 2px; height: auto; }
  .appointment-tracker li div { padding: 2px 0 0; }
  .appointment-tracker--compact li { grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto; column-gap: 10px; min-height: 39px; padding-bottom: 8px; }
  .appointment-tracker--compact li::before { top: 25px; left: 12px; }
  .appointment-tracker--compact li > span { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Login is a focused viewport, but the shared site footer must stay reachable,
   so the page keeps its normal document scroll instead of clamping to one screen. */
body:has(.auth-shell) {
  width: 100%;
  max-width: 100%;
}

body:has(.auth-shell) main {
  min-height: calc(100dvh - 116px);
  min-width: 0;
  overflow: visible;
}

body:has(.auth-shell) footer { display: block; }

/* Keep the appointment title as a compact orientation cue. */
.appointment-page .appointment-heading {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left-width: 3px;
}

.appointment-page .appointment-heading h1 {
  margin: 0 0 3px;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  line-height: 1.12;
}

.appointment-page .appointment-heading p {
  max-width: 620px;
  font-size: .82rem;
  line-height: 1.35;
}

.auth-shell {
  min-height: calc(100dvh - 116px);
  height: auto;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
  overflow: visible;
}

.auth-aside {
  min-width: 0;
  overflow: hidden;
  padding: clamp(32px, 6vw, 88px);
}

.auth-aside h1 {
  max-width: 680px;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

.form-card {
  width: min(500px, calc(100% - 40px));
  max-width: 100%;
  min-width: 0;
  padding: 32px;
}

.form-card h2 {
  font-size: 2rem;
  margin-bottom: 22px;
}

.form-card form label { margin: 12px 0; }

@media (max-width: 760px) {
  body:has(.auth-shell) main { min-height: calc(100dvh - 108px); height: auto; }

  .auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 0;
  }

  .auth-aside { display: none; }

  .form-card {
    width: min(440px, calc(100% - 28px));
    padding: 24px 20px;
  }

  .form-card h2 {
    font-size: 1.8rem;
    margin-bottom: 18px;
  }
}

/* Appointment plan editor: a focused, step-based workspace instead of a loose form. */
.admin-body .admin-appointment-plan-modal { width: min(920px, calc(100vw - 32px)); max-width: 920px; max-height: 90vh; overflow: hidden; border: 0; border-top: 5px solid var(--admin-blue); border-radius: 6px; box-shadow: 0 24px 70px rgba(18, 38, 52, .28); }
.admin-body .admin-appointment-plan-modal form { display: flex; max-height: calc(90vh - 5px); flex-direction: column; }
.admin-body .admin-appointment-plan-modal .modal-head { align-items: center; padding: 20px 28px 16px; background: #fff; }
.admin-body .admin-appointment-plan-modal .modal-head h3 { margin: 4px 0 0; color: #1d3444; font-size: 22px; letter-spacing: -.02em; }
.admin-body .admin-appointment-plan-modal .modal-head .link-button { width: 34px; height: 34px; border: 1px solid #dbe3e8; border-radius: 50%; color: #71818b; font-size: 22px; line-height: 1; }
.admin-body .admin-appointment-plan-modal .modal-head .link-button:hover { border-color: #9ccce5; background: #eef6fb; color: var(--admin-blue-dark); }
.admin-body .admin-appointment-plan-form-intro { display: grid; gap: 3px; padding: 13px 28px 15px; border-top: 1px solid #edf1f3; border-bottom: 1px solid #dce5ea; background: linear-gradient(105deg, #f1f8fb, #fbfcfd 68%); }
.admin-body .admin-appointment-plan-form-intro strong { color: #1d5875; font-size: 13px; }
.admin-body .admin-appointment-plan-form-intro span { color: #71818b; font-size: 12px; }
.admin-body .admin-appointment-plan-form-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 28px; border: 0; background: #f7f9fa; }
.admin-body .admin-appointment-plan-form-tabs button { min-height: 46px; border: 1px solid #d9e3e8; border-radius: 4px; background: #fff; color: #667883; font-size: 13px; font-weight: 700; }
.admin-body .admin-appointment-plan-form-tabs button:hover { border-color: #9ccce5; background: #f1f8fb; color: var(--admin-blue-dark); }
.admin-body .admin-appointment-plan-form-tabs button.active { border-color: var(--admin-blue); background: var(--admin-blue); color: #fff; box-shadow: 0 4px 10px rgba(30, 145, 207, .18); }
.admin-body .admin-appointment-plan-form-panel { overflow: auto; min-height: 290px; padding: 24px 28px 28px; background: #fff; }
.admin-body .admin-appointment-plan-form-panel > label, .admin-body .admin-appointment-plan-form-panel .appointment-resource-step, .admin-body .admin-appointment-plan-form-panel .admin-appointment-plan-region label { margin: 0; }
.admin-body .admin-appointment-plan-form-panel label > span { display: block; margin-bottom: 6px; color: #354e5d; font-size: 12px; font-weight: 800; }
.admin-body .admin-appointment-plan-form-panel input, .admin-body .admin-appointment-plan-form-panel select, .admin-body .admin-appointment-plan-form-panel textarea { min-height: 40px; border-color: #cbd8df; border-radius: 4px; background: #fcfdfd; }
.admin-body .admin-appointment-plan-form-panel input:focus, .admin-body .admin-appointment-plan-form-panel select:focus, .admin-body .admin-appointment-plan-form-panel textarea:focus { border-color: var(--admin-blue); box-shadow: 0 0 0 3px rgba(30, 145, 207, .12); }
.admin-body .admin-appointment-plan-region { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.admin-body .admin-appointment-plan-resource-chain { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; margin: 0 0 18px; }
.admin-body .appointment-doctor-picker [data-appointment-doctor-search] { margin-bottom: 7px; }
.admin-body .appointment-doctor-picker [data-appointment-doctor-status] { display: block; min-height: 16px; margin-top: 5px; color: #71818b; font-size: 11px; line-height: 1.35; }
.admin-body .admin-appointment-plan-reason textarea { min-height: 128px; resize: vertical; }
.admin-body .admin-appointment-plan-cost-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
.admin.body .admin-appointment-plan-cost-grid label, .admin-body .admin-appointment-plan-cost-grid label { margin: 0; }
.admin-body .admin-appointment-plan-cost-grid small { display: block; margin-top: 5px; color: #81909a; font-size: 11px; }
.admin-body #plan-form-stay > label + label { margin-top: 18px; }
.admin-body #plan-form-stay textarea { min-height: 120px; resize: vertical; }
.admin-body .admin-appointment-plan-modal .modal-actions { display: flex; align-items: center; gap: 9px; margin: 0; padding: 14px 28px; border-top: 1px solid #dce5ea; background: #f7f9fa; }
.admin-body .admin-appointment-plan-save-note { flex: 1; color: #71818b; font-size: 11px; line-height: 1.45; }
.admin-body .admin-appointment-plan-modal .modal-actions button { min-width: 92px; }
@media (max-width: 700px) {
  .admin-body .admin-appointment-plan-modal { width: calc(100vw - 20px); }
  .admin-body .admin-appointment-plan-modal .modal-head, .admin-body .admin-appointment-plan-form-intro, .admin-body .admin-appointment-plan-form-tabs, .admin-body .admin-appointment-plan-form-panel, .admin-body .admin-appointment-plan-modal .modal-actions { padding-right: 18px; padding-left: 18px; }
  .admin-body .admin-appointment-plan-region, .admin-body .admin-appointment-plan-resource-chain, .admin-body .admin-appointment-plan-cost-grid { grid-template-columns: 1fr; }
  .admin-body .admin-appointment-plan-modal .modal-actions { flex-wrap: wrap; }
  .admin-body .admin-appointment-plan-save-note { flex-basis: 100%; }
}

/* Admin appointment detail: compact command header and scheduling workspace. */
.admin-body {
  overflow-x: hidden;
}

.admin-login-body .admin-grid {
  grid-template-columns: minmax(0, 1fr);
}

.admin-login-body .admin-main {
  min-width: 0;
  width: 100%;
}

.admin-login-body main.admin-shell {
  height: calc(100dvh - 59px);
  min-height: calc(100dvh - 59px);
  overflow: auto;
}

.admin-login-body .admin-container {
  height: 100%;
  min-height: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

.admin-login-body .admin-grid,
.admin-login-body .admin-main {
  height: 100%;
  min-height: 100%;
}

.admin-login-body .admin-login-shell {
  display: grid;
  height: 100%;
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(28px, 6vh, 72px) 20px;
  background:
    linear-gradient(rgba(245, 248, 250, .94), rgba(245, 248, 250, .94)),
    repeating-linear-gradient(135deg, transparent 0 28px, rgba(0, 62, 126, .06) 28px 29px);
  overflow: visible;
}

.admin-login-body .admin-login-card {
  width: min(440px, 100%);
  margin: 0;
  padding: 38px 40px 40px;
  border: 1px solid #d5dee5;
  border-top: 5px solid var(--portal-gold);
  border-radius: 5px;
  box-shadow: 0 22px 55px rgba(0, 30, 84, .14);
}

.admin-login-heading {
  margin-bottom: 26px;
  text-align: center;
}

.admin-login-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 50%;
  background: var(--portal-navy);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 0 0 6px rgba(0, 62, 126, .08);
}

.admin-login-heading .eyebrow {
  margin-bottom: 6px;
  color: var(--portal-blue);
  font-size: 10px;
}

.admin-login-heading h1 {
  margin: 0;
  color: #18344a;
  font-family: inherit;
  font-size: clamp(23px, 4vw, 29px);
  line-height: 1.25;
}

.admin-login-heading p {
  margin: 9px 0 0;
  color: #6f7f8a;
  font-size: 13px;
}

.admin-login-card form label:first-of-type { margin-top: 0; }
.admin-login-card form button { margin-top: 8px; }

@media (max-width: 600px) {
  .admin-login-body main.admin-shell { height: calc(100dvh - 63px); min-height: calc(100dvh - 63px); }
  .admin-login-body .admin-login-shell { padding: 20px 14px; }
  .admin-login-body .admin-login-card { padding: 30px 22px 28px; }
}

.admin-body .admin-appointment-hero {
  margin-bottom: 12px;
  padding: 14px 18px;
}

.admin-body .admin-appointment-hero-grid {
  gap: 18px;
  align-items: center;
}

.admin-body .admin-appointment-identity h2 {
  margin: 5px 0 3px;
  font-size: 21px;
}

.admin-body .admin-appointment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-body .admin-appointment-actions form {
  margin: 0;
}

.admin-body .admin-appointment-actions .button,
.admin-body .admin-appointment-actions button {
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.admin-body .admin-appointment-status-form {
  align-items: center;
  gap: 6px;
}

.admin-body .admin-appointment-status-form label {
  min-width: 155px;
}

.admin-body .admin-appointment-status-form label > span {
  display: none;
}

.admin-body .admin-appointment-status-form select {
  min-height: 34px;
}

.admin-body .admin-appointment-workspace {
  overflow: hidden;
}

.admin-body .admin-appointment-tab-panel {
  min-height: 0;
  padding: 20px;
}

.admin-body .admin-appointment-section-head {
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 11px;
}

.admin-body .admin-appointment-plan-list {
  display: grid;
  gap: 12px;
}

.admin-body .admin-appointment-plan-card {
  overflow: hidden;
  border: 1px solid var(--official-border);
  border-left: 3px solid var(--portal-gold);
  background: #fff;
}

.admin-body .admin-appointment-plan-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  background: #edf3f7;
}

.admin-body .admin-appointment-plan-card-head > div:first-child {
  min-width: 0;
}

.admin-body .admin-appointment-plan-card-head h4 {
  margin: 3px 0;
  color: var(--portal-navy);
  font-size: 15px;
}

.admin-body .admin-appointment-plan-card-head p {
  overflow: hidden;
  margin: 0;
  color: var(--admin-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-body .admin-appointment-plan-side {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.admin-body .admin-appointment-plan-summary strong {
  display: block;
  color: var(--portal-navy);
  font-size: 14px;
}

.admin-body .admin-appointment-plan-summary small {
  color: var(--admin-muted);
  font-size: 10px;
}

.admin-body .admin-appointment-plan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 8px 16px;
  border-top: 1px solid #e1e7eb;
  background: #fbfcfd;
}

.admin-body .admin-appointment-plan-actions form {
  margin: 0;
}

.admin-body .admin-appointment-plan-actions .button {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 11px;
}

.admin-body .admin-appointment-plan-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-top: 1px solid #e1e7eb;
  background: #f5f8fa;
}

.admin-body .admin-appointment-plan-tabs button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-right: 1px solid #e1e7eb;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--admin-muted);
  font-size: 11px;
  white-space: nowrap;
}

.admin-body .admin-appointment-plan-tabs button.active {
  border-bottom-color: var(--portal-blue);
  background: #fff;
  color: var(--portal-navy);
  font-weight: 800;
}

.admin-body .admin-appointment-plan-panel {
  min-height: 0;
  padding: 14px 16px 16px;
}

.admin-body .admin-appointment-plan-panel[hidden] {
  display: none;
}

.admin-body .admin-appointment-plan-panel .admin-appointment-data-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.admin-body .admin-appointment-plan-panel .admin-appointment-data-grid > div {
  min-height: 62px;
  padding: 10px 11px;
}

@media (max-width: 760px) {
  .admin-body .admin-appointment-hero-grid {
    gap: 12px;
  }

  .admin-body .admin-appointment-actions {
    justify-content: flex-start;
  }

  .admin-body .admin-appointment-plan-card-head {
    grid-template-columns: 1fr;
  }

  .admin-body .admin-appointment-plan-side {
    justify-items: start;
    text-align: left;
  }

  .admin-body .admin-appointment-plan-panel .admin-appointment-data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dedicated visit-plan desk: separate plan production from appointment review. */
.admin-body .admin-plan-management-hero,
.admin-body .admin-plan-workspace-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #cbd8e1;
  border-left: 5px solid var(--portal-gold);
  background: linear-gradient(118deg, #102f47 0%, #174d70 72%, #1d638b 100%);
  padding: 24px 26px;
  color: #fff;
}

.admin-body .admin-plan-management-hero::after,
.admin-body .admin-plan-workspace-hero::after {
  position: absolute;
  right: -72px;
  bottom: -96px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  content: "";
}

.admin-body .admin-plan-management-hero > *,
.admin-body .admin-plan-workspace-hero > * {
  position: relative;
  z-index: 1;
}

.admin-body .admin-plan-management-hero span,
.admin-body .admin-plan-workspace-hero > div:first-child > span {
  color: #b9d5e5;
  font: 800 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.admin-body .admin-plan-management-hero h2,
.admin-body .admin-plan-workspace-hero h2 {
  margin: 7px 0 5px;
  color: #fff;
  font-family: inherit;
  font-size: 24px;
}

.admin-body .admin-plan-management-hero p,
.admin-body .admin-plan-workspace-hero p {
  max-width: 720px;
  margin: 0;
  color: #d7e6ef;
  font-size: 12px;
  line-height: 1.65;
}

.admin-body .admin-plan-management-hero > strong {
  min-width: 82px;
  color: #fff;
  font: 800 44px/1 Georgia, serif;
  text-align: right;
}

.admin-body .admin-plan-workspace-hero .detail-back-link {
  margin-bottom: 14px;
  color: #d7e6ef;
  font-size: 12px;
}

.admin-body .admin-plan-workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-body .admin-plan-workspace-actions .button {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.admin-body .admin-plan-workspace-actions .button.primary {
  border-color: var(--portal-gold);
  background: var(--portal-gold);
  color: #192e3c;
}

.admin-body .admin-plan-management-list {
  padding: 0;
  overflow: hidden;
}

.admin-body .admin-plan-management-search {
  display: flex;
  max-width: 660px;
  padding: 16px;
}

.admin-body .admin-plan-management-search input {
  min-width: 0;
  flex: 1;
  border-radius: 2px 0 0 2px;
}

.admin-body .admin-plan-management-search button,
.admin-body .admin-plan-management-search .button {
  min-height: 38px;
  border-radius: 0;
}

.admin-body .admin-plan-management-table td {
  vertical-align: middle;
}

.admin-body .admin-plan-management-table td > strong,
.admin-body .admin-plan-management-table td > small {
  display: block;
}

.admin-body .admin-plan-management-table td > small,
.admin-body .admin-plan-management-table .admin-plan-count + small {
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 10px;
}

.admin-body .admin-plan-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.admin-body .admin-plan-count strong {
  color: var(--portal-navy);
  font-size: 22px;
}

.admin-body .admin-plan-count span {
  color: var(--admin-muted);
  font-size: 11px;
}

.admin-body .admin-plan-link-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7c6c58;
  font-size: 11px;
  font-weight: 700;
}

.admin-body .admin-plan-link-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9aa97;
  content: "";
}

.admin-body .admin-plan-link-state.is-active {
  color: #24704b;
}

.admin-body .admin-plan-link-state.is-active::before {
  background: #36a268;
  box-shadow: 0 0 0 3px rgba(54, 162, 104, .12);
}

.admin-body .admin-plan-share-box--standalone {
  margin: 0 0 14px;
  border-left-color: var(--portal-gold);
  background: #fff;
}

.admin-body .admin-plan-workspace-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  border: 1px solid var(--official-border);
  background: var(--official-border);
}

.admin-body .admin-plan-workspace-summary > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: #fff;
  padding: 13px 16px;
}

.admin-body .admin-plan-workspace-summary strong {
  color: var(--portal-navy);
  font-size: 23px;
}

.admin-body .admin-plan-workspace-summary span {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-body .admin-plan-workspace-list {
  gap: 14px;
}

.admin-body .admin-plan-cost-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.admin-body .admin-plan-cost-form-head span {
  color: var(--admin-muted);
  font-size: 11px;
}

.admin-body .admin-plan-cost-range-list {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.admin-body .admin-plan-cost-range {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) repeat(2, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid #dfe6ea;
  background: #f8fafb;
  padding: 9px 11px;
}

.admin-body .admin-plan-cost-range > span {
  align-self: center;
  color: var(--portal-navy);
  font-size: 12px;
  font-weight: 800;
}

.admin-body .admin-plan-cost-range label {
  margin: 0;
}

.admin-body .admin-plan-cost-range label small {
  display: block;
  margin-bottom: 3px;
  color: var(--admin-muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .admin-body .admin-plan-management-hero,
  .admin-body .admin-plan-workspace-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .admin-body .admin-plan-management-hero > strong {
    text-align: left;
  }

  .admin-body .admin-plan-workspace-actions {
    justify-content: flex-start;
  }

  .admin-body .admin-plan-workspace-actions .button {
    flex: 1;
    justify-content: center;
  }

  .admin-body .admin-plan-management-table th:nth-child(4),
  .admin-body .admin-plan-management-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 560px) {
  .admin-body .admin-plan-management-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
  }

  .admin-body .admin-plan-management-search input {
    grid-column: 1 / -1;
    border-radius: 2px;
  }

  .admin-body .admin-plan-workspace-summary {
    grid-template-columns: 1fr;
  }

  .admin-body .admin-plan-workspace-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-body .admin-plan-share-box--standalone {
    padding: 14px;
  }

  .admin-body .admin-plan-cost-form-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .admin-body .admin-plan-cost-range {
    grid-template-columns: 1fr 1fr;
  }

  .admin-body .admin-plan-cost-range > span {
    grid-column: 1 / -1;
  }
}

/* Appointment plan desk: compose, confirm and publish from one focused workspace. */
.admin-body .admin-plan-desk-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 24px;
  margin-bottom: 16px;
  padding: 17px 20px 0;
  border: 1px solid #cfd9e1;
  border-left: 5px solid var(--admin-blue);
  background: linear-gradient(105deg, #fff 0%, #fff 72%, #eef6fa 100%);
  box-shadow: 0 1px 3px rgba(28, 54, 72, .06);
}

.admin-body .admin-plan-desk-heading .detail-back-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #567286;
  font-size: 11px;
  font-weight: 700;
}

.admin-body .admin-plan-desk-title-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-body .admin-plan-desk-title-row > div { min-width: 0; }
.admin-body .admin-plan-desk-kicker { color: #718593; font: 800 10px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.admin-body .admin-plan-desk-heading h2 { margin: 3px 0 0; color: #263f52; font-size: 23px; line-height: 1.3; }
.admin-body .admin-plan-desk-heading > p { margin: 5px 0 0; color: #697b88; font-size: 11px; }
.admin-body .admin-plan-desk-status { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 6px 9px; border: 1px solid #bcd9e8; background: #eef8fc; color: #176f9b; font-size: 11px; font-weight: 800; }
.admin-body .admin-plan-desk-status i { width: 7px; height: 7px; border-radius: 50%; background: #1e91cf; box-shadow: 0 0 0 3px rgba(30,145,207,.12); }
.admin-body .admin-plan-desk-header > .admin-plan-workspace-actions { align-self: center; }
.admin-body .admin-plan-desk-header .admin-plan-workspace-actions .button { min-height: 36px; border-color: #9cb1bf; background: #fff; color: #385466; }
.admin-body .admin-plan-desk-header .admin-plan-workspace-actions .button.primary { border-color: var(--admin-blue-dark); background: var(--admin-blue); color: #fff; }
.admin-body .admin-plan-desk-header .admin-plan-workspace-summary { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 160px)); width: max-content; max-width: 100%; margin: 1px 0 0; border: 0; border-top: 1px solid #d7e1e7; background: transparent; }
.admin-body .admin-plan-desk-header .admin-plan-workspace-summary > div { gap: 6px; padding: 9px 18px 10px 0; background: transparent; }
.admin-body .admin-plan-desk-header .admin-plan-workspace-summary > div + div { padding-left: 18px; border-left: 1px solid #d7e1e7; }
.admin-body .admin-plan-desk-header .admin-plan-workspace-summary strong { font-size: 18px; }

.admin-body .admin-plan-desk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.admin-body .admin-plan-desk-main { min-width: 0; border: 1px solid #d2dce3; border-top: 3px solid var(--portal-navy); background: #fff; box-shadow: 0 1px 3px rgba(28,54,72,.05); }
.admin-body .admin-plan-desk-section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; padding: 12px 15px; border-bottom: 1px solid #dce4e9; background: #f7f9fb; }
.admin-body .admin-plan-desk-section-head > div { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-body .admin-plan-desk-section-head > div > span { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid #bfd3df; background: #fff; color: #237ca8; font-size: 16px; font-weight: 800; }
.admin-body .admin-plan-desk-section-head h3 { margin: 0; color: #2e4657; font-size: 15px; }
.admin-body .admin-plan-desk-section-head p { margin: 3px 0 0; color: #788791; font-size: 10px; line-height: 1.45; }
.admin-body .admin-plan-desk-section-head > .button { min-height: 34px; padding: 6px 11px; font-size: 11px; }
.admin-body .admin-plan-desk-main > .admin-plan-workspace-list { padding: 14px; }

.admin-body .admin-plan-desk-main .admin-appointment-plan-card { border-left-color: var(--admin-blue); box-shadow: 0 2px 6px rgba(35,64,83,.06); }
.admin-body .admin-plan-desk-main .admin-appointment-plan-card-head { padding: 14px 16px; background: linear-gradient(100deg,#f2f7fa,#fbfcfd); }
.admin-body .admin-plan-desk-main .admin-appointment-plan-card-head .admin-appointment-plan-number { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border: 1px solid #9fc8dc; border-left: 4px solid var(--admin-blue); background: #e7f3f9; color: #175f86; font: 800 17px/1.25 "Microsoft YaHei","Noto Sans SC",sans-serif; letter-spacing: .04em; box-shadow: 0 1px 2px rgba(30,93,126,.08); }
.admin-body .admin-plan-desk-main .admin-appointment-plan-card-head h4 { margin: 5px 0 3px; font-size: 16px; }
.admin-body .admin-plan-desk-main .admin-appointment-plan-actions { border-top: 0; border-bottom: 1px solid #e1e7eb; }
.admin-body .admin-plan-desk-main .admin-appointment-plan-tabs { border-top: 0; }
.admin-body .admin-plan-desk-main .admin-appointment-condition { margin-top: 12px; padding: 13px 14px; border-left: 3px solid #91b9cf; }

.admin-body .admin-appointment-plan-empty { margin: 14px; padding: 44px 20px; border: 1px dashed #bdcbd4; border-top: 0; background: linear-gradient(180deg,#fbfcfd,#f6f9fa); text-align: center; box-shadow: none; }
.admin-body .admin-appointment-plan-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 13px; border: 1px solid #acd0e2; border-radius: 50%; background: #eaf6fb; color: #187daa; font-size: 25px; }
.admin-body .admin-appointment-plan-empty h4 { margin: 0; color: #304a5a; font-size: 15px; }
.admin-body .admin-appointment-plan-empty p { max-width: 480px; margin: 7px auto 17px; color: #71818c; font-size: 11px; line-height: 1.65; }

.admin-body .admin-plan-desk-side { position: sticky; top: 72px; display: grid; gap: 12px; }
.admin-body .admin-plan-desk-side .admin-plan-share-box--standalone { margin: 0; padding: 16px; border: 1px solid #cfdbe3; border-top: 3px solid var(--admin-blue); background: #fff; box-shadow: 0 1px 3px rgba(28,54,72,.05); }
.admin-body .admin-plan-desk-side .admin-plan-share-intro > span { width: 29px; height: 29px; flex-basis: 29px; border-radius: 50%; font-size: 14px; }
.admin-body .admin-plan-desk-side .admin-plan-share-intro h4 { color: #2d4859; font-size: 14px; }
.admin-body .admin-plan-desk-side .admin-plan-share-intro p { margin-top: 5px; line-height: 1.55; }
.admin-body .admin-plan-desk-side .admin-plan-share-url { display: grid; gap: 7px; }
.admin-body .admin-plan-desk-side .admin-plan-share-url input,.admin-body .admin-plan-desk-side .admin-plan-share-url .button { border-radius: 2px; }
.admin-body .admin-plan-desk-side .admin-plan-share-actions { align-items: stretch; }
.admin-body .admin-plan-desk-side .admin-plan-share-actions > span { width: 100%; margin-right: 0; }
.admin-body .admin-plan-desk-side .admin-plan-share-actions form { flex: 1; }
.admin-body .admin-plan-desk-side .admin-plan-share-actions form .button { width: 100%; }
.admin-body .admin-plan-desk-side .admin-plan-share-generate { align-items: stretch; flex-direction: column; }
.admin-body .admin-plan-desk-side .admin-plan-share-generate--disabled .button:disabled { border-color: #c7d0d6; background: #dfe5e9; color: #7b8992; cursor: not-allowed; opacity: 1; box-shadow: none; }
.admin-body .admin-plan-desk-side .admin-plan-share-generate--disabled small { padding: 9px 10px; border-left: 3px solid #d5a62a; background: #fff7e4; color: #80621c; line-height: 1.55; }
.admin-body .admin-plan-desk-side .admin-plan-share-disabled { margin-bottom: 0; padding: 10px; border-left: 3px solid #d5a62a; line-height: 1.55; }

.admin-body .admin-plan-context-card { padding: 16px; border: 1px solid #d4dde3; background: #fff; box-shadow: 0 1px 3px rgba(28,54,72,.04); }
.admin-body .admin-plan-context-card > span { display: block; margin-bottom: 7px; color: #788892; font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.admin-body .admin-plan-context-card > strong { display: block; color: #294253; font-size: 15px; }
.admin-body .admin-plan-context-card > small { display: block; margin: 3px 0 12px; color: #6e7f8b; font: 10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; }
.admin-body .admin-plan-context-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #e2e7ea; color: #71818b; font-size: 10px; }
.admin-body .admin-plan-context-card > div b { color: #3d5665; font-size: 11px; }
.admin-body .admin-plan-context-status { justify-content: flex-start !important; }
.admin-body .admin-plan-context-status > span { width: 7px; height: 7px; border-radius: 50%; background: #2d9b6c; box-shadow: 0 0 0 3px rgba(45,155,108,.12); }
.admin-body .admin-plan-context-card > .button { width: 100%; margin-top: 11px; min-height: 34px; font-size: 11px; }
.admin-body .admin-plan-desk-layout :focus-visible,.admin-body .admin-plan-desk-header :focus-visible { outline: 3px solid rgba(30,145,207,.24); outline-offset: 2px; }

@media (max-width: 1100px) {
  .admin-body .admin-plan-desk-layout { grid-template-columns: minmax(0,1fr) 280px; }
  .admin-body .admin-appointment-plan-panel .admin-appointment-data-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 860px) {
  .admin-body .admin-plan-desk-layout { grid-template-columns: 1fr; }
  .admin-body .admin-plan-desk-side { position: static; grid-template-columns: minmax(0,1.25fr) minmax(240px,.75fr); }
}

@media (max-width: 620px) {
  .admin-body .admin-plan-desk-header { grid-template-columns: 1fr; padding: 15px 14px 0; }
  .admin-body .admin-plan-desk-header > .admin-plan-workspace-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .admin-body .admin-plan-desk-header .admin-plan-workspace-actions .button { justify-content: center; }
  .admin-body .admin-plan-desk-title-row { align-items: flex-start; justify-content: space-between; }
  .admin-body .admin-plan-desk-heading h2 { font-size: 19px; }
  .admin-body .admin-plan-desk-status { max-width: 130px; white-space: normal; }
  .admin-body .admin-plan-desk-header .admin-plan-workspace-summary { grid-template-columns: repeat(3,1fr); width: 100%; }
  .admin-body .admin-plan-desk-header .admin-plan-workspace-summary > div { align-items: flex-start; flex-direction: column; gap: 1px; padding-right: 8px; }
  .admin-body .admin-plan-desk-header .admin-plan-workspace-summary > div + div { padding-left: 10px; }
  .admin-body .admin-plan-desk-side { grid-template-columns: 1fr; }
  .admin-body .admin-plan-desk-section-head { align-items: flex-start; }
  .admin-body .admin-plan-desk-section-head > div > span { display: none; }
  .admin-body .admin-plan-desk-section-head p { display: none; }
  .admin-body .admin-plan-desk-main > .admin-plan-workspace-list { padding: 10px; }
  .admin-body .admin-appointment-plan-empty { margin: 10px; padding: 34px 14px; }
  .admin-body .admin-appointment-plan-panel .admin-appointment-data-grid { grid-template-columns: 1fr; }
  .admin-body .admin-appointment-plan-card-head { gap: 9px; }
  .admin-body .admin-appointment-plan-actions { justify-content: stretch; }
  .admin-body .admin-appointment-plan-actions .button,.admin-body .admin-appointment-plan-actions form { flex: 1; }
  .admin-body .admin-appointment-plan-actions form .button { width: 100%; }
  .admin-body .admin-appointment-plan-form-tabs { gap: 5px; }
  .admin-body .admin-appointment-plan-form-tabs button { min-height: 40px; padding-inline: 6px; font-size: 11px; }
  .admin-body .admin-appointment-plan-modal .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-body .admin-appointment-plan-modal .modal-actions .admin-appointment-plan-save-note { grid-column: 1 / -1; }
}
