﻿:root {
  --blue-900: #025eb8;
  --blue-800: #0b72d7;
  --blue-700: #1e86e9;
  --brand-primary: #025eb8;
  --brand-primary-2: #0b72d7;
  --brand-primary-3: #1e86e9;
  --brand-accent: #179cff;
  --brand-accent-2: #0d79db;
  --brand-strong: #1f3552;
  --brand-focus-rgb: 49, 146, 242;
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #d2dce8;
  --text: #1a2e44;
  --muted: #60728a;
  --ok: #20a867;
  --ok-2: #178a53;
  --danger: #c92646;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f0f2f5 0%, #f3f5f7 100%);
}

.container {
  max-width: 1260px;
  margin: 14px auto;
  padding: 0 12px 26px;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

.card {
  border: 1px solid #d5dfeb;
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 6px 16px rgba(29, 63, 112, 0.08);
  padding: 14px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-shell {
  width: 100%;
  max-width: 460px;
  margin: 58px auto 20px;
  text-align: center;
}

.login-logo h1 {
  color: #0b74d6;
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -1.2px;
  margin: 0;
  text-shadow: 0 8px 24px rgba(11, 116, 214, 0.18);
}

.login-logo span {
  display: block;
  margin-top: -10px;
  color: #0b74d6;
  font-size: 16px;
}

.login-title-wrap {
  margin: 44px 0 26px;
}

.login-title-wrap h2 {
  font-size: 54px;
  margin-bottom: 8px;
  color: #223a55;
}

.login-title-wrap p {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: #111f32;
  letter-spacing: 0.4px;
}

.login-form {
  gap: 14px;
}

.field-wrap input {
  height: 62px;
  font-size: 24px;
  border-radius: 12px;
  border: 1px solid #c2cfde;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(21, 74, 142, 0.08);
}

.field-wrap input::placeholder {
  color: #707c89;
}

.verify-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #c8d2dd;
  border-radius: 12px;
  background: #fff;
  height: 62px;
  padding: 0 14px;
  color: #2f425b;
  box-shadow: 0 8px 20px rgba(21, 74, 142, 0.08);
}

.verify-box strong {
  font-size: 20px;
  font-weight: 500;
}

.verify-box.ready {
  background: #f0fff7;
  border-color: #bde8d0;
  color: #1f6b43;
}

.ready-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #25b26e;
  box-shadow: 0 0 0 6px rgba(37, 178, 110, 0.2);
}

.login-btn {
  height: 62px;
  font-size: 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, #57c1ff 0%, #2f9bfb 55%, #1f7de3 100%);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(47, 155, 251, 0.34);
}

.login-btn:hover {
  background: linear-gradient(135deg, #6dcaff 0%, #43a8ff 55%, #2e89e9 100%);
}

.forgot-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 16px;
  color: #5f6f84;
  text-decoration: none;
}

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

.password-reset-form {
  margin-top: 18px;
}

.password-reset-form .field-wrap {
  margin-bottom: 12px;
}

.reset-btn {
  font-size: 22px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #5f6f84;
  font-size: 15px;
  text-decoration: underline;
  box-shadow: none;
  padding: 10px 0 0;
}

.status-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: #1f6b43;
  font-size: 14px;
  line-height: 1.35;
}

.login-footer-banner {
  background: #0557a4;
  color: #fff;
  padding: 26px 26px;
}

.login-footer-banner p {
  margin: 0;
  font-size: 50px;
  max-width: 640px;
  font-weight: 600;
}

label {
  font-size: 13px;
  color: #4b627f;
  font-weight: 600;
}

form {
  display: grid;
  gap: 8px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfdff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(var(--brand-focus-rgb), 0.17);
}

button {
  border: none;
  border-radius: 12px;
  padding: 9px 12px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-accent-2) 100%);
  box-shadow: 0 10px 20px rgba(var(--brand-focus-rgb), 0.28);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(var(--brand-focus-rgb), 0.32);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: linear-gradient(135deg, #536d8f 0%, #334863 100%);
  box-shadow: 0 10px 20px rgba(45, 62, 85, 0.24);
}

button.danger {
  background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
  box-shadow: 0 10px 20px rgba(198, 40, 40, 0.28);
}

button.legal-contract-btn {
  background: linear-gradient(135deg, #f39c12 0%, #d97706 100%);
  box-shadow: 0 10px 20px rgba(217, 119, 6, 0.28);
}

button.legal-contract-btn:hover {
  box-shadow: 0 14px 24px rgba(217, 119, 6, 0.34);
}

button.finalize-btn {
  background: linear-gradient(135deg, #31cf86 0%, #159a5f 100%);
  box-shadow: 0 10px 20px rgba(21, 154, 95, 0.3);
}

#patient-form button,
#appointment-form button,
#user-form button {
  background: linear-gradient(135deg, #29d388 0%, #17ac67 100%);
  box-shadow: 0 10px 20px rgba(29, 159, 103, 0.3);
}

#user-form .user-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

#user-form .user-form-actions #user-submit-btn,
#user-form .user-form-actions #user-cancel-edit {
  flex: 1;
}

#user-form .user-form-actions #user-cancel-edit {
  background: linear-gradient(135deg, #536d8f 0%, #334863 100%);
  box-shadow: 0 10px 20px rgba(45, 62, 85, 0.24);
}

.form-help {
  margin: -4px 0 10px;
  font-size: 12px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--brand-primary-2);
  border-radius: 12px 12px 0 0;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-primary-2) 48%, var(--brand-primary-3) 100%);
}

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

.brand-wrap h2 {
  margin: 0;
  font-weight: 800;
}

.header-center-logo {
  width: 118px;
  height: 118px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.brand-heart {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.header-opening-greeting {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff3cd;
  color: #6b4f00;
  border: 1px solid rgba(255, 220, 130, 0.85);
  font-weight: 700;
}

.greeting-banner {
  margin-top: 8px;
  border: 1px solid #f0d183;
  border-radius: 10px;
  background: #fff6d9;
  color: #6b4f00;
  font-weight: 700;
  padding: 10px 12px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.alerts-wrap {
  position: relative;
}

.alerts-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.alerts-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e63946;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.alerts-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(460px, 92vw);
  max-height: 68vh;
  overflow: auto;
  background: #fff;
  color: #183454;
  border: 1px solid #c9d9eb;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(11, 37, 66, 0.25);
  z-index: 1300;
  padding: 10px;
}

.alerts-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.alerts-list {
  display: grid;
  gap: 8px;
}

.clinical-inline-alerts {
  display: grid;
  gap: 8px;
  margin: 4px 0 10px;
}

.clinical-history-box {
  border: 1px solid #d6e2f0;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  margin: 0 0 10px;
}

.clinical-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clinical-history-content {
  margin-top: 8px;
}

.history-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
}

#history-month-label {
  font-size: 14px;
  color: #1c3d62;
}

.history-calendar {
  border: 1px solid #d1deed;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.history-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.history-weekday {
  background: #eef5ff;
  color: #355a82;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  padding: 6px 2px;
  border-bottom: 1px solid #d4e2f1;
}

.history-day {
  appearance: none;
  box-shadow: none;
  border-radius: 0;
  border: none;
  background: #ffffff;
  min-height: 42px;
  border-right: 1px solid #edf3fb;
  border-bottom: 1px solid #edf3fb;
  padding: 4px 5px;
  font-size: 12px;
  font-weight: 600;
  color: #35557a;
  cursor: pointer;
  position: relative;
  transform: none;
  transition: background 0.12s ease, color 0.12s ease, outline-color 0.12s ease;
}

.history-day:hover {
  background: #f3f9ff;
}

.history-day:disabled {
  opacity: 1;
  cursor: default;
  filter: none;
}

.history-day:nth-child(7n) {
  border-right: none;
}

.history-day.other-month {
  background: #f8fbff;
  color: #a0b1c5;
  cursor: default;
}

.history-day.has-attention {
  background: #dff0ff;
  color: #103f6c;
  font-weight: 700;
}

.history-day.selected {
  outline: 2px solid #2d88e6;
  outline-offset: -2px;
  background: #c8e7ff;
}

.history-day.selected.has-attention {
  background: #b9ddff;
}

.history-day-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #1f7ddd;
}

.history-day-detail {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.history-compare-panel {
  margin-top: 10px;
  border: 1px solid #d1dfef;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.history-compare-card .history-compare-panel {
  margin-top: 0;
}

.history-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.history-compare-title {
  font-size: 13px;
  font-weight: 800;
  color: #1d3b5f;
}

.history-compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.history-compare-col {
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.history-compare-col h4 {
  margin: 0;
  font-size: 12px;
  color: #1f3552;
}

.history-compare-meta {
  font-size: 11px;
  color: #385779;
}

.history-compare-field {
  border: 1px solid #d6e2f0;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
}

.history-compare-field strong {
  display: block;
  font-size: 11px;
  color: #1f3552;
  margin-bottom: 3px;
}

.history-compare-field p {
  margin: 0;
  font-size: 12px;
  color: #294666;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-compare-growth {
  margin-top: 8px;
  border: 1px solid #d6e2f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.history-compare-growth h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #1f3552;
}

.history-compare-growth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.history-compare-growth-card {
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 6px;
}

.history-compare-growth-card h5 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #1f3552;
}

.clinical-history-item {
  border: 1px solid #d1dfef;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 10px;
}

.clinical-history-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.clinical-history-item-title {
  font-weight: 700;
  color: #1d3b5f;
}

.history-status {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #cfe0f5;
  background: #ecf5ff;
  color: #2b5580;
}

.history-status.finalized {
  border-color: #bce5cf;
  background: #ecfff4;
  color: #1f7a4e;
}

.clinical-history-item-body {
  display: grid;
  gap: 3px;
  color: #294666;
  font-size: 13px;
}

.clinical-history-empty {
  color: #567192;
  font-size: 13px;
  padding: 6px 4px;
}

.alert-card {
  border: 1px solid #d7e3f0;
  border-left: 6px solid #9db4cc;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fcff;
}

.alert-card strong {
  display: block;
  margin-bottom: 3px;
}

.alert-card small {
  display: block;
  color: #47607e;
  margin-top: 4px;
}

.alert-critical {
  border-left-color: #d62839;
  background: #fff5f6;
}

.alert-warning {
  border-left-color: #f0a202;
  background: #fffaf0;
}

.alert-info {
  border-left-color: #2f7fd1;
  background: #f4f9ff;
}

.header-tools input {
  min-width: 320px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.17);
  color: #fff;
}

.header-tools input::placeholder {
  color: rgba(255, 255, 255, 0.86);
}

.user-chip {
  color: #e8f4ff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  padding: 6px 10px;
  white-space: normal;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  max-width: 520px;
  line-height: 1.2;
}

.user-chip-main {
  font-weight: 700;
}

.user-chip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11px;
  color: #f4fbff;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #d3ddeb;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 8px;
  margin-bottom: 12px;
}

.tab,
.ghost-tab {
  color: #2d425c;
  background: #eef3f8;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: none;
}

.tab.active {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-accent) 0%, var(--brand-accent-2) 100%);
}

.ghost-tab {
  background: #f4f6f9;
}

.reports-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

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

.reports-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.billing-items-wrap {
  margin-top: 10px;
}

.billing-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.billing-items-header label {
  font-weight: 700;
  color: #1f3f63;
}

.billing-items-table input {
  margin: 0;
}

.billing-items-table td:last-child {
  width: 110px;
}

.billing-item-remove {
  width: 100%;
}

.billing-totals-grid {
  margin-top: 10px;
}

.reports-kpi {
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
}

.reports-kpi-label {
  display: block;
  color: #4b6582;
  font-size: 12px;
}

.audit-split .card {
  min-height: 360px;
}

#audit-patients-table td,
#audit-attentions-table td {
  vertical-align: top;
}

.btn-audit-patient.active,
.btn-audit-attention.active {
  background: #2f79c8;
  color: #fff;
  border-color: #2f79c8;
}

.audit-pdf-frame {
  width: 100%;
  min-height: 760px;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  background: #fff;
}

.god-services-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #f8fbff;
}

.god-danger-box {
  border-color: #f0c1c1;
  background: #fff8f8;
}

.god-danger-controls {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.god-danger-action-wrap {
  display: flex;
  justify-content: flex-end;
}

.god-services-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.god-logo-preview-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.god-logo-preview {
  width: 160px;
  height: 70px;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
}

.god-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.god-file-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.god-file-name {
  font-size: 12px;
  color: #3d5c7f;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-reminder-banner {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f3c46a;
  background: #fff7e6;
  color: #7a4d00;
  font-weight: 600;
}

.header-plan-reminder {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #f8ce74;
  background: #fff2cf;
  color: #7a4d00;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.panel {
  display: none;
  gap: 12px;
}

.panel.active {
  display: grid;
}

.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agenda-mode {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #ccd9ea;
  color: #36516f;
  background: #f1f6fd;
  font-size: 13px;
  font-weight: 600;
}

.agenda-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

#agenda-week-label {
  color: #36516f;
  min-width: 260px;
  text-align: center;
}

.weekly-board {
  overflow: auto;
  border: 1px solid #d4deea;
  border-radius: 8px;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

.week-table th,
.week-table td {
  border: 1px solid #d7e0ea;
}

.week-table th {
  background: #f1f6fd;
  padding: 8px;
  font-size: 13px;
  color: #2f4b6d;
}

.week-time {
  width: 72px;
  text-align: center;
  font-size: 12px;
  color: #5a708d;
  background: #fbfdff;
  padding: 6px;
}

.week-cell {
  height: 48px;
  vertical-align: top;
  padding: 4px;
  background: #fff;
}

.appointment-chip {
  border-radius: 6px;
  background: #e8f8ef;
  border-left: 4px solid var(--ok);
  padding: 4px 6px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #2c4d3f;
  display: grid;
  gap: 2px;
}

.appointment-chip .name {
  font-weight: 700;
}

.appointment-chip .meta {
  color: #5d786a;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid #d9e2ed;
  padding: 8px;
  font-size: 14px;
}

#users-table td:last-child {
  width: 90px;
}

#users-tab-panel .split {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 2.1fr);
  align-items: start;
}

.users-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #d9e2ed;
  border-radius: 10px;
  background: #ffffff;
}

#users-tab-panel .users-table-wrap table {
  min-width: 1180px;
}

#users-tab-panel .users-table-wrap th,
#users-tab-panel .users-table-wrap td {
  vertical-align: top;
  line-height: 1.35;
}

#users-tab-panel .users-table-wrap th:nth-child(1),
#users-tab-panel .users-table-wrap td:nth-child(1),
#users-tab-panel .users-table-wrap th:nth-child(2),
#users-tab-panel .users-table-wrap td:nth-child(2),
#users-tab-panel .users-table-wrap th:nth-child(4),
#users-tab-panel .users-table-wrap td:nth-child(4),
#users-tab-panel .users-table-wrap th:nth-child(5),
#users-tab-panel .users-table-wrap td:nth-child(5),
#users-tab-panel .users-table-wrap th:nth-child(6),
#users-tab-panel .users-table-wrap td:nth-child(6),
#users-tab-panel .users-table-wrap th:nth-child(8),
#users-tab-panel .users-table-wrap td:nth-child(8),
#users-tab-panel .users-table-wrap th:nth-child(9),
#users-tab-panel .users-table-wrap td:nth-child(9),
#users-tab-panel .users-table-wrap th:nth-child(12),
#users-tab-panel .users-table-wrap td:nth-child(12) {
  white-space: nowrap;
}

#users-tab-panel .users-table-wrap td:nth-child(10),
#users-tab-panel .users-table-wrap td:nth-child(11),
#users-tab-panel .users-table-wrap td:nth-child(3),
#users-tab-panel .users-table-wrap td:nth-child(7) {
  word-break: break-word;
}

#users-tab-panel .users-table-wrap td:nth-child(12) {
  text-align: center;
}

/* Mantiene visible la columna Accion/Editar al lado derecho */
#users-tab-panel .users-table-wrap th:last-child,
#users-tab-panel .users-table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: -8px 0 12px -10px rgba(32, 52, 78, 0.45);
}

#users-tab-panel .users-table-wrap th:last-child {
  z-index: 3;
  background: #f3f7fb;
}

@media (max-width: 1320px) {
  #users-tab-panel .split {
    grid-template-columns: 1fr;
  }

  .god-danger-controls {
    grid-template-columns: 1fr;
  }

  .god-danger-action-wrap {
    justify-content: flex-start;
  }
}

.btn-edit-user {
  padding: 6px 10px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 700;
  background: linear-gradient(135deg, #5f78a0 0%, #3d5478 100%) !important;
  box-shadow: 0 8px 18px rgba(42, 59, 83, 0.25) !important;
}

th {
  background: #f3f7fb;
  color: #3d5879;
}

.hint {
  margin-top: 12px;
  color: #3f5d82;
  font-size: 13px;
}

.error {
  color: var(--danger);
  font-weight: 600;
  min-height: 18px;
}

.message {
  color: var(--ok-2);
  font-weight: 600;
  min-height: 18px;
}

pre {
  margin: 0;
  border: 1px solid #d6e1ed;
  border-radius: 8px;
  background: #f7fbff;
  padding: 10px;
  white-space: pre-wrap;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.appointment-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 31, 50, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 18px;
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #d2deec;
  padding: 14px;
  box-shadow: 0 24px 40px rgba(16, 42, 74, 0.32);
}

.history-compare-card {
  width: min(1240px, 96vw);
  max-height: 90vh;
}

.app-notice-card {
  width: min(520px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.clinical-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#clinical-professional-header {
  margin: 0;
  font-weight: 700;
  color: #2d4668;
}

#clinical-date-info {
  margin: 0 0 2px 0;
}

.clinical-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0 0 8px;
}

.clinical-meta-item {
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  background: #f9fcff;
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}

.clinical-meta-item-wide {
  grid-column: 1 / -1;
}

.clinical-meta-label {
  font-size: 11px;
  font-weight: 700;
  color: #4a6484;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.clinical-meta-value {
  font-size: 15px;
  color: #1f3552;
  line-height: 1.2;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f7fbff;
  font-weight: 500;
}

.check-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.consent-check-row {
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f7fbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.consent-check-row label {
  border: 0;
  padding: 0;
  background: transparent;
  margin: 0;
  font-weight: 500;
}

.consent-editor-card {
  width: min(980px, 100%);
}

.consent-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  background: #f7fbff;
  padding: 8px;
  margin-bottom: 8px;
}

.consent-toolbar-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  user-select: none;
}

.consent-editor {
  border: 1px solid #cbd8e9;
  border-radius: 10px;
  background: #ffffff;
  min-height: 320px;
  max-height: 56vh;
  overflow: auto;
  padding: 12px;
  line-height: 1.45;
  color: #1d324c;
}

.consent-editor:focus {
  outline: none;
  border-color: #3192f2;
  box-shadow: 0 0 0 3px rgba(49, 146, 242, 0.17);
}

.consent-editor p {
  margin: 0 0 10px;
}

.consent-form {
  display: grid;
  gap: 6px;
  font-size: 14px;
  line-height: 1.35;
}

.consent-a-table {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.2fr 1fr;
  border: 1px solid #a9bfda;
  border-radius: 6px;
  overflow: hidden;
}

.consent-a-table-patient {
  grid-template-columns: 1.05fr 1.05fr 1fr 1fr 0.6fr 0.6fr 1.1fr;
}

.consent-a-cell {
  border-right: 1px solid #c7d7ea;
  border-bottom: 1px solid #c7d7ea;
  padding: 5px 6px;
  background: #fff;
  font-size: 12px;
}

.consent-a-cell.head {
  font-weight: 800;
  text-transform: uppercase;
  color: #1f3552;
  background: #dff3df;
  font-size: 11px;
}

.consent-a-table:not(.consent-a-table-patient) .consent-a-cell:nth-child(4n),
.consent-a-table-patient .consent-a-cell:nth-child(7n) {
  border-right: 0;
}

.consent-section-title {
  font-weight: 800;
  color: #1f3552;
  background: #e9f4ea;
  border: 1px solid #b8d8ba;
  padding: 6px 8px;
  border-radius: 6px;
  margin-top: 2px;
}

.consent-row {
  border: 1px solid #d8e3ef;
  border-radius: 6px;
  padding: 6px 8px;
  background: #ffffff;
}

.consent-image-box {
  min-height: 180px;
  border: 1px dashed #bdd0e5;
  border-radius: 8px;
  padding: 6px;
  background: #fcfeff;
}

.consent-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.consent-sign-grid-3,
.consent-sign-grid-2 {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.consent-sign-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

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

.consent-sign-grid-3 div,
.consent-sign-grid-2 div {
  text-align: center;
}

.consent-sign-grid-3 small,
.consent-sign-grid-2 small {
  color: #4b627f;
  font-size: 12px;
}

.consent-sign-field {
  border: 1px solid #d6e2f0;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

.consent-sign-space {
  min-height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-weight: 700;
  color: #1f3552;
  text-align: center;
  word-break: break-word;
}

.consent-sign-line {
  border-top: 1px solid #2f4766;
  margin-top: 6px;
  padding-top: 4px;
}

.consent-sign-empty {
  border: 0;
  background: transparent;
}

.consent-editor ul,
.consent-editor ol {
  margin: 0 0 10px 20px;
  padding: 0;
}

.consent-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto;
  border-radius: 6px;
}

.consent-editor img.consent-img-selected {
  outline: 2px solid #2f8de9;
  box-shadow: 0 0 0 3px rgba(47, 141, 233, 0.2);
}

.consent-editor img.consent-img-left {
  margin-left: 0;
  margin-right: auto;
}

.consent-editor img.consent-img-center {
  margin-left: auto;
  margin-right: auto;
}

.consent-editor img.consent-img-right {
  margin-left: auto;
  margin-right: 0;
}

.consent-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

#c-iess-extra-wrap {
  margin-top: 8px;
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 10px;
  background: #f9fcff;
}

#c-iess-extra-wrap h4 {
  margin: 0 0 8px;
  color: #1f3552;
}

.iess-extra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.iess-extra-grid .grid-span-2 {
  grid-column: 1 / -1;
}

.odonto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.psico-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.odonto-grid .grid-span-2 {
  grid-column: 1 / -1;
}

.psico-grid .grid-span-2 {
  grid-column: 1 / -1;
}

#c-dx-tools-wrap {
  display: grid;
  gap: 8px;
}

.psico-dx-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.psico-dx-switch .mini-btn {
  border-radius: 999px;
  padding: 5px 12px;
}

.psico-dx-switch .mini-btn.active {
  background: #dfeeff;
  border-color: #a9c8ef;
  color: #184878;
  font-weight: 700;
}

.dsm5-wrap {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 8px;
  background: #f9fcff;
}

.dsm5-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.dsm5-count {
  font-size: 12px;
  font-weight: 700;
  color: #2d4668;
  background: #e8f2ff;
  border: 1px solid #c5dbf7;
  border-radius: 999px;
  padding: 2px 8px;
}

.dsm5-list {
  margin-top: 6px;
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  font-size: 13px;
}

.dsm5-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: start;
  gap: 8px;
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fbfdff;
  font-weight: 500;
}

.dsm5-item input[type="checkbox"] {
  margin: 2px 0 0;
  width: 14px;
  height: 14px;
  justify-self: start;
}

.dsm5-item-text {
  display: block;
  color: #2b4565;
  line-height: 1.25;
  text-align: left;
  word-break: break-word;
}

.dsm5-item-index {
  font-weight: 700;
  color: #1f5a9a;
  margin-right: 4px;
}

.dsm5-result {
  margin-top: 6px;
  font-size: 12px;
  color: #2d4668;
  font-weight: 700;
}

.psico-tests-root {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #f9fcff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.psico-tests-guide {
  border: 1px solid #d7e1ed;
  border-radius: 9px;
  background: #fff;
  padding: 6px 8px;
}

.psico-tests-guide summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
  color: #1f5a9a;
}

.psico-tests-guide summary::-webkit-details-marker {
  display: none;
}

.psico-tests-guide summary::before {
  content: "▸";
  margin-right: 6px;
  color: #2e5d8f;
}

.psico-tests-guide[open] summary::before {
  content: "▾";
}

.psico-tests-guide-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fdfefe;
}

.psico-tests-guide-table th,
.psico-tests-guide-table td {
  font-size: 12px;
  padding: 7px 8px;
  line-height: 1.25;
  vertical-align: top;
}

.psico-tests-guide-table th {
  font-weight: 800;
  color: #1c4f84;
  background: #f3f8ff;
}

.psico-tests-selectors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.psico-test-filter-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
}

.psico-test-filter-row label {
  font-size: 12px;
  color: #1f5a9a;
  font-weight: 700;
}

.psico-test-filter-row select {
  height: 34px;
  font-size: 12px;
}

.psico-test-category {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #fff;
  padding: 7px 8px;
}

.psico-test-category strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #1f5a9a;
}

.psico-test-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.psico-test-category-options small {
  color: #5f7694;
  font-size: 11px;
  font-weight: 600;
}

.psico-test-category-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d2deee;
  border-radius: 999px;
  background: #fff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #23486f;
}

.psico-test-category-options input[type="radio"] {
  width: 13px;
  height: 13px;
}

.psico-test-card {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.psico-test-title {
  margin: 0;
  font-size: 13px;
  color: #184878;
  font-weight: 800;
}

.psico-test-help {
  margin: 0;
  font-size: 12px;
  color: #3a5777;
}

.psico-test-interpret {
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  background: #f6faff;
  padding: 6px 8px;
  display: grid;
  gap: 3px;
}

.psico-test-interpret strong {
  font-size: 12px;
  color: #1d4f84;
}

.psico-test-interpret p {
  margin: 0;
  font-size: 11px;
  color: #2a486a;
  line-height: 1.3;
}

.psico-test-items {
  display: grid;
  gap: 6px;
}

.psico-test-item {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 380px);
  gap: 8px;
  align-items: center;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fbfdff;
  padding: 6px 8px;
}

.psico-test-item p {
  margin: 0;
  font-size: 12px;
  color: #2d4768;
}

.psico-test-item.psico-test-item-compact {
  grid-template-columns: 1fr minmax(150px, 170px);
}

.psico-test-item.psico-test-item-compact p {
  font-size: 12px;
  line-height: 1.25;
}

.psico-test-item select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 6px 40px 6px 10px;
  line-height: 1.35;
  font-size: 12px;
}

.psico-test-item.psico-test-item-compact select {
  height: 34px;
  padding: 5px 32px 5px 8px;
  font-size: 11px;
}

.psico-test-item input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 10px;
  line-height: 1.2;
  font-size: 12px;
}

.psico-test-result {
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  background: #f7fbff;
  color: #214b76;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}

.psico-test-alert {
  border: 1px solid #efb7b7;
  border-radius: 8px;
  background: #fff0f0;
  color: #9b2525;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
}

.psico-tests-applied-summary {
  border: 1px solid #cfe0f4;
  border-radius: 9px;
  background: #f4f9ff;
  padding: 7px 9px;
  display: grid;
  gap: 4px;
}

.psico-tests-applied-summary strong {
  color: #1d4f84;
  font-size: 12px;
}

.psico-tests-applied-summary p {
  margin: 0;
  font-size: 12px;
  color: #2a486a;
  line-height: 1.3;
}

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

.psico-risk-group {
  border: 1px solid #e4edf8;
  border-radius: 8px;
  background: #fbfdff;
  padding: 6px 8px;
}

.psico-risk-group strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #1f5a9a;
}

.psico-risk-group label {
  display: block;
  font-size: 12px;
  color: #2b4565;
  margin: 3px 0;
}

@media (max-width: 900px) {
  .psico-tests-selectors {
    grid-template-columns: 1fr;
  }
  .psico-test-filter-row {
    grid-template-columns: 1fr;
  }
  .psico-test-item {
    grid-template-columns: 1fr;
  }
  .psico-risk-grid {
    grid-template-columns: 1fr;
  }
}

.psico-impression-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.psico-impression-head strong {
  color: #1f4f86;
  font-size: 14px;
}

.psico-impression-list {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #f9fcff;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.psico-impression-group {
  border: 1px solid #e1eaf5;
  border-radius: 9px;
  background: #ffffff;
  padding: 7px 8px;
}

.psico-impression-group strong {
  display: block;
  margin-bottom: 5px;
  color: #1f5a9a;
  font-size: 13px;
}

.psico-impression-group-items {
  display: grid;
  gap: 5px;
}

.psico-impression-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: start;
  gap: 8px;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  background: #fbfdff;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 500;
  color: #2b4565;
}

.psico-impression-item input[type="checkbox"] {
  margin: 1px 0 0;
  width: 14px;
  height: 14px;
}

.psico-impression-item-text {
  line-height: 1.25;
}

@media (max-width: 980px) {
  .psico-impression-list {
    grid-template-columns: 1fr;
  }
}

.odontograma-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.odontograma-mark-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.odontograma-range-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.odontograma-range-tools .range-info {
  font-size: 12px;
  color: #355779;
  font-weight: 700;
}

.odontograma-legend {
  border: 1px dashed #b7c8db;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 10px;
  background: #f8fbff;
}

.odontograma-legend-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 4px 10px;
  font-size: 12px;
  color: #2a4766;
}

.odontograma-legend-note {
  margin-top: 4px;
  font-size: 12px;
  color: #355779;
}

.odontograma-legend-rects {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 12px;
  color: #2a4766;
}

.legend-rect {
  display: inline-block;
  width: 18px;
  height: 10px;
  margin-right: 6px;
  border: 1px solid #7f95b0;
  border-radius: 2px;
  vertical-align: -1px;
}

.legend-rect-externo {
  background: #fff5b8;
  border-color: #d8bf56;
}

.legend-rect-medio {
  background: #ffe1e5;
  border-color: #d88d98;
}

.odontograma-legend-col {
  display: grid;
  gap: 4px;
}

.odontograma-legend .mark-blue {
  color: #0d48b3;
}

.odontograma-legend .mark-red {
  color: #cc1f2f;
}

.odonto-status-btn.active {
  background: #1f78d1;
  color: #fff;
  border-color: #1f78d1;
}

.odonto-mark-btn {
  min-width: 38px;
  font-weight: 800;
  background: #ffffff;
  border: 1px solid #c0cfe1;
  box-shadow: none;
}

.odonto-mark-btn.active {
  background: #f3f8ff;
  border-color: #1f78d1;
  box-shadow: 0 0 0 2px rgba(31, 120, 209, 0.18);
}

.odonto-mark-btn.mark-blue {
  color: #0d48b3 !important;
  border-color: #7fa2d8;
  background: #f4f8ff;
}

.odonto-mark-btn.mark-red {
  color: #cc1f2f !important;
  border-color: #e6a0a8;
  background: #fff5f6;
}

.odonto-mark-btn.mark-blue.active {
  background: #e8f1ff;
  border-color: #0d48b3;
}

.odonto-mark-btn.mark-red.active {
  background: #ffecee;
  border-color: #cc1f2f;
}

.odontograma-chart {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px;
  margin-bottom: 8px;
}

.odonto-summary-view {
  min-height: 148px;
  width: 100%;
  border: 1px solid var(--line, #b8c8de);
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
  color: #1f3556;
  line-height: 1.35;
  font-size: 14px;
  white-space: normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.odonto-summary-view .line {
  margin: 0 0 4px 0;
}

.odonto-summary-view .line:last-child {
  margin-bottom: 0;
}

.odonto-cpod-wrap {
  margin-top: 8px;
}

.odonto-cpod-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 120px));
  gap: 8px;
}

.odonto-cpod-grid > div {
  display: grid;
  gap: 4px;
}

.odonto-cpod-grid input[readonly] {
  text-align: center;
  font-weight: 700;
  color: #1b3d66;
  background: #f8fbff;
}

.odontograma-row {
  display: grid;
  grid-template-columns: repeat(16, minmax(34px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
  position: relative;
}

.odontograma-row.small {
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  justify-content: center;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.odonto-range-bridge {
  position: absolute;
  transform: translateY(-50%);
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.odonto-range-bridge .brace {
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

.odonto-range-bridge .line {
  flex: 1;
  border-top: 2px dashed currentColor;
  margin: 0 2px;
}

.odonto-range-bridge.arc-blue {
  color: #0d48b3;
}

.odonto-range-bridge.arc-red {
  color: #df2222;
}

.odontograma-tooth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.odonto-rect-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 0;
}

.odontograma-tooth.with-rects {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 2px;
}

.odontograma-tooth.with-rects .odonto-rect-pair.arc-up {
  order: 2;
  margin-bottom: 2px;
}

.odontograma-tooth.with-rects .odontograma-box {
  order: 3;
}

.odontograma-tooth.with-rects .odonto-rect-pair.arc-down {
  order: 4;
  margin-top: 2px;
}

.odontograma-code {
  order: initial;
}

.odonto-rect-select {
  width: 28px;
  min-width: 28px;
  height: 14px;
  padding: 0 2px;
  border-radius: 1px;
  border: 1px solid #7f95b0;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  color: #264766;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: none;
}

.odonto-rect-select.rect-externo {
  background: #f8fbff;
}

.odonto-rect-select.rect-medio {
  background: #ffffff;
}

.odonto-rect-select.rect-externo.filled {
  background: #fff5b8;
  border-color: #d8bf56;
}

.odonto-rect-select.rect-medio.filled {
  background: #ffe1e5;
  border-color: #d88d98;
}

.odontograma-code {
  font-size: 11px;
  color: #244363;
  font-weight: 700;
}

.odontograma-box {
  width: 32px;
  height: 32px;
  background: #fff;
  position: relative;
  transition: transform 0.12s ease;
}

.odontograma-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.odonto-mark-overlay {
  pointer-events: none;
}

.odontograma-arc-lines {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(50% + 8px);
  transform: translateY(-50%);
  display: grid;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}

.odontograma-arc-lines span {
  display: block;
  height: 4px;
  border-radius: 3px;
}

.odontograma-arc-lines.arc-blue span {
  background: #0d48b3;
}

.odontograma-arc-lines.arc-red span {
  background: #df2222;
}

.odonto-surface {
  fill: #ffffff;
  stroke: #7f95b0;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.odonto-surface:hover {
  stroke: #355779;
  stroke-width: 1.15;
}

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

.odontograma-box.tooth-absent::after {
  content: "X";
  position: absolute;
  inset: -1px;
  display: grid;
  place-items: center;
  color: #de1f35;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 0 1px #ffffff;
}

.odonto-surface[data-state="caries"] {
  fill: #ffe3e6;
  stroke: #df4157;
}

.odonto-surface[data-state="restaurado"] {
  fill: #e5f1ff;
  stroke: #2e73c8;
}

.odonto-surface[data-state="endodoncia"] {
  fill: #efe7ff;
  stroke: #7852c5;
}

.odonto-surface[data-state="fractura"] {
  fill: #ffefe0;
  stroke: #d37a2f;
}

.odonto-surface[data-state="ausente"] {
  fill: #eef1f5;
  stroke: #7d8c9f;
}
.plan-reagendar-row {
  display: grid;
  grid-template-columns: 1fr 130px auto;
  gap: 8px;
  align-items: center;
}

.date-picker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.date-picker-row button {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
}

#appointment-form .date-picker-row button {
  background: linear-gradient(135deg, #536d8f 0%, #334863 100%);
  box-shadow: 0 10px 20px rgba(45, 62, 85, 0.24);
}

.school-days-stack {
  display: grid;
  gap: 6px;
}

.school-days-right {
  grid-column: 2 / 3;
}

.gineco-inline {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(6, minmax(95px, 1fr));
  gap: 6px 8px;
}

.gineco-field label {
  font-size: 12px;
  margin-bottom: 2px;
}

.gineco-field input {
  height: 34px;
  padding: 6px 8px;
}

.gineco-no-sabe-label {
  padding: 2px 6px;
  gap: 4px;
  font-size: 11px;
}

.gineco-no-sabe-label input[type="checkbox"] {
  width: 12px;
  height: 12px;
}

.antecedents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin-bottom: 6px;
}

.antecedents-grid #c-gineco-wrap {
  grid-column: 1 / -1;
}

.antecedents-grid #c-embarazo-wrap {
  grid-column: 1 / -1;
}

.antecedents-grid #c-lactancia-wrap {
  grid-column: 1 / -1;
}

.antecedents-grid #c-psico-antecedentes-wrap {
  grid-column: 1 / -1;
}

.embarazo-detail {
  margin-top: 6px;
  display: grid;
  gap: 8px;
}

#c-embarazo-medical-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 6px 8px;
}

.embarazo-field label {
  font-size: 12px;
  margin-bottom: 2px;
}

.embarazo-field input {
  height: 34px;
  padding: 6px 8px;
}

.embarazo-field-wide {
  grid-column: span 2;
}

.embarazo-obstetric {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #f9fcff;
  padding: 8px;
  margin-top: 4px;
}

.embarazo-obstetric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

#c-embarazo-curva-chart {
  margin-bottom: 8px;
}

.embarazo-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 6px 8px;
  margin-bottom: 8px;
}

.embarazo-score-breakdown {
  border: 1px solid #d6e2f0;
  border-radius: 8px;
  background: #f4f8ff;
  color: #294666;
  font-size: 12px;
  padding: 6px 8px;
  margin-bottom: 8px;
  display: grid;
  gap: 4px;
}

.embarazo-score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.embarazo-score-row strong {
  font-size: 12px;
}

.embarazo-score-recommend {
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 8px;
  font-size: 12px;
  color: #294666;
}

.embarazo-score-recommend ul {
  margin: 4px 0 0 16px;
  padding: 0;
}

.embarazo-score-required {
  margin-top: 8px;
  border: 1px solid #e8b8bf;
  border-radius: 8px;
  background: #fff0f2;
  color: #8a1f2e;
  padding: 6px 8px;
  font-size: 12px;
}

.antecedent-block {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 5px 6px;
  background: #f9fcff;
  margin-bottom: 0;
}

.antecedent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.antecedent-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.antecedent-head label {
  font-size: 12px;
  margin-bottom: 0;
}

.yes-no-group {
  display: flex;
  gap: 10px;
}

.yes-no-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #ccd8e8;
  background: #ffffff;
  font-weight: 600;
}

.yes-no-group input[type="radio"] {
  width: 14px;
  height: 14px;
}

.antecedent-detail {
  margin-top: 5px;
  min-height: 68px;
  padding: 6px 8px;
  font-size: 14px;
}

@media (max-width: 760px) {
  .clinical-meta-grid {
    grid-template-columns: 1fr;
  }

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

  #c-embarazo-medical-fields {
    grid-template-columns: 1fr;
  }

  .embarazo-field-wide {
    grid-column: span 1;
  }
}

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 4px 6px;
}

.vitals-section {
  margin-bottom: 6px;
}

.vitals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.vitals-head label {
  margin: 0;
}

.vitals-psico-recommendation {
  font-size: 11px;
  line-height: 1.3;
  color: #7a4f0a;
  background: #fff5df;
  border: 1px solid #efd39d;
  border-radius: 8px;
  padding: 4px 8px;
  flex: 1;
  min-width: 260px;
}

.vitals-content {
  display: block;
}

.vital-item {
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  padding: 4px 5px;
  background: #f9fcff;
}

.vital-item label {
  font-size: 11px;
  margin-bottom: 1px;
}

.vital-item input,
.vital-item select {
  height: 30px;
  padding: 4px 7px;
  font-size: 14px;
}

.vital-item input.vital-moderate {
  background: #fff8dd;
  border-color: #f0df9a;
  color: #7f6515;
}

.vital-item input.vital-severe {
  background: #ffe9e8;
  border-color: #f2c0bc;
  color: #8a3430;
  font-weight: 700;
}

.consciousness-head .mini-btn {
  padding: 3px 8px;
  font-size: 11px;
}

.risk-pill {
  min-width: 0;
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
}

.vital-item .pa-row input {
  min-width: 0;
}

@media (max-width: 980px) {
  .vitals-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 680px) {
  .vitals-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 520px) {
  .vitals-grid {
    grid-template-columns: 1fr;
  }

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

.vital-item label {
  display: block;
  margin-bottom: 6px;
}

.consciousness-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.consciousness-head label {
  margin-bottom: 0;
}

.pa-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.pa-row span {
  font-weight: 700;
  color: #3a5170;
}

.risk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.growth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.growth-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.growth-note {
  font-size: 12px;
  color: #385579;
  background: #eef5ff;
  border: 1px solid #cfe0f6;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 8px;
}

.growth-alerts {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.growth-alert-item {
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #d6e2f0;
  background: #f4f8ff;
  color: #294666;
}

.growth-alert-item.level-ok {
  border-color: #b7dfc9;
  background: #eefaf3;
  color: #1f5e3a;
}

.growth-alert-item.level-mid {
  border-color: #ecd39d;
  background: #fff8e8;
  color: #7a5a14;
}

.growth-alert-item.level-high {
  border-color: #e8b8bf;
  background: #fff0f2;
  color: #8a1f2e;
}

.growth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 8px;
}

.growth-item {
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  background: #f9fcff;
  padding: 6px;
}

.growth-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f3b63;
  margin-bottom: 6px;
}

.growth-chart-canvas {
  min-height: 210px;
  border: 1px dashed #c9d8ec;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.growth-chart-summary {
  margin: 6px 2px 0;
  padding: 6px 8px;
  border: 1px solid #dbe7f4;
  border-radius: 7px;
  background: #f7fbff;
  font-size: 11px;
  line-height: 1.35;
  color: #2d4b6f;
}

.growth-chart-summary .growth-summary-title {
  font-weight: 700;
  color: #1f3b63;
}

.growth-chart-summary.level-ok {
  border-color: #b7dfc9;
  background: #eefaf3;
  color: #1f5e3a;
}

.growth-chart-summary.level-mid {
  border-color: #ecd39d;
  background: #fff8e8;
  color: #7a5a14;
}

.growth-chart-summary.level-high {
  border-color: #e8b8bf;
  background: #fff0f2;
  color: #8a1f2e;
}

.growth-chart-zoomable {
  cursor: zoom-in;
}

.growth-chart-zoomable:hover {
  border-color: #8eb3e0;
  box-shadow: 0 0 0 2px rgba(47, 126, 216, 0.08) inset;
}

.growth-chart-svg {
  width: 100%;
  height: 210px;
  display: block;
}

.growth-chart-canvas--large {
  min-height: 560px;
}

.growth-chart-svg--large {
  height: 560px;
}

.growth-zoom-modal-card {
  width: min(1200px, 98vw);
  max-height: 94vh;
}

@media (max-width: 860px) {
  .growth-grid {
    grid-template-columns: 1fr;
  }
}

.risk-pill {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 10px;
  border: 1px solid #d4ddeb;
  background: #f1f5fb;
  color: #39506f;
  font-weight: 700;
  min-width: 0;
  width: 100%;
  height: 30px;
  line-height: 20px;
  box-sizing: border-box;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.risk-pill.risk-green {
  background: #e6f7ee;
  border-color: #bde7cd;
  color: #2f6a46;
}

.risk-pill.risk-yellow {
  background: #fff8dd;
  border-color: #f0df9a;
  color: #7f6515;
}

.risk-pill.risk-red {
  background: #ffe9e8;
  border-color: #f2c0bc;
  color: #8a3430;
}

.guide-modal-card {
  width: min(860px, 100%);
}

.finalize-confirm-card {
  width: min(560px, 100%);
  max-height: none;
}

.finalize-confirm-text {
  margin: 4px 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #1a3556;
}

.app-notice-rich {
  white-space: pre-line;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.side-opening-panel {
  position: fixed;
  top: 16px;
  right: 12px;
  width: 300px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #d7e1ee;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(20, 49, 84, 0.15);
  padding: 12px;
  z-index: 1100;
}

.side-opening-panel h4 {
  margin: 0 0 8px;
  color: #1f4f86;
  font-size: 16px;
  font-weight: 800;
}

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

.side-opening-item {
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #f7fbff;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #1a3556;
}

.side-opening-item strong {
  display: block;
  margin-bottom: 3px;
  color: #15457b;
}

@media (min-width: 1650px) {
  .side-opening-panel {
    left: calc((100vw + 1260px) / 2 + 10px);
    right: auto;
  }
}

@media (max-width: 1320px) {
  .side-opening-panel {
    display: none !important;
  }
}

.finalize-confirm-note {
  margin: 0;
  border: 1px solid #f2d8a2;
  background: #fff8e8;
  color: #6a4a12;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.45;
}

.finalize-confirm-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.guide-image-wrap {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 8px;
  background: #f9fcff;
}

.guide-image-wrap img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.guide-fallback {
  margin-top: 10px;
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f7fbff;
  color: #2f4766;
  font-size: 13px;
}

.guide-fallback ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.risk-info {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  cursor: help;
  background: #e8eef8;
  border: 1px solid #bfd0e8;
  color: #284d7a;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 7px 9px;
  background: #f9fcff;
}

.native-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #1f8fff 0%, #0e6fd2 100%);
  box-shadow: 0 6px 14px rgba(14, 111, 210, 0.25);
}

.file-btn:hover {
  filter: brightness(1.05);
}

.file-btn-image::before {
  content: "[IMG]";
  font-size: 13px;
}

.file-btn-doc::before {
  content: "[DOC]";
  font-size: 13px;
}

.file-name {
  font-size: 12px;
  color: #456080;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d7e1ed;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f7fbff;
  font-size: 13px;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cdd9e8;
}

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #1f8fff 0%, #0e6fd2 100%);
}

.file-view-btn:hover {
  filter: brightness(1.05);
}

.file-item button {
  padding: 5px 8px;
  font-size: 12px;
}

.cie10-results {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #f9fcff;
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 0;
}

.cie10-item {
  border: none;
  border-bottom: 1px solid #e0e9f3;
  background: #fff;
  color: #1f3550;
  text-align: left;
  padding: 8px 10px;
  box-shadow: none;
  border-radius: 0;
  font-weight: 600;
}

.cie10-item:last-child {
  border-bottom: none;
}

.cie10-item small {
  display: block;
  margin-top: 2px;
  color: #4f6581;
  font-weight: 500;
}

.cie10-empty {
  padding: 8px 10px;
  color: #5c6f87;
  font-size: 13px;
}

.cie10-selected {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.cie10-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #d6e2f0;
  border-radius: 9px;
  background: #f7fbff;
  font-size: 13px;
  color: #2e4663;
}

.cie10-pill button {
  padding: 4px 8px;
  font-size: 12px;
}

.dx-type-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 6px;
  flex-wrap: wrap;
}

.dx-type-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #244264;
}

.dx-type-option input[type="radio"] {
  margin: 0;
}

.cie10-pill-main {
  flex: 1;
  min-width: 230px;
}

.cie10-pill-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cie10-pill-controls .qty-num,
.cie10-pill-controls .qty-text {
  width: 110px;
  min-width: 110px;
  height: 30px;
  padding: 5px 8px;
  border: 1px solid #c8d7e8;
  border-radius: 8px;
  background: #ffffff;
  color: #2e4663;
  font-size: 12px;
}

.cie10-pill-controls .qty-text {
  width: 140px;
  min-width: 140px;
  background: #f2f7ff;
  font-weight: 700;
}

.med-manual-wrap {
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fcff;
}

.med-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.plus-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  border-radius: 10px;
}

.clinical-quick-actions {
  position: relative;
  z-index: 1265;
  display: inline-grid;
  gap: 8px;
  justify-items: end;
}

.clinical-quick-plus {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(18, 49, 87, 0.28);
}

.clinical-quick-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  border: 1px solid #c8d8ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(16, 42, 74, 0.22);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.clinical-quick-menu .mini-btn {
  width: 100%;
  justify-content: center;
}

.support-chat-widget {
  position: fixed;
  top: 150px;
  right: 20px;
  z-index: 1200;
}

.support-chat-fab {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 22px;
  box-shadow: 0 10px 20px rgba(18, 49, 87, 0.28);
}

.support-chat-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #c43131;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid #fff;
}

.support-chat-panel {
  margin-top: 10px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(78vh, 740px);
  border: 1px solid #c8d8ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(16, 42, 74, 0.22);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.support-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.support-chat-selected-user {
  margin: 0;
}

.support-chat-threads {
  max-height: 120px;
  overflow: auto;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.support-chat-thread-btn {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid #d2dceb;
  border-radius: 8px;
  background: #f7faff;
  color: #17345f;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
}

.support-chat-thread-btn.active {
  background: #e7f1ff;
  border-color: #7aa7df;
}

.support-chat-thread-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  text-align: center;
  border-radius: 999px;
  background: #c43131;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
}

.support-chat-messages {
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  padding: 8px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 6px;
  background: #fbfdff;
}

.support-chat-item {
  border-radius: 10px;
  border: 1px solid #d7e3f3;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  background: #fff;
}

.support-chat-item.mine {
  background: #ebf4ff;
  border-color: #c2d8f2;
}

.support-chat-item-meta {
  font-size: 11px;
  color: #4f6690;
  margin-bottom: 2px;
}

.support-chat-item-type {
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 4px;
}

.support-chat-compose {
  display: grid;
  gap: 6px;
}

@media (max-width: 900px) {
  .support-chat-widget {
    top: auto;
    right: 12px;
    bottom: 12px;
  }
}

.med-manual-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.clinical-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.clinical-actions button[type="submit"] {
  min-width: 220px;
}

#c-save-nursing-postconsulta-btn {
  margin-left: auto;
}

.legal-sign-wrap {
  margin-top: 10px;
  border: 1px solid #d6e2f0;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
}

.legal-sign-wrap h4 {
  margin: 0 0 8px;
  color: #173a67;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  background: #f2f8ff;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px 12px;
}

.sign-preview-box {
  min-height: 90px;
  border: 1px dashed #c7d7ea;
  border-radius: 10px;
  background: #f9fcff;
  display: grid;
  place-items: center;
  padding: 8px;
}

#profile-sign-image-preview {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.legal-sign-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}

.rx-toggle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.rx-title {
  margin: 0;
}

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

.rx-toggle-actions button {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.rx-toggle-actions button.active {
  background: linear-gradient(135deg, #2b7de1 0%, #165bb3 100%);
  color: #fff;
}

.rx-panel {
  margin-top: 8px;
}

.exam-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.exam-request-head label {
  margin: 0;
}

.exam-request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-request-actions button {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.lab-modal-card {
  max-width: 980px;
}

.lab-tools {
  margin-bottom: 8px;
}

.lab-catalog {
  max-height: 46vh;
  overflow: auto;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  padding: 10px;
  background: #f9fcff;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.lab-cat {
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.lab-cat h4 {
  margin: 0 0 6px;
  color: #17385f;
}

.lab-items {
  display: grid;
  gap: 6px;
}

.lab-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  color: #294767;
  line-height: 1.3;
}

.lab-item input[type="checkbox"] {
  width: auto;
  margin: 2px 0 0;
  padding: 0;
  box-shadow: none;
  accent-color: #0d79db;
}

.lab-item span {
  display: block;
  word-break: break-word;
}

.indicaciones-rows {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.indicacion-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 0.7fr;
  gap: 8px;
  align-items: center;
}

.indicacion-empty {
  border: 1px dashed #c8d6e8;
  border-radius: 8px;
  padding: 10px;
  color: #5d7492;
  background: #f7fbff;
  font-size: 13px;
}

#c-add-indicacion-btn {
  margin-bottom: 6px;
}

@media (max-width: 980px) {
  .login-shell {
    margin-top: 34px;
    max-width: 560px;
  }

  .login-logo h1 {
    font-size: 40px;
  }

  .login-title-wrap h2 {
    font-size: 36px;
  }

  .login-title-wrap p {
    font-size: 26px;
  }

  .field-wrap input {
    height: 54px;
    font-size: 22px;
  }

  .login-btn {
    height: 58px;
    font-size: 29px;
  }

  .verify-box strong {
    font-size: 17px;
  }

  .login-footer-banner p {
    font-size: 34px;
  }

  .header-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-tools input {
    min-width: 220px;
  }

  .header-center-logo {
    width: 92px;
    height: 92px;
  }

  .user-chip {
    max-width: 100%;
  }

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

  .history-compare-grid {
    grid-template-columns: 1fr;
  }

  #user-form .user-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #user-form .user-form-actions button {
    width: 100%;
  }

  .agenda-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .med-manual-grid {
    grid-template-columns: 1fr;
  }

  .legal-sign-grid {
    grid-template-columns: 1fr;
  }

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

  .clinical-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .clinical-actions button {
    width: 100%;
  }

  #c-save-nursing-postconsulta-btn {
    margin-left: 0;
  }

  .rx-toggle-head {
    flex-direction: column;
    align-items: stretch;
  }

  .exam-request-head {
    flex-direction: column;
    align-items: stretch;
  }

  .exam-request-actions {
    width: 100%;
  }

  .exam-request-actions button {
    width: 100%;
  }

  .lab-catalog {
    grid-template-columns: 1fr;
    max-height: 40vh;
  }

  .rx-toggle-actions {
    width: 100%;
  }

  .rx-toggle-actions button {
    flex: 1;
  }

  .indicacion-row {
    grid-template-columns: 1fr;
  }

  .cie10-pill {
    flex-direction: column;
    align-items: stretch;
  }

  .cie10-pill-controls {
    justify-content: flex-end;
  }
}


/* Pricing Page */
.pricing-body {
  background:
    radial-gradient(1200px 500px at 15% -20%, rgba(2, 94, 184, 0.2) 0%, rgba(2, 94, 184, 0) 60%),
    radial-gradient(900px 500px at 90% -15%, rgba(19, 156, 255, 0.16) 0%, rgba(19, 156, 255, 0) 60%),
    #f2f6fb;
}

.pricing-shell {
  max-width: 1220px;
  margin: 24px auto 36px;
  padding: 0 14px 20px;
}

.pricing-hero {
  text-align: center;
  padding: 34px 18px 20px;
}

.pricing-kicker {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #2d5f92;
  text-transform: uppercase;
  font-size: 12px;
}

.pricing-hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  margin-bottom: 10px;
  letter-spacing: -1.4px;
  color: #0f243a;
}

.pricing-lead {
  max-width: 770px;
  margin: 0 auto 18px;
  color: #415972;
  font-size: 18px;
}

.trial-offer {
  max-width: 760px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #0f6dc2 0%, #1498ff 100%);
  color: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 26px rgba(13, 96, 169, 0.28);
}

.trial-offer-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.9;
  font-weight: 700;
}

.trial-offer h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.15;
}

.trial-offer-copy {
  margin: 8px 0 0;
  font-size: 15px;
}

.trial-offer-date {
  margin: 8px 0 0;
  font-size: 13px;
  opacity: 0.95;
}

.plan-cta-trial {
  margin-top: 12px;
  display: inline-block;
  background: linear-gradient(135deg, #1cca6f 0%, #119754 100%);
  box-shadow: 0 10px 20px rgba(8, 100, 54, 0.3);
  min-width: 250px;
}

.pricing-billing-toggle {
  display: inline-flex;
  border: 1px solid #b9cce0;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.billing-mode-btn {
  min-width: 126px;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  color: #355777;
  font-weight: 700;
  padding: 10px 16px;
}

.billing-mode-btn:hover {
  transform: none;
  box-shadow: none;
}

.billing-mode-btn.active {
  background: linear-gradient(135deg, #1498ff 0%, #0567c5 100%);
  color: #fff;
}

.pricing-mini-note {
  margin: 10px 0 0;
  color: #4b6b8d;
  font-size: 13px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.pricing-card {
  background: #fff;
  border: 1px solid #d4e0ee;
  border-radius: 14px;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(25, 67, 116, 0.08);
}

.pricing-card.featured {
  border-color: #1498ff;
  box-shadow: 0 16px 28px rgba(9, 120, 220, 0.22);
}

.plan-badge {
  margin: 0 0 6px;
  font-size: 11px;
  color: #fff;
  background: #1498ff;
  border-radius: 999px;
  width: fit-content;
  padding: 4px 10px;
  font-weight: 700;
}

.plan-badge-trial {
  background: #14b86a;
}

.plan-name {
  margin: 0;
  color: #1e3e5f;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.pricing-card h2 {
  margin: 6px 0 4px;
  font-size: 24px;
  line-height: 1.1;
}

.plan-desc {
  margin: 0 0 12px;
  color: #4f6680;
  min-height: 40px;
}

.plan-price {
  margin: 0 0 12px;
  color: #0f243a;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.plan-price span {
  font-size: 46px;
  letter-spacing: -1.2px;
  line-height: 1;
}

.plan-price small {
  color: #58718d;
  font-size: 14px;
  margin-bottom: 5px;
}

.plan-kpi {
  margin: 0 0 4px;
  font-size: 13px;
  color: #36587b;
}

.plan-monthly-eq {
  font-weight: 700;
}

.plan-saving {
  color: #128a4e;
  font-weight: 700;
  margin-bottom: 10px;
}

.plan-cta {
  text-decoration: none;
  text-align: center;
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #179cff 0%, #0d79db 100%);
  box-shadow: 0 10px 20px rgba(13, 118, 218, 0.28);
}

.plan-cta:hover {
  filter: brightness(1.05);
}

.plan-features {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #224666;
  display: grid;
  gap: 6px;
}

.pricing-compare {
  margin-top: 14px;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
}

.pricing-table th,
.pricing-table td {
  border-bottom: 1px solid #dbe6f2;
  text-align: left;
  padding: 10px 10px;
  font-size: 14px;
}

.pricing-table th {
  color: #234a71;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #eef4fb;
}

.pricing-footer {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.pricing-back,
.pricing-contact {
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 14px;
}

.pricing-back {
  color: #294d71;
  border: 1px solid #b9cce0;
  background: #fff;
}

.pricing-contact {
  color: #fff;
  background: linear-gradient(135deg, #17b75f 0%, #108648 100%);
  box-shadow: 0 10px 20px rgba(16, 134, 72, 0.25);
}

@media (max-width: 1100px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 700px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .plan-price span {
    font-size: 38px;
  }
  .pricing-table th,
  .pricing-table td {
    font-size: 12px;
    padding: 8px 8px;
  }
}


/* Checkout Page */
.checkout-shell {
  max-width: 1120px;
  margin: 18px auto 28px;
  background: #fff;
  border: 1px solid #d6deea;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(24, 55, 96, 0.12);
  overflow: hidden;
}

.checkout-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #dde5f0;
}

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

.checkout-brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #222;
  background: #efb2a2;
  font-size: 16px;
}

.checkout-brand h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 1px;
}

.checkout-continue {
  color: #173a61;
  text-decoration: underline;
  font-weight: 600;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  padding: 18px;
  background: #fff;
}

.checkout-left h2,
.checkout-right h2 {
  margin: 0 0 10px;
  font-size: 33px;
}

.checkout-left h3 {
  margin: 10px 0 8px;
  font-size: 24px;
}

.checkout-note {
  background: #f5f7fb;
  border: 1px solid #e2e8f2;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: #4a5d73;
  font-size: 15px;
}

.checkout-note a {
  color: #173a61;
  font-weight: 600;
}

.checkout-form {
  gap: 12px;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  background: #fff;
  border-radius: 4px;
  border: 1px solid #cdd8e7;
}

.checkout-form button {
  margin-top: 4px;
}

.checkout-right {
  position: relative;
}

.checkout-summary-card {
  background: #f6f8fc;
  border: 1px solid #d7e0ed;
  border-radius: 6px;
  padding: 14px;
}

.checkout-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.checkout-summary-head h2 {
  font-size: 20px;
  margin: 0;
}

.checkout-summary-head a {
  color: #173a61;
  text-decoration: underline;
  font-weight: 600;
  font-size: 14px;
}

.checkout-row {
  margin: 8px 0;
}

.checkout-row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.checkout-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 6px;
}

.checkout-profile-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-top: 1px solid #dde5f0;
  border-bottom: 1px solid #dde5f0;
  margin: 12px 0;
  padding: 12px 0;
}

.checkout-item strong {
  font-size: 18px;
}

.checkout-linkline {
  margin: 8px 0;
}

.checkout-linkline a {
  color: #304b69;
  text-decoration: underline;
  font-size: 14px;
}

.checkout-totals {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.checkout-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #cfd9e7;
  font-size: 18px;
}

.checkout-secure {
  margin: 12px 0 0;
  text-align: center;
  color: #4f627a;
  font-weight: 600;
  font-size: 14px;
}

@media (max-width: 980px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  .checkout-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
.checkout-card-fields {
  margin: 8px 0 2px;
  padding: 10px;
  border: 1px solid #d7dfec;
  border-radius: 6px;
  background: #f7f9fc;
}

.checkout-card-fields h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.checkout-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkout-card-expiry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 700px) {
  .checkout-card-row {
    grid-template-columns: 1fr;
  }
}
.checkout-sim-result {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d7e4f0;
  border-radius: 6px;
  background: #f8fbff;
}

.checkout-sim-result h4 {
  margin: 0 0 8px;
  color: #173b61;
}

.checkout-confirm-note {
  margin: 10px 0 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #f3d38a;
  background: #fff8e6;
  color: #6b4f12;
  font-size: 13px;
}
