:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  --warning: #b54708;
  --info: #175cd3;
  --success: #067647;
  --shadow: 0 18px 45px rgba(28, 39, 76, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Barlow", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(245, 247, 251, 0.96), rgba(235, 242, 248, 0.98)),
    radial-gradient(circle at 20% 0%, rgba(15, 118, 110, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
}

.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url("https://static.vecteezy.com/system/resources/previews/006/712/977/non_2x/abstract-health-medical-science-healthcare-icon-digital-technology-doctor-concept-modern-innovation-treatment-medicine-on-hi-tech-future-blue-background-for-wallpaper-template-web-design-vector.jpg") no-repeat center center / cover;
  background-attachment: fixed;
}

.brand-block, .side-brand, .user-chip, .panel-head, .actions {
  display: flex;
  align-items: center;
}

.brand-block { gap: 18px; }

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 800;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 0.85rem;
}

.brand-block h1, .brand-block p, .login-heading h2, .login-heading p {
  margin: 0;
}

.brand-block h1 { font-size: 2.2rem; }
.brand-block p { opacity: 0.84; margin-top: 6px; }

.logo-watermark {
  position: fixed;
  left: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  max-width: 30vw;
  opacity: 0.15;
  z-index: 1;
  pointer-events: none;
}

.logo-watermark img {
  width: 100%;
  height: auto;
  display: block;
}

.glass-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 32px 44px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 40px;
  box-shadow: 0 35px 68px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation: loginRise 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.institutional-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo-area {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.logo-icon {
  width: 70px;
  height: 70px;
  background: url("https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg/1280px-Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg.png") no-repeat center / contain;
  filter: drop-shadow(0 8px 18px rgba(190, 0, 0, 0.3));
}

.ministry-name {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 14px;
  border-radius: 60px;
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.institutional-title {
  margin-bottom: 8px;
  color: #0f2b3d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.institutional-sub {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  background: #eef2ff;
  color: #2c5f8a;
  font-size: 11px;
  font-weight: 650;
}

.system-name {
  margin: 18px 0 6px;
  background: linear-gradient(135deg, #b91c1c, #dc2626, #1e40af);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0;
}

.version-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 40px;
  background: #eef2ff;
  color: #0f3b6f;
  font-size: 11px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 650;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.required-mark {
  color: #dc2626;
  font-weight: 850;
}

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

textarea { resize: vertical; }

.form-group {
  margin-bottom: 22px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
}

.input-label i {
  color: #b91c1c;
  font-size: 14px;
}

.modern-input {
  width: 100%;
  padding: 13px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.modern-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.primary-btn, .ghost-btn, .nav-item {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 12px 22px rgba(15, 118, 110, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 16px 28px rgba(15, 118, 110, 0.28);
}

.ghost-btn {
  padding: 10px 13px;
  background: #eef6f5;
  color: var(--primary-dark);
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.11);
}

.chip-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: #eef6f5;
  color: var(--primary-dark);
  cursor: pointer;
}

.chip-icon-btn:hover {
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 0;
  border-radius: 40px;
  background: linear-gradient(105deg, #b91c1c 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 12px 20px -10px rgba(185, 28, 28, 0.4);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  background: linear-gradient(105deg, #991b1b, #b91c1c);
  box-shadow: 0 18px 25px -12px rgba(185, 28, 28, 0.5);
}

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

.message-area {
  min-height: 30px;
  margin-top: 18px;
  padding: 8px;
  border-radius: 40px;
  background: #fff5f5;
  color: #c2410c;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
}

.message-area:empty {
  display: none;
}

.login-footer-note {
  margin-top: 20px;
  color: #6c86a3;
  text-align: center;
  font-size: 10px;
  font-weight: 650;
}

.btn-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@keyframes loginRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns 0.24s ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, #0b2f36 0%, #123d48 48%, #0a242c 100%);
  color: white;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  box-shadow: 14px 0 34px rgba(15, 23, 42, 0.16);
  transition: width 0.24s ease, padding 0.24s ease;
}

.sidebar.collapsed {
  width: 78px;
  padding: 20px 12px;
}

.side-brand {
  gap: 12px;
  min-height: 46px;
}

.side-brand > div {
  min-width: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.side-brand strong {
  display: block;
  line-height: 1.05;
}

.side-brand small { display: block; color: rgba(255,255,255,0.7); margin-top: 2px; }

.sidebar-toggle {
  margin-left: auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 9px 16px rgba(0,0,0,0.18);
}

.sidebar.collapsed .side-brand > div,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logout span {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-8px);
}

.sidebar.collapsed .sidebar-toggle {
  margin-left: 0;
}

.nav {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  min-height: 46px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255,255,255,0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(0,0,0,0.12);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .logout {
  width: 52px;
  justify-content: center;
  padding: 12px;
}

.nav-item.active, .nav-item:hover {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(30, 64, 175, 0.88));
  color: white;
  transform: translateY(-1px);
}

.logout {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 18px rgba(0,0,0,0.14);
}

.content {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 26px;
  background:
    linear-gradient(rgba(255,255,255,0.84), rgba(255,255,255,0.86)),
    url("https://static.vecteezy.com/system/resources/previews/008/889/844/non_2x/medical-healthcare-background-with-hexagonal-pattern-vector.jpg") center / cover fixed;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow { margin: 0 0 4px; font-weight: 700; text-transform: uppercase; font-size: 0.76rem; }
.topbar h2 { margin: 0; font-size: 1.7rem; }

.user-chip {
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
}

.user-chip span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #dff3f0;
  color: var(--primary-dark);
  font-weight: 800;
}

.user-chip small { display: block; color: var(--muted); margin-top: 2px; }

.loader-line {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: #d6ece9;
  margin-bottom: 16px;
}

.loader-line::before {
  content: "";
  display: block;
  height: 100%;
  width: 38%;
  background: var(--primary);
  animation: slide 0.9s infinite ease-in-out;
}

@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(270%); }
}

.view { display: none; }
.view.active { display: block; }

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

.kpi-card, .panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.08), inset 0 1px 0 rgba(255,255,255,0.75);
}

.kpi-card {
  padding: 18px;
  border-top: 4px solid var(--primary);
}

.kpi-card span { color: var(--muted); font-weight: 700; }
.kpi-card strong { display: block; font-size: 2.1rem; margin-top: 8px; }
.kpi-card.danger { border-top-color: var(--danger); }
.kpi-card.warning { border-top-color: var(--warning); }
.kpi-card.info { border-top-color: var(--info); }
.kpi-card.success { border-top-color: var(--success); }

.analysis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.analysis-kpi-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.07);
}

.analysis-kpi-card span,
.analysis-kpi-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.analysis-kpi-card span {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.analysis-kpi-card strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 2rem;
  line-height: 1;
}

.analysis-kpi-card small {
  font-size: 0.72rem;
  line-height: 1.25;
}

.analysis-kpi-card.danger { border-left-color: var(--danger); }
.analysis-kpi-card.warning { border-left-color: var(--warning); }
.analysis-kpi-card.info { border-left-color: var(--info); }
.analysis-kpi-card.success { border-left-color: var(--success); }
.analysis-kpi-card.neutral { border-left-color: #64748b; }

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 16px;
}

.clinical-analysis-panel .chart-container canvas {
  width: 100%;
  height: 320px;
}

.clinical-analysis-panel .heatmap-container {
  margin-top: 16px;
}

.two-col, .work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.work-grid { align-items: start; }

.triage-work-grid {
  grid-template-columns: minmax(0, 2.15fr) minmax(320px, 0.85fr);
}

.form-panel,
.queue-panel {
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}

.panel { padding: 18px; }
.panel-head { justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel h3 { margin: 0; font-size: 1.08rem; }

.pill {
  color: var(--primary-dark);
  background: #dff3f0;
  border-radius: 99px;
  padding: 6px 10px;
  font-weight: 750;
  font-size: 0.82rem;
}

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

.span-2 { grid-column: span 2; }

.dynamic-form {
  display: grid;
  gap: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdff;
}

.form-section:nth-child(5n + 1) { background: #fffafa; border-left: 5px solid #dc2626; }
.form-section:nth-child(5n + 2) { background: #f6fef9; border-left: 5px solid #16a34a; }
.form-section:nth-child(5n + 3) { background: #f5f9ff; border-left: 5px solid #2563eb; }
.form-section:nth-child(5n + 4) { background: #fff8f1; border-left: 5px solid #ea580c; }
.form-section:nth-child(5n) { background: #fbf7ff; border-left: 5px solid #9333ea; }

.form-section header {
  padding: 12px 14px;
  background: #eef6f5;
  border-bottom: 1px solid var(--line);
}

.form-section h4,
.form-section p {
  margin: 0;
}

.form-section h4 {
  font-size: 0.98rem;
}

.form-section p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.pressure-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.pressure-inputs strong {
  color: #64748b;
  font-size: 1.1rem;
}

.triage-decision-section {
  border-left-color: #b42318 !important;
  background: linear-gradient(135deg, #fff5f5 0%, #fff8f1 100%) !important;
}

.triage-decision-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 14px;
}

.clinical-section.readonly-section {
  opacity: 0.92;
}

.clinical-widget {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  position: relative;
}

.clinical-widget label {
  position: relative;
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.widget-head > span,
.widget-head {
  color: #0f2b3d;
}

.diagnosis-results {
  display: none;
  gap: 6px;
  position: absolute;
  left: 16px;
  right: 16px;
  z-index: 60;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.diagnosis-results:not(:empty) {
  display: grid;
}

.diagnosis-result {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.diagnosis-result small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.diagnosis-result:hover {
  border-color: #dc2626;
  background: #fff5f5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.diagnosis-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border-radius: 99px;
  padding: 7px 10px;
  background: #eef6f5;
  color: #0f3b6f;
  font-weight: 650;
}

.diagnosis-tag button {
  border: 0;
  border-radius: 99px;
  background: #dc2626;
  color: white;
  cursor: pointer;
}

.external-diagnosis {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff7ed;
}

.treatment-list {
  display: grid;
  gap: 10px;
}

.treatment-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(90px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.clinical-exit-row {
  margin-top: 16px;
}

.clinical-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.danger-action {
  color: #b42318;
  background: #fff5f5;
}

.select-triage {
  border: 0;
  color: white;
  font-weight: 850;
  background: linear-gradient(145deg, #16a34a, #067647);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 12px 22px rgba(16, 24, 40, 0.18);
}

.select-triage option {
  background: #ffffff;
  color: #172033;
  font-weight: 750;
}

.select-triage option[value="ROJO"] { color: #b42318; }
.select-triage option[value="NARANJA"] { color: #ea580c; }
.select-triage option[value="AMARILLO"] { color: #713f12; }
.select-triage option[value="VERDE"] { color: #067647; }
.select-triage option[value="AZUL"] { color: #175cd3; }

.select-triage.triage-ROJO {
  background: linear-gradient(145deg, #dc2626, #991b1b);
}

.select-triage.triage-NARANJA {
  background: linear-gradient(145deg, #fb923c, #ea580c);
}

.select-triage.triage-AMARILLO {
  color: #1e293b;
  background: linear-gradient(145deg, #fef08a, #facc15);
}

.select-triage.triage-VERDE {
  background: linear-gradient(145deg, #16a34a, #067647);
}

.select-triage.triage-AZUL {
  background: linear-gradient(145deg, #3b82f6, #175cd3);
}

.field {
  grid-column: span var(--span, 6);
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

.field input[readonly],
.field select:disabled,
.field textarea[readonly] {
  color: #475467;
  background: #f2f4f7;
}

.check-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.check-field small {
  grid-column: 1 / -1;
}

.field-disabled {
  opacity: 0.58;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.queue, .list, .bars {
  display: grid;
  gap: 10px;
}

.queue-card, .list-row, .bar-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

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

.queue-card.visual {
  position: relative;
  overflow: hidden;
  border-color: rgba(15, 118, 110, 0.18);
  background: linear-gradient(145deg, #ffffff 0%, #f7fbfb 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.queue-card.visual::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #dc2626, #0f766e);
}

.queue-card.triage-ROJO::before { background: #b42318; }
.queue-card.triage-NARANJA::before { background: #ea580c; }
.queue-card.triage-AMARILLO::before { background: #facc15; }
.queue-card.triage-VERDE::before { background: #16a34a; }
.queue-card.triage-AZUL::before { background: #2563eb; }

.queue-meta,
.queue-priority {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.queue-priority {
  padding: 8px 10px;
  border-radius: 7px;
  background: #eef6f5;
  color: #0f3b6f;
}

.queue-priority strong {
  color: #0f766e;
}

.queue-sensor,
.inline-sensor {
  display: flex;
  align-items: center;
  gap: 9px;
}

.queue-sensor small,
.inline-sensor + small {
  color: var(--muted);
}

.sensor-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.14);
}

.wait-warning .sensor-dot {
  background: #facc15;
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.2);
  animation: pulse-wait 1.1s infinite;
}

.wait-critical .sensor-dot {
  background: #dc2626;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.18);
  animation: pulse-wait 0.75s infinite;
}

.wait-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5e7eb;
}

.wait-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #facc15, #dc2626);
}

@keyframes pulse-wait {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.24); opacity: 0.72; }
}

.queue-card header, .list-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.triage-badge {
  border-radius: 99px;
  padding: 4px 9px;
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
}

.triage-badge-action {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(15, 35, 64, 0.14);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.triage-badge-action:hover {
  transform: translateY(-1px);
  filter: saturate(1.12);
  box-shadow: 0 10px 18px rgba(15, 35, 64, 0.2);
}

.triage-badge-action:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.32);
  outline-offset: 2px;
}

.triage-priority-modal-card {
  max-width: 520px;
}

.triage-priority-modal-card .modal-footer {
  align-items: stretch;
  gap: 12px;
}

.triage-priority-modal-card .modal-footer .ghost-btn,
.triage-priority-modal-card .modal-footer .primary-btn {
  min-height: 42px;
  margin: 0;
}

.ROJO { background: #b42318; }
.NARANJA { background: #c4320a; }
.AMARILLO { background: #facc15; color: #1e293b; }
.VERDE { background: #067647; }
.AZUL { background: #175cd3; }

.triage-badge.ROJO,
.triage-badge-action.ROJO { background: #b42318; color: #ffffff; }
.triage-badge.NARANJA,
.triage-badge-action.NARANJA { background: #c4320a; color: #ffffff; }
.triage-badge.AMARILLO,
.triage-badge-action.AMARILLO { background: #facc15; color: #1e293b; }
.triage-badge.VERDE,
.triage-badge-action.VERDE { background: #067647; color: #ffffff; }
.triage-badge.AZUL,
.triage-badge-action.AZUL { background: #175cd3; color: #ffffff; }

.triage-badge-action {
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.clinical-form {
  display: grid;
  gap: 14px;
}

.actions { justify-content: flex-end; gap: 10px; }
.actions .primary-btn { width: auto; margin: 0; }

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 250px);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 0.84rem; text-transform: uppercase; }

.direction-panel {
  padding: 0;
  overflow: hidden;
}

.direction-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  background: linear-gradient(105deg, #0f2b3d, #164e63);
  color: white;
}

.direction-hero h3,
.direction-hero p {
  margin: 0;
}

.direction-hero .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.direction-hero h3 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.btn-red {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 40px;
  padding: 11px 16px;
  background: linear-gradient(105deg, #b91c1c, #dc2626);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 13px 22px -10px rgba(185, 28, 28, 0.8), 0 3px 0 #7f1d1d;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.btn-red:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 16px 26px -10px rgba(185, 28, 28, 0.86), 0 4px 0 #7f1d1d;
}

.btn-red:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 18px -10px rgba(185, 28, 28, 0.7), 0 1px 0 #7f1d1d;
}

.direction-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(220px, 1fr);
  gap: 14px;
  padding: 16px 18px;
  background: #f8fafe;
  border-bottom: 1px solid var(--line);
}

.direction-hero.compact {
  min-height: auto;
  padding: 18px;
}

.variables-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 360px);
}

.variables-table-wrap {
  max-height: calc(100vh - 270px);
}

.variables-table {
  min-width: 1680px;
}

.variables-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.variables-table input,
.variables-table select {
  min-width: 86px;
  padding: 8px 9px;
  border-radius: 7px;
}

.variables-table td:nth-child(1),
.variables-table td:nth-child(2),
.variables-table td:nth-child(4),
.variables-table td:nth-child(5) {
  max-width: 260px;
  white-space: normal;
}

.data-table td {
  vertical-align: middle;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-badge.active {
  background: #e0f2e9;
  color: #0b5e42;
}

.status-badge.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.btn-icon {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 8px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 11px 18px rgba(15, 23, 42, 0.12);
}

.stats-shell-panel {
  min-height: 280px;
}

.stats-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafe;
}

.chart-container,
.heatmap-container {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.06);
}

.chart-container canvas {
  width: 100% !important;
  height: 320px !important;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #0f172a;
  font-weight: 800;
}

.kpi-unit {
  margin-left: 2px;
  font-size: 1rem;
}

.heatmap-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
}

.heatmap-table th,
.heatmap-table td {
  min-width: 34px;
  padding: 7px 6px;
  border: 0;
  border-radius: 6px;
  text-align: center;
  font-size: 0.78rem;
}

.heatmap-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
}

.heat-zero { background: #f8fafc; color: #94a3b8; }
.heat-low { background: #fee2e2; color: #7f1d1d; }
.heat-mid { background: #fb923c; color: #7c2d12; }
.heat-high { background: #dc2626; color: white; }

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 18px;
  height: 12px;
  border-radius: 4px;
}

.legend-color.zero { background: #f8fafc; border: 1px solid #e2e8f0; }
.legend-color.low { background: #fee2e2; }
.legend-color.mid { background: #fb923c; }
.legend-color.high { background: #dc2626; }

.section-label {
  display: block;
  margin: 8px 0 10px;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.procedure-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.procedure-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafe;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 750;
}

.procedure-check input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.plan-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.plan-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.plan-card small {
  color: var(--muted);
  font-weight: 650;
}

.plan-card ul {
  margin: 0;
  padding-left: 18px;
}

.btn-edit { background: #eff6ff; color: #1e40af; }
.btn-reset { background: #fffbeb; color: #b45309; }
.btn-toggle { background: #f1f5f9; color: #334155; }

.glass-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 10000;
}

.glass-modal.show {
  display: flex;
}

.modal-card-stat {
  width: min(880px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 28px;
  background: white;
  box-shadow: 0 40px 70px rgba(0, 0, 0, 0.38);
  animation: modalUp 0.22s ease;
}

.modal-header-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: #f9fbfe;
  border-bottom: 2px solid #dc2626;
}

.modal-header-stat h2 {
  margin: 0;
  background: linear-gradient(135deg, #b91c1c, #0f2b3d);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 1.35rem;
}

.close-modal {
  border: 0;
  background: transparent;
  color: #5f6c84;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
}

.modal-body-stat {
  padding: 24px;
}

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

.input-group-stat {
  display: grid;
  gap: 8px;
}

.input-group-stat span {
  color: #5b6e8c;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.span-modal {
  grid-column: span 2;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-upload {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.bulk-upload strong,
.bulk-upload span {
  display: block;
}

.bulk-upload span,
.bulk-upload-result {
  color: var(--muted);
  font-size: 0.88rem;
}

.bulk-upload input {
  width: 100%;
}

.bulk-upload-result {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef6f5;
  border: 1px solid #cfe6e2;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill.status-warn {
  background: #fef3c7;
  color: #92400e;
}

.empty-state.compact {
  margin-top: 12px;
  padding: 12px;
  font-size: 0.86rem;
}

.form008-modal-card {
  width: min(1180px, 98vw);
  border-radius: 12px;
}

.form008-preview {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #e5e7eb;
}

.form008-page {
  width: 210mm;
  min-height: 297mm;
  height: auto;
  margin: 0 auto;
  padding: 5mm;
  box-sizing: border-box;
  overflow: visible;
  background: white;
  color: #111827;
  border: 1px solid #cbd5e1;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  break-after: page;
  page-break-after: always;
}

.form008-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.form008-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid #111827;
}

.form008-head strong,
.form008-head span {
  display: block;
}

.form008-head strong {
  font-size: 0.65rem;
  line-height: 1.05;
}

.form008-head span {
  color: #475569;
  font-size: 0.55rem;
}

.form008-code {
  border: 1px solid #111827;
  padding: 3px 6px;
  font-weight: 900;
  font-size: 0.55rem;
}

.form008-section {
  break-inside: avoid;
  margin-bottom: 3px;
  border: 1px solid #334155;
}

.form008-section h4 {
  margin: 0;
  padding: 2px 4px;
  background: #e2e8f0;
  color: #111827;
  font-size: 0.48rem;
  letter-spacing: 0;
}

.form008-section > p {
  margin: 0;
  padding: 1px 4px;
  border-top: 1px solid #94a3b8;
  color: #334155;
  font-size: 0.45rem;
  font-weight: 800;
}

.form008-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.form008-cell {
  min-height: 14px;
  padding: 1px 3px;
  border-top: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
}

.form008-cell span {
  display: block;
  color: #475569;
  font-size: 0.37rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
}

.form008-cell strong {
  display: block;
  margin-top: 1px;
  color: #111827;
  font-size: 0.47rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.08;
}

.form008-dx {
  display: grid;
  gap: 0;
}

.form008-dx div {
  display: grid;
  grid-template-columns: 74px 54px 1fr;
  gap: 4px;
  padding: 2px 4px;
  border-top: 1px solid #cbd5e1;
}

.form008-dx span,
.form008-dx strong,
.form008-dx p {
  margin: 0;
  font-size: 0.48rem;
  line-height: 1.1;
}

.form008-treatment {
  font-size: 0.48rem;
}

.form008-treatment th,
.form008-treatment td {
  border-top: 1px solid #cbd5e1;
  padding: 2px 4px;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.form008-treatment-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form008-treatment-note {
  min-height: 18px;
  padding: 2px 4px;
  border-top: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
}

.form008-treatment-note.is-wide {
  grid-column: 1 / -1;
}

.form008-treatment-note span {
  display: block;
  color: #475569;
  font-size: 0.37rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
}

.form008-treatment-note strong {
  display: block;
  margin-top: 1px;
  color: #111827;
  font-size: 0.47rem;
  font-weight: 750;
  line-height: 1.12;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 40px;
  padding: 12px 24px;
  background: #b91c1c;
  color: white;
  cursor: pointer;
  font-weight: 800;
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media print {
  body.printing-form008 * {
    visibility: hidden !important;
  }
  body.printing-form008 #modalForm008,
  body.printing-form008 #modalForm008 * {
    visibility: visible !important;
  }
  body.printing-form008 #modalForm008 {
    position: static !important;
    display: block !important;
    padding: 0;
    background: white;
    inset: auto;
  }
  body.printing-form008 .modal-header-stat,
  body.printing-form008 .modal-actions {
    display: none !important;
  }
  body.printing-form008 .form008-modal-card {
    width: auto !important;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
    animation: none;
  }
  body.printing-form008 .form008-preview {
    display: block;
    padding: 0;
    background: white;
  }
  body.printing-form008 .form008-page {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    margin: 0;
    padding: 5mm;
    box-sizing: border-box;
    box-shadow: none;
    border: 0;
    overflow: visible;
    break-after: page;
    page-break-after: always;
  }
  body.printing-form008 .form008-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  @page {
    size: A4;
    margin: 0;
  }
}

.toast-notify {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 80px;
  background: #1e293b;
  color: white;
  box-shadow: 0 15px 30px -12px black;
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  visibility: hidden;
  transition: 0.25s;
  z-index: 20;
}

.toast-notify.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast-notify.error {
  background: #7f1a1a;
  border-left: 4px solid #f87171;
}

.toast-notify:not(.error) {
  background: #0f3b2c;
  border-left: 4px solid #2dd4bf;
}

@media (max-width: 980px) {
  .shell,
  .shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .sidebar.collapsed {
    width: auto;
    padding: 12px;
  }
  .nav { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .nav-item { justify-content: center; text-align: center; padding: 10px 6px; }
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .logout span,
  .sidebar.collapsed .side-brand > div {
    opacity: 1;
    position: static;
    transform: none;
  }
  .logout { margin-top: 0; }
  .kpi-grid, .two-col, .work-grid, .triage-work-grid, .triage-decision-grid, .analysis-grid { grid-template-columns: 1fr; }
  .analysis-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body { overflow: auto; }
  .content, .sidebar {
    height: auto;
    overflow: visible;
  }
  .form-panel,
  .queue-panel {
    max-height: none;
  }
  .direction-toolbar,
  .stats-filters { grid-template-columns: 1fr; }
  .procedure-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .content { padding: 16px; }
  .analysis-kpi-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .field { grid-column: span 12; }
  .nav { grid-template-columns: 1fr; }
  .direction-hero { align-items: stretch; flex-direction: column; }
  .grid-2cols { grid-template-columns: 1fr; }
  .procedure-checks { grid-template-columns: 1fr; }
  .span-modal { grid-column: span 1; }
  .logo-watermark { display: none; }
  .glass-panel {
    padding: 24px 20px 32px;
    border-radius: 28px;
  }
  .system-name { font-size: 18px; }
  .modern-input { padding: 11px 16px; }
  .btn-login { padding: 12px; }
}

/* Corporate blue refinement */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172133;
  --muted: #5d6b82;
  --line: #d8e1ec;
  --primary: #0b5f9c;
  --primary-dark: #073b68;
  --primary-soft: #e7f1fa;
  --accent: #2d8fce;
  --danger: #a23b3b;
  --warning: #a66a14;
  --info: #2563ad;
  --success: #147a58;
  --shadow: 0 16px 36px rgba(25, 42, 75, 0.12);
}

body {
  font-size: 14px;
  background: linear-gradient(135deg, #f5f8fc 0%, #eaf1f8 100%);
}

.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 36px);
  background:
    linear-gradient(115deg, rgba(5, 30, 55, 0.76), rgba(11, 95, 156, 0.58)),
    url("https://static.vecteezy.com/system/resources/previews/006/712/977/non_2x/abstract-health-medical-science-healthcare-icon-digital-technology-doctor-concept-modern-innovation-treatment-medicine-on-hi-tech-future-blue-background-for-wallpaper-template-web-design-vector.jpg") no-repeat center center / cover;
  background-attachment: fixed;
}

.logo-watermark {
  opacity: 0.08;
  filter: grayscale(1) brightness(1.8);
}

.glass-panel {
  max-width: 420px;
  padding: 28px 28px 26px;
  border-radius: 18px;
  border: 1px solid rgba(213, 226, 240, 0.92);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 55px rgba(4, 24, 48, 0.28);
}

.institutional-header {
  margin-bottom: 22px;
}

.logo-area {
  margin-bottom: 14px;
}

.logo-icon {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 8px 16px rgba(8, 59, 104, 0.18));
}

.ministry-name {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  letter-spacing: 0;
}

.institutional-title {
  color: #0c2d4f;
  font-size: 15px;
  font-weight: 800;
}

.institutional-sub {
  background: #f2f6fb;
  color: #48627d;
  font-size: 10px;
}

.system-name {
  margin-top: 16px;
  color: var(--primary-dark);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.16;
}

.form-group {
  margin-bottom: 16px;
}

.input-label {
  color: #23415f;
  font-size: 12px;
}

.input-label i {
  color: var(--primary);
}

.modern-input,
input,
select,
textarea {
  border-color: #d7e2ef;
  border-radius: 8px;
  font-size: 13px;
}

.modern-input {
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
}

.modern-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 95, 156, 0.16);
}

.btn-login {
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 25px -14px rgba(7, 59, 104, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.btn-login:hover {
  background: linear-gradient(135deg, #0a5288, #052d50);
  box-shadow: 0 18px 28px -15px rgba(7, 59, 104, 0.8);
}

.message-area {
  color: #244564;
  background: #edf5fc;
  border-radius: 10px;
  font-size: 12px;
}

.login-footer-note {
  color: #607187;
  font-size: 11px;
}

.shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.shell.sidebar-collapsed {
  grid-template-columns: 70px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 12px;
  background: linear-gradient(180deg, #073b68 0%, #092f55 58%, #061d35 100%);
  box-shadow: 12px 0 30px rgba(15, 35, 64, 0.12);
}

.sidebar.collapsed {
  width: 70px;
  padding: 16px 9px;
}

.side-brand {
  gap: 10px;
  min-height: 42px;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--primary-dark);
  font-size: 0.72rem;
}

.side-brand strong {
  font-size: 0.92rem;
  letter-spacing: 0;
}

.side-brand small {
  font-size: 0.72rem;
}

.sidebar-toggle,
.chip-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav {
  gap: 6px;
  margin-top: 22px;
}

.nav-item {
  min-height: 38px;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 700;
}

.nav-item i {
  width: 18px;
  font-size: 0.92rem;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #7cc7ff;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .logout {
  width: 48px;
  padding: 10px;
}

.logout {
  border-radius: 9px;
  font-size: 0.85rem;
}

.content {
  padding: 18px 20px 24px;
}

.topbar {
  margin-bottom: 16px;
}

.eyebrow {
  color: #54708c;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: 1.28rem;
  font-weight: 850;
  color: #11263d;
}

.user-chip {
  padding: 7px 9px;
  border-radius: 12px;
  font-size: 0.86rem;
}

.user-chip span {
  width: 32px;
  height: 32px;
  font-size: 0.74rem;
}

.user-chip small {
  font-size: 0.72rem;
}

.panel {
  padding: 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-head {
  gap: 10px;
  margin-bottom: 12px;
}

.panel h3 {
  font-size: 0.98rem;
}

.kpi-grid,
.analysis-kpi-grid {
  gap: 12px;
}

.kpi-card {
  padding: 14px;
  border-top-width: 3px;
}

.kpi-card span,
.analysis-kpi-card span,
.analysis-kpi-card small {
  font-size: 0.72rem;
}

.kpi-card strong {
  font-size: 1.55rem;
  margin-top: 5px;
}

.analysis-kpi-card {
  min-height: 96px;
  padding: 12px;
}

.analysis-kpi-card strong {
  font-size: 1.45rem;
}

.primary-btn,
.ghost-btn,
.btn-save {
  border-radius: 8px;
  font-size: 0.84rem;
}

.primary-btn,
.btn-save {
  background: var(--primary);
  box-shadow: 0 12px 20px rgba(11, 95, 156, 0.2);
}

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

.ghost-btn {
  padding: 8px 11px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.danger-action {
  color: #8b2f2f;
  background: #f8eeee;
}

.data-table {
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 8px 9px;
}

.form-panel,
.queue-panel {
  max-height: calc(100vh - 104px);
}

.field {
  gap: 6px;
}

.field label,
label {
  font-size: 0.82rem;
}

.modal-header-stat {
  padding: 16px 18px;
}

.modal-header-stat h2 {
  color: var(--primary-dark);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 1.2rem;
}

.modal-body-stat {
  padding: 18px;
}

.toast-notify:not(.error) {
  background: var(--primary-dark);
  border-left-color: #7cc7ff;
}

@media (max-width: 980px) {
  .shell,
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .sidebar.collapsed {
    width: auto;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .side-brand {
    min-height: 36px;
  }

  .nav {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item,
  .sidebar.collapsed .nav-item {
    width: auto;
    min-width: max-content;
    padding: 8px 10px;
  }

  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .logout span,
  .sidebar.collapsed .side-brand > div {
    opacity: 1;
    position: static;
    transform: none;
  }

  .logout {
    margin-top: 10px;
  }

  .content {
    padding: 14px;
  }
}

/* Final login override requested: static geometry, MSP logo inside card */
.login-view {
  isolation: isolate;
}

.login-view::before,
.login-view::after {
  z-index: 0;
  pointer-events: none;
  animation: none !important;
}

.login-view::before {
  inset: 0;
  opacity: 0.42;
  background:
    linear-gradient(135deg, transparent 0 57%, rgba(255,255,255,0.10) 57% 61%, transparent 61%),
    linear-gradient(45deg, transparent 0 32%, rgba(45,143,206,0.13) 32% 35%, transparent 35%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 62px);
}

.login-view::after {
  inset: auto 8% 10% auto;
  width: min(28vw, 260px);
  height: min(28vw, 260px);
  opacity: 0.32;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  transform: rotate(28deg);
}

.glass-panel {
  position: relative;
  z-index: 2;
}

.logo-watermark {
  display: none !important;
}

.logo-area {
  display: flex !important;
  justify-content: center;
  margin-bottom: 12px;
}

.logo-icon {
  display: block !important;
  width: 58px;
  height: 58px;
  background: url("https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg/1280px-Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg.png") no-repeat center / contain;
  filter: drop-shadow(0 8px 16px rgba(8, 59, 104, 0.18));
}

.ministry-name {
  display: inline-block !important;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  letter-spacing: 0;
}

#modalPasswordChange {
  background: rgba(5, 24, 43, 0.34);
  backdrop-filter: blur(2px);
}

/* Refinamiento visual operativo */
.shell,
.app-view,
.content,
.sidebar {
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar.collapsed .nav {
  overflow-x: hidden;
}

.direction-hero,
.direction-hero.compact {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(7, 59, 104, 0.98), rgba(8, 87, 128, 0.94)),
    radial-gradient(circle at 92% 18%, rgba(45, 212, 191, 0.28), transparent 34%);
}

.direction-hero .eyebrow,
.direction-hero h3,
.direction-hero p,
.direction-hero span {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(3, 18, 32, 0.22);
}

.direction-hero .btn-red,
.direction-hero .primary-btn {
  box-shadow: 0 14px 28px rgba(4, 24, 48, 0.25);
}

.panel > .panel-head {
  padding: 8px 10px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 87, 128, 0.10), rgba(45, 143, 206, 0.06)),
    #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.panel > .panel-head .eyebrow {
  color: #075985;
}

.form-section:nth-child(5n + 1) header { background: linear-gradient(135deg, #fff1f2, #ffffff); }
.form-section:nth-child(5n + 2) header { background: linear-gradient(135deg, #ecfdf3, #ffffff); }
.form-section:nth-child(5n + 3) header { background: linear-gradient(135deg, #eff6ff, #ffffff); }
.form-section:nth-child(5n + 4) header { background: linear-gradient(135deg, #fff7ed, #ffffff); }
.form-section:nth-child(5n) header { background: linear-gradient(135deg, #f5f3ff, #ffffff); }

.kpi-card,
.analysis-kpi-card {
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.kpi-card.info,
.analysis-kpi-card.info { background: linear-gradient(135deg, #eff6ff, #ffffff); }
.kpi-card.success,
.analysis-kpi-card.success { background: linear-gradient(135deg, #ecfdf3, #ffffff); }
.kpi-card.warning,
.analysis-kpi-card.warning { background: linear-gradient(135deg, #fffbeb, #ffffff); }
.kpi-card.danger,
.analysis-kpi-card.danger { background: linear-gradient(135deg, #fff1f2, #ffffff); }
.analysis-kpi-card.neutral { background: linear-gradient(135deg, #f8fafc, #ffffff); }

.nav-item[data-view="enfermeria-cola"] { --nav-accent: #06b6d4; }
.nav-item[data-view="enfermeria-procedimientos"] { --nav-accent: #22c55e; }
.nav-item[data-view="enfermeria-mis-procedimientos"] { --nav-accent: #f59e0b; }
.nav-item[data-view="enfermeria-analisis"] { --nav-accent: #a855f7; }
.nav-item[data-view="enfermeria-planes"] { --nav-accent: #ef4444; }

.nav-item i {
  color: var(--nav-accent, #7cc7ff);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--nav-accent, #7cc7ff) 45%, transparent));
}

.nav-item.active i,
.nav-item:hover i {
  color: #ffffff;
}

#enfermeria-cola .panel,
#enfermeria-procedimientos .panel,
#enfermeria-mis-procedimientos .panel,
#enfermeria-analisis .panel,
#enfermeria-planes .panel {
  border-top: 4px solid color-mix(in srgb, var(--primary) 70%, #38bdf8);
}

/* Final stable floating diagnosis dropdowns */
.diagnosis-search-box {
  position: relative;
  min-width: 0;
}

.diagnosis-search-box .diagnosis-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.diagnosis-search-box .diagnosis-results:not(:empty) {
  display: grid;
}

.diagnosis-search-box .diagnosis-result {
  padding: 7px 9px;
}

/* Final stable floating diagnosis dropdowns */
.diagnosis-search-box {
  position: relative;
  min-width: 0;
}

.diagnosis-search-box .diagnosis-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.diagnosis-search-box .diagnosis-results:not(:empty) {
  display: grid;
}

.diagnosis-search-box .diagnosis-result {
  padding: 7px 9px;
}

/* Stable floating diagnosis dropdowns */
.diagnosis-search-box {
  position: relative;
  min-width: 0;
}

.diagnosis-search-box .diagnosis-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.diagnosis-search-box .diagnosis-results:not(:empty) {
  display: grid;
}

.diagnosis-search-box .diagnosis-result {
  padding: 7px 9px;
}

/* Login correction: keep MSP logo in the card, remove only the large side watermark */
.login-view {
  isolation: isolate;
}

.login-view::before,
.login-view::after {
  z-index: 0;
  opacity: 0.42;
  animation: none !important;
}

.login-view::before {
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 57%, rgba(255,255,255,0.10) 57% 61%, transparent 61%),
    linear-gradient(45deg, transparent 0 32%, rgba(45,143,206,0.13) 32% 35%, transparent 35%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 62px);
}

.login-view::after {
  inset: auto 8% 10% auto;
  width: min(28vw, 260px);
  height: min(28vw, 260px);
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  transform: rotate(28deg);
}

.glass-panel {
  z-index: 2;
}

.logo-watermark {
  display: none !important;
}

.logo-area {
  display: flex !important;
  justify-content: center;
  margin-bottom: 12px;
}

.logo-icon {
  display: block !important;
  width: 58px;
  height: 58px;
  background: url("https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg/1280px-Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg.png") no-repeat center / contain;
  filter: drop-shadow(0 8px 16px rgba(8, 59, 104, 0.18));
}

.ministry-name {
  display: inline-block !important;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  letter-spacing: 0;
}

#modalPasswordChange {
  align-items: center;
  background: rgba(5, 24, 43, 0.34);
  backdrop-filter: blur(2px);
}

#modalPasswordChange .modal-header-stat {
  border-bottom-color: #d8e1ec;
}

#modalPasswordChange .close-modal {
  font-size: 26px;
}

/* Visual refinement: denser app shell and formal login */
.login-view {
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(5, 28, 50, 0.84), rgba(8, 74, 122, 0.62)),
    url("https://static.vecteezy.com/system/resources/previews/006/712/977/non_2x/abstract-health-medical-science-healthcare-icon-digital-technology-doctor-concept-modern-innovation-treatment-medicine-on-hi-tech-future-blue-background-for-wallpaper-template-web-design-vector.jpg") no-repeat center / cover;
}

.login-view::before,
.login-view::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.login-view::before {
  background:
    repeating-linear-gradient(132deg, rgba(255,255,255,0.14) 0 1px, transparent 1px 46px),
    linear-gradient(132deg, transparent 0 44%, rgba(125, 211, 252, 0.14) 44% 48%, transparent 48%);
  animation: loginLines 18s linear infinite;
}

.login-view::after {
  width: 260px;
  height: 260px;
  inset: auto 9% 12% auto;
  border: 1px solid rgba(255,255,255,0.22);
  transform: rotate(28deg);
  animation: loginFloat 7s ease-in-out infinite alternate;
}

.logo-watermark,
.logo-area,
.logo-icon,
.ministry-name {
  display: none !important;
}

.glass-panel {
  max-width: 390px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 26px 60px rgba(4, 24, 48, 0.34);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #0b5f9c, #2d8fce, #12a37f);
}

.institutional-title {
  font-size: 14px;
}

.system-name {
  font-size: 18px;
  color: #073b68;
}

.sidebar {
  position: relative;
  background:
    linear-gradient(180deg, rgba(7, 59, 104, 0.97), rgba(6, 29, 53, 0.98)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 24px);
}

.nav-item {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--nav-accent, #7cc7ff) 18%, transparent), rgba(255,255,255,0.055));
}

.nav-item::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -80%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.4s ease;
}

.nav-item:hover::after {
  left: 118%;
}

.nav-item[data-view="triage"],
.nav-item[data-view="clinica-cola"],
.nav-item[data-view="clinica-atencion"] { --nav-accent: #38bdf8; }
.nav-item[data-view="clinica-documentos"],
.nav-item[data-view="clinica-mis-atenciones"] { --nav-accent: #2dd4bf; }
.nav-item[data-view="clinica-analisis"],
.nav-item[data-view="estadistico-analisis"],
.nav-item[data-view="estadistico-produccion"] { --nav-accent: #facc15; }
.nav-item[data-view="usuarios"],
.nav-item[data-view="variables-admin"] { --nav-accent: #f97316; }
.nav-item[data-view^="enfermeria"] { --nav-accent: #22c55e; }

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--nav-accent, #7cc7ff) 34%, #073b68), rgba(255,255,255,0.13));
  box-shadow: inset 3px 0 0 var(--nav-accent, #7cc7ff), 0 10px 22px rgba(0,0,0,0.18);
}

.content {
  padding: 14px 16px 20px;
}

.topbar {
  margin-bottom: 12px;
}

.panel {
  padding: 11px;
}

.panel-head {
  margin-bottom: 9px;
}

.form-section header {
  padding: 8px 10px;
}

.dynamic-form {
  gap: 10px;
}

.dynamic-grid {
  gap: 8px;
  padding: 10px;
}

.field,
label {
  gap: 5px;
}

.field-label,
.input-label,
.input-group-stat span {
  font-size: 0.72rem;
}

input,
select,
textarea,
.modern-input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

textarea {
  min-height: 70px;
}

.primary-btn,
.ghost-btn,
.btn-save {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.data-table {
  font-size: 0.76rem;
}

.data-table th,
.data-table td {
  padding: 6px 7px;
}

.chart-container,
.heatmap-container {
  padding: 11px;
  margin-top: 10px;
}

.analysis-kpi-card {
  min-height: 82px;
  padding: 10px;
}

.analysis-kpi-card strong,
.kpi-card strong {
  font-size: 1.28rem;
}

.catalog-search {
  min-height: 30px;
  padding: 6px 8px;
  background: #f8fbff;
  border-style: dashed;
}

.diagnosis-results {
  max-height: 190px;
}

.diagnosis-result {
  padding: 7px 9px;
}

.password-modal-card {
  width: min(520px, 94vw);
  border-radius: 14px;
}

.force-modal {
  z-index: 12000;
}

.modal-help {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.password-rules span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf5fc;
  color: #073b68;
  font-size: 0.72rem;
  font-weight: 750;
}

@keyframes loginLines {
  from { transform: translate3d(-3%, -3%, 0); }
  to { transform: translate3d(3%, 3%, 0); }
}

@keyframes loginFloat {
  from { transform: translateY(0) rotate(28deg); opacity: 0.42; }
  to { transform: translateY(-18px) rotate(34deg); opacity: 0.68; }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .login-view {
    padding: 14px;
    background-attachment: scroll;
  }

  .glass-panel {
    max-width: min(100%, 390px);
    padding: 22px 18px;
    border-radius: 16px;
  }

  .logo-icon {
    width: 50px;
    height: 50px;
  }

  .system-name {
    font-size: 18px;
  }

  .institutional-sub {
    display: none;
  }

  .topbar {
    gap: 10px;
  }

  .topbar h2 {
    font-size: 1.12rem;
  }

  .user-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .panel {
    padding: 12px;
  }

  .clinical-actions,
  .actions {
    justify-content: stretch;
  }

  .clinical-actions .ghost-btn,
  .clinical-actions .primary-btn,
  .actions .ghost-btn,
  .actions .primary-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* Final login override requested: static geometry, MSP logo inside card */
.login-view {
  isolation: isolate;
}

.login-view::before,
.login-view::after {
  z-index: 0;
  pointer-events: none;
  animation: none !important;
}

.login-view::before {
  inset: 0;
  opacity: 0.42;
  background:
    linear-gradient(135deg, transparent 0 57%, rgba(255,255,255,0.10) 57% 61%, transparent 61%),
    linear-gradient(45deg, transparent 0 32%, rgba(45,143,206,0.13) 32% 35%, transparent 35%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 62px);
}

.login-view::after {
  inset: auto 8% 10% auto;
  width: min(28vw, 260px);
  height: min(28vw, 260px);
  opacity: 0.32;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  transform: rotate(28deg);
}

.glass-panel {
  position: relative;
  z-index: 2;
}

.logo-watermark {
  display: none !important;
}

.logo-area {
  display: flex !important;
  justify-content: center;
  margin-bottom: 12px;
}

.logo-icon {
  display: block !important;
  width: 58px;
  height: 58px;
  background: url("https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg/1280px-Ministerio_de_Salud_P%C3%BAblica_de_Ecuador_logo.svg.png") no-repeat center / contain;
  filter: drop-shadow(0 8px 16px rgba(8, 59, 104, 0.18));
}

.ministry-name {
  display: inline-block !important;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  letter-spacing: 0;
}

#modalPasswordChange {
  background: rgba(5, 24, 43, 0.34);
  backdrop-filter: blur(2px);
}
