:root {
  --bg: #eef5f7;
  --panel: #ffffff;
  --panel-strong: #f7fbfc;
  --text: #172033;
  --muted: #667589;
  --line: #d8e5e9;
  --primary: #0f7c8f;
  --primary-dark: #0a6575;
  --danger: #d84949;
  --shadow: 0 16px 38px rgba(38, 72, 83, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

html {
  scroll-behavior: smooth;
}

/* Sitio institucional */
.landing-page {
  --landing-ink: #123039;
  --landing-green: #177b75;
  --landing-mint: #dff3ee;
  --landing-cream: #f7f5ee;
  color: var(--landing-ink);
  background: #fbfdfc;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-bottom: 1px solid rgba(18, 48, 57, .09);
  padding: 18px clamp(22px, 5vw, 76px);
  background: rgba(251, 253, 252, .94);
  backdrop-filter: blur(12px);
}

.public-header-session {
  justify-content: flex-start;
}

.public-header-session .public-nav {
  margin-left: auto;
}

.public-header-session .menu-toggle {
  flex: 0 0 auto;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.public-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.public-brand strong {
  font-size: 17px;
  letter-spacing: .01em;
}

.public-brand small {
  color: #708086;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.public-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 46% 54%;
  color: #fff;
  background: var(--landing-green);
  font-family: Georgia, serif;
  font-size: 22px;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 38px);
  font-size: 14px;
  font-weight: 700;
}

.public-nav a:not(.admin-access):hover {
  color: var(--landing-green);
}

.admin-access {
  border: 1px solid #cbdcda;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--landing-green);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  min-height: 680px;
  overflow: hidden;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 88px clamp(30px, 7vw, 110px);
}

.landing-kicker {
  margin: 0 0 18px;
  color: var(--landing-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.landing-kicker > span {
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 9px 3px 0;
  background: currentColor;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(48px, 6.1vw, 88px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}

.hero-lead {
  max-width: 620px;
  margin: 30px 0 0;
  color: #60747a;
  font-size: 19px;
  line-height: 1.7;
}

.landing-cta {
  border-radius: 999px;
  padding: 14px 24px;
  background: var(--landing-green) !important;
}

.text-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 12px 2px;
  color: var(--landing-green);
  font-weight: 800;
}

.text-link span {
  font-size: 20px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin: 34px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid #dce8e5;
  color: #52686e;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.trust-list span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  color: var(--landing-green);
  background: var(--landing-mint);
}

.respiratory-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 680px;
  overflow: hidden;
  background: linear-gradient(145deg, #d9eee9 0%, #b8dcd5 100%);
}

.visual-orbit {
  position: absolute;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%;
}

.orbit-one { width: 520px; height: 520px; }
.orbit-two { width: 390px; height: 390px; }

.lungs-symbol {
  position: relative;
  width: 280px;
  height: 340px;
  filter: drop-shadow(0 24px 28px rgba(23, 123, 117, .14));
}
.thyroid-symbol { position: relative; z-index: 2; width: 210px; height: 220px; filter: drop-shadow(0 24px 30px rgba(9,94,107,.2)); }
.thyroid-lobe { position: absolute; top: 28px; width: 92px; height: 168px; border: 3px solid rgba(255,255,255,.78); background: linear-gradient(145deg,#efab91,#d97878); }
.thyroid-lobe.left { left: 12px; border-radius: 70% 40% 62% 45%; transform: rotate(-12deg); }
.thyroid-lobe.right { right: 12px; border-radius: 40% 70% 45% 62%; transform: rotate(12deg); }
.thyroid-center { position: absolute; z-index: 2; top: 98px; left: 82px; width: 46px; height: 42px; border: 3px solid rgba(255,255,255,.78); border-radius: 45%; background: #e58a7e; }

.lung {
  position: absolute;
  bottom: 26px;
  width: 126px;
  height: 244px;
  border: 2px solid rgba(255,255,255,.88);
  background: rgba(255,255,255,.42);
}

.lung.left { left: 5px; border-radius: 66% 34% 48% 52% / 43% 37% 63% 57%; transform: rotate(4deg); }
.lung.right { right: 5px; border-radius: 34% 66% 52% 48% / 37% 43% 57% 63%; transform: rotate(-4deg); }
.trachea { position: absolute; top: 8px; left: 136px; width: 8px; height: 112px; border-radius: 8px; background: rgba(255,255,255,.88); }
.bronchus { position: absolute; top: 105px; width: 86px; height: 7px; border-radius: 8px; background: rgba(255,255,255,.88); }
.bronchus.left { left: 64px; transform: rotate(34deg); }
.bronchus.right { right: 64px; transform: rotate(-34deg); }

.visual-note {
  position: absolute;
  right: 32px;
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  padding: 14px 18px;
  background: rgba(255,255,255,.68);
  backdrop-filter: blur(10px);
}

.visual-note > span { width: 9px; height: 9px; border-radius: 50%; background: var(--landing-green); }
.visual-note p { display: grid; gap: 3px; margin: 0; }
.visual-note small { color: #61777b; }
.visual-note strong { font-size: 13px; }

.intro-strip {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 50px;
  padding: 55px clamp(30px, 7vw, 110px);
  color: #fff;
  background: var(--landing-green);
}

.intro-strip p { margin: 0; opacity: .7; font-size: 14px; text-transform: uppercase; letter-spacing: .12em; }
.intro-strip strong { max-width: 790px; font-family: Georgia, serif; font-size: clamp(24px, 3vw, 38px); font-weight: 400; line-height: 1.3; }

.landing-section { padding: 110px clamp(30px, 7vw, 110px); }
.section-heading { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: end; }
.section-heading h2, .approach-card h2, .contact-section h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 64px); font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
.section-heading > p { max-width: 580px; margin: 0; color: #64777c; font-size: 17px; line-height: 1.7; }

.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 70px; background: #d7e4e1; }
.service-grid article { min-width: 0; overflow: hidden; background: #fbfdfc; transition: box-shadow .3s ease, background-color .3s ease; }
.service-image { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; background: #edf4f2; transition: filter .3s ease; }
.service-grid article:hover { position: relative; z-index: 1; background: #fff; box-shadow: 0 18px 42px rgba(23, 63, 71, .14); }
.service-grid article:hover .service-image { filter: saturate(1.05) brightness(1.02); }
.service-content { min-height: 250px; padding: 28px 30px 32px; }
.service-number { color: #93aaa7; font-family: Georgia, serif; font-size: 15px; }
.service-grid h3 { margin: 45px 0 14px; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.service-grid p { margin: 0; color: #64777c; line-height: 1.65; }

.approach-section { display: grid; grid-template-columns: 1.05fr .95fr; background: var(--landing-cream); }
.approach-card { padding: 100px clamp(30px, 7vw, 110px); color: #fff; background: #173f47; }
.landing-kicker.light { color: #8fd1c6; }
.approach-card > p:last-child { max-width: 610px; margin: 32px 0 0; color: #c4d5d7; font-size: 17px; line-height: 1.8; }
.care-steps { display: grid; align-content: center; gap: 0; margin: 0; padding: 60px clamp(30px, 6vw, 90px); list-style: none; }
.care-steps li { display: grid; grid-template-columns: 54px 1fr; gap: 22px; padding: 30px 0; border-bottom: 1px solid #d9ded8; }
.care-steps li:last-child { border-bottom: 0; }
.care-steps li > span { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #acc5c0; border-radius: 50%; color: var(--landing-green); font-family: Georgia, serif; }
.care-steps h3 { margin: 2px 0 8px; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.care-steps p { margin: 0; color: #69797c; line-height: 1.6; }

.contact-section { display: grid; grid-template-columns: 1.15fr .85fr; gap: 80px; align-items: center; padding: 110px clamp(30px, 7vw, 110px); }
.contact-section > div:first-child > p:last-child { max-width: 620px; color: #64777c; font-size: 17px; line-height: 1.7; }
.contact-placeholder { display: grid; gap: 10px; border: 1px solid #d3e2df; border-radius: 18px; padding: 34px; background: #f0f8f6; }
.contact-placeholder span { color: var(--landing-green); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.contact-placeholder strong { font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.contact-placeholder small { color: #728287; line-height: 1.5; }
.consulting-location-card { overflow: hidden; border: 1px solid #cfe0dc; border-radius: 20px; background: #fff; box-shadow: 0 18px 45px rgba(32, 81, 78, .12); }
.consulting-location-brand { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 22px; padding: 24px 28px; background: linear-gradient(145deg, #f6fbf9, #e8f5ef); }
.consulting-location-brand img { display: block; width: 118px; height: 118px; border-radius: 16px; object-fit: contain; background: #fff; box-shadow: 0 7px 20px rgba(36, 151, 111, .12); }
.consulting-location-brand div { display: grid; gap: 3px; }
.consulting-location-brand span { color: #21835f; font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.consulting-location-brand strong { color: #26976f; font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.consulting-location-brand small { color: #596a6d; font-size: 13px; font-weight: 700; }
.consulting-contact-list { display: grid; margin: 0; padding: 8px 28px 24px; font-style: normal; }
.consulting-contact-list > a, .consulting-contact-list > div { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 13px; border-bottom: 1px solid #e3ece9; padding: 16px 0; }
.consulting-contact-list > :last-child { border-bottom: 0; }
.consulting-contact-list svg { width: 25px; height: 25px; fill: none; stroke: #278b68; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.consulting-contact-list span { display: grid; gap: 4px; }
.consulting-contact-list small { color: #728287; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.consulting-contact-list strong { color: #294a4d; font-size: 15px; font-weight: 800; }
.consulting-contact-list a { transition: color .18s ease, transform .18s ease; }
.consulting-contact-list a:hover strong { color: #21835f; }
.consulting-contact-list > a:hover { transform: translateX(3px); }
.consulting-contact-list .consulting-whatsapp { margin-top: 12px; border: 1px solid #8bcaae; border-radius: 12px; padding: 13px 15px; background: #edf9f3; }
.consulting-contact-list .consulting-whatsapp:hover { background: #dff4e9; }

.public-footer { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 30px; align-items: center; border-top: 1px solid #dbe6e4; padding: 34px clamp(30px, 5vw, 76px); color: #65777b; font-size: 12px; }
.public-content-section { background: #f2f8f6; }
.public-content-filters { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 38px; }
.public-content-filters button { border: 1px solid #bcd5cf; border-radius: 999px; padding: 10px 17px; color: #35635f; background: #fff; cursor: pointer; font-weight: 800; }
.public-content-filters button:hover,.public-content-filters button.active { border-color: var(--landing-green); color: #fff; background: var(--landing-green); }
.public-content-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; margin-top: 28px; }
.public-content-card { overflow: hidden; border: 1px solid #d4e4e0; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(30,80,72,.08); transition: transform .2s,box-shadow .2s; }
.public-content-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(30,80,72,.14); }
.public-content-card.featured { border-color: #79b9a9; }
.public-content-card>img,.public-content-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 16/9; object-fit: cover; color: #fff; background: linear-gradient(145deg,#78bbae,#256e69); font-size: 48px; }
.public-content-copy { padding: 24px; }
.public-content-type { color: var(--landing-green); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.public-content-copy h3 { margin: 10px 0; font-family: Georgia,serif; font-size: 25px; font-weight: 400; }
.public-content-copy p { color: #64777c; line-height: 1.65; white-space: pre-line; }
.public-download { display: inline-flex; align-items: center; gap: 9px; margin-top: 8px; border-radius: 10px; padding: 11px 14px; color: #fff; background: var(--landing-green); font-size: 13px; font-weight: 800; }
.public-content-status { grid-column: 1/-1; border: 1px dashed #b8d0ca; border-radius: 14px; padding: 30px; text-align: center; color: #667b78; background: #fff; }
#contentDialog { width: min(760px, calc(100vw - 24px)); max-width: calc(100vw - 24px); overflow-x: clip; }
.public-content-form { width: 100%; max-width: 100%; min-width: 0; max-height: none; overflow: visible; }
.public-content-form > *, .public-content-form section, .public-content-form div, .public-content-form label { min-width: 0; max-width: 100%; }
.public-content-form header small { display: block; margin-top: 5px; color: var(--primary); font-weight: 800; }
.content-step-indicator { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.content-step-indicator span { height: 5px; border-radius: 999px; background: #dce7e9; }
.content-step-indicator span.active { background: var(--primary); }
.content-form-step { min-width: 0; }
.content-single-column { display: grid; grid-template-columns: 1fr; gap: 13px; }
.content-single-column > label { min-width: 0; }
.public-content-form textarea { display: block; width: 100%; min-height: 92px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; color: var(--text); background: #fff; font: inherit; line-height: 1.5; resize: none; }
.public-content-form #contentSummary { min-height: 68px; }
.public-content-form #contentText { min-height: 108px; }
.public-content-form label > small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }
.content-file-field { align-self: stretch; border: 1px solid #dbe7ea; border-radius: 10px; padding: 13px; background: #f8fbfc; }
.content-file-field input[type="file"] { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; overflow: hidden; border: 1px dashed #acc8ce; border-radius: 8px; padding: 7px; color: var(--text); background: #fff; }
.content-file-field input[type="file"]::file-selector-button { margin-right: 10px; border: 0; border-radius: 6px; padding: 7px 10px; color: #fff; background: var(--primary); font-weight: 800; cursor: pointer; }
.content-switches { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; border-top: 1px solid var(--line); padding-top: 13px; }
.public-content-form .content-switches .switch-row { display: flex; min-height: 48px; justify-content: space-between; border: 1px solid #dbe7ea; border-radius: 9px; padding: 11px 13px; color: var(--text); background: #f8fbfc; }
.public-content-form .content-switches .switch-row input { flex: 0 0 22px; margin: 0; }
.content-file-note { margin: 0; border-radius: 8px; padding: 10px 12px; color: #557076; background: #edf5f6; font-size: 12px; line-height: 1.4; }
.content-wizard-actions { width: 100%; min-width: 0; flex-wrap: wrap; overflow: hidden; }
.content-wizard-actions .form-action-button { max-width: 100%; }
.content-wizard-actions #cancelContent { margin-right: auto; }
.table-subtext { display: block; max-width: 420px; margin-top: 4px; color: var(--muted); }
@media(max-width:900px){.public-content-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.public-content-grid{grid-template-columns:1fr}.public-content-filters{display:grid;grid-template-columns:1fr 1fr}.public-nav a[href="#recursos"]{display:none}.content-switches{grid-template-columns:1fr}#contentDialog{width:calc(100vw - 12px);max-width:calc(100vw - 12px);margin-inline:6px}.public-content-form{width:100%;gap:12px;padding:14px}.public-content-form textarea{resize:none}.public-content-form #contentText{min-height:92px}.content-wizard-actions{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.content-wizard-actions #cancelContent{grid-column:1/-1;width:100%;margin:0}.content-wizard-actions .form-action-button{width:100%;min-width:0;padding-inline:8px;font-size:13px}}
.public-footer p { text-align: center; }
.synapta-credit { display: grid; justify-items: end; gap: 4px; min-width: 210px; color: #65777b; }
.synapta-credit span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.synapta-credit img { display: block; width: min(220px, 100%); border-radius: 5px; }
.synapta-credit small { color: var(--landing-green); font-size: 11px; font-weight: 800; }
.synapta-credit:hover small { text-decoration: underline; }
@media (max-width: 860px) { .synapta-credit { justify-items: start; min-width: 0; } }

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

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

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

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

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.ghost,
.btn.soft {
  color: var(--primary);
  border-color: var(--line);
  background: #fff;
}

.btn.danger {
  color: #fff;
  background: var(--danger);
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.public-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  min-height: 440px;
}

.public-hero > div,
.feature-grid article,
.auth-card,
.content-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.public-hero > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
}

.public-hero h1,
.auth-card h1,
.topbar h1 {
  margin: 0;
  line-height: 1.04;
}

.public-hero h1 {
  max-width: 760px;
  font-size: clamp(38px, 5vw, 64px);
}

.public-hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.professional-name { display:grid; gap:4px; margin:12px 0 4px; color:var(--primary); }
.professional-name strong { font-size:clamp(20px,2.4vw,29px); line-height:1.15; }
.professional-name span { color:var(--muted); font-size:15px; font-weight:800; letter-spacing:.02em; }

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 30px;
  color: #fff;
  background: linear-gradient(150deg, #0f7c8f, #17364a);
}

.hero-panel span,
.hero-panel small {
  opacity: .8;
}

.hero-panel strong {
  margin: 12px 0;
  font-size: 28px;
}

.feature-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.feature-grid article,
.metric-card {
  padding: 22px;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(450px, 100%);
}

.auth-card {
  padding: 30px;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr 48px;
}

.password-field input {
  border-radius: 8px 0 0 8px;
}

.password-field button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--primary);
  background: var(--panel-strong);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.password-field button:hover { color: #fff; background: var(--primary); }
.password-field button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-field button .eye-slash { opacity: 0; stroke-width: 2.6; transition: opacity .15s ease; }
.password-field button.password-visible .eye-slash { opacity: 1; }
.password-field button svg[hidden] { display: none; }

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.message.error {
  color: var(--danger);
}

.admin-page {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(320px, calc(100vw - 42px));
  min-height: 100vh;
  padding: 22px;
  color: #fff;
  background: #10202a;
  box-shadow: 18px 0 42px rgba(16, 32, 42, .24);
  transform: translateX(-105%);
  visibility: hidden;
  transition: transform .24s ease, visibility .24s;
}

.menu-open .sidebar {
  transform: translateX(0);
  visibility: visible;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  border: 0;
  padding: 0;
  background: rgba(16, 32, 42, .48);
  opacity: 0;
  visibility: hidden;
  cursor: default;
  transition: opacity .24s ease, visibility .24s;
}

.menu-open .sidebar-backdrop {
  opacity: 1;
  visibility: visible;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary);
  font-weight: 900;
}

.brand small,
.session-box small {
  display: block;
  color: rgba(255,255,255,.64);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  border-radius: 8px;
  padding: 12px;
  color: rgba(255,255,255,.76);
  font-weight: 800;
}

.side-nav a:hover,
.side-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.sidebar-submenu { display: grid; }
.sidebar-submenu summary { position: relative; border-radius: 8px; padding: 12px 36px 12px 12px; color: rgba(255,255,255,.76); font-weight: 800; list-style: none; cursor: pointer; transition: color .16s ease, background .16s ease; }
.sidebar-submenu summary::-webkit-details-marker { display: none; }
.sidebar-submenu summary::after { content: "›"; position: absolute; top: 50%; right: 14px; font-size: 20px; transform: translateY(-50%) rotate(90deg); transition: transform .18s ease; }
.sidebar-submenu[open] summary::after { transform: translateY(-50%) rotate(-90deg); }
.sidebar-submenu summary:hover, .sidebar-submenu summary.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-submenu-items { display: grid; gap: 5px; margin: 6px 0 0 13px; border-left: 1px solid rgba(255,255,255,.18); padding-left: 10px; }
.side-nav .sidebar-submenu-items a { padding: 9px 11px; font-size: 13px; }

.session-box {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.admin-main {
  width: 100%;
  padding: 30px;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.menu-toggle {
  display: inline-grid;
  place-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  color: var(--primary);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(38, 72, 83, .1);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.menu-toggle:hover {
  color: #fff;
  background: var(--primary);
}

.metric-card {
  display: grid;
  gap: 8px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  font-size: 32px;
}

.metric-card small {
  color: var(--muted);
}

.dashboard-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.icon-action.dashboard-action {
  display: inline-flex;
  width: auto;
  min-width: 116px;
  height: 46px;
  gap: 8px;
  border: 1px solid #83bec5;
  padding: 0 14px;
  color: #075f70;
  background: linear-gradient(180deg, #fff, #eaf6f7);
  box-shadow: 0 5px 0 #b5dadd, 0 9px 18px rgba(20, 91, 103, .14);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}
.icon-action.dashboard-action:hover,
.icon-action.dashboard-action:focus-visible {
  box-shadow: 0 3px 0 #075f70, 0 10px 22px rgba(15, 124, 143, .28);
  transform: translateY(-2px);
}
.icon-action.dashboard-action:active { box-shadow: 0 1px 0 #075f70; transform: translateY(2px); }
.icon-action.dashboard-action-primary { border-color: var(--primary); color: #fff; background: linear-gradient(145deg, var(--primary), #075f70); box-shadow: 0 5px 0 #064b58, 0 9px 18px rgba(15, 124, 143, .24); }
.icon-action.dashboard-action-manual { border-color: #e2aa5c; color: #89520c; background: linear-gradient(180deg, #fff, #fff5e6); box-shadow: 0 4px 0 #efd2a5, 0 8px 16px rgba(137, 82, 12, .13); }
.icon-action.dashboard-action-manual:hover,
.icon-action.dashboard-action-manual:focus-visible { border-color: #a9630b; color: #fff; background: #a9630b; box-shadow: 0 3px 0 #754506, 0 10px 22px rgba(137, 82, 12, .25); }
.dashboard-module-action {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 52px;
  gap: 10px;
  border: 1px solid #7db8c0;
  border-radius: 11px;
  padding: 8px 14px;
  color: #075f70;
  background: linear-gradient(180deg, #fff, #eaf6f7);
  box-shadow: 0 4px 0 #add3d7, 0 8px 16px rgba(20, 91, 103, .13);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.05;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dashboard-module-action svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-module-action span { display: grid; gap: 3px; }
.dashboard-module-action small { color: inherit; font-size: 9px; font-weight: 800; letter-spacing: .06em; opacity: .72; text-transform: uppercase; }
.dashboard-module-action:hover,
.dashboard-module-action:focus-visible { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 3px 0 #075f70, 0 10px 22px rgba(15, 124, 143, .26); outline: none; transform: translateY(-2px); }
.dashboard-module-action:active { box-shadow: 0 1px 0 #075f70; transform: translateY(2px); }
.dashboard-module-action-sharing { border-color: #84bea6; color: #176a49; background: linear-gradient(180deg, #fff, #eaf7f1); box-shadow: 0 4px 0 #b4dac9, 0 8px 16px rgba(23, 106, 73, .13); }
.dashboard-module-action-sharing:hover,
.dashboard-module-action-sharing:focus-visible { border-color: #176a49; background: #176a49; box-shadow: 0 3px 0 #0f4e35, 0 10px 22px rgba(23, 106, 73, .25); }
.dashboard-module-action-followup { border-color: #b4a4db; color: #62449d; background: linear-gradient(180deg, #fff, #f1edfa); box-shadow: 0 4px 0 #d4cae9, 0 8px 16px rgba(98, 68, 157, .13); }
.dashboard-module-action-followup:hover,
.dashboard-module-action-followup:focus-visible { border-color: #62449d; background: #62449d; box-shadow: 0 3px 0 #463071, 0 10px 22px rgba(98, 68, 157, .25); }
.dashboard-module-action-content { border-color: #e2aa5c; color: #89520c; background: linear-gradient(180deg, #fff, #fff5e6); box-shadow: 0 4px 0 #efd2a5, 0 8px 16px rgba(137, 82, 12, .13); }
.dashboard-module-action-content:hover,
.dashboard-module-action-content:focus-visible { border-color: #a9630b; background: #a9630b; box-shadow: 0 3px 0 #754506, 0 10px 22px rgba(137, 82, 12, .25); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 18px; margin-top: 18px; }
.dashboard-panel { min-width: 0; }
.coverage-chart { display: grid; gap: 13px; margin-top: 18px; }
.coverage-row { display: grid; gap: 6px; }
.coverage-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.coverage-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e7eef0; }
.coverage-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #59b8aa); }
.quality-summary { display: grid; gap: 10px; margin-top: 18px; }
.quality-item { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.quality-item strong { grid-row: 1 / span 2; align-self: center; min-width: 48px; color: var(--primary); font-size: 25px; text-align: center; }
.quality-item span { font-weight: 800; }
.quality-item small { color: var(--muted); }
.quality-item.warn strong { color: #b77410; }
.quality-item.ok strong { color: #278250; }
.dashboard-recent { margin-top: 18px; }
.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 28px 0 14px; }
.dashboard-section-heading h2 { margin: 3px 0 0; }
.dashboard-sharing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-access-panel { margin-top: 18px; }
.dashboard-access-summary { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 10px; margin-top: 18px; }
.dashboard-access-summary .quality-item { grid-template-columns: 1fr; text-align: center; }
.dashboard-access-summary .quality-item strong { grid-row: auto; }
.dashboard-public-content-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); }
.dashboard-public-content-list { display: grid; gap: 9px; margin-top: 16px; }
.dashboard-public-content-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid #dce9e7;
  border-radius: 13px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #f8fbfa);
  text-decoration: none;
  transition: .2s ease;
}
.dashboard-public-content-row:hover,
.dashboard-public-content-row:focus-visible { border-color: #8dbfba; box-shadow: 0 8px 20px rgba(26, 80, 83, .12); outline: none; transform: translateY(-2px); }
.dashboard-public-content-row > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.dashboard-public-content-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-public-content-row small { color: var(--muted); }
.dashboard-content-type { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; font-size: 12px; font-weight: 900; }
.dashboard-content-type.type-novedad { color: #075f70; background: #dff4f7; }
.dashboard-content-type.type-consejo { color: #176a49; background: #e3f5ec; }
.dashboard-content-type.type-descargable { color: #8b3e69; background: #f8e8f1; }
.dashboard-content-status { padding: 5px 8px; border-radius: 999px; color: #496366; background: #edf3f2; font-size: 10px; font-weight: 800; white-space: nowrap; }
.dashboard-content-status.status-visible { color: #176a49; background: #dff5e9; }
.dashboard-content-status.status-programado { color: #62449d; background: #eee8fa; }
.dashboard-content-status.status-borrador,
.dashboard-content-status.status-vencido { color: #8a5508; background: #fff0cf; }
.pami-import-card, .pami-history-card { margin-bottom: 20px; }
.pami-heading, .pami-result-heading { align-items: center; }
.pami-upload-form { display: grid; grid-template-columns: minmax(170px, .45fr) minmax(260px, 1fr) auto; align-items: end; gap: 16px; margin-top: 24px; }
.pami-file-field small { display: block; margin-top: 6px; color: var(--muted); }
.pami-preview { display: grid; gap: 20px; }
.pami-metrics { margin-top: 0; }
.pami-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 14px; }
.pami-tabs button { border: 1px solid #b9d9dc; border-radius: 999px; padding: 9px 15px; color: var(--primary); background: #fff; font-weight: 800; cursor: pointer; }
.pami-tabs button:hover, .pami-tabs button.active { border-color: var(--primary); color: #fff; background: var(--primary); }
.pami-history-card { margin-top: 20px; }
.pami-confirm-card { max-width: 720px; }
.pami-confirm-card > p { color: var(--muted); line-height: 1.65; }
.pami-confirm-summary { border: 1px solid #bcdcd5; border-radius: 10px; padding: 14px; color: #176a49; background: #edf8f3; font-weight: 800; }
.pami-patient-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 1px solid #b9dcd0; border-radius: 12px; padding: 14px; background: #f0f8f5; }
.pami-patient-status[hidden] { display: none; }
.pami-patient-status > div { display: grid; gap: 5px; }
.pami-patient-status span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.pami-patient-status strong { font-size: 16px; }
.pami-patient-status > small { grid-column: 1 / -1; color: var(--muted); }
.pami-status-active { color: #278250; }
.pami-status-inactive { color: #b44343; }
.pami-status-pending { color: #9a6a16; }
.badge.pami-inactive { color: #963d3d; background: #f8e2e2; }
.pami-list-date { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.recent-activity { display: grid; margin-top: 14px; }
.recent-activity-row { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--line); padding: 12px 5px; color: inherit; text-decoration: none; transition: background .15s ease, padding .15s ease; }
.recent-activity-row:hover { padding-inline: 10px; background: #f0f8f9; }
.recent-activity-row time { color: var(--muted); font-size: 11px; font-weight: 800; }
.recent-activity-row strong, .recent-activity-row small { display: block; }
.recent-activity-row small { margin-top: 4px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) { .dashboard-grid { grid-template-columns: 1fr; } .dashboard-quick-actions { justify-content: flex-start; } .dashboard-access-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-public-content-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .pami-upload-form { grid-template-columns: 1fr; } .pami-upload-form .form-action-button { width: 100%; } }
@media (max-width: 520px) { .pami-patient-status { grid-template-columns: 1fr; } .pami-patient-status > small { grid-column: auto; } }
@media (max-width: 520px) { .recent-activity-row { grid-template-columns: 1fr; gap: 4px; } .dashboard-section-heading { align-items: stretch; flex-direction: column; } .dashboard-access-summary { grid-template-columns: 1fr; } .dashboard-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } .icon-action.dashboard-action { min-width: 0; } .dashboard-module-action { justify-content: center; width: 100%; } .dashboard-panel .section-heading { align-items: stretch; flex-direction: column; } .dashboard-public-content-row { grid-template-columns: 42px minmax(0, 1fr); } .dashboard-content-status { grid-column: 2; justify-self: start; } }

.sidebar-session {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255,255,255,.06);
}

.sidebar-session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-session-heading strong {
  color: #8ed5d0;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.sidebar-session.session-expiring {
  border-color: rgba(255, 200, 87, .72);
  background: rgba(255, 181, 43, .12);
}

.sidebar-session.session-expiring .sidebar-session-heading strong {
  color: #ffd477;
}

.btn.session-renew {
  min-height: 38px;
  padding: 8px 10px;
  color: #10202a;
  background: #ffd477;
}

.sidebar-session-message {
  margin: 0;
  color: #aee6df;
  font-size: 12px;
  line-height: 1.4;
}

.sidebar-session-message:empty {
  display: none;
}

.sidebar-session-message.error {
  color: #ffaaaa;
}

.content-card {
  padding: 20px;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.search-field {
  flex: 1;
}

.responsive-table {
  overflow-x: auto;
}

@media (max-width: 1100px) {
  .responsive-table {
    overflow: visible;
  }

  .responsive-data-table,
  .responsive-data-table tbody,
  .responsive-data-table tr,
  .responsive-data-table td {
    display: block;
    width: 100%;
  }

  .responsive-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .responsive-data-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
    gap: 16px;
  }

  .responsive-data-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 8px 22px rgba(38, 72, 83, .08);
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  }

  .responsive-data-table tbody tr:nth-child(even) {
    background: var(--panel);
  }

  .responsive-data-table tbody tr:not(.table-message-row):hover,
  .responsive-data-table tbody tr:not(.table-message-row):focus-within {
    border-color: #a8d3d8;
    background: #eaf7fa;
    box-shadow: 0 13px 30px rgba(38, 72, 83, .16);
    transform: translateY(-3px);
  }

  .responsive-data-table tbody tr:not(.table-message-row):hover td,
  .responsive-data-table tbody tr:not(.table-message-row):focus-within td {
    background: transparent;
  }

  .responsive-data-table tbody tr:not(.table-message-row):active {
    border-color: var(--primary);
    background: #eaf7fa;
    transform: translateY(-1px);
  }

  .responsive-data-table td {
    display: grid;
    grid-template-columns: minmax(105px, 38%) minmax(0, 62%);
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-bottom: 1px solid #e7eeee;
    padding: 11px 14px;
    overflow-wrap: anywhere;
  }

  .responsive-data-table td:last-child {
    border-bottom: 0;
  }

  .responsive-data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
  }

  .responsive-data-table td.badge-stack,
  .responsive-data-table td.actions-cell {
    display: grid;
  }

  .responsive-data-table td.badge-stack > *,
  .responsive-data-table td.actions-cell > * {
    grid-column: 2;
  }

  .responsive-data-table td.actions-cell {
    grid-template-columns: minmax(105px, 38%) repeat(2, minmax(0, 1fr));
  }

  .responsive-data-table td.actions-cell::before {
    grid-column: 1;
    grid-row: 1;
  }

  .responsive-data-table td.actions-cell > * {
    grid-column: auto;
  }

  .responsive-data-table .table-message-row {
    grid-column: 1 / -1;
  }

  .responsive-data-table .table-message-row td {
    display: block;
    border: 0;
    padding: 24px;
    text-align: center;
  }

  .responsive-data-table .table-message-row td::before {
    display: none;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

tbody tr:nth-child(even) {
  background: var(--panel-strong);
}

tbody tr:hover {
  background: #eaf7fa;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  color: #126333;
  background: #dff5e8;
}

.badge.warn {
  color: #775102;
  background: #fff1c9;
}

.muted-badge {
  color: #6b7280;
  background: #edf0f3;
}

.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-btn {
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.action-btn:hover {
  color: #fff;
  background: var(--primary);
}

.actions-cell {
  display: flex;
  gap: 8px;
}

.action-btn.delete {
  border-color: var(--danger);
  color: var(--danger);
}

.action-btn.delete:hover {
  color: #fff;
  background: var(--danger);
}

.icon-action {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid #b9d9dc;
  border-radius: 10px;
  padding: 0;
  color: var(--primary);
  background: #fff;
  box-shadow: 0 5px 14px rgba(38, 72, 83, .08);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.icon-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action:hover,
.icon-action:focus-visible {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 9px 20px rgba(15, 124, 143, .24);
  outline: none;
  transform: translateY(-2px) scale(1.04);
}

.icon-action.delete {
  border-color: #efc7c7;
  color: var(--danger);
}

.icon-action.delete:hover,
.icon-action.delete:focus-visible {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
  box-shadow: 0 9px 20px rgba(216, 73, 73, .24);
}

.icon-action.attend {
  border-color: #b8ded0;
  color: #167451;
}

.icon-action.attend:hover,
.icon-action.attend:focus-visible {
  border-color: #167451;
  color: #fff;
  background: #167451;
  box-shadow: 0 9px 20px rgba(22, 116, 81, .24);
}

.clinical-main {
  background: #f2f7f7;
}

.clinical-topbar {
  align-items: start;
}

.clinical-topbar .muted {
  margin: 9px 0 0;
}

.clinical-layout {
  display: grid;
  grid-template-columns: minmax(270px, .34fr) minmax(0, 1fr);
  gap: 20px;
}

.clinical-summary {
  display: grid;
  align-content: start;
  gap: 20px;
}

.clinical-summary h2,
.clinical-history h2 {
  margin: 0 0 18px;
}

.clinical-data {
  display: grid;
  gap: 0;
  margin: 0;
}

.clinical-data > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.clinical-data dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.clinical-data dd { margin: 0; overflow-wrap: anywhere; }
.clinical-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.history-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.history-empty { display: grid; place-items: center; min-height: 360px; padding: 40px 20px; text-align: center; }
.history-empty h3 { margin: 16px 0 8px; font-size: 22px; }
.history-empty p { max-width: 470px; margin: 0 0 24px; color: var(--muted); line-height: 1.6; }
.empty-history-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: var(--primary); background: #dff2f4; font-size: 36px; font-weight: 300; }
.history-timeline { position: relative; display: grid; gap: 0; margin-top: 16px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; border-left: 2px solid #c8e1e4; padding: 0 0 28px 25px; }
.timeline-item::before { content: ""; position: absolute; left: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline-item time { color: var(--muted); font-size: 13px; font-weight: 800; }
.timeline-item h3 { margin: 0 0 8px; }
.timeline-item p, .timeline-empty { margin: 0; color: var(--muted); line-height: 1.6; }

.record-shell { display: grid; gap: 16px; }
.clinical-patient-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.patient-header-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.patient-header-grid > div { min-width: 0; padding: 10px 12px; background: #fff; }
.patient-header-grid dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.patient-header-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.clinical-board { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .95fr); gap: 16px; min-height: calc(100vh - 330px); }
.clinical-board-column { display: grid; gap: 16px; min-width: 0; }
.primary-column { grid-template-rows: minmax(430px, 1.7fr) minmax(240px, .8fr); }
.secondary-column { grid-template-rows: minmax(300px, .75fr) minmax(370px, 1fr); }
.clinical-event-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; overflow: hidden; border: 1px solid #bcc9cc; border-radius: 10px; background: #fff; box-shadow: 0 7px 20px rgba(38,72,83,.07); }
.clinical-event-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid #aab9bd; padding: 7px 10px 7px 18px; background: #d9dedf; }
.clinical-event-panel h2 { margin: 0; font-size: 15px; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.panel-add { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #8abcc3; border-radius: 8px; padding: 0; color: var(--primary); background: #fff; font-size: 23px; line-height: 1; cursor: pointer; transition: color .15s ease, background .15s ease, transform .15s ease; }
.panel-add:hover { color: #fff; background: var(--primary); transform: translateY(-1px); }
.clinical-event-list { min-height: 0; overflow-y: auto; padding: 10px; background: #fff; }
.evolution-panel .clinical-event-list { background: #fffde0; }
.clinical-event-panel[data-section] { border-color: var(--section-border); box-shadow: 0 8px 22px var(--section-shadow); }
.clinical-event-panel[data-section] > header { border-bottom-color: var(--section-border); color: var(--section-text); background: var(--section-header); }
.clinical-event-panel[data-section] .clinical-event-list { background: var(--section-surface); }
.clinical-event-panel[data-section] .panel-add { border-color: var(--section-accent); color: var(--section-accent); }
.clinical-event-panel[data-section] .panel-add:hover { color: #fff; background: var(--section-accent); }
.clinical-event-panel[data-section] .clinical-event-card { border-bottom-color: var(--section-line); }
.clinical-event-panel[data-section] .clinical-event-card:hover { background: var(--section-hover); }
.clinical-event-panel[data-section="EVOLUCION"] { --section-header: #fff0a8; --section-surface: #fffced; --section-border: #dfbd39; --section-line: #f0dfa0; --section-accent: #9a7300; --section-text: #624900; --section-hover: #fff2b8; --section-shadow: rgba(154,115,0,.12); }
.clinical-event-panel[data-section="ANTECEDENTE"] { --section-header: #dceeff; --section-surface: #f5faff; --section-border: #85b9df; --section-line: #cfe4f4; --section-accent: #2878ad; --section-text: #18577f; --section-hover: #e4f3ff; --section-shadow: rgba(40,120,173,.12); }
.clinical-event-panel[data-section="PRACTICA"] { --section-header: #dff5e8; --section-surface: #f5fcf8; --section-border: #83c59d; --section-line: #cce9d7; --section-accent: #278250; --section-text: #185d38; --section-hover: #e2f6e9; --section-shadow: rgba(39,130,80,.12); }
.clinical-event-panel[data-section="TRATAMIENTO"] { --section-header: #eee4ff; --section-surface: #faf7ff; --section-border: #b59cde; --section-line: #e0d4f2; --section-accent: #7651ad; --section-text: #523681; --section-hover: #f0e8fb; --section-shadow: rgba(118,81,173,.12); }
.clinical-event-card { position: relative; border-bottom: 1px solid #e1e8e9; padding: 11px 10px; transition: background .16s ease; }
.clinical-event-card:last-child { border-bottom: 0; }
.clinical-event-card:hover { background: rgba(15,124,143,.07); }
.clinical-event-card > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 7px; }
.clinical-event-card time { color: var(--text); font-size: 13px; font-weight: 900; }
.clinical-event-card p { margin: 0; padding-right: 62px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.event-origin { border-radius: 999px; padding: 3px 7px; font-size: 9px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.event-origin.migrated { color: #657177; background: #edf0f1; }
.event-origin.manual { color: #126333; background: #dff5e8; }
.event-actions { position: absolute; top: 9px; right: 8px; display: flex; gap: 5px; }
.mini-icon { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 6px; padding: 0; color: var(--primary); background: #fff; font-size: 16px; cursor: pointer; }
.mini-icon:hover { color: #fff; background: var(--primary); }
.mini-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mini-icon.attach-event { color: #2878ad; }
.mini-icon.attach-event:hover { color: #fff; background: #2878ad; }
.mini-icon.delete-event { color: var(--danger); }
.mini-icon.delete-event:hover { color: #fff; background: var(--danger); }
.panel-empty { display: grid; place-items: center; min-height: 130px; margin: 0; color: var(--muted); text-align: center; }
.clinical-event-dialog { width: min(720px, calc(100% - 24px)); }
.clinical-event-dialog textarea { min-height: 190px; resize: vertical; line-height: 1.5; }
.treatment-batch { display: grid; gap: 9px; }
.treatment-batch-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.treatment-batch > .btn { justify-self: start; }
.treatment-item-list { display: grid; gap: 7px; }
.treatment-batch-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid #d8c9ed; border-radius: 8px; padding: 9px 10px; background: #faf7ff; }
.treatment-batch-item strong, .treatment-batch-item small { display: block; overflow-wrap: anywhere; }
.treatment-batch-item small { margin-top: 3px; color: var(--muted); }
.clinical-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.clinical-header-action { width: 46px; height: 46px; border-color: #9ec5cc; color: var(--primary); background: #fff; box-shadow: 0 5px 14px rgba(27,92,104,.1); }
.clinical-header-action:hover, .clinical-header-action:focus-visible { border-color: var(--primary); color: #fff; background: var(--primary); transform: translateY(-2px) scale(1.05); }
.clinical-header-action.print { color: #7651ad; border-color: #c7b4e3; }
.clinical-header-action.print:hover, .clinical-header-action.print:focus-visible { color: #fff; border-color: #7651ad; background: #7651ad; }
.clinical-header-action.export-pdf { color: #a34658; border-color: #e5bac3; background: #fff7f8; }
.clinical-header-action.export-pdf:hover, .clinical-header-action.export-pdf:focus-visible { color: #fff; border-color: #a34658; background: #a34658; }
.history-export-dialog { max-width: calc(100dvw - 16px); margin-inline: auto; overflow-x: clip; }
.history-export-dialog .modal-card { width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; }
.history-export-dialog .modal-card > *,
.history-export-dialog header > div,
.history-export-dialog label,
.history-export-dialog span { min-width: 0; max-width: 100%; }
.history-export-dialog p,
.history-export-dialog small,
.history-export-dialog span { overflow-wrap: anywhere; }
.history-export-all { border: 1px solid #b8d9d4; border-radius: 12px; padding: 12px 14px; background: #f1f9f7; }
.history-export-all > span { display: grid; gap: 3px; }
.history-export-all small { color: var(--muted); }
.history-export-sections { display: grid; min-inline-size: 0; max-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.history-export-sections legend { padding: 0 7px; color: var(--primary); font-weight: 900; }
.history-export-sections label { display: flex; align-items: center; gap: 9px; border: 1px solid #e0ebea; border-radius: 9px; padding: 10px; background: #fff; cursor: pointer; }
.history-export-sections input { width: 18px; height: 18px; accent-color: var(--primary); }
.history-export-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.history-export-dates input { width: 100%; min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
  .history-export-dialog { width: calc(100dvw - 12px); max-width: calc(100dvw - 12px); }
  .history-export-dialog .modal-card { gap: 13px; padding: 14px; }
  .history-export-dialog .modal-card header { align-items: flex-start; }
  .history-export-sections, .history-export-dates { grid-template-columns: minmax(0, 1fr); }
  .history-export-sections { padding: 10px; }
  .history-export-dialog .modal-card footer { display: grid; grid-template-columns: minmax(0, 1fr); }
  .history-export-dialog .modal-card footer .form-action-button { width: 100%; min-width: 0; }
}
.clinical-header-action.back { color: #52656b; border-color: #bdc9cc; }
.clinical-header-action.back:hover, .clinical-header-action.back:focus-visible { color: #fff; border-color: #52656b; background: #52656b; }
.clinical-header-action.anthropometry { color: #a95f08; border-color: #e5bd83; background: #fffaf1; }
.clinical-header-action.anthropometry:hover, .clinical-header-action.anthropometry:focus-visible { color: #fff; border-color: #a95f08; background: #a95f08; }
.clinical-header-action.diabetes { color: #b4233a; border-color: #e0aeb7; }
.clinical-header-action.diabetes:hover,.clinical-header-action.diabetes:focus-visible { color:#fff; border-color:#b4233a; background:#b4233a; }
.clinical-header-action.thyroid { color:#7651ad; border-color:#c7b4e3; }
.clinical-header-action.thyroid:hover,.clinical-header-action.thyroid:focus-visible { color:#fff; border-color:#7651ad; background:#7651ad; }
.clinical-header-action.bone { color:#2878ad; border-color:#9bc7e4; }
.clinical-header-action.bone:hover,.clinical-header-action.bone:focus-visible { color:#fff; border-color:#2878ad; background:#2878ad; }
.clinical-header-action.endocrine { color:#13806f; border-color:#8fcfc4; background:#f3fcfa; }
.clinical-header-action.endocrine:hover,.clinical-header-action.endocrine:focus-visible { color:#fff; border-color:#13806f; background:#13806f; }
.determination-builder { display:grid; gap:10px; padding:12px; border:1px solid #b9ddd6; border-radius:12px; background:#f5fcfa; }
.determination-row { display:grid; grid-template-columns:.8fr 1.2fr .7fr .7fr 1fr auto; gap:8px; align-items:end; }
.determination-row label { min-width:0; }
.determination-row input { width:100%; }
.determination-remove { width:40px; height:40px; border-radius:9px; border:1px solid #e0aeb7; color:#b4233a; background:#fff; font-size:22px; cursor:pointer; }
.endocrine-determinations { width:100%; border-collapse:collapse; margin-top:10px; font-size:13px; }
.endocrine-determinations th,.endocrine-determinations td { padding:7px; border-bottom:1px solid #dce9e6; text-align:left; }
.study-file-area { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; border-top:1px solid var(--line); padding-top:11px; }
.study-file-area .study-file-previews { flex:1 0 100%; width:100%; margin-top:2px; border-top:0; padding-top:0; }
.study-file-add { display:inline-flex; align-items:center; gap:7px; border:1px dashed #6fa9b2; border-radius:8px; padding:8px 11px; color:var(--primary); background:#f3fbfc; font-weight:800; cursor:pointer; }
.study-file-add:hover { color:#fff; background:var(--primary); transform:translateY(-1px); }
.study-file-chip { display:inline-flex; overflow:hidden; border:1px solid #b9d4d8; border-radius:8px; background:#fff; }
.study-file-chip button { border:0; padding:7px 9px; color:#315f67; background:transparent; cursor:pointer; }
.study-file-chip button:first-child:hover { background:#eaf6f7; }
.study-file-chip button:last-child { color:#b4233a; border-left:1px solid #d9e5e7; font-size:17px; }
@media(max-width:780px){.determination-row{grid-template-columns:repeat(2,minmax(0,1fr))}.determination-remove{align-self:end}}
.bone-regions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.bone-regions section { display:grid; gap:8px; border:1px solid #cfe4f4; border-radius:10px; padding:11px; background:#f5faff; }
.bone-regions h3 { margin:0; color:#2878ad; font-size:14px; }
@media(max-width:560px){.bone-regions{grid-template-columns:1fr}}
.thyroid-layout { grid-template-columns:minmax(360px,1fr) minmax(0,1fr); }
.thyroid-form-section { display:grid; gap:12px; border:1px solid #dfd3ef; border-radius:10px; padding:12px; background:#fbf8ff; }
.thyroid-form-section h3 { margin:0; color:#624391; }
.thyroid-nodule-box { display:grid; gap:10px; border-top:1px solid #e2d8ef; padding-top:12px; }
.thyroid-nodule-card { border:1px solid #d8c9e9; border-radius:8px; padding:10px; background:#fff; }
.thyroid-nodule-card header { display:flex; justify-content:space-between; gap:8px; }
.thyroid-nodule-card small,.thyroid-study-nodules small { display:block; margin-top:4px; color:var(--muted); }
.thyroid-study-nodules { display:grid; gap:3px; margin:10px 0; border-left:3px solid #9b78c8; padding:8px 10px; background:#faf7ff; }
@media(max-width:860px){.thyroid-layout{grid-template-columns:1fr}}
.diabetes-kind { display:inline-flex; border-radius:999px; padding:4px 8px; color:#8e2335; background:#fde7eb; font-size:10px; font-weight:900; text-transform:uppercase; }
.weekly-diabetes-intro { margin-bottom: 18px; border-left: 5px solid #8f5fb7; background: linear-gradient(135deg, #fff, #f7f1fb); }
.weekly-comparison { border-top: 4px solid #8f5fb7; }
.weekly-diabetes-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .65fr); gap: 18px; align-items: start; }
.weekly-diabetes-form { min-width: 0; }
.weekly-form-heading { align-items: center; }
.weekly-form-heading .form-action-button { min-width: 175px; }
.weekly-days { display: grid; gap: 12px; }
.weekly-day { overflow: hidden; border: 1px solid #d7e3e1; border-radius: 12px; background: #fff; }
.weekly-day summary { display: grid; grid-template-columns: minmax(100px, .5fr) auto minmax(110px, 1fr); align-items: center; gap: 14px; padding: 14px 17px; color: #244b50; background: linear-gradient(90deg, #e8f5f0, #f8fbfa); font-weight: 850; cursor: pointer; list-style: none; }
.weekly-day summary::-webkit-details-marker { display: none; }
.weekly-day summary::after { content: "⌄"; justify-self: end; color: #278b68; font-size: 18px; transition: transform .18s ease; }
.weekly-day[open] summary::after { transform: rotate(180deg); }
.weekly-day summary time { color: #527076; font-size: 12px; }
.weekly-day-count { color: #688084; font-size: 10px; font-weight: 800; text-align: right; text-transform: uppercase; }
.weekly-day-table { padding: 5px 12px 12px; }
.weekly-column-headings, .weekly-measurement-row { display: grid; grid-template-columns: minmax(130px, 1.2fr) repeat(5, minmax(82px, .72fr)) minmax(130px, 1fr); gap: 7px; align-items: center; }
.weekly-column-headings { padding: 9px 7px; color: #73858a; font-size: 9px; font-weight: 900; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.weekly-measurement-row { border-top: 1px solid #e2ece9; padding: 7px; }
.weekly-measurement-row:nth-child(odd) { background: #fbfdfc; }
.weekly-moment { color: #365b60; font-size: 11px; }
.weekly-measurement-row label { min-width: 0; }
.weekly-measurement-row label > span { display: none; }
.weekly-measurement-row input { min-width: 0; height: 36px; border-radius: 7px; padding: 6px 7px; font-size: 11px; }
.weekly-measurement-row .weekly-glucose { border-color: #9cc8b8; background: #f2faf6; font-weight: 850; }
.weekly-measurement-row .weekly-insulin { border-color: #bda8d1; background: #faf6fc; }
.weekly-history { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; }
.weekly-history-card .anthropometry-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weekly-stats { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.weekly-stats article { border: 1px solid #dce7e5; border-radius: 9px; padding: 10px; text-align: center; background: #fff; }
.weekly-stats small, .weekly-stats strong { display: block; }
.weekly-stats small { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.weekly-stats strong { color: #294f53; font-size: 15px; }
.weekly-target-band { fill: rgba(54, 170, 113, .12); }
.weekly-target-line { stroke: rgba(39, 130, 80, .55); stroke-width: 1; stroke-dasharray: 5 4; }
.laboratory-chart .weekly-point.range { fill: #fff; stroke: #278250; }
.laboratory-chart .weekly-point.low { fill: #fff; stroke: #d08a21; }
.laboratory-chart .weekly-point.high { fill: #fff; stroke: #c74e4e; }
.diabetes-section-divider { display: flex; align-items: center; gap: 15px; margin: 30px 0 18px; color: #78519b; font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.diabetes-section-divider::before, .diabetes-section-divider::after { content: ""; flex: 1; height: 1px; background: #d9cce3; }
.laboratory-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.laboratory-form { margin: 0; }
.laboratory-form h2 { margin: 2px 0 0; }
.laboratory-form textarea { resize: vertical; line-height: 1.5; }
.laboratory-form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.laboratory-save-action { width: 46px; height: 46px; border-color: var(--primary); color: #fff; background: var(--primary); }
.laboratory-save-action:hover, .laboratory-save-action:focus-visible { background: var(--primary-dark); transform: translateY(-2px) scale(1.05); }
.laboratory-cancel-action { width: 46px; height: 46px; color: #52656b; border-color: #bdc9cc; }
.laboratory-cancel-action:hover, .laboratory-cancel-action:focus-visible { color: #fff; border-color: #52656b; background: #52656b; }
.laboratory-list { display: grid; gap: 10px; margin-top: 16px; }
.laboratory-card { border: 1px solid #cfe0e3; border-radius: 10px; padding: 13px 14px; background: #f8fcfd; }
.laboratory-card > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.event-actions-inline { display: flex; gap: 6px; }
.laboratory-card h3 { margin: 3px 0 0; font-size: 16px; }
.laboratory-card time { color: var(--primary); font-size: 12px; font-weight: 900; }
.laboratory-card p { margin: 12px 0 8px; white-space: pre-wrap; line-height: 1.55; }
.laboratory-card > small { display: block; border-top: 1px solid #dce9eb; padding-top: 8px; color: var(--muted); white-space: pre-wrap; }
.anthropometry-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(105px,1fr)); gap: 8px; margin: 12px 0; }
.anthropometry-summary span { border-radius: 8px; padding: 8px; background: #edf6f7; }
.anthropometry-summary small,.anthropometry-summary strong { display: block; }
.anthropometry-summary small { margin-bottom: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.anthropometry-form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.form-action-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border: 2px solid transparent; border-radius: 10px; padding: 11px 20px; font-weight: 900; cursor: pointer; box-shadow: 0 6px 15px rgba(16,32,42,.1); transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.form-action-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.form-action-button.save { color: #fff; border-color: var(--primary); background: var(--primary); }
.form-action-button.save:hover,.form-action-button.save:focus-visible { border-color: #075b69; background: #075b69; transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 22px rgba(15,124,143,.25); }
.form-action-button.cancel { color: #9b3443; border-color: #dbaeb5; background: #fff; }
.form-action-button.cancel:hover,.form-action-button.cancel:focus-visible { color: #fff; border-color: #b4233a; background: #b4233a; transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 22px rgba(180,35,58,.2); }
.form-action-button.delete { color:#fff; border-color:#b4233a; background:#b4233a; }
.form-action-button.delete:hover,.form-action-button.delete:focus-visible { border-color:#86192a; background:#86192a; transform:translateY(-2px) scale(1.02); box-shadow:0 10px 22px rgba(180,35,58,.28); }
.form-action-button.back { color:#526f7a; border-color:#aebfc5; background:#f7fafb; }
.form-action-button.back:hover,.form-action-button.back:focus-visible { color:#fff; border-color:#3f626e; background:#3f626e; transform:translateY(-2px) scale(1.02); box-shadow:0 10px 22px rgba(63,98,110,.22); }
.modal-card footer.crud-form-actions { display:flex; justify-content:flex-end; align-items:center; gap:12px; }
.crud-form-actions .form-action-button { min-width:175px; min-height:56px; padding:13px 22px; font-size:15px; }
.header-back-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border: 2px solid #bdc9cc; border-radius: 10px; padding: 10px 18px; color: #52656b; background: #fff; font-weight: 900; box-shadow: 0 6px 15px rgba(16,32,42,.1); transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.header-back-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.header-back-button:hover,.header-back-button:focus-visible { color: #fff; border-color: #52656b; background: #52656b; transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 22px rgba(82,101,107,.24); }
@media (max-width:520px){.anthropometry-form-actions,.modal-card footer.crud-form-actions{display:grid;grid-template-columns:1fr}.form-action-button,.crud-form-actions .form-action-button{width:100%;min-width:0}}
@media (max-width:520px){.header-back-button{width:100%}.topbar:has(.header-back-button){align-items:stretch}}
.laboratory-determinations { display: grid; gap: 12px; max-height: 54vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #f8fbfc; }
.laboratory-determination-group { display: grid; gap: 2px; }
.laboratory-determination-group h3 { position: sticky; top: -10px; z-index: 1; margin: 0 0 4px; padding: 8px; color: #18577f; background: #dceeff; font-size: 12px; text-transform: uppercase; }
.laboratory-value-row { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(105px, .45fr); align-items: center; gap: 9px; padding: 4px 7px; }
.laboratory-value-row span { font-size: 12px; font-weight: 700; }
.laboratory-value-row input { min-width: 0; padding: 7px 8px; }
.laboratory-values { display: grid; gap: 10px; margin-top: 12px; }
.laboratory-values section { border: 1px solid #d8e6e8; border-radius: 8px; overflow: hidden; }
.laboratory-values h4 { margin: 0; padding: 7px 9px; color: #18577f; background: #e6f2f9; font-size: 11px; text-transform: uppercase; }
.laboratory-values section > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .35fr); gap: 12px; border-top: 1px solid #edf2f3; padding: 7px 9px; font-size: 13px; }
.laboratory-values strong { overflow-wrap: anywhere; text-align: right; }
.laboratory-comparison { margin-bottom: 18px; }
.laboratory-comparison .section-heading { align-items: end; }
.laboratory-comparison .section-heading label { min-width: min(100%, 330px); }
.laboratory-chart { min-height: 250px; margin-top: 14px; border: 1px solid #d9e7e9; border-radius: 12px; padding: 8px; background: linear-gradient(180deg, #f8fcfd, #fff); }
.laboratory-chart svg { display: block; width: 100%; height: auto; min-height: 230px; overflow: visible; }
.laboratory-chart .chart-grid { stroke: #dce8ea; stroke-width: 1; }
.laboratory-chart .chart-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.laboratory-chart .chart-area { fill: rgba(15,124,143,.1); }
.laboratory-chart .chart-point { fill: #fff; stroke: var(--primary); stroke-width: 3; }
.laboratory-chart text { fill: #52656b; font-size: 11px; font-family: inherit; }
.laboratory-chart .chart-value { fill: #17343d; font-weight: 800; }
.laboratory-comparison-values { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 8px; margin-top: 10px; }
.laboratory-comparison-value { border: 1px solid #d8e6e8; border-radius: 8px; padding: 9px; text-align: center; background: #fff; }
.laboratory-comparison-value time, .laboratory-comparison-value strong { display: block; }
.laboratory-comparison-value time { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.laboratory-attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 9px; margin-top: 12px; border-top: 1px solid #dce9eb; padding-top: 12px; }
.clinical-attachments { position: relative; z-index: 1; margin-top: 10px; }
.clinical-attachment-dialog .modal-card { width: min(620px, calc(100vw - 32px)); }
.clinical-viewer-header { gap: 12px; }
.clinical-viewer-controls { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.clinical-viewer-controls .zoom-value { min-width: 58px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--primary); background: #fff; font-size: 12px; font-weight: 900; cursor: pointer; }
.clinical-viewer-controls .zoom-value:hover { color: #fff; background: var(--primary); }
.laboratory-viewer-content.clinical-image-viewer { display: block; text-align: center; }
.laboratory-viewer-content.clinical-image-viewer img { width: auto; max-width: none; max-height: none; transform-origin: top center; transition: width .16s ease; }
.laboratory-attachment { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #d8e6e8; border-radius: 8px; padding: 7px; background: #fff; }
.attachment-preview { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border: 0; border-radius: 6px; padding: 0; color: #b4232e; background: #f5f7f8; cursor: pointer; }
.attachment-preview:hover { outline: 2px solid var(--primary); }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-pdf-icon { font-size: 13px; font-weight: 900; }
.attachment-name { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.laboratory-viewer { width: min(1120px, calc(100% - 24px)); }
.laboratory-viewer .modal-card { grid-template-rows: auto minmax(0, 1fr); height: min(88vh, 900px); }
.laboratory-viewer-content { display: grid; place-items: center; min-height: 0; height: 100%; overflow: auto; padding: 12px; background: #263238; }
.laboratory-viewer-content img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.laboratory-viewer-content iframe { width: 100%; height: 100%; min-height: 65vh; border: 0; background: #fff; }

@media (max-width: 860px) { .laboratory-layout { grid-template-columns: 1fr; } .clinical-actions { justify-content: flex-start; } .laboratory-determinations { max-height: none; } }
@media (max-width: 520px) { .laboratory-value-row, .laboratory-values section > div { grid-template-columns: 1fr; } .laboratory-values strong { text-align: left; } }
@media (max-width: 620px) { .laboratory-comparison .section-heading { align-items: stretch; } .laboratory-comparison-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1120px) {
  .weekly-diabetes-layout { grid-template-columns: 1fr; }
  .weekly-history { position: static; max-height: none; }
  .weekly-column-headings { display: none; }
  .weekly-measurement-row { grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #dce8e5; border-radius: 10px; margin-top: 9px; padding: 11px; background: #fff; }
  .weekly-moment { grid-column: 1 / -1; border-bottom: 1px solid #e2ece9; padding-bottom: 7px; }
  .weekly-measurement-row label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
  .weekly-observation { grid-column: span 2; }
}
@media (max-width: 620px) {
  .weekly-form-heading { align-items: stretch; }
  .weekly-form-heading .form-action-button { width: 100%; }
  .weekly-day summary { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .weekly-day-count { grid-column: 1 / -1; text-align: left; }
  .weekly-day summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .weekly-day-table { padding: 4px 8px 10px; }
  .weekly-measurement-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekly-moment, .weekly-observation { grid-column: 1 / -1; }
  .weekly-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  @page { margin: 12mm; }
  body.admin-page { color: #000; background: #fff; }
  .sidebar, .menu-toggle, .clinical-actions, .panel-add, .event-actions, dialog { display: none !important; }
  .admin-main, .clinical-main { width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .topbar { min-height: 0; border: 0; padding: 0 0 10px; box-shadow: none; }
  .clinical-patient-header, .clinical-event-panel { break-inside: avoid; box-shadow: none; }
  .clinical-board { display: block; min-height: 0; }
  .clinical-board-column { display: block; }
  .clinical-event-panel { margin-bottom: 12px; overflow: visible; }
  .clinical-event-list { max-height: none !important; overflow: visible !important; }
  .clinical-event-card { break-inside: avoid; }
}

.icon-action.add {
  width: 48px;
  height: 48px;
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.icon-action.add:hover,
.icon-action.add:focus-visible {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.04);
}

.icon-action.add svg {
  transition: transform .22s ease;
}

.icon-action.add:hover svg,
.icon-action.add:focus-visible svg {
  transform: rotate(90deg);
}

.icon-action::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 150px;
  border-radius: 6px;
  padding: 6px 8px;
  color: #fff;
  background: #10202a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s ease, visibility .15s, transform .15s ease;
}

.icon-action:hover::after,
.icon-action:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

.pager div {
  display: flex;
  gap: 8px;
}

.pager-action { width: 40px; height: 40px; }
.pager-action:hover:not(:disabled), .pager-action:focus-visible:not(:disabled) { transform: translateY(-2px) scale(1.07); }
.pager-action:disabled { color: #9baaad; border-color: #d8e0e2; background: #eef2f3; box-shadow: none; cursor: not-allowed; opacity: .65; transform: none; }
.pager-action:disabled::after { display: none; }
.export-actions { display: flex; align-items: end; gap: 7px; }
.export-action { width: 40px; height: 40px; }
.export-action.excel { color: #217346; border-color: #9cc9ad; }
.export-action.excel:hover, .export-action.excel:focus-visible { color: #fff; border-color: #217346; background: #217346; }
.export-action.word { color: #2b579a; border-color: #a8bcdb; }
.export-action.word:hover, .export-action.word:focus-visible { color: #fff; border-color: #2b579a; background: #2b579a; }
.export-action.pdf { color: #b4232e; border-color: #dfadb2; }
.export-action.pdf:hover, .export-action.pdf:focus-visible { color: #fff; border-color: #b4232e; background: #b4232e; }
.export-action:disabled { opacity: .55; cursor: wait; transform: none; }

.modal {
  width: min(760px, calc(100% - 24px));
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(16, 32, 42, .55);
}

.app-dialog {
  width: min(480px, calc(100% - 28px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  color: var(--text);
  background: transparent;
  box-shadow: 0 24px 70px rgba(16, 32, 42, .3);
}

.app-dialog::backdrop {
  background: rgba(16, 32, 42, .62);
  backdrop-filter: blur(3px);
}

.app-dialog-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 26px;
  background: var(--panel);
}

.app-dialog-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--primary);
  background: #e2f3f5;
}

.app-dialog[data-type="danger"] .app-dialog-icon {
  color: var(--danger);
  background: #ffe8e8;
}

.app-dialog-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-dialog-copy h2 {
  margin: 2px 0 9px;
  font-size: 21px;
}

.app-dialog-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.app-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.modal-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: var(--panel);
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-card h2 {
  margin: 0;
}

.delete-review-modal {
  width: min(920px, calc(100% - 24px));
}

.delete-review-modal .modal-card {
  max-height: 90vh;
  overflow-y: auto;
}

.delete-warning {
  margin: 0;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  padding: 12px 14px;
  color: #863737;
  background: #fff1f1;
  font-weight: 700;
}

.patient-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.patient-details > div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--panel);
}

.patient-details dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.patient-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--text);
  font-size: 16px;
}

.wide {
  grid-column: 1 / -1;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-row input {
  width: 22px;
  height: 22px;
}

.reconciliation-main { background: #f4f8f8; }
.reconciliation-intro {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 18px; border: 1px solid #b8dce0; border-radius: 12px; padding: 17px 20px;
  background: #eaf7f8;
}
.reconciliation-intro p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; }
.reconciliation-lock { flex: none; border-radius: 999px; padding: 7px 12px; color: #275b64; background: #fff; font-size: 12px; font-weight: 900; }
.reconciliation-metrics { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 12px; margin-bottom: 18px; }
.reconciliation-metrics button {
  display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 11px; padding: 15px;
  text-align: left; color: var(--text); background: var(--panel); box-shadow: 0 5px 16px rgba(38,72,83,.06); cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.reconciliation-metrics button:hover { border-color: #91c5cb; box-shadow: 0 9px 22px rgba(38,72,83,.12); transform: translateY(-2px); }
.reconciliation-metrics span { color: var(--muted); font-size: 12px; font-weight: 800; }
.reconciliation-metrics strong { font-size: 26px; }
.reconciliation-toolbar { align-items: end; }
.table-subline { display: block; margin-top: 5px; color: var(--muted); white-space: nowrap; }
.score-pill { display: inline-grid; place-items: center; min-width: 42px; height: 42px; border-radius: 50%; font-weight: 900; }
.score-high { color: #126333; background: #dff5e8; }
.score-medium { color: #775102; background: #fff1c9; }
.score-none { color: #6b7280; background: #edf0f3; }
.evidence-chip { display: inline-flex; border: 1px solid #c9e2e5; border-radius: 999px; padding: 4px 8px; color: #27636c; background: #eff9fa; font-size: 11px; font-weight: 800; }
.action-btn.review { min-width: 78px; }
.reconciliation-dialog { width: min(1120px, calc(100% - 24px)); }
.reconciliation-dialog .modal-card { max-height: 94vh; overflow-y: auto; }
.reconciliation-current-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-radius: 9px; padding: 11px 13px; background: var(--panel-strong); }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.comparison-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.comparison-panel h3 { margin: 0; padding: 13px 16px; color: #fff; background: #516872; font-size: 15px; }
.current-panel h3 { background: var(--primary); }
.comparison-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; background: var(--line); gap: 1px; }
.comparison-details > div { min-width: 0; padding: 11px 13px; background: #fff; }
.comparison-details dt { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.comparison-details dt span { color: #16824c; font-size: 15px; }
.comparison-details dd { margin: 0; overflow-wrap: anywhere; line-height: 1.4; }
.comparison-details .matched-field { background: #f0faf4; }
.empty-candidate { padding: 30px; text-align: center; }
.empty-candidate p { color: var(--muted); }
.clinical-content-summary { border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.clinical-content-summary h3 { margin: 0 0 12px; font-size: 15px; }
.clinical-content-summary > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.clinical-content-summary span { display: grid; gap: 3px; border-radius: 8px; padding: 10px; color: var(--muted); background: var(--panel-strong); font-size: 11px; }
.clinical-content-summary span strong { color: var(--text); font-size: 18px; }
.clinical-content-summary > small { display: block; margin-top: 10px; color: var(--muted); line-height: 1.5; }
.candidate-picker { position: relative; }
.candidate-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.candidate-results:empty { display: none; }
.candidate-results button { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: left; color: var(--text); background: #fff; cursor: pointer; }
.candidate-results button:hover { border-color: var(--primary); background: #eff9fa; }
.candidate-results small { color: var(--muted); }
.reconciliation-actions { display: grid !important; grid-template-columns: auto 1fr auto auto auto; }
.btn.danger-outline { border: 1px solid var(--danger); color: var(--danger); background: #fff; }
.btn.danger-outline:hover { color: #fff; background: var(--danger); }
.import-preview { border: 2px solid #b8dce0; border-radius: 12px; padding: 17px; background: #f3fbfc; }
.import-preview > header { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.import-preview h3 { margin: 0; }
.import-preview-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 14px 0; }
.import-preview-counts span { display: grid; gap: 3px; border-radius: 8px; padding: 11px; background: #fff; }
.import-preview-counts strong { font-size: 21px; }
.import-preview-counts small { color: var(--muted); }
.import-warnings:not(:empty) { margin: 12px 0; border-left: 4px solid #e0a11b; padding: 10px 13px; background: #fff8e7; }
.import-warnings ul { margin: 7px 0 0; padding-left: 20px; }
.import-preview details { margin: 12px 0; }
.import-preview summary { color: var(--primary); font-weight: 800; cursor: pointer; }
.import-event-samples { display: grid; gap: 8px; margin-top: 10px; }
.import-event-samples article { display: grid; grid-template-columns: 100px 150px minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.import-event-samples time { color: var(--muted); font-size: 12px; font-weight: 800; }
.import-event-samples p { margin: 0; color: var(--muted); line-height: 1.45; }
.import-safety-note { color: #275b64; font-size: 13px; font-weight: 700; }

@media (max-width: 860px) {
  .topbar.clinical-topbar {
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    row-gap: 14px;
  }
  .clinical-topbar > div:not(.clinical-actions) {
    min-width: 0;
    width: 100%;
  }
  .clinical-topbar #patientTitle {
    max-width: 100%;
    font-size: clamp(24px, 7vw, 34px);
    line-height: 1.12;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .clinical-topbar #patientSubtitle {
    max-width: 100%;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .clinical-topbar .clinical-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }
  .clinical-patient-header { grid-template-columns: 1fr; }
  .patient-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clinical-board { grid-template-columns: 1fr; min-height: 0; }
  .primary-column, .secondary-column { grid-template-rows: none; }
  .clinical-event-panel { min-height: 340px; }
  .evolution-panel { min-height: 500px; }
  .reconciliation-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-grid { grid-template-columns: 1fr; }
  .candidate-results { grid-template-columns: 1fr; }
  .reconciliation-actions { grid-template-columns: 1fr !important; }
  .reconciliation-actions span { display: none; }
  .reconciliation-actions .btn { width: 100%; }
  .import-preview-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-event-samples article { grid-template-columns: 1fr; }
  .reconciliation-intro { align-items: flex-start; flex-direction: column; }
  .clinical-layout {
    grid-template-columns: 1fr;
  }

  .clinical-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-header {
    position: static;
    padding: 16px 20px;
  }

  .public-nav a:not(.admin-access) {
    display: none;
  }

  .landing-hero,
  .intro-strip,
  .section-heading,
  .approach-section,
  .contact-section,
  .public-footer {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
  }

  .hero-copy,
  .landing-section,
  .approach-card,
  .contact-section {
    padding: 70px 24px;
  }

  .hero-copy h1 {
    font-size: clamp(46px, 14vw, 68px);
  }

  .respiratory-visual {
    min-height: 520px;
  }

  .intro-strip {
    gap: 18px;
    padding: 42px 24px;
  }

  .section-heading {
    gap: 24px;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 45px;
  }

  .service-grid article {
    min-height: 0;
  }

  .service-grid h3 {
    margin-top: 38px;
  }

  .service-content {
    min-height: 235px;
    padding: 24px;
  }

  .care-steps {
    padding: 40px 24px;
  }

  .contact-section {
    gap: 35px;
  }

  .consulting-location-brand {
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 20px;
  }

  .consulting-location-brand img {
    width: 92px;
    height: 92px;
  }

  .consulting-contact-list {
    padding-inline: 20px;
  }

  .public-footer {
    text-align: left;
  }

  .public-footer p {
    text-align: left;
  }

  .public-hero,
  .feature-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar,
  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar > .btn {
    grid-column: 1 / -1;
  }

  .topbar > .icon-action.add {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .admin-main {
    padding: 20px;
  }

  .table-toolbar,
  .pager {
    display: flex;
  }

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

  .patient-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar.clinical-topbar {
    margin-bottom: 16px;
  }
  .clinical-topbar .eyebrow {
    margin-bottom: 5px;
  }
  .clinical-topbar .clinical-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 7px;
  }
  .clinical-topbar .clinical-header-action {
    width: 100%;
    max-width: 52px;
    justify-self: center;
  }
  .patient-header-grid { grid-template-columns: 1fr; }
  .clinical-event-card p { padding-right: 0; }
  .manual-event p { padding-top: 28px; }
  .reconciliation-metrics { grid-template-columns: 1fr 1fr; }
  .comparison-details { grid-template-columns: 1fr; }
  .clinical-content-summary > div { grid-template-columns: repeat(2, 1fr); }
  .clinical-summary {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .app-dialog-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
  }

  .app-dialog-icon {
    width: 44px;
    height: 44px;
  }

  .app-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .app-dialog-actions .btn {
    width: 100%;
  }

  .patient-details {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 14px;
  }

  .content-card {
    padding: 12px;
  }

  .responsive-data-table td {
    grid-template-columns: minmax(92px, 36%) minmax(0, 64%);
    padding: 10px 12px;
  }

  .responsive-data-table td.actions-cell {
    grid-template-columns: 1fr 1fr;
  }

  .responsive-data-table td.actions-cell::before {
    grid-column: 1 / -1;
  }

  .responsive-data-table td.actions-cell .action-btn {
    width: 100%;
  }

  .public-header-session {
    gap: 10px;
    padding-inline: 14px;
  }

  .public-header-session .menu-toggle {
    width: 40px;
    height: 40px;
  }

  .public-header-session .public-brand-mark {
    width: 38px;
    height: 38px;
  }

  .public-header-session .public-brand strong {
    font-size: 15px;
  }

  .public-header-session .admin-access {
    padding: 8px 10px;
    font-size: 11px;
  }

  .admin-access {
    padding: 9px 12px;
    font-size: 12px;
  }

  .public-brand small {
    display: none;
  }

  .hero-actions,
  .trust-list {
    align-items: stretch;
    flex-direction: column;
  }

  .text-link {
    justify-content: center;
  }

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

  .service-grid article {
    min-height: 0;
  }

  .service-content {
    min-height: 220px;
  }

  .visual-note {
    right: 18px;
    bottom: 18px;
    left: 18px;
  }
}
.clinical-header-action.referral { background: #7a4fa3; color: #fff; }
.clinical-header-action.referral:hover { background: #603783; }
.clinical-header-action.share-results { background: #16866f; color: #fff; }
.clinical-header-action.share-results:hover { background: #0f6a58; }
.referral-section { margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.table-secondary { display: block; margin-top: 4px; color: #64747a; }
.form-span-2 { grid-column: 1 / -1; }
.field-help { display: block; margin-top: 6px; color: #64747a; font-size: 12px; line-height: 1.35; }
.share-documents { margin: 18px 0; border: 1px solid #d7e1e4; border-radius: 12px; padding: 14px; }
.share-document-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.share-document-option { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; background: #f4f8f9; }
.share-document-option small { display: block; color: #64747a; margin-top: 3px; }
.share-package-history { margin-top: 16px; }
.share-package-history h3 { margin-bottom: 9px; }
.share-package-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 7px; border: 1px solid #d7e1e4; border-radius: 10px; }
.share-package-row small { display: block; margin-top: 4px; color: #64747a; }
.secure-share-entry { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: 20px 0; border-left: 5px solid #7a4fa3; background: linear-gradient(120deg,#fbf8ff,#f3ebfa); }
.secure-share-entry-copy h2 { margin: 3px 0 8px; }
.secure-share-entry-copy p { margin: 0; color: #5d6870; }
.secure-share-entry-copy ol { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 14px 0 0; padding-left: 22px; font-weight: 700; color: #63417f; }
.secure-share-entry-button { flex: 0 0 auto; background: #7a4fa3; color: #fff; border-color: #7a4fa3; min-width: 230px; }
.secure-share-entry-button:hover { background: #603783; border-color: #603783; }
.communication-security-note { margin: 16px 0; padding: 12px 14px; border-left: 4px solid #d59b20; border-radius: 8px; background: #fff7df; color: #624d1d; }
.communication-actions { flex-wrap: wrap; }
.communication-center-list { display: grid; gap: 16px; }
.communication-center-card { border: 1px solid #d8e3e5; border-radius: 14px; padding: 18px; background: #fff; box-shadow: 0 8px 24px rgba(26,62,70,.06); }
.communication-center-card > header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.communication-center-card h2 { margin: 8px 0 3px; }
.communication-center-card p { margin: 0; color: #64747a; }
.communication-package-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0; }
.communication-package-summary span { padding: 7px 10px; border-radius: 999px; background: #edf5f6; color: #34545b; }
.communication-history { display: grid; gap: 7px; margin-top: 10px; }
.communication-history div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 8px; background: #f6f8f9; }
.communication-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.empty-communications { padding: 36px; text-align: center; }
.share-destination-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-bottom: 20px; }
.share-destination-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; border-top: 5px solid; }
.share-destination-card.patient { border-color: #16866f; }
.share-destination-card.doctor { border-color: #7a4fa3; }
.share-destination-card .form-action-button { grid-column: 1 / -1; width: 100%; }
.share-destination-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #eaf4f3; color: #17695d; font-size: 22px; font-weight: 900; }
.share-destination-card.doctor .share-destination-icon { background: #f2eafa; color: #69428a; }
.share-destination-card h2 { margin-top: 0; }
.consent-confirmation { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 9px; background: #f2f7f8; }
@media (max-width: 760px) { .share-destination-grid { grid-template-columns: 1fr; } }
@media (max-width: 650px) {
  .communication-center-card > header,.communication-history div { flex-direction: column; }
  .communication-card-actions .form-action-button { width: 100%; }
}
@media (max-width: 800px) {
  .secure-share-entry { align-items: stretch; flex-direction: column; }
  .secure-share-entry-button { width: 100%; }
}
.shared-result-page { min-height: 100vh; background: linear-gradient(150deg,#e8f4f4,#f8fbfb); padding: 24px; }
.shared-result-shell { width: min(920px,100%); margin: 0 auto; }
.shared-result-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.shared-result-header h1,.shared-result-header p { margin: 0; }
.shared-access-card { max-width: 560px; margin: 50px auto; }
.shared-access-card form { display: grid; gap: 16px; margin-top: 20px; }
.shared-file-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.shared-file-card { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid #d8e4e6; border-radius: 12px; padding: 14px; background: white; cursor: pointer; }
.shared-file-card:hover { border-color: #0f7c8f; transform: translateY(-2px); }
.shared-file-card small { display: block; color: #64747a; margin-top: 4px; }
.shared-file-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: #e7f3f4; color: #0f6877; font-weight: 900; }
@media (max-width: 720px) {
  .section-heading { align-items: stretch; flex-direction: column; }
  .form-span-2 { grid-column: auto; }
}
.shared-result-patient {
  margin: .35rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #20333d);
}
