/* NexSalud Enterprise UI — global visual system
   Layered last so existing module behavior is preserved while the shell,
   forms, grids, tables, cards and feedback components share one language. */

:root {
  --ns-primary: #0d8fca;
  --ns-primary-strong: #0877aa;
  --ns-primary-soft: #eaf7fc;
  --ns-primary-ring: rgba(13, 143, 202, .18);
  --ns-navy-950: #08131c;
  --ns-navy-900: #0d1b26;
  --ns-navy-850: #112432;
  --ns-navy-800: #17303f;
  --ns-surface: #ffffff;
  --ns-surface-2: #f8fafc;
  --ns-surface-3: #f2f6f9;
  --ns-canvas: #f4f7fa;
  --ns-text: #16232d;
  --ns-text-2: #425361;
  --ns-muted: #70808d;
  --ns-border: #dfe7ed;
  --ns-border-strong: #cbd7df;
  --ns-success: #147a55;
  --ns-success-soft: #eaf7f1;
  --ns-warning: #9a6207;
  --ns-warning-soft: #fff6df;
  --ns-danger: #b42334;
  --ns-danger-soft: #fff0f2;
  --ns-info: #2563a5;
  --ns-info-soft: #eef6ff;
  --ns-shadow-xs: 0 1px 2px rgba(13, 30, 43, .04);
  --ns-shadow-sm: 0 4px 14px rgba(13, 30, 43, .06);
  --ns-shadow-md: 0 12px 30px rgba(13, 30, 43, .09);
  --ns-radius-sm: 8px;
  --ns-radius-md: 12px;
  --ns-radius-lg: 16px;
  --ns-sidebar-width: 248px;
  --ns-sidebar-collapsed: 78px;
  --ns-content-max: 1640px;
  --primary: var(--ns-primary);
  --primary-dark: var(--ns-primary-strong);
  --sidebar: var(--ns-navy-900);
  --sidebar-2: var(--ns-navy-850);
  --bg: var(--ns-canvas);
  --text: var(--ns-text);
  --muted: var(--ns-muted);
  --border: var(--ns-border);
  --danger: var(--ns-danger);
  --success: var(--ns-success);
}

html { color-scheme: light; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -.006em;
  background: var(--ns-canvas);
  color: var(--ns-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #cfeffc; color: #0a4f6e; }
:focus-visible { outline: 3px solid var(--ns-primary-ring); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #aebcc6 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #b8c5ce; border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ===== APPLICATION SHELL ===== */
.app-shell {
  min-height: 100vh;
  grid-template-columns: var(--ns-sidebar-width) minmax(0, 1fr);
  background: var(--ns-canvas);
  transition: grid-template-columns .22s ease;
}

.app-shell.ns-sidebar-collapsed { grid-template-columns: var(--ns-sidebar-collapsed) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -10%, rgba(40, 169, 224, .13), transparent 30%),
    linear-gradient(180deg, var(--ns-navy-900), var(--ns-navy-950));
  border-right: 1px solid rgba(255,255,255,.05);
  box-shadow: 8px 0 30px rgba(5, 19, 28, .06);
  z-index: 60;
}

.sidebar-brand {
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: linear-gradient(135deg, #149bd5, #0b82b9);
  letter-spacing: 0;
  box-shadow: inset 0 -1px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 5;
}
.system-brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px rgba(255,255,255,.14);
}
.system-brand-mark img { width: 30px; height: 30px; object-fit: contain; }
.system-brand-mark span { font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.sidebar-brand strong {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.05;
  white-space: nowrap;
}
.system-brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.system-brand-subtitle { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.78); white-space: nowrap; letter-spacing: .035em; }

.ns-sidebar-tools {
  padding: 10px 12px 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ns-nav-search {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(255,255,255,.09) !important;
  background: rgba(255,255,255,.055) !important;
  color: #eaf2f7 !important;
  border-radius: 10px !important;
  padding: 0 11px 0 33px !important;
  font-size: 12px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2397a9b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
}
.ns-nav-search::placeholder { color: #8ea0ac; }
.ns-nav-search:focus { border-color: rgba(73,185,232,.55) !important; box-shadow: 0 0 0 3px rgba(37,164,217,.12) !important; }
.ns-sidebar-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.055);
  color: #dce7ee;
  transition: background .16s ease, transform .16s ease;
}
.ns-sidebar-toggle:hover { background: rgba(255,255,255,.11); }
.ns-sidebar-toggle svg { width: 17px; height: 17px; }

.user-box {
  gap: 11px;
  padding: 13px 14px;
  border-bottom: 0;
  margin: 6px 10px 0;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 12px;
}
.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: white;
  background: linear-gradient(145deg, #2aa9df, #147eab);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(0,0,0,.16);
}
.user-box > div:last-child { min-width: 0; }
.user-box strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: #f4f8fb; }
.user-box small { color: #9eb0bc; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.context-box {
  margin: 8px 10px 4px;
  padding: 11px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 12px;
}
.context-box span { color: #8296a3; font-size: 9.5px; letter-spacing: .1em; font-weight: 700; }
.context-box strong { color: #e9f0f4; font-size: 11.5px; font-weight: 650; }
.context-box a { color: #56bce8; font-size: 10.5px; font-weight: 650; }
.context-box a:hover { color: #9bdcf5; }

.sidebar nav { padding: 5px 9px 12px; }
.nav-title {
  padding: 15px 9px 6px;
  color: #718593;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}
.sidebar nav > a,
.sidebar nav summary,
.sidebar nav .submenu-link,
.sidebar nav .submenu-nested {
  border-left: 0 !important;
  border-radius: 9px;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}
.sidebar nav > a {
  padding: 9px 10px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #cbd7df;
  font-size: 12.25px;
  font-weight: 620;
}
.sidebar nav > a:hover,
.sidebar nav > a.active { background: rgba(37,164,217,.12); color: #f3fbff; }
.sidebar nav > a.active { box-shadow: inset 3px 0 0 #35b3e8; }

.menu-group,
.submenu-details { margin: 2px 0; }
.menu-group > summary,
.submenu-details > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  color: #d9e3e9;
  font-size: 12.25px;
  font-weight: 640;
  padding: 9px 30px 9px 10px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}
.menu-group > summary::-webkit-details-marker,
.submenu-details > summary::-webkit-details-marker { display: none; }
.menu-group > summary:hover,
.submenu-details > summary:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-group[open] > summary { background: rgba(37,164,217,.08); color: #eaf8ff; }
.menu-group > summary::after,
.submenu-details > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.7px solid #7e929e;
  border-bottom: 1.7px solid #7e929e;
  transform: rotate(45deg);
  position: absolute;
  right: 13px;
  top: 14px;
  transition: transform .16s ease, top .16s ease;
}
.menu-group[open] > summary::after,
.submenu-details[open] > summary::after { transform: rotate(225deg); top: 17px; }
.submenu-links { padding: 3px 0 5px 10px; background: transparent !important; }
.submenu-deep { padding: 2px 0 4px 9px; }
.submenu-details > summary { font-size: 11.6px; color: #b8c7d0; padding-top: 8px; padding-bottom: 8px; }
.submenu-nested,
.submenu-link {
  padding: 7px 10px 7px 14px !important;
  color: #9fb0bb !important;
  font-size: 10.9px !important;
  font-weight: 520 !important;
  line-height: 1.3;
  margin: 1px 0;
}
.submenu-nested:hover,
.submenu-link:hover { background: rgba(255,255,255,.045) !important; color: #e5edf2 !important; }
.submenu-nested.active,
.submenu-link.active { background: linear-gradient(90deg, rgba(41,178,229,.18), rgba(41,178,229,.06)) !important; color: #eaf9ff !important; box-shadow: inset 3px 0 0 #31b5e8; border-radius: 10px !important; }
.submenu-section-label {
  margin: 8px 0 3px 8px;
  padding: 0 6px;
  color: #6f8491;
  font-size: 8.8px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ns-nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: #8ea4b2;
}
.active .ns-nav-icon,
summary:hover .ns-nav-icon,
.menu-group[open] > summary .ns-nav-icon { color: #54bce8; }

.sidebar-logout {
  padding: 8px 10px 12px;
  background: linear-gradient(180deg, transparent, rgba(5,14,20,.34));
  position: sticky;
  bottom: 0;
}
.sidebar-logout button {
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #9fb1bc;
  font-size: 11px;
  font-weight: 620;
}
.sidebar-logout button:hover { background: rgba(183,45,60,.16); color: #ffdce1; border-color: rgba(255,115,132,.15); }

/* collapsed desktop sidebar */
.ns-sidebar-collapsed .sidebar { overflow: visible; }
.ns-sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 12px; }
.ns-sidebar-collapsed .system-brand-copy,
.ns-sidebar-collapsed .user-box > div:last-child,
.ns-sidebar-collapsed .context-box,
.ns-sidebar-collapsed .nav-title,
.ns-sidebar-collapsed .ns-nav-search,
.ns-sidebar-collapsed .sidebar nav a:not(.active) > .ns-nav-label,
.ns-sidebar-collapsed .sidebar nav summary > .ns-nav-label,
.ns-sidebar-collapsed .submenu-links,
.ns-sidebar-collapsed .sidebar-logout button { display: none !important; }
.ns-sidebar-collapsed .ns-sidebar-tools { justify-content: center; padding-inline: 12px; }
.ns-sidebar-collapsed .user-box { padding: 9px; justify-content: center; margin-inline: 10px; }
.ns-sidebar-collapsed .sidebar nav { padding-inline: 10px; }
.ns-sidebar-collapsed .sidebar nav > a,
.ns-sidebar-collapsed .menu-group > summary { justify-content: center; padding: 10px; }
.ns-sidebar-collapsed .menu-group > summary::after { display: none; }
.ns-sidebar-collapsed .sidebar-logout { padding-inline: 10px; }
.ns-sidebar-collapsed .sidebar-logout::before {
  content: "↪";
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  margin: auto;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  color: #aebbc3;
}

.content { min-width: 0; background: var(--ns-canvas); }

/* ===== PAGE HEADER ===== */
.topbar {
  min-height: 72px;
  padding: 13px 26px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--ns-border);
  box-shadow: 0 1px 0 rgba(13,30,43,.01);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}
.topbar > div:first-child { min-width: 0; }
.topbar h1 {
  margin: 0 0 2px;
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.18;
  font-weight: 730;
  color: #142531;
  letter-spacing: -.025em;
}
.topbar p { font-size: 11.5px; color: var(--ns-muted); }
.top-user {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--ns-border);
  background: var(--ns-surface-2);
  border-radius: 999px;
  color: var(--ns-text-2);
  font-size: 11px;
  font-weight: 650;
  box-shadow: var(--ns-shadow-xs);
}
.top-user::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #26a269;
  box-shadow: 0 0 0 3px #e7f7ef;
  margin-right: 8px;
}

/* ===== PAGE SPACING & SURFACES ===== */
.panel,
.welcome-panel,
.summary-card,
.converter-card,
.setup-card,
.stat-card,
.cc-action-card,
.cartera-hero,
.cm-hero,
.tf-hero,
.fevrips-hero {
  border-color: var(--ns-border) !important;
  border-radius: var(--ns-radius-lg) !important;
  box-shadow: var(--ns-shadow-xs);
}
.panel,
.welcome-panel { background: var(--ns-surface); }
.panel { margin: 22px; padding: 22px; }
.welcome-panel { margin: 22px; padding: 24px; }
.module-grid { margin: 0 22px 22px; gap: 14px; }
.summary-grid { margin: 22px; gap: 14px; }

.panel h2,
.welcome-panel h2,
.summary-card h2,
.converter-card h2 { color: #182934; letter-spacing: -.018em; }
.panel > h2:first-child,
.section-heading-row h2 { font-size: 17px; font-weight: 720; margin-bottom: 4px; }
.section-heading-row { gap: 14px; align-items: flex-start; }
.section-heading-row p { margin-bottom: 0; }
.muted { color: var(--ns-muted) !important; }
.cm-kicker,
.ops-kicker {
  color: var(--ns-primary-strong) !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase;
}

/* ===== MODULE HOME CARDS ===== */
.module-card {
  min-height: 116px;
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius-lg);
  padding: 18px;
  gap: 14px;
  box-shadow: var(--ns-shadow-xs);
  background: linear-gradient(180deg, #fff, #fbfdfe);
  position: relative;
  overflow: hidden;
}
.module-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background .16s ease;
}
.module-card:hover {
  transform: translateY(-2px);
  border-color: #c7d9e4;
  box-shadow: var(--ns-shadow-md);
}
.module-card:hover::after { background: var(--ns-primary); }
.module-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ns-primary-soft);
  color: var(--ns-primary-strong);
  font-size: 21px;
}
.module-card h3 { font-size: 14.5px; font-weight: 720; margin: 1px 0 5px; }
.module-card p { font-size: 11.5px; line-height: 1.5; color: var(--ns-muted); }

.summary-card {
  padding: 18px;
  background: linear-gradient(180deg,#fff,#fbfcfd);
}
.summary-card span { font-size: 9.5px; font-weight: 800; letter-spacing: .09em; color: var(--ns-muted); }
.summary-card strong { font-size: 31px; font-weight: 760; letter-spacing: -.035em; color: #162a36; }
.summary-card small { font-size: 11px; }

/* ===== FORMS ===== */
label {
  margin: 13px 0 6px;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  color: #344956;
}
input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--ns-border-strong);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--ns-text);
  background: #fff;
  font-size: 12px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa9b4; }
input:hover, select:hover, textarea:hover { border-color: #b6c7d2; }
input:focus, select:focus, textarea:focus {
  border-color: var(--ns-primary);
  box-shadow: 0 0 0 3px var(--ns-primary-ring);
}
input:disabled, select:disabled, textarea:disabled,
input[readonly], textarea[readonly] { background: #f4f7f9; color: #647682; }
small, .field-help { color: var(--ns-muted); font-size: 10.5px; }

.grid-form { gap: 1px 16px; }
.form-grid { gap: 14px 16px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf1f4;
}
.check-line {
  display: flex !important;
  align-items: center;
  gap: 9px;
  font-weight: 600 !important;
  color: var(--ns-text-2) !important;
}
.check-line input[type="checkbox"],
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--ns-primary);
}

/* ===== BUTTONS ===== */
button,
.button-link,
.button-primary,
.button-secondary,
.action-link,
a.button-link {
  min-height: 38px;
  border-radius: 9px !important;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  transition: transform .12s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}
button:active,
.button-link:active,
.button-primary:active,
.button-secondary:active { transform: translateY(1px); }
button:not([class]),
.button-primary,
a.button-link,
.success-button,
.wizard-next {
  background: linear-gradient(180deg, #149bd5, #0b88c1);
  color: #fff;
  border: 1px solid #0b83b9;
  box-shadow: 0 2px 5px rgba(12,133,185,.16);
}
button:not([class]):hover,
.button-primary:hover,
a.button-link:hover,
.success-button:hover,
.wizard-next:hover { background: linear-gradient(180deg, #108bc2, #0877a8); box-shadow: 0 4px 10px rgba(12,115,160,.2); }
.button-secondary,
.button-light,
button.secondary {
  background: #fff !important;
  color: #39515f !important;
  border: 1px solid var(--ns-border-strong) !important;
  box-shadow: var(--ns-shadow-xs) !important;
}
.button-secondary:hover,
.button-light:hover,
button.secondary:hover { background: #f7fafb !important; border-color: #b7c8d2 !important; }
button.small {
  min-height: 30px;
  padding: 6px 9px;
  background: #f3f6f8;
  border: 1px solid var(--ns-border);
  color: #425563;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
}
button.small:hover { background: #eaf0f4; }
button.small.danger,
button.danger { color: var(--ns-danger) !important; border-color: #f1cdd2 !important; background: #fff7f8 !important; }
button:disabled, .button-link[aria-disabled="true"] { opacity: .58; cursor: not-allowed; box-shadow: none !important; }
.inline-actions { gap: 6px; align-items: center; }
.small-link, .mini-link, .action-link { color: var(--ns-primary-strong) !important; font-weight: 700; }
.small-link:hover, .mini-link:hover, .action-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ===== TABLES / DATA GRIDS ===== */
.table-wrap,
.cm-scroll-table,
.cartera-table-scroll {
  border: 1px solid var(--ns-border);
  border-radius: 11px;
  background: #fff;
  overflow: auto;
}
table { border-collapse: separate; border-spacing: 0; background: #fff; }
th, td {
  padding: 9px 10px;
  border-bottom: 1px solid #e8edf1;
  font-size: 11.5px;
  line-height: 1.38;
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fb;
  color: #5b6d7a;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom-color: #d9e3e9;
}
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: #f8fbfd; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #1d303c; }
.count-pill {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #edf3f6;
  color: #526773;
  font-size: 10px;
  font-weight: 800;
}

/* ===== STATUS / FEEDBACK ===== */
.status,
.state-pill,
.tf-state,
.cartera-state,
.fevrips-state,
.mipres-status,
.cc-badge,
.cuv-pill {
  border-radius: 999px !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: .02em;
  padding: 4px 8px !important;
  line-height: 1.25;
}
.status.on, .success, .ok { --ns-state-bg: var(--ns-success-soft); --ns-state-fg: var(--ns-success); }
.status.off, .error, .danger { --ns-state-bg: var(--ns-danger-soft); --ns-state-fg: var(--ns-danger); }
.warning, .warn { --ns-state-bg: var(--ns-warning-soft); --ns-state-fg: var(--ns-warning); }
.neutral { --ns-state-bg: #eff3f5; --ns-state-fg: #596b76; }

.alert {
  margin: 14px 22px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 11.5px;
  line-height: 1.45;
  box-shadow: var(--ns-shadow-xs);
}
.alert.success { background: var(--ns-success-soft); color: #116844; border-color: #ccebdd; }
.alert.error { background: var(--ns-danger-soft); color: #9e2332; border-color: #f0cbd1; }
.alert.warning { background: var(--ns-warning-soft); color: #825307; border-color: #f4dfa8; }
.alert.neutral { background: var(--ns-info-soft); color: #245c8d; border-color: #d5e7fa; }
.flash-wrap { padding: 0 22px; }
.flash-wrap .alert { margin-inline: 0; }
.empty, .empty-state, .empty-state-soft {
  color: var(--ns-muted) !important;
  background: #fafcfd !important;
  border: 1px dashed #d6e0e6 !important;
  border-radius: 11px !important;
  padding: 26px 18px !important;
  text-align: center;
  font-size: 11.5px;
}

/* ===== HEROES / CONTEXT BANDS ===== */
.fevrips-hero,
.cm-hero,
.tf-hero,
.cartera-hero {
  background:
    radial-gradient(circle at 96% 0%, rgba(29,157,210,.08), transparent 27%),
    linear-gradient(180deg,#fff,#fbfdfe) !important;
}
.cm-center-context,
.ops-context-panel,
.tf-data-grid {
  border-color: var(--ns-border) !important;
  background: #f8fafb !important;
  border-radius: 12px !important;
}
.cm-center-context > div,
.tf-data-grid > div { min-width: 0; }
.cm-center-context span,
.tf-data-grid small { color: var(--ns-muted) !important; font-size: 9px !important; font-weight: 800 !important; letter-spacing: .06em; text-transform: uppercase; }
.cm-center-context strong,
.tf-data-grid strong { color: #263946 !important; font-size: 11.5px !important; font-weight: 700 !important; }

/* settings and two-column layouts */
.settings-grid,
.fevrips-settings-grid,
.cm-two-columns,
.regimen-layout,
.tf-visor-layout { gap: 16px !important; }
.settings-grid > .panel,
.fevrips-settings-grid > .panel { margin: 0 !important; }
.settings-grid,
.fevrips-settings-grid { margin: 0 22px 22px !important; }

/* ===== AUTH / SETUP ===== */
.auth-page {
  background:
    radial-gradient(circle at 18% 12%, rgba(24,156,212,.12), transparent 28%),
    radial-gradient(circle at 82% 86%, rgba(19,112,155,.08), transparent 30%),
    #f4f8fa;
}
.auth-card {
  border: 1px solid #dce6ec;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(12, 39, 56, .12);
  padding: 32px;
}
.brand { color: var(--ns-primary-strong); font-size: 13px; letter-spacing: .14em; }

/* ===== MODALS ===== */
.fev-connection-modal__backdrop { backdrop-filter: blur(3px); }
.fev-connection-modal__dialog {
  border-radius: 18px !important;
  border: 1px solid rgba(212,224,231,.96) !important;
  box-shadow: 0 24px 70px rgba(7,27,39,.22) !important;
}
.fev-connection-modal__eyebrow { letter-spacing: .1em !important; font-size: 9px !important; }
.fev-connection-modal__dialog h3 { letter-spacing: -.018em; }
.fev-connection-modal__primary { min-width: 105px; }

/* ===== NEWS ===== */
.news-item {
  border-radius: 12px !important;
  border-color: var(--ns-border) !important;
  box-shadow: var(--ns-shadow-xs);
}
.news-type { font-size: 9px !important; font-weight: 800 !important; letter-spacing: .08em; }

/* ===== OPERATIONAL DETAILS ===== */
.ops-tabs,
.cm-token-buttons { gap: 6px !important; }
.ops-tabs a,
.ops-tabs button,
.cm-token-buttons button {
  border-radius: 8px !important;
  font-size: 10.5px !important;
  min-height: 34px !important;
}
.tf-invoice-item { border-radius: 9px !important; }
.tf-invoice-item.active { background: var(--ns-primary-soft) !important; box-shadow: inset 3px 0 0 var(--ns-primary); }
.tf-timeline-item { border-color: var(--ns-border) !important; border-radius: 11px !important; }

/* ===== RESPONSIVE ===== */
.ns-mobile-menu-button { display: none; }
@media (max-width: 1180px) {
  :root { --ns-sidebar-width: 248px; }
  .panel { margin: 18px; }
  .welcome-panel, .summary-grid { margin: 18px; }
  .module-grid { margin: 0 18px 18px; }
  .settings-grid, .fevrips-settings-grid { margin: 0 18px 18px !important; }
  .alert { margin-inline: 18px; }
}

@media (max-width: 800px) {
  .app-shell,
  .app-shell.ns-sidebar-collapsed { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(294px, 86vw);
    transform: translateX(-103%);
    transition: transform .22s ease;
    box-shadow: 12px 0 38px rgba(5,19,28,.2);
  }
  body.ns-mobile-nav-open .sidebar { transform: translateX(0); }
  body.ns-mobile-nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(5,19,28,.38);
    backdrop-filter: blur(1px);
    z-index: 55;
  }
  body.ns-mobile-nav-open .sidebar { z-index: 70; }
  .ns-mobile-menu-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #fff !important;
    color: #3a505e !important;
    border: 1px solid var(--ns-border) !important;
    box-shadow: var(--ns-shadow-xs) !important;
    margin-right: 10px;
  }
  .topbar { padding: 11px 14px; min-height: 64px; }
  .topbar > div:first-child { display: flex; align-items: center; min-width: 0; }
  .topbar > div:first-child > div { min-width: 0; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 66vw; }
  .top-user { display: none; }
  .panel, .welcome-panel { margin: 12px; padding: 17px; border-radius: 13px !important; }
  .module-grid { margin: 0 12px 12px; grid-template-columns: 1fr; }
  .summary-grid { margin: 12px; grid-template-columns: 1fr; }
  .settings-grid, .fevrips-settings-grid { margin: 0 12px 12px !important; grid-template-columns: 1fr !important; }
  .alert { margin: 10px 12px; }
  .grid-form, .form-grid { grid-template-columns: 1fr !important; }
  .form-actions { justify-content: stretch; }
  .form-actions > * { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ========================================================================== */
/* NexSalud Enterprise UI v2 — product layer                                  */
/* ========================================================================== */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ns-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ns-primary-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.ns-eyebrow.light { color: rgba(229,246,255,.78); }

/* ===== Page identity / breadcrumb ===== */
.ns-page-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ns-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  color: #83939e;
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ns-breadcrumb span { white-space: nowrap; }
.ns-breadcrumb i {
  width: 4px;
  height: 4px;
  border-right: 1px solid #a8b4bc;
  border-top: 1px solid #a8b4bc;
  transform: rotate(45deg);
  flex: 0 0 4px;
}

.topbar { gap: 16px; }
.topbar > div:first-child { flex: 1 1 auto; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(800px, 70vw); }

.ns-topbar-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.ns-topbar-tool {
  height: 34px;
  min-height: 34px !important;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ns-border) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #526572 !important;
  box-shadow: var(--ns-shadow-xs) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
}
.ns-topbar-tool:hover { background: #f7fafb !important; border-color: #c6d3dc !important; }
.ns-topbar-tool svg { width: 14px; height: 14px; }
.ns-topbar-tool kbd {
  border: 1px solid #d7e0e6;
  border-bottom-width: 2px;
  background: #f6f8fa;
  border-radius: 5px;
  color: #7b8b96;
  font: 700 9px/1 "Segoe UI", sans-serif;
  padding: 3px 4px;
}

/* ===== Density modes ===== */
.ns-density-compact .panel { padding: 17px; }
.ns-density-compact label { margin-top: 9px; margin-bottom: 4px; }
.ns-density-compact input,
.ns-density-compact select { min-height: 34px; padding-block: 6px; }
.ns-density-compact textarea { min-height: 78px; }
.ns-density-compact th,
.ns-density-compact td { padding: 6px 8px; font-size: 10.75px; }
.ns-density-compact th { font-size: 9px; }
.ns-density-compact .module-card { min-height: 98px; padding: 14px; }
.ns-density-compact .topbar { min-height: 62px; padding-top: 9px; padding-bottom: 9px; }

/* ===== Home / dashboard ===== */
.ns-home-shell {
  padding: 22px;
  display: grid;
  gap: 16px;
}
.ns-home-shell .panel,
.ns-home-shell .welcome-panel,
.ns-home-shell .module-grid { margin: 0 !important; }

.ns-home-hero {
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid #d7e6ef;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 10%, rgba(63,181,229,.18), transparent 32%),
    linear-gradient(135deg, #f8fdff 0%, #f3f9fc 58%, #edf7fb 100%);
  box-shadow: var(--ns-shadow-sm);
  overflow: hidden;
  position: relative;
}
.ns-home-hero::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  right: -78px;
  top: -116px;
  border: 34px solid rgba(13,143,202,.045);
  pointer-events: none;
}
.ns-home-hero-copy { min-width: 0; position: relative; z-index: 1; }
.ns-home-hero h2 {
  margin: 6px 0 7px;
  color: #132b3a;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.ns-home-hero p {
  max-width: 790px;
  margin: 0;
  color: #5d7180;
  font-size: 12.5px;
  line-height: 1.55;
}
.ns-home-hero p strong { color: #2c4352; }
.ns-home-session-card {
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(203,222,233,.94);
  border-radius: 13px;
  box-shadow: var(--ns-shadow-xs);
  position: relative;
  z-index: 1;
}
.ns-live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #27a66f;
  box-shadow: 0 0 0 4px rgba(39,166,111,.11);
}
.ns-home-session-card small,
.ns-home-session-card strong { display: block; }
.ns-home-session-card small { color: #7c8e99; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.ns-home-session-card strong { margin-top: 2px; color: #234536; font-size: 11.5px; }

.ns-home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ns-home-stats article {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--ns-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ns-shadow-xs);
}
.ns-home-stat-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ns-primary-soft);
  color: var(--ns-primary-strong);
}
.ns-home-stat-icon svg { width: 18px; height: 18px; }
.ns-home-stats article > div { min-width: 0; }
.ns-home-stats small,
.ns-home-stats strong,
.ns-home-stats article span:last-child { display: block; }
.ns-home-stats small { color: #788995; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.ns-home-stats strong { margin: 1px 0; color: #1b3443; font-size: 18px; line-height: 1.2; font-weight: 760; letter-spacing: -.025em; }
.ns-home-stats article span:last-child { overflow: hidden; color: #8997a0; font-size: 9.8px; white-space: nowrap; text-overflow: ellipsis; }

.ns-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
}
.ns-home-main {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--ns-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ns-shadow-xs);
}
.ns-home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.ns-home-section-head h2 { margin: 3px 0 3px; color: #1b303d; font-size: 17px; font-weight: 740; letter-spacing: -.018em; }
.ns-home-section-head p { margin: 0; color: var(--ns-muted); font-size: 10.8px; }
.ns-home-module-search { margin: 0; width: min(260px, 34vw); }
.ns-home-module-search input {
  min-height: 36px;
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237a8a94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.7-3.7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
}
.ns-home-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 11px !important;
}
.ns-home-module-card {
  min-height: 126px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 13px;
  box-shadow: none;
}
.ns-home-module-card .module-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 11px;
  font-size: 18px;
}
.ns-home-module-card .module-icon svg { width: 20px; height: 20px; }
.ns-home-module-copy { min-width: 0; display: flex; flex-direction: column; min-height: 92px; }
.ns-home-module-copy h3 { margin-top: 0; }
.ns-home-module-copy p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ns-module-open {
  margin-top: auto;
  color: #4f6d7e;
  font-size: 9.8px;
  font-weight: 750;
  opacity: .8;
}
.ns-home-module-card:hover .ns-module-open { color: var(--ns-primary-strong); opacity: 1; }
.ns-home-module-card[hidden] { display: none !important; }

.ns-home-side { min-width: 0; display: grid; gap: 16px; }
.ns-home-news { padding: 18px !important; }
.ns-home-news .section-heading-row { align-items: flex-start; }
.ns-home-news .section-heading-row h2 { margin-top: 3px; }
.ns-home-news-list { max-height: 520px; overflow: auto; padding-right: 2px; }
.ns-home-news .news-item { padding: 13px !important; }
.ns-home-news .news-item h3 { margin: 5px 0 4px; font-size: 12px; }
.ns-home-news .news-item p { font-size: 10.5px; line-height: 1.5; }
.ns-home-productivity { padding: 18px !important; }
.ns-home-productivity h2 { margin: 3px 0 12px; }
.ns-home-shortcuts { display: grid; gap: 8px; }
.ns-home-shortcuts > div {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid #e6edf1;
  border-radius: 9px;
  background: #fafcfd;
}
.ns-home-shortcuts kbd {
  min-width: 24px;
  padding: 4px 5px;
  border: 1px solid #d5dfe5;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: #566b78;
  font: 750 9px/1 "Segoe UI", sans-serif;
  text-align: center;
}
.ns-home-shortcuts span { margin-left: 3px; color: #687985; font-size: 10.5px; }

/* ===== Authentication ===== */
.ns-auth-page {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: stretch;
  background: #eef4f7;
}
.ns-auth-shell {
  width: min(1120px, calc(100vw - 48px));
  min-height: min(680px, calc(100vh - 48px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(400px, 1.05fr);
  border: 1px solid #d6e1e7;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(9,34,49,.14);
  overflow: hidden;
}
.ns-auth-brand-panel {
  min-width: 0;
  padding: 34px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(74,190,236,.22), transparent 31%),
    radial-gradient(circle at 5% 92%, rgba(39,143,188,.16), transparent 28%),
    linear-gradient(155deg, #102b3c 0%, #0b2130 48%, #081923 100%);
  position: relative;
  overflow: hidden;
}
.ns-auth-brand-panel::after {
  content: "";
  width: 330px;
  height: 330px;
  position: absolute;
  right: -205px;
  bottom: -190px;
  border: 52px solid rgba(80,191,235,.06);
  border-radius: 50%;
  pointer-events: none;
}
.ns-auth-brand-lockup { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.ns-auth-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 1px rgba(255,255,255,.1);
}
.ns-auth-logo img { width: 38px; height: 38px; object-fit: contain; }
.ns-auth-logo span { font-size: 12px; font-weight: 850; }
.ns-auth-brand-lockup > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.ns-auth-product-label { color: rgba(225,239,247,.65); font-size: 8.5px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.ns-auth-brand-lockup strong { margin-top: 2px; color: #fff; font-size: 17px; letter-spacing: -.018em; }
.ns-auth-brand-copy { margin: auto 0; max-width: 470px; position: relative; z-index: 1; }
.ns-auth-brand-copy h1 { margin: 8px 0 14px; color: #fff; font-size: clamp(28px, 3.1vw, 42px); line-height: 1.08; letter-spacing: -.045em; font-weight: 730; }
.ns-auth-brand-copy p { margin: 0; color: rgba(223,237,245,.72); font-size: 12.5px; line-height: 1.65; }
.ns-auth-brand-foot { display: flex; align-items: center; gap: 10px; color: rgba(220,235,243,.66); font-size: 9.5px; position: relative; z-index: 1; }
.ns-auth-brand-foot .ns-live-dot { background: #5ed09a; box-shadow: 0 0 0 4px rgba(94,208,154,.11); }
.ns-auth-form-panel { min-width: 0; display: grid; place-items: center; padding: 42px; background: #fff; }
.ns-auth-form-card { width: min(100%, 430px); }
.ns-auth-form-card h2 { margin: 5px 0 5px; color: #172e3d; font-size: 27px; font-weight: 750; letter-spacing: -.035em; }
.ns-auth-form-card > .muted { margin: 0 0 22px; font-size: 11.5px; }
.ns-auth-form-card .alert { margin: 0 0 11px; }
.ns-auth-form { display: grid; gap: 12px; }
.ns-auth-form > div > label { margin-top: 0; }
.ns-auth-form input,
.ns-auth-form select { min-height: 44px; border-radius: 10px; }
.ns-auth-submit { width: 100%; min-height: 44px !important; margin-top: 4px; font-size: 12px !important; }
.ns-auth-security-note { margin: 16px 0 0; color: #85949e; font-size: 9.7px; line-height: 1.5; text-align: center; }
.ns-auth-mobile-brand { display: none; }
.ns-auth-secondary-actions { margin-top: 16px; padding-top: 15px; border-top: 1px solid #edf1f3; display: flex; gap: 8px; flex-wrap: wrap; }
.ns-auth-secondary-actions form { margin: 0; }
.ns-center-select-card { width: min(100%, 470px); }

/* ===== Enterprise table affordances ===== */
.ns-table-shell { position: relative; }
.ns-table-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 26px;
  margin: 0 0 7px;
  color: #82919b;
  font-size: 9.5px;
  font-weight: 650;
}
.ns-table-info span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #e0e7eb;
  border-radius: 999px;
  background: #f8fafb;
}
.ns-table-info button {
  min-height: 26px !important;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #dfe7ec !important;
  background: #fff !important;
  color: #687a86 !important;
  box-shadow: none !important;
  font-size: 9.5px !important;
}
.ns-table-info button:hover { background: #f6f9fa !important; }
.table-wrap.ns-wide-grid table { min-width: 920px; }
.table-wrap.ns-action-grid th:last-child,
.table-wrap.ns-action-grid td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -8px 0 14px rgba(31,50,63,.025);
}
.table-wrap.ns-action-grid th:last-child { z-index: 3; background: #f7f9fb; }
.table-wrap.ns-action-grid td:last-child { background: #fff; }
.table-wrap.ns-action-grid tbody tr:hover td:last-child { background: #f8fbfd; }

/* ===== Global enterprise confirmation modal ===== */
.ns-modal-open { overflow: hidden; }
.ns-confirm-modal,
.ns-command-palette { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
/* Confirmations must always stay above nested operational modals (drafts, evidence, integrations). */
.ns-confirm-modal { z-index: 12000; }
.ns-confirm-modal[hidden],
.ns-command-palette[hidden] { display: none !important; }
.ns-modal-backdrop { position: absolute; inset: 0; background: rgba(4,17,25,.46); backdrop-filter: blur(4px); opacity: 0; transition: opacity .14s ease; }
.ns-confirm-dialog,
.ns-command-dialog {
  width: min(100%, 470px);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(218,228,234,.96);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(4,23,35,.25);
  overflow: hidden;
  transform: translateY(8px) scale(.985);
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
}
.ns-confirm-modal.is-open .ns-modal-backdrop,
.ns-command-palette.is-open .ns-modal-backdrop { opacity: 1; }
.ns-confirm-modal.is-open .ns-confirm-dialog,
.ns-command-palette.is-open .ns-command-dialog { opacity: 1; transform: translateY(0) scale(1); }
.ns-confirm-body { padding: 22px 22px 18px; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 14px; }
.ns-confirm-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ns-warning-soft);
  color: var(--ns-warning);
}
.ns-confirm-icon.danger { background: var(--ns-danger-soft) !important; color: var(--ns-danger) !important; }
.ns-confirm-icon svg { width: 20px; height: 20px; }
.ns-confirm-copy { min-width: 0; }
.ns-confirm-kicker { display: block; margin: 1px 0 3px; color: #84939d; font-size: 8.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ns-confirm-copy h3 { margin: 0 0 7px; color: #1c303d; font-size: 17px; font-weight: 740; letter-spacing: -.02em; }
.ns-confirm-copy p { margin: 0; color: #627582; font-size: 11.5px; line-height: 1.55; white-space: pre-line; }
.ns-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid #e9eef1; background: #fafcfd; }
.ns-confirm-actions button { min-width: 92px; }
.ns-confirm-proceed.danger { background: linear-gradient(180deg,#c84250,#ad2f3e) !important; border-color: #a62b39 !important; }

/* ===== Command palette ===== */
.ns-command-palette { align-items: start; padding-top: min(15vh, 130px); }
.ns-command-dialog { width: min(100%, 620px); }
.ns-command-head { padding: 13px; border-bottom: 1px solid #e8eef1; }
.ns-command-search-wrap { position: relative; }
.ns-command-search-wrap svg { width: 17px; height: 17px; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #7b8d98; }
.ns-command-search {
  width: 100%;
  min-height: 44px;
  padding-left: 39px;
  border: 0 !important;
  background: #f7f9fb !important;
  box-shadow: inset 0 0 0 1px #e0e7eb !important;
  font-size: 12.5px;
}
.ns-command-search:focus { box-shadow: inset 0 0 0 1px var(--ns-primary), 0 0 0 3px var(--ns-primary-ring) !important; }
.ns-command-results { max-height: min(55vh, 460px); overflow: auto; padding: 7px; }
.ns-command-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #314753 !important;
  box-shadow: none !important;
  text-align: left;
}
.ns-command-item:hover,
.ns-command-item.is-active { background: #eef8fc !important; }
.ns-command-item-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #edf4f7; color: #477084; }
.ns-command-item-icon svg { width: 15px; height: 15px; }
.ns-command-item-copy { min-width: 0; }
.ns-command-item-copy strong,
.ns-command-item-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ns-command-item-copy strong { color: #263d4b; font-size: 11.5px; }
.ns-command-item-copy small { margin-top: 2px; color: #8a98a1; font-size: 9px; }
.ns-command-item > span:last-child { color: #9aa6ae; font-size: 15px; }
.ns-command-empty { padding: 30px 20px; color: #85939c; font-size: 11px; text-align: center; }
.ns-command-foot { display: flex; align-items: center; gap: 12px; padding: 9px 13px; border-top: 1px solid #e8eef1; background: #fafcfd; color: #86949d; font-size: 9px; }
.ns-command-foot kbd { padding: 3px 5px; border: 1px solid #d9e1e6; border-bottom-width: 2px; border-radius: 5px; background: #fff; font: 700 8px/1 "Segoe UI", sans-serif; color: #657781; }

/* ===== Better statuses ===== */
.status::before,
.cartera-state::before,
.fevrips-state::before,
.mipres-status::before,
.tf-state::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  opacity: .8;
}

/* ===== Responsive v2 ===== */
@media (max-width: 1100px) {
  .ns-home-layout { grid-template-columns: 1fr; }
  .ns-home-side { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr); }
  .ns-home-news-list { max-height: 360px; }
  .ns-auth-shell { grid-template-columns: minmax(300px,.9fr) minmax(360px,1.1fr); }
}
@media (max-width: 860px) {
  .ns-home-shell { padding: 16px; }
  .ns-home-stats { grid-template-columns: 1fr; }
  .ns-home-hero { align-items: flex-start; flex-direction: column; }
  .ns-home-session-card { min-width: 0; width: 100%; }
  .ns-home-side { grid-template-columns: 1fr; }
  .ns-auth-shell { width: min(100% - 24px, 560px); min-height: 0; margin: 12px auto; grid-template-columns: 1fr; border-radius: 20px; }
  .ns-auth-brand-panel { display: none; }
  .ns-auth-form-panel { padding: 32px 26px; }
  .ns-auth-mobile-brand { margin-bottom: 28px; display: flex; align-items: center; gap: 10px; }
  .ns-auth-mobile-brand strong { color: #1d3848; font-size: 15px; }
}
@media (max-width: 640px) {
  .ns-home-shell { padding: 12px; gap: 12px; }
  .ns-home-hero { padding: 20px; border-radius: 15px; }
  .ns-home-hero h2 { font-size: 22px; }
  .ns-home-main { padding: 15px; }
  .ns-home-section-head { align-items: stretch; flex-direction: column; }
  .ns-home-module-search { width: 100%; }
  .ns-home-module-grid { grid-template-columns: 1fr; }
  .ns-topbar-tool .ns-tool-label,
  .ns-topbar-tool kbd { display: none; }
  .ns-topbar-tool { width: 34px; padding: 0; }
  .top-user { max-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .ns-confirm-modal,
  .ns-command-palette { padding: 12px; }
  .ns-command-palette { padding-top: 70px; }
  .ns-confirm-body { grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 18px 16px 15px; }
  .ns-confirm-icon { width: 34px; height: 34px; }
  .ns-confirm-actions { padding: 11px 13px; }
  .ns-auth-form-panel { padding: 27px 20px; }
  .ns-auth-form-card h2 { font-size: 24px; }
}

/* ===== Cross-module ERP polish ===== */
.stats-grid,
.cartera-kpis,
.global-kpi-grid,
.ops-kpis,
.cm-kpi-grid,
.mipres-mini-kpis,
.summary-grid,
.package-summary,
.db-kpis {
  gap: 10px !important;
}

.stats-grid > *,
.cartera-kpis > article,
.global-kpi-grid > article,
.ops-kpis > *,
.cm-kpi-grid > *,
.mipres-mini-kpis > *,
.summary-grid > *,
.package-summary > *,
.db-kpis > * {
  border: 1px solid var(--ns-border) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #fff, #fbfdfe) !important;
  box-shadow: var(--ns-shadow-xs) !important;
}

.cartera-kpis > article {
  border-top-width: 1px !important;
  padding: 15px !important;
}
.cartera-kpis > article::before,
.global-kpi-grid > article::before,
.cm-kpi-grid > *::before {
  content: "";
  display: block;
  width: 26px;
  height: 3px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #52b4dd;
  opacity: .85;
}
.cartera-kpis > article:nth-child(2)::before { background: #4ea77d; }
.cartera-kpis > article:nth-child(3)::before { background: #668ec8; }
.cartera-kpis > article:nth-child(4)::before { background: #d6a64c; }
.cartera-kpis > article:nth-child(5)::before { background: #c96a72; }

.cartera-kpis span,
.global-kpi-grid span,
.ops-kpis span,
.cm-kpi-grid span,
.mipres-mini-kpis span,
.package-summary span,
.db-kpis span,
.summary-grid span {
  color: #7d8c96 !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: .065em !important;
  text-transform: uppercase !important;
}
.cartera-kpis strong,
.global-kpi-grid strong,
.ops-kpis strong,
.cm-kpi-grid strong,
.mipres-mini-kpis strong,
.package-summary strong,
.db-kpis strong,
.summary-grid strong {
  color: #1d3341 !important;
  font-weight: 760 !important;
  letter-spacing: -.025em !important;
}

/* Tool/filter bars should read like an enterprise command strip rather than a form card. */
.search-row,
.filter-bar,
.cartera-filter-bar,
.tf-global-search,
.inline-filter,
.filters-row {
  border-color: var(--ns-border) !important;
}
.search-row,
.filter-bar,
.cartera-filter-bar {
  align-items: end;
  gap: 9px !important;
}
.search-row input,
.search-row select,
.filter-bar input,
.filter-bar select,
.cartera-filter-bar input,
.cartera-filter-bar select { min-height: 36px; }

/* Process flows / step strips */
.mipres-flow,
.cartera-flow,
.fevrips-flow,
.cm-flow,
.ops-tabs {
  border-color: var(--ns-border) !important;
  box-shadow: none !important;
}
.mipres-flow span,
.cartera-flow span,
.fevrips-flow span,
.cm-flow span {
  font-size: 10px !important;
  font-weight: 720 !important;
}

/* Consistent section dividers and details */
.panel hr { border: 0; border-top: 1px solid #e8eef1; margin: 20px 0; }
details > summary { outline: none; }
.panel details:not(.menu-group):not(.submenu-details) > summary {
  color: #3b5361;
  font-size: 10.5px;
  font-weight: 700;
}
pre,
.json-box {
  border: 1px solid #dce6ec !important;
  border-radius: 10px !important;
  background: #0f1f2a !important;
  color: #dceaf2 !important;
  font-size: 10.5px !important;
  line-height: 1.55 !important;
}
code {
  border-radius: 5px;
  background: #f1f5f7;
  color: #39576a;
  padding: 2px 5px;
  font-size: .92em;
}
pre code { background: transparent; color: inherit; padding: 0; }

/* Form sections and upload controls */
input[type="file"] {
  padding: 6px 8px;
  background: #fbfcfd;
}
input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 7px 10px;
  border: 1px solid #d2dde4;
  border-radius: 7px;
  background: #fff;
  color: #435b69;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #f4f8fa; }

/* Stronger action hierarchy inside rows */
td .inline-actions { flex-wrap: nowrap; }
td .inline-actions form { margin: 0; }
td .inline-actions .button-link,
td .inline-actions button { white-space: nowrap; }

/* Cards selected / focused by domain workflows */
.selected-row td,
tr.selected td { background: #eef8fc !important; }
.selected-row td:first-child,
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--ns-primary); }

@media (max-width: 760px) {
  td .inline-actions { flex-wrap: wrap; }
}

/* FEV-RIPS configuration status panel */
.fevrips-status-panel { align-self: start; }
.fevrips-status-panel > h2 { margin: 3px 0 4px; }
.ns-integration-status-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.ns-integration-status-list > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 11px;
  border: 1px solid #e2eaee;
  border-radius: 10px;
  background: #fafcfd;
}
.ns-integration-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #98a7b1;
  box-shadow: 0 0 0 3px rgba(152,167,177,.11);
}
.ns-integration-dot.configured { background: #3b9cc5; box-shadow: 0 0 0 3px rgba(59,156,197,.11); }
.ns-integration-dot.ready { background: #2b9b6d; box-shadow: 0 0 0 3px rgba(43,155,109,.11); }
.ns-integration-dot.pending { background: #d29a31; box-shadow: 0 0 0 3px rgba(210,154,49,.12); }
.ns-integration-status-list small,
.ns-integration-status-list strong,
.ns-integration-status-list div > span { display: block; }
.ns-integration-status-list small { color: #81909a; font-size: 8.5px; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.ns-integration-status-list strong { margin-top: 1px; color: #2a414f; font-size: 11px; }
.ns-integration-status-list div > span { margin-top: 2px; overflow: hidden; color: #84929b; font-size: 9.5px; white-space: nowrap; text-overflow: ellipsis; }
.ns-integration-actions { display: grid; gap: 8px; margin-top: 14px; }
.ns-integration-actions form { margin: 0; }
.ns-integration-actions button { width: 100%; }

/* ========================================================================== */
/* NexSalud Enterprise UI v3 — workspaces, module dashboards and data grids   */
/* ========================================================================== */

/* ---- Module hero / high-level context ----------------------------------- */
.ns-module-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  min-height: 168px;
  padding: 26px 28px;
  border-color: #dce8ef;
  background:
    radial-gradient(circle at 88% 12%, rgba(31, 159, 214, .12), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fbfdff 58%, #f4faff 100%);
  box-shadow: var(--ns-shadow-sm);
}
.ns-module-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  bottom: -130px;
  border-radius: 50%;
  border: 34px solid rgba(13,143,202,.045);
  pointer-events: none;
}
.ns-module-hero-main { position: relative; z-index: 1; max-width: 980px; }
.ns-module-hero .ns-eyebrow,
.ns-workspace-panel .ns-eyebrow,
.ns-status-panel .ns-eyebrow,
.ns-action-panel .ns-eyebrow,
.ns-dashboard-two-col .ns-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--ns-primary-strong);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
}
.ns-module-hero h2 {
  margin: 0;
  max-width: 900px;
  color: #122836;
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1.12;
  letter-spacing: -.025em;
}
.ns-module-hero p {
  max-width: 900px;
  margin: 10px 0 0;
  color: #536776;
  font-size: 14px;
  line-height: 1.58;
}
.ns-module-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}
.ns-module-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #dce8ef;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #657785;
  font-size: 11.5px;
  box-shadow: var(--ns-shadow-xs);
}
.ns-module-hero-meta b { color: #243946; font-weight: 750; }
.ns-module-hero-badge,
.ns-env-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #d8e7ee;
  border-radius: 12px;
  background: rgba(255,255,255,.84);
  color: #405563;
  box-shadow: var(--ns-shadow-xs);
}
.ns-module-hero-badge strong { font-size: 11.5px; white-space: nowrap; }
.ns-module-hero-badge.is-ready { border-color: #cce9dc; background: #f4fbf7; color: var(--ns-success); }
.ns-module-hero-badge.is-pending { border-color: #ecdcae; background: #fffbef; color: var(--ns-warning); }
.ns-env-badge > div { display: flex; flex-direction: column; line-height: 1.15; }
.ns-env-badge small { color: #718490; font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; }
.ns-env-badge strong { margin-top: 3px; font-size: 12px; }
.ns-env-badge.is-production { border-color: #cce9dc; background: #f4fbf7; color: var(--ns-success); }
.ns-env-badge.is-training { border-color: #cfe0f2; background: #f4f9ff; color: var(--ns-info); }
.ns-module-hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- Process rail ------------------------------------------------------- */
.ns-process-rail {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 42px minmax(140px, 1fr) 42px minmax(140px, 1fr) 42px minmax(140px, 1fr);
  align-items: center;
  margin: 14px 0 16px;
  padding: 13px 16px;
  border: 1px solid var(--ns-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ns-shadow-xs);
}
.ns-process-rail > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ns-process-rail > div > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e1e8;
  border-radius: 9px;
  background: #f5f8fa;
  color: #6b7c88;
  font-size: 11px;
  font-weight: 800;
}
.ns-process-rail > div.is-done > span { border-color: #bfe4d3; background: var(--ns-success-soft); color: var(--ns-success); }
.ns-process-rail > div div { min-width: 0; display: flex; flex-direction: column; }
.ns-process-rail strong { color: #243946; font-size: 11.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-process-rail small { margin-top: 2px; color: #7a8a95; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-process-rail > i { height: 1px; background: linear-gradient(90deg,#dfe7ed,#bcd2de,#dfe7ed); }

/* ---- KPI system -------------------------------------------------------- */
.ns-kpi-grid { display: grid; gap: 12px; margin: 0 0 16px; }
.ns-kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ns-kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ns-kpi-card {
  position: relative;
  min-width: 0;
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ns-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ns-shadow-xs);
  overflow: hidden;
}
.ns-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--ns-primary);
  opacity: .72;
}
.ns-kpi-card.ns-kpi-success::before { background: var(--ns-success); }
.ns-kpi-card.ns-kpi-danger::before { background: var(--ns-danger); }
.ns-kpi-card.ns-kpi-warning::before { background: #c58918; }
.ns-kpi-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ns-primary-soft);
  color: var(--ns-primary-strong);
}
.ns-kpi-success .ns-kpi-icon { background: var(--ns-success-soft); color: var(--ns-success); }
.ns-kpi-danger .ns-kpi-icon { background: var(--ns-danger-soft); color: var(--ns-danger); }
.ns-kpi-warning .ns-kpi-icon { background: var(--ns-warning-soft); color: var(--ns-warning); }
.ns-kpi-icon svg { width: 19px; height: 19px; }
.ns-kpi-card > div { min-width: 0; display: flex; flex-direction: column; }
.ns-kpi-card small { color: #687b88; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.ns-kpi-card strong { margin-top: 3px; color: #162b38; font-size: 24px; line-height: 1.05; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-kpi-card > div > span { margin-top: 5px; color: #81909a; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Feature / action workspaces -------------------------------------- */
.ns-workspace-panel { padding: 22px; }
.ns-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ns-feature-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ns-feature-card {
  min-width: 0;
  display: flex;
  gap: 13px;
  padding: 16px;
  border: 1px solid #dfe8ed;
  border-radius: 13px;
  background: linear-gradient(180deg,#fff,#fbfdfe);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ns-feature-card:hover { transform: translateY(-2px); border-color: #bcdbe8; background: #fff; box-shadow: var(--ns-shadow-sm); }
.ns-feature-card-primary { border-color: #c6e5f1; background: linear-gradient(180deg,#f7fcff,#fff); }
.ns-feature-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ns-primary-soft);
  color: var(--ns-primary-strong);
}
.ns-feature-icon svg { width: 20px; height: 20px; }
.ns-feature-card > div { min-width: 0; }
.ns-feature-kicker { color: #7a8d99; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .065em; }
.ns-feature-card h3 { margin: 2px 0 5px; color: #1d3340; font-size: 14px; }
.ns-feature-card p { min-height: 43px; margin: 0 0 10px; color: #687b88; font-size: 11.5px; line-height: 1.42; }
.ns-feature-card b { display: inline-flex; align-items: center; gap: 5px; color: var(--ns-primary-strong); font-size: 10.5px; }
.ns-feature-card b i { font-style: normal; transition: transform .15s ease; }
.ns-feature-card:hover b i { transform: translateX(3px); }

.ns-info-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 17px;
  background: #fbfdff;
}
.ns-info-strip-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; background: #eef7fb; color: var(--ns-primary-strong); }
.ns-info-strip-icon svg { width: 17px; height: 17px; }
.ns-info-strip strong { color: #273d4a; font-size: 11.5px; }
.ns-info-strip p { margin: 2px 0 0; color: #6f808c; font-size: 11px; }

/* ---- Integration status panels ---------------------------------------- */
.ns-workspace-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; margin-bottom: 16px; }
.ns-status-list { display: grid; gap: 0; border: 1px solid var(--ns-border); border-radius: 12px; overflow: hidden; }
.ns-status-list > div { min-height: 55px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: #fff; border-bottom: 1px solid #edf1f4; }
.ns-status-list > div:last-child { border-bottom: 0; }
.ns-status-list > div > div { min-width: 0; display: flex; flex-direction: column; }
.ns-status-list small { color: #778995; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.ns-status-list strong { margin-top: 2px; color: #2a3e4a; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #a9b5bd; box-shadow: 0 0 0 4px rgba(169,181,189,.12); }
.ns-status-dot.is-on { background: #1a9a6b; box-shadow: 0 0 0 4px rgba(26,154,107,.12); }
.ns-status-dot.is-warn { background: #d39a23; box-shadow: 0 0 0 4px rgba(211,154,35,.12); }
.ns-status-dot.is-off { background: #d1535f; box-shadow: 0 0 0 4px rgba(209,83,95,.12); }
.ns-quick-action-grid { display: grid; gap: 9px; }
.ns-quick-action-grid > a {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid #e0e8ed;
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.ns-quick-action-grid > a:hover { transform: translateX(2px); border-color: #b9dce9; background: #f9fdff; }
.ns-quick-action-grid > a > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--ns-primary-soft); color: var(--ns-primary-strong); }
.ns-quick-action-grid > a svg { width: 18px; height: 18px; }
.ns-quick-action-grid > a > div { min-width: 0; display: flex; flex-direction: column; }
.ns-quick-action-grid strong { color: #263b48; font-size: 11.5px; }
.ns-quick-action-grid small { margin-top: 2px; color: #778895; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-quick-action-grid i { color: #87a2b1; font-style: normal; font-size: 17px; }

/* ---- MIPRES service cards --------------------------------------------- */
.ns-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ns-service-card { min-height: 215px; display: flex; flex-direction: column; }
.ns-service-head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.ns-service-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--ns-primary-soft); color: var(--ns-primary-strong); }
.ns-service-icon svg { width: 20px; height: 20px; }
.ns-service-head h2 { margin: 1px 0 0; font-size: 15px; }
.ns-service-card > p { flex: 1; margin: 14px 0 16px; color: #697c88; font-size: 11.5px; line-height: 1.5; }
.ns-service-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ns-state-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; background: #eef2f5; color: #61727e; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.ns-state-chip.is-success { background: var(--ns-success-soft); color: var(--ns-success); }
.ns-state-chip.is-warning { background: var(--ns-warning-soft); color: var(--ns-warning); }
.ns-state-chip.is-danger { background: var(--ns-danger-soft); color: var(--ns-danger); }
.ns-state-chip.is-info { background: var(--ns-info-soft); color: var(--ns-info); }
.ns-connection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--ns-border); border-radius: 12px; overflow: hidden; }
.ns-connection-grid > div { min-width: 0; padding: 12px 13px; background: #fff; border-right: 1px solid #edf1f4; }
.ns-connection-grid > div:last-child { border-right: 0; }
.ns-connection-grid small { display: block; color: #7b8b96; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.ns-connection-grid strong { display: block; margin-top: 4px; color: #2b3f4b; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Dashboard split --------------------------------------------------- */
.ns-dashboard-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---- Enterprise data grid toolbar ------------------------------------- */
.ns-grid-shell { position: relative; }
.ns-grid-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin: 8px 0 8px;
  padding: 6px 8px;
  border: 1px solid #e0e8ed;
  border-radius: 10px;
  background: #f9fbfc;
}
.ns-grid-toolbar-left,
.ns-grid-toolbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ns-grid-records { color: #687a86; font-size: 10.5px; white-space: nowrap; }
.ns-grid-records strong { color: #304652; font-weight: 800; }
.ns-grid-search {
  width: min(280px, 34vw);
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 10px 0 31px !important;
  border-radius: 8px !important;
  border: 1px solid #d9e3e9 !important;
  background-color: #fff !important;
  background-repeat: no-repeat !important;
  background-position: 9px center !important;
  background-size: 14px !important;
  font-size: 11px !important;
}
.ns-grid-tool {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #d9e3e9;
  border-radius: 8px;
  background: #fff;
  color: #536774;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}
.ns-grid-tool:hover { border-color: #bbd7e3; color: var(--ns-primary-strong); background: #fbfeff; }
.ns-grid-tool svg { width: 14px; height: 14px; }
.ns-grid-tool.is-active { border-color: #a9d4e5; background: var(--ns-primary-soft); color: var(--ns-primary-strong); }
.ns-grid-column-menu {
  position: absolute;
  right: 8px;
  top: 49px;
  z-index: 30;
  width: min(290px, calc(100vw - 40px));
  max-height: 330px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d7e2e8;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--ns-shadow-md);
}
.ns-grid-column-menu[hidden] { display: none !important; }
.ns-grid-column-menu > strong { display: block; padding: 4px 5px 7px; color: #304652; font-size: 10.5px; }
.ns-grid-column-menu label { min-height: 31px; display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; color: #536774; font-size: 10.5px; cursor: pointer; }
.ns-grid-column-menu label:hover { background: #f4f8fa; }
.ns-grid-column-menu input { width: 14px !important; height: 14px !important; min-height: 14px !important; margin: 0; }
[data-ns-col-hidden="1"] { display: none !important; }
.ns-grid-no-results { display: none; padding: 24px 16px; text-align: center; color: #7c8c97; font-size: 11px; }
.ns-grid-no-results.is-visible { display: block; }

/* high-density grid treatment */
.table-wrap[data-ns-grid-v3="1"],
.cm-scroll-table[data-ns-grid-v3="1"] {
  border: 1px solid #dce5eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--ns-shadow-xs);
}
.table-wrap[data-ns-grid-v3="1"] table,
.cm-scroll-table[data-ns-grid-v3="1"] table { margin: 0; border: 0; }
.table-wrap[data-ns-grid-v3="1"] thead th,
.cm-scroll-table[data-ns-grid-v3="1"] thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 39px;
  background: #f4f7f9;
  color: #4e626f;
  border-bottom: 1px solid #dbe4e9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.table-wrap[data-ns-grid-v3="1"] tbody td,
.cm-scroll-table[data-ns-grid-v3="1"] tbody td { border-bottom-color: #edf1f4; font-size: 11.5px; vertical-align: middle; }
.table-wrap[data-ns-grid-v3="1"] tbody tr:hover td,
.cm-scroll-table[data-ns-grid-v3="1"] tbody tr:hover td { background: #f9fcfd; }
.ns-grid-numeric { text-align: right !important; font-variant-numeric: tabular-nums; }
.ns-grid-code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 10.5px !important; }

/* Focus mode for data-heavy work */
body.ns-grid-focus-open { overflow: hidden; }
.ns-grid-focus-backdrop { position: fixed; inset: 0; z-index: 190; background: rgba(6,18,26,.48); backdrop-filter: blur(2px); }
.panel.ns-grid-focus,
section.ns-grid-focus {
  position: fixed !important;
  inset: 18px 22px 18px calc(var(--ns-sidebar-width) + 22px) !important;
  z-index: 200 !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  max-width: none !important;
  max-height: none !important;
  overflow: hidden !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.24) !important;
}
.ns-sidebar-collapsed .panel.ns-grid-focus,
.ns-sidebar-collapsed section.ns-grid-focus { left: calc(var(--ns-sidebar-collapsed) + 22px) !important; }
.ns-grid-focus .table-wrap,
.ns-grid-focus .cm-scroll-table { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow: auto !important; }
.ns-grid-focus .ns-grid-toolbar { flex: 0 0 auto; }

/* Auto-normalized state chips generated by v3 JS */
.ns-auto-state { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: #eef2f5; color: #596d7a; font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.ns-auto-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .72; }
.ns-auto-state.is-success { background: var(--ns-success-soft); color: var(--ns-success); }
.ns-auto-state.is-warning { background: var(--ns-warning-soft); color: var(--ns-warning); }
.ns-auto-state.is-danger { background: var(--ns-danger-soft); color: var(--ns-danger); }
.ns-auto-state.is-info { background: var(--ns-info-soft); color: var(--ns-info); }
.ns-auto-state.is-neutral { background: #eef2f5; color: #637580; }

/* ---- Module coloring without losing NexSalud identity ------------------ */
body.ns-module-contratacion .topbar { --ns-module-accent: #167cba; }
body.ns-module-cartera .topbar { --ns-module-accent: #147a55; }
body.ns-module-cuentas-medicas .topbar { --ns-module-accent: #1874a5; }
body.ns-module-gestion-operativa .topbar { --ns-module-accent: #6f5fa8; }
body.ns-module-administracion .topbar { --ns-module-accent: #4a6273; }
body[class*="ns-module-"] .topbar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--ns-module-accent, var(--ns-primary));
}
.topbar { position: relative; }

/* ---- Density ----------------------------------------------------------- */
.ns-density-compact .ns-kpi-card { min-height: 88px; padding: 12px 14px; }
.ns-density-compact .ns-module-hero { min-height: 142px; padding: 20px 22px; }
.ns-density-compact .ns-feature-card { padding: 12px; }
.ns-density-compact .ns-service-card { min-height: 190px; }
.ns-density-compact .table-wrap[data-ns-grid-v3="1"] thead th,
.ns-density-compact .cm-scroll-table[data-ns-grid-v3="1"] thead th { height: 32px; padding-top: 5px; padding-bottom: 5px; }
.ns-density-compact .table-wrap[data-ns-grid-v3="1"] tbody td,
.ns-density-compact .cm-scroll-table[data-ns-grid-v3="1"] tbody td { padding-top: 6px; padding-bottom: 6px; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1280px) {
  .ns-kpi-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ns-feature-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-connection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ns-connection-grid > div { border-bottom: 1px solid #edf1f4; }
}
@media (max-width: 1080px) {
  .ns-kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-service-grid { grid-template-columns: 1fr; }
  .ns-workspace-split, .ns-dashboard-two-col { grid-template-columns: 1fr; }
  .ns-process-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .ns-process-rail > i { display: none; }
}
@media (max-width: 800px) {
  .ns-module-hero { flex-direction: column; min-height: 0; padding: 20px; }
  .ns-module-hero h2 { font-size: 23px; }
  .ns-module-hero-badge, .ns-env-badge, .ns-module-hero-actions { align-self: stretch; }
  .ns-module-hero-actions .button-link { flex: 1 1 auto; justify-content: center; }
  .ns-kpi-grid-4, .ns-kpi-grid-5 { grid-template-columns: 1fr 1fr; }
  .ns-feature-grid, .ns-feature-grid-4 { grid-template-columns: 1fr; }
  .ns-process-rail { grid-template-columns: 1fr 1fr; }
  .ns-connection-grid { grid-template-columns: 1fr; }
  .ns-connection-grid > div { border-right: 0; }
  .ns-grid-toolbar { align-items: stretch; flex-direction: column; }
  .ns-grid-toolbar-left, .ns-grid-toolbar-right { width: 100%; }
  .ns-grid-search { width: 100%; }
  .ns-grid-toolbar-left { justify-content: space-between; }
  .ns-grid-toolbar-right { justify-content: flex-end; }
  .panel.ns-grid-focus, section.ns-grid-focus { inset: 10px !important; }
}
@media (max-width: 560px) {
  .ns-kpi-grid-4, .ns-kpi-grid-5 { grid-template-columns: 1fr; }
  .ns-kpi-card { min-height: 90px; }
  .ns-process-rail { grid-template-columns: 1fr; }
  .ns-grid-tool span { display: none; }
}

.ns-grid-filtered-out { display: none !important; }


/* ========================================================================
   NexSalud Enterprise UI v4 — Accounting / Operations / Payments
   ======================================================================== */
.ns-accounting-hero { --ns-domain-accent: #5b7aa1; }
.ns-portfolio-payments-hero { --ns-domain-accent: #2a8a74; }
.ns-accounting-hero::after, .ns-portfolio-payments-hero::after { opacity: .72; }

.ns-master-detail-grid { display:grid; grid-template-columns:minmax(290px,.72fr) minmax(0,1.55fr); gap:14px; align-items:start; margin-bottom:16px; }
.ns-master-detail-grid-wide { grid-template-columns:minmax(320px,.82fr) minmax(0,1.7fr); }
.ns-master-form-panel { position:sticky; top:76px; }
.ns-master-form-panel h2, .ns-master-list-panel h2 { margin-top:4px; }
.ns-compact-master-form { margin-top:16px; }
.ns-compact-master-form .form-grid.two { gap:10px; }
.ns-master-list-panel .table-wrap { max-height:620px; }
.ns-inline-note { display:flex; align-items:flex-start; gap:9px; margin-top:11px; padding:10px 11px; border:1px solid #dfe8ed; border-radius:9px; background:#f8fbfc; color:#667985; }
.ns-inline-note > span { width:20px; height:20px; flex:0 0 20px; color:var(--ns-primary-strong); }
.ns-inline-note svg { width:16px; height:16px; }
.ns-inline-note p { margin:0; font-size:10.5px; line-height:1.45; }

.ns-filter-panel { padding-bottom:14px; }
.ns-filter-grid { display:grid; gap:10px; align-items:end; }
.ns-filter-grid-3 { grid-template-columns:minmax(240px,1.4fr) minmax(160px,.65fr) auto; }
.ns-filter-grid label { margin:0; }
.ns-enterprise-filterbar { margin-top:4px; }

.ns-readiness-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0 0 16px; }
.ns-readiness-grid > article { display:grid; grid-template-columns:38px minmax(0,1fr); gap:11px; align-items:center; min-height:86px; padding:13px 14px; border:1px solid #dfe8ed; border-radius:12px; background:#fff; box-shadow:var(--ns-shadow-xs); }
.ns-readiness-grid > article > span { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; background:#eef4f7; color:#617987; }
.ns-readiness-grid > article > span svg { width:18px; height:18px; }
.ns-readiness-grid article.is-ready { border-color:#d3eadf; background:#fbfefc; }
.ns-readiness-grid article.is-ready > span { background:var(--ns-success-soft); color:var(--ns-success); }
.ns-readiness-grid article.is-missing { border-color:#eed8d9; background:#fffafa; }
.ns-readiness-grid article.is-missing > span { background:var(--ns-danger-soft); color:var(--ns-danger); }
.ns-readiness-grid small { display:block; color:#738591; font-size:9.5px; font-weight:750; text-transform:uppercase; letter-spacing:.045em; }
.ns-readiness-grid strong { display:block; margin-top:2px; color:#223844; font-size:18px; }
.ns-readiness-grid p { margin:2px 0 0; color:#7b8d98; font-size:10.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.ns-process-panel { padding:12px 14px; }
.ns-process-rail-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.ns-form-workspace { border-top:2px solid rgba(29,126,166,.18); }
.ns-account-role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.ns-account-role-grid .cartera-account-card { margin:0; }
.ns-bank-master-form { display:grid; grid-template-columns:minmax(120px,.45fr) minmax(200px,1fr) minmax(200px,.85fr) auto; gap:10px; align-items:end; margin-bottom:14px; }
.ns-bank-master-form > label { margin:0; }

.ops-context-panel { border-top:2px solid rgba(29,126,166,.16); }
.ops-tabs { gap:6px !important; }
.ops-tabs a { min-height:34px; display:inline-flex; align-items:center; padding:7px 10px !important; border:1px solid #dce6eb !important; border-radius:8px !important; background:#fff !important; color:#5e7380 !important; font-size:10.5px !important; font-weight:700 !important; text-decoration:none !important; }
.ops-tabs a:hover { border-color:#bcd7e2 !important; color:var(--ns-primary-strong) !important; background:#f8fcfd !important; }
.ops-tabs a.active { border-color:#a8d2e2 !important; background:var(--ns-primary-soft) !important; color:var(--ns-primary-strong) !important; box-shadow:inset 0 0 0 1px rgba(29,126,166,.04); }

@media (max-width:1180px){
  .ns-master-detail-grid,.ns-master-detail-grid-wide{grid-template-columns:1fr;}
  .ns-master-form-panel{position:static;}
  .ns-bank-master-form{grid-template-columns:1fr 1fr;}
}
@media (max-width:860px){
  .ns-readiness-grid,.ns-process-rail-3{grid-template-columns:1fr;}
  .ns-filter-grid-3,.ns-account-role-grid,.ns-bank-master-form{grid-template-columns:1fr;}
}
.ns-process-rail > div.is-current > span { border-color:#8bc4dc; background:var(--ns-primary-soft); color:var(--ns-primary-strong); box-shadow:0 0 0 3px rgba(29,126,166,.07); }

/* ========================================================================
   NexSalud Enterprise UI v7 — page workspace normalization
   ======================================================================== */
.ns-page-shell{
  width:min(100%,var(--ns-content-max));
  margin:0 auto;
  padding:18px 24px 34px;
  display:grid;
  gap:16px;
  box-sizing:border-box;
}
.ns-page-shell > .panel,
.ns-page-shell > .welcome-panel,
.ns-page-shell > .ns-kpi-grid,
.ns-page-shell > .ns-master-detail-grid,
.ns-page-shell > .ns-readiness-grid,
.ns-page-shell > .alert,
.ns-page-shell > .compact-callout,
.ns-page-shell > .ops-kpis,
.ns-page-shell > .global-kpi-grid{
  margin:0 !important;
}
.ns-page-shell .panel{box-shadow:0 3px 14px rgba(13,30,43,.045)}
.ns-page-shell .panel + .panel{margin-top:0!important}

/* Accounting workspace */
.ns-accounting-page{gap:14px}
.ns-accounting-page .ns-accounting-hero{
  background:
    radial-gradient(circle at 90% 10%,rgba(91,122,161,.09),transparent 29%),
    linear-gradient(135deg,#fff,#f8fbfd 62%,#f4f8fb);
  border-top:3px solid #6c8db1!important;
}
.ns-accounting-page .ns-kpi-grid{gap:12px}
.ns-accounting-page .ns-master-detail-grid{margin:0!important;gap:14px}
.ns-accounting-page .ns-master-form-panel,
.ns-accounting-page .ns-master-list-panel{margin:0!important}
.ns-accounting-page .ns-master-form-panel{
  border-top:3px solid #7392b3!important;
  background:linear-gradient(180deg,#fff,#fbfcfe);
}
.ns-accounting-page .ns-master-list-panel{overflow:hidden}
.ns-accounting-page .ns-master-list-panel .section-heading-row{
  padding-bottom:14px;
  border-bottom:1px solid #e8eef2;
  margin-bottom:2px;
}
.ns-accounting-page .ns-master-list-panel .table-wrap{
  margin:0 -22px;
  border:0;
  border-radius:0;
  max-height:640px;
}
.ns-accounting-page .ns-master-list-panel table{margin:0}
.ns-accounting-page .ns-master-list-panel thead th{
  position:sticky;top:0;z-index:2;
  background:#f6f9fb!important;
  color:#607483!important;
  font-size:10px!important;
  letter-spacing:.065em;
  text-transform:uppercase;
  border-bottom:1px solid #dfe8ed!important;
}
.ns-accounting-page .ns-master-list-panel tbody tr{transition:background .12s ease}
.ns-accounting-page .ns-master-list-panel tbody tr:hover{background:#f8fcfe}
.ns-accounting-page .ns-master-list-panel tbody td{vertical-align:middle}
.ns-accounting-page .count-pill{
  min-width:34px;height:30px;display:inline-grid;place-items:center;
  border-radius:999px;background:#edf5f9;color:#35627a;border:1px solid #d4e4ec;
  font-weight:800;font-size:11px;
}
.ns-accounting-page .accounting-action-edit,
.ns-accounting-page .accounting-action-contacts,
.ns-accounting-page .accounting-action-toggle,
.ns-accounting-page .accounting-action-delete{
  min-height:30px!important;padding:5px 9px!important;border-radius:8px!important;font-size:10.5px!important;
}
.ns-accounting-page .accounting-action-delete{background:#fff6f7!important;color:#a93645!important;border-color:#f0d1d6!important}
.ns-accounting-page .accounting-action-toggle{background:#f7fafb!important;color:#516b7b!important;border-color:#dce6ec!important}
.ns-accounting-page .accounting-action-on{background:#edf8f2!important;color:#18714d!important;border-color:#cfe8dc!important}
.ns-accounting-page .accounting-action-off{background:#fff8ec!important;color:#8d641a!important;border-color:#ecdcb7!important}
.ns-accounting-page .ns-filter-panel{
  padding:16px 18px!important;
  background:linear-gradient(180deg,#fff,#fbfdfe);
}
.ns-accounting-page .ns-filter-grid input,
.ns-accounting-page .ns-filter-grid select{height:42px}

/* Operational workspace */
.ns-operational-page{gap:14px}
.ns-operational-page .ns-ops-hero,
.ns-operational-page .global-ops-hero{
  overflow:hidden;
  background:
    radial-gradient(circle at 92% 8%,rgba(22,144,159,.10),transparent 28%),
    linear-gradient(135deg,#fff,#f7fcfd 62%,#f2f9fa)!important;
  border-top:3px solid #178e9a!important;
  border-left:1px solid var(--ns-border)!important;
}
.ns-operational-page .ns-ops-hero .section-heading-row,
.ns-operational-page .global-ops-hero .section-heading-row{align-items:center}
.ns-operational-page .ops-kicker{color:#107984!important}
.ns-operational-page .ops-tabs{
  padding:5px;
  border:1px solid #dbe7eb;
  background:#f8fbfc;
  border-radius:12px;
  gap:4px!important;
}
.ns-operational-page .ops-tabs a{
  border-color:transparent!important;
  background:transparent!important;
  border-radius:8px!important;
  min-height:34px!important;
}
.ns-operational-page .ops-tabs a:hover{background:#edf7f9!important}
.ns-operational-page .ops-tabs a.active{
  background:#fff!important;
  color:#0d7180!important;
  border-color:#d4e5e9!important;
  box-shadow:0 2px 8px rgba(12,75,85,.08)!important;
}
.ns-operational-page .ns-kpi-grid{gap:12px}
.ns-operational-page .ns-form-workspace{
  border-top:3px solid #2d9ca4!important;
  background:linear-gradient(180deg,#fff,#fbfdfd);
}
.ns-operational-page .ns-readiness-grid{margin:0!important}
.ns-operational-page .ns-readiness-grid > article{min-height:82px}
.ns-operational-page .compact-callout{
  background:linear-gradient(135deg,#fbfdfe,#f3f9fb);
  border-style:dashed!important;
}

/* Operational filters */
.ns-operational-page .ops-filter-bar,
.ns-operational-page .agenda-filter-grid,
.ns-operational-page .global-filter-grid{
  padding:14px;
  border:1px solid #dfe8ed!important;
  border-radius:14px!important;
  background:#f8fbfc!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.ns-operational-page .ops-filter-bar label,
.ns-operational-page .agenda-filter-grid label,
.ns-operational-page .global-filter-grid label{
  display:block;margin:0 0 5px;font-size:10px;font-weight:800;color:#667b87;text-transform:uppercase;letter-spacing:.05em;
}
.ns-operational-page .ops-filter-bar input,
.ns-operational-page .ops-filter-bar select,
.ns-operational-page .agenda-filter-grid select,
.ns-operational-page .global-filter-grid input,
.ns-operational-page .global-filter-grid select{height:40px}

/* Calendar shell */
.ns-operational-page .legacy-fullcalendar-shell,
.ns-operational-page .agenda-calendar-shell{
  border:1px solid #dfe8ed!important;
  border-radius:16px!important;
  background:#fff!important;
  overflow:hidden;
  box-shadow:0 2px 10px rgba(13,30,43,.04);
}
.ns-operational-page .legacy-fc-toolbar{
  margin:0!important;
  padding:12px 14px;
  background:#f8fbfc;
  border-bottom:1px solid #e2eaee;
}
.ns-operational-page .legacy-fc-toolbar h3{font-size:15px!important;color:#263d49;text-transform:capitalize!important}
.ns-operational-page .legacy-fc-toolbar button{
  background:#fff!important;color:#4f6978!important;border:1px solid #d8e4e9!important;
  border-radius:8px!important;padding:7px 10px!important;font-size:11px;font-weight:750;
}
.ns-operational-page .legacy-fc-toolbar button:hover{background:#eef7f9!important;color:#0f7280!important}
.ns-operational-page .legacy-fc-toolbar button.active{background:#e9f6f8!important;color:#0c727e!important;border-color:#bcdce1!important}
.ns-operational-page .legacy-fullcalendar-shell .ops-calendar{padding:0!important;background:#fff!important}
.ns-operational-page .ops-cal-head{background:#f7fafb!important;color:#5c7280!important;border-color:#e3eaee!important}
.ns-operational-page .ops-cal-cell{border-color:#e7edf1!important;min-height:92px!important}
.ns-operational-page .ops-cal-cell:hover{background:#fbfdfe}
.ns-operational-page .cal-event{border-radius:6px!important;padding:4px 6px!important;font-weight:700!important}

/* Task cards */
.ns-operational-page .ops-task-list{display:grid;gap:12px;margin-top:14px}
.ns-operational-page .ops-task-list .ops-task{margin:0!important}
.ns-operational-page .ops-task{
  grid-template-columns:minmax(0,1.55fr) minmax(310px,.72fr)!important;
  border:1px solid #dfe8ed!important;
  border-left:4px solid #d8a43f!important;
  border-radius:16px!important;
  box-shadow:0 3px 12px rgba(13,30,43,.04);
}
.ns-operational-page .ops-task.task-complete{border-left-color:#2d986a!important}
.ns-operational-page .ops-task.task-failed{border-left-color:#ca4e58!important}
.ns-operational-page .ops-task-main{padding:18px 20px!important}
.ns-operational-page .ops-task-log{
  padding:16px!important;
  background:#f8fbfc!important;
  border-left:1px solid #e0e8ed!important;
}
.ns-operational-page .ops-task h3{margin:8px 0 0;font-size:15px;line-height:1.35;color:#203540}
.ns-operational-page .ops-meta{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin:14px 0!important;
}
.ns-operational-page .ops-meta span{
  display:block;padding:9px 10px;border:1px solid #e4ebef;border-radius:9px;background:#fbfdfe;color:#58707e;font-size:11px!important;
}
.ns-operational-page .ops-meta b{display:block;margin-bottom:2px;color:#778a96;font-size:9px;text-transform:uppercase;letter-spacing:.05em}
.ns-operational-page .ops-note{border-left:3px solid #91b7c4!important;background:#f7fafc!important;color:#526b79!important}
.ns-operational-page .ops-actions button,
.ns-operational-page .ops-actions .button-light{min-height:32px!important;border-radius:8px!important;font-size:10.5px!important}
.ns-operational-page .ops-task-log h4{margin:0 0 10px;font-size:12px;text-transform:uppercase;letter-spacing:.055em;color:#617783}
.ns-operational-page .ops-progress-form{min-width:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important}
.ns-operational-page .ops-progress-row{padding:10px!important;border-bottom:1px solid #e8eef1!important}

/* Agenda + global grids */
.ns-operational-page .agenda-table-panel,
.ns-operational-page .global-list-panel{overflow:hidden}
.ns-operational-page .agenda-table-panel .table-wrap,
.ns-operational-page .global-list-panel .table-wrap{margin:0 -22px -4px;border:0;border-radius:0}
.ns-operational-page .agenda-table-panel thead th,
.ns-operational-page .global-list-panel thead th{
  position:sticky;top:0;z-index:2;background:#f7fafb!important;color:#607582!important;
  font-size:10px!important;text-transform:uppercase;letter-spacing:.055em;
}
.ns-operational-page .agenda-table-panel tbody tr:hover,
.ns-operational-page .global-list-panel tbody tr:hover{background:#f8fcfd}
.ns-operational-page .global-access-badge{
  border-color:#cae3e7!important;background:#eff8f9!important;color:#126b73!important;
}
.ns-operational-page .global-security-note{
  background:#f8fbfc!important;border-color:#dce8ec!important;color:#5d707a!important;
}
.ns-operational-page .global-calendar{
  margin-top:14px!important;padding:0!important;border:1px solid #e0e8ed!important;border-radius:14px!important;overflow:hidden;
}
.ns-operational-page .global-calendar .fc{
  --fc-border-color:#e3eaee;
  --fc-page-bg-color:#fff;
  --fc-neutral-bg-color:#f8fbfc;
  --fc-today-bg-color:#f0fafb;
  font-size:12px;
}
.ns-operational-page .global-calendar .fc .fc-toolbar{padding:14px 14px 8px;margin:0!important}
.ns-operational-page .global-calendar .fc .fc-toolbar-title{font-size:16px!important;color:#263b47}
.ns-operational-page .global-calendar .fc .fc-button-primary{
  background:#fff!important;border-color:#d6e2e7!important;color:#506977!important;
  box-shadow:none!important;text-transform:none!important;font-size:11px!important;font-weight:750!important;
}
.ns-operational-page .global-calendar .fc .fc-button-primary:hover,
.ns-operational-page .global-calendar .fc .fc-button-primary.fc-button-active{background:#eaf6f8!important;color:#0d7280!important;border-color:#bcdce1!important}
.ns-operational-page .global-calendar .fc-event{border-radius:5px!important;padding:2px 4px!important;font-weight:700}

@media(max-width:1100px){
  .ns-page-shell{padding:16px 18px 28px}
  .ns-operational-page .ops-task{grid-template-columns:1fr!important}
  .ns-operational-page .ops-task-log{border-left:0!important;border-top:1px solid #e0e8ed!important}
}
@media(max-width:760px){
  .ns-page-shell{padding:12px 12px 22px}
  .ns-operational-page .ops-meta{grid-template-columns:1fr!important}
  .ns-operational-page .legacy-fc-toolbar{grid-template-columns:1fr!important}
  .ns-accounting-page .ns-master-list-panel .table-wrap,
  .ns-operational-page .agenda-table-panel .table-wrap,
  .ns-operational-page .global-list-panel .table-wrap{margin-left:-14px;margin-right:-14px}
}

/* ========================================================================
   NexSalud Enterprise UI v8 — Cuentas Médicas / ADRES / RIPS workspaces
   ======================================================================== */
.ns-kpi-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.ns-medical-workspace,.ns-converter-workspace,.ns-adres-workspace{gap:15px}
.ns-medical-hero,.ns-rips-hero,.ns-adres-hero{
  background:
    radial-gradient(circle at 92% 8%,rgba(26,151,201,.10),transparent 26%),
    linear-gradient(135deg,#fff 0%,#f8fbfd 62%,#f3f9fc 100%);
  border-top:3px solid #208fbd!important;
}
.ns-rips-hero{border-top-color:#387fa6!important}
.ns-adres-hero{border-top-color:#2b8d83!important;background:radial-gradient(circle at 92% 8%,rgba(43,141,131,.10),transparent 26%),linear-gradient(135deg,#fff,#f8fcfb 62%,#f2faf8)}
.ns-standard-card{
  min-width:270px;max-width:340px;padding:17px 18px;border-radius:15px;border:1px solid #d6e6ed;
  background:rgba(255,255,255,.93);display:grid;gap:5px;box-shadow:0 8px 22px rgba(17,48,66,.05)
}
.ns-standard-card small{font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#728594}
.ns-standard-card strong{font-size:15px;color:#173442}
.ns-standard-card span{font-size:11px;line-height:1.4;color:#637884}
.ns-workspace-panel{overflow:hidden}
.ns-source-upload-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:12px}
.ns-source-upload-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.ns-source-upload-card{
  min-height:172px;display:grid;align-content:start;gap:8px;padding:17px;border:1px dashed #b7ceda;border-radius:15px;
  background:linear-gradient(180deg,#fff,#f9fcfd);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease
}
.ns-source-upload-card:hover{border-color:#64b9dc;box-shadow:0 8px 24px rgba(13,143,202,.08);transform:translateY(-1px)}
.ns-source-upload-card-accent{border-color:#b8dcd7;background:linear-gradient(180deg,#fff,#f7fcfb)}
.ns-source-upload-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:#eaf7fc;color:#0e7dab}
.ns-source-upload-icon svg{width:19px;height:19px}
.ns-source-upload-card strong{font-size:15px;color:#18313e}
.ns-source-upload-card>span:not(.ns-source-upload-icon){font-size:12px;line-height:1.4;color:#587080}
.ns-source-upload-card input{width:100%;box-sizing:border-box;margin-top:4px;padding:8px;border:1px solid #d7e3e9;border-radius:9px;background:#fff;font-size:12px}
.ns-source-upload-card small{font-size:10.5px;line-height:1.35;color:#728592}
.ns-source-upload-action{grid-column:1/-1;display:flex;align-items:center;gap:14px;padding-top:2px}
.ns-source-upload-action .btn{min-width:220px}
.ns-source-upload-action span{font-size:11.5px;color:#6d7f8b}
.ns-process-header{
  display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:20px 22px!important;
  background:linear-gradient(180deg,#fff,#fbfdfe);border-top:3px solid #4a91b3!important
}
.ns-process-header h2{margin:4px 0 4px;font-size:21px}
.ns-process-header p{margin:0;max-width:820px}
.ns-process-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:wrap}
.ns-metric-strip{display:grid;grid-template-columns:repeat(9,minmax(88px,1fr));gap:8px;margin:14px 0 16px}
.ns-metric-strip>div{padding:10px 11px;border:1px solid #e0e9ee;border-radius:11px;background:#f9fbfc;min-width:0}
.ns-metric-strip small{display:block;font-size:9px;letter-spacing:.07em;text-transform:uppercase;color:#728592;font-weight:800}
.ns-metric-strip strong{display:block;margin-top:3px;font-size:14px;color:#1d3542;overflow-wrap:anywhere}
.ns-compact-empty{display:grid;justify-items:center;gap:3px;padding:25px 18px;color:#748591;text-align:center}
.ns-compact-empty strong{font-size:14px;color:#334c5a}
.ns-compact-empty span{font-size:12px}
.ns-medical-master-grid{align-items:start}
.ns-context-help-card{margin:0!important;background:linear-gradient(180deg,#fff,#f8fbfd);border-top:3px solid #8fa9b9!important}
.ns-context-help-card h2{margin:5px 0 8px}
.ns-context-help-card p{line-height:1.55;color:#5e7380}
.ns-example-card{display:grid;gap:3px;margin:15px 0;padding:13px;border:1px solid #dce8ed;border-radius:12px;background:#fff}
.ns-example-card small{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#778a96;font-weight:800}
.ns-example-card strong{font-size:14px;color:#18313e}.ns-example-card span{font-size:12px;color:#527080}
.ns-error-count{display:inline-flex;min-width:28px;justify-content:center;padding:3px 7px;border-radius:999px;background:#fff0f2;color:#a52939;font-weight:800}
.ns-danger-zone{
  display:flex;justify-content:space-between;align-items:center;gap:16px;padding:15px 17px;border:1px solid #f0cbd0;border-radius:14px;background:#fff8f9
}
.ns-danger-zone>div{display:grid;gap:2px}.ns-danger-zone strong{font-size:13px;color:#8f2f3b}.ns-danger-zone span{font-size:11px;color:#8b6970}
.ns-code-viewer{border:1px solid #1f3441!important;border-radius:13px!important;background:#0e1820!important;color:#dce8ef!important;box-shadow:inset 0 1px rgba(255,255,255,.03);padding:16px!important;font-size:12px!important;line-height:1.55!important}
.ns-principle-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.ns-principle-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.ns-principle-grid>article{display:flex;gap:12px;align-items:flex-start;padding:15px 16px;border:1px solid #dde8ed;border-radius:14px;background:#fff;box-shadow:0 3px 12px rgba(13,30,43,.035)}
.ns-principle-index{width:34px;height:34px;flex:0 0 34px;border-radius:10px;display:grid;place-items:center;background:#eaf7fc;color:#0c739f;font-size:11px;font-weight:900}
.ns-principle-grid strong{display:block;font-size:13px;color:#203744;margin-bottom:4px}.ns-principle-grid p{margin:0;font-size:11.5px;line-height:1.45;color:#667b88}
.ns-capability-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:4px}
.ns-capability-grid article{display:grid;grid-template-columns:auto 1fr;column-gap:9px;row-gap:3px;padding:13px;border:1px solid #e1eaee;border-radius:12px;background:#fbfdfe}
.ns-capability-grid b{grid-row:1/3;width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:#e8f6f4;color:#217a70;font-size:10px}
.ns-capability-grid strong{font-size:12.5px;color:#243c48}.ns-capability-grid span{font-size:11px;line-height:1.4;color:#687d89}
.ns-adres-route-grid{display:grid;grid-template-columns:minmax(260px,1.1fr) minmax(220px,.75fr) minmax(260px,1fr);gap:12px;margin:14px 0}
.ns-adres-route-grid>label{display:grid;gap:5px;font-size:11.5px;font-weight:750;color:#405663}
.ns-adres-route-grid select,.ns-adres-route-grid input{width:100%;box-sizing:border-box}
.ns-adres-route-grid small{font-weight:400;color:#71838e;line-height:1.35}
.ns-adres-route-note{display:grid;gap:3px;padding:12px 13px;border:1px solid #dce9e5;border-radius:11px;background:#f6fbf9}
.ns-adres-route-note small{font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:#568177;font-weight:850}.ns-adres-route-note strong{font-size:12.5px;color:#315c53}.ns-adres-route-note span{font-size:11px;line-height:1.4;color:#637d76}
.ns-inline-form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.ns-inline-form>label{display:grid;gap:5px;font-size:11px;font-weight:750}.ns-inline-form select{min-width:180px}
.ns-service-review-card{padding:15px!important;background:linear-gradient(180deg,#fff,#fbfdfe)!important}

/* Normalize the large legacy medical forms that still preserve their domain markup. */
.ns-medical-workspace .cm-hero{margin:0!important;border-radius:15px!important;border:1px solid #dce8ee!important;border-top:3px solid #208fbd!important;border-left:1px solid #dce8ee!important;box-shadow:0 3px 14px rgba(13,30,43,.045)!important}
.ns-medical-workspace .cm-security-badge{background:#eef8fc;border-color:#d1e8f1;color:#176b8c;font-size:10.5px}
.ns-medical-workspace .cm-flow{border-radius:12px;background:#f8fbfc;border-color:#dfe9ee}
.ns-medical-workspace .cm-flow span b{background:#218eb9}
.ns-medical-workspace .cm-two-columns{margin:0!important;gap:15px}
.ns-medical-workspace .cm-two-columns>.panel,.ns-medical-workspace>.panel{margin:0!important}
.ns-medical-workspace .cm-config-block{border-radius:13px!important;border-color:#e0e9ee!important;background:#fbfdfe!important}
.ns-medical-workspace .cm-config-block h3{color:#243b47;font-size:14px}
.ns-medical-workspace .cm-special-card,.ns-medical-workspace .cm-compression-card{border-radius:12px!important;border-color:#dce7ec!important;box-shadow:none!important}
.ns-medical-workspace .cm-dropbox{border-radius:14px;border-color:#bcd4df;background:#fbfdfe}
.ns-medical-workspace .cm-dropbox:hover{border-color:#62b9dc;background:#f5fbfe}
.ns-medical-workspace .cm-kpi-grid{margin:0!important}
.ns-medical-workspace .package-summary{border-radius:13px;overflow:hidden;border:1px solid #e0e9ee;background:#fbfdfe}

/* ADRES legacy report / validator markup inside the new workspace. */
.ns-adres-workspace>.report-hero,.ns-adres-workspace>.validator-hero{margin:0!important;border-radius:15px!important;border-top:3px solid #2b8d83!important;background:linear-gradient(135deg,#fff,#f7fcfb)!important}
.ns-adres-workspace>.panel{margin:0!important}
.ns-adres-workspace .report-kpis,.ns-adres-workspace .validator-kpis{gap:10px}
.ns-adres-workspace .report-kpi,.ns-adres-workspace .validator-kpi{border-radius:12px!important;border-color:#dfe9e7!important;background:#fbfdfc!important}

@media(max-width:1280px){
  .ns-metric-strip{grid-template-columns:repeat(5,minmax(90px,1fr))}
  .ns-source-upload-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ns-adres-route-grid{grid-template-columns:1fr 1fr}.ns-adres-route-note{grid-column:1/-1}
  .ns-capability-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1000px){
  .ns-kpi-grid-3,.ns-principle-grid,.ns-principle-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ns-source-upload-grid,.ns-source-upload-grid-3{grid-template-columns:1fr}
  .ns-process-header{flex-direction:column}.ns-process-actions{justify-content:flex-start}
  .ns-standard-card{max-width:none;width:100%;box-sizing:border-box}
}
@media(max-width:760px){
  .ns-kpi-grid-3,.ns-principle-grid,.ns-principle-grid-3,.ns-capability-grid,.ns-adres-route-grid{grid-template-columns:1fr}
  .ns-metric-strip{grid-template-columns:repeat(2,minmax(90px,1fr))}
  .ns-source-upload-action,.ns-danger-zone{align-items:stretch;flex-direction:column}
  .ns-source-upload-action .btn{width:100%;min-width:0}
  .ns-adres-route-note{grid-column:auto}
}

/* ===== V9 · ADMINISTRACIÓN, TRAZABILIDAD Y CARTERA ===== */
.ns-admin-page,
.ns-trace-page,
.ns-portfolio-page{max-width:var(--ns-content-max);margin:0 auto;}
.ns-admin-page .ns-module-hero,
.ns-trace-page .ns-module-hero,
.ns-portfolio-page .ns-module-hero{margin:0!important;}
.ns-admin-form-panel,.ns-admin-list-panel{overflow:hidden}
.ns-admin-form-panel .grid-form{padding-top:4px}
.ns-admin-form-panel .grid-form>div:not(.full){min-width:0}
.ns-admin-list-panel .table-wrap{border:1px solid #e2eaf0;border-radius:14px;overflow:auto}
.ns-form-context{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;background:#eef7fb;color:#24617d;font-size:11px;font-weight:800;border:1px solid #d5e8f1}
.ns-admin-page .role-editor-panel,.ns-admin-page .role-list-panel{margin:0!important}
.ns-admin-page .system-config-shell{margin:0!important;display:grid;gap:16px}
.ns-admin-page .flash-wrap{margin:0!important}
.ns-admin-page .system-config-shortcuts{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}

.ns-trace-workspace{overflow:hidden}
.ns-enterprise-toolbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:12px;border:1px solid #e0e9ef;border-radius:14px;background:#f8fbfd;margin-bottom:14px}
.ns-enterprise-toolbar input[type=search]{min-width:280px;flex:1}
.ns-trace-search-panel{padding:14px 16px}
.ns-enterprise-searchbar{max-width:none!important;margin:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important}
.ns-enterprise-searchbar input{min-height:46px;border-radius:12px!important;border:1px solid #d7e3ea!important;padding:0 14px!important}
.ns-enterprise-searchbar button{min-height:46px;border-radius:12px!important;padding-inline:18px!important}
.ns-trace-invoice-list{min-height:520px}
.ns-trace-detail-panel{min-height:520px}
.ns-trace-empty-detail{min-height:430px;display:grid;place-content:center;text-align:center;padding:24px;color:#6e8290}
.ns-trace-empty-detail strong{display:block;font-size:18px;color:#1c3342;margin-bottom:6px}
.ns-trace-empty-detail span{max-width:450px;font-size:13px;line-height:1.5}
.ns-trace-import-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:16px}
.ns-trace-upload-panel,.ns-trace-schema-panel{margin:0!important}
.ns-trace-upload-panel input[type=file]{padding:14px;border:1px dashed #bcd2df;border-radius:12px;background:#f8fbfd}
.ns-trace-schema-panel .tf-column-chips{gap:7px}
.ns-trace-schema-panel .tf-col-chip{border-radius:999px;padding:7px 9px;background:#f5f9fb}
.ns-trace-page .tf-visor-layout{margin:0!important;grid-template-columns:minmax(300px,.72fr) minmax(0,1.6fr)!important}
.ns-trace-page .tf-action-bar{position:sticky;bottom:10px;z-index:12;padding:12px;border:1px solid #dce7ed;border-radius:14px;background:rgba(255,255,255,.96);box-shadow:0 12px 28px rgba(13,30,43,.10);backdrop-filter:blur(10px)}
.ns-trace-page .tf-security-note{display:block!important;padding:18px 20px;border-left:4px solid #2aa7da}
.ns-trace-page .tf-security-note strong{font-size:14px;color:#16384a}
.ns-trace-page .tf-security-note p{margin:5px 0 0;color:#587080;font-size:12.5px}

.ns-portfolio-page .ns-module-hero,.ns-portfolio-page .ns-kpi-grid,.ns-portfolio-page>.panel,.ns-portfolio-page>.ns-dashboard-two-col{margin:0!important}
.ns-portfolio-page .cartera-wizard-shell{margin:0!important}
.ns-portfolio-page .cartera-step-panel{margin:0!important}
.ns-portfolio-page .report-scroll{max-height:66vh}
.ns-portfolio-page .ns-enterprise-filterbar{align-items:end}
.ns-supersalud-workspace{display:grid;grid-template-columns:minmax(300px,.62fr) minmax(0,1.38fr);gap:16px}
.ns-supersalud-list-panel,.ns-supersalud-detail-panel{margin:0!important;min-width:0}
.ns-compact-form{padding:14px;border:1px solid #e2ebf0;border-radius:14px;background:#f9fbfc;margin-bottom:16px}
.ns-case-list{display:grid;gap:8px;max-height:560px;overflow:auto;padding-right:3px}
.ns-case-item{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 13px;border:1px solid #e0e9ef;border-radius:13px;background:#fff;text-decoration:none;color:inherit;transition:.15s ease}
.ns-case-item:hover{border-color:#a9d7e8;background:#f7fcfe;transform:translateY(-1px)}
.ns-case-item.active{border-color:#66bee1;background:#eef9fd;box-shadow:inset 3px 0 0 #1fa5d7}
.ns-case-item>div:first-child{min-width:0}.ns-case-item strong{display:block;font-size:13px;color:#172f3e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ns-case-item span{display:block;font-size:11px;color:#6c8190;margin-top:3px}
.ns-case-meta{flex:0 0 auto;text-align:right}.ns-case-meta b{display:block;font-size:14px;color:#0f759f}.ns-case-meta small{display:block;color:#6f8290;font-size:10px;margin-top:2px}
.ns-case-detail-head{padding-bottom:14px;border-bottom:1px solid #e7eef3}
.ns-case-progress{display:grid;grid-template-columns:auto auto;align-items:center;gap:2px 7px;text-align:right}.ns-case-progress>strong{font-size:24px;color:#0c7ca9}.ns-case-progress>span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#758895;font-weight:800}.ns-case-progress>em{grid-column:1/-1;justify-self:end;font-style:normal;margin-top:3px}
.ns-case-detail-form{padding-top:14px}.ns-checklist-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.ns-checklist-card{padding:13px;border:1px solid #e0e8ed;border-radius:13px;background:#fbfcfd}.ns-checklist-card.done{background:#f1faf5;border-color:#cfeadb}.ns-checklist-card .check{display:flex;align-items:flex-start;gap:8px;margin:0}.ns-checklist-card .check input{width:auto;margin-top:3px}.ns-checklist-card .check span{min-width:0}.ns-checklist-card .check strong{display:inline;font-size:12.5px}.ns-checklist-card .check em{display:inline-flex;margin-left:6px;padding:2px 6px;border-radius:999px;background:#fff3dc;color:#8a5d0b;font-size:9px;font-style:normal;font-weight:800}.ns-checklist-card p{font-size:11px;color:#657b89;line-height:1.4;margin:7px 0}.ns-checklist-card>input{font-size:11.5px}
.ns-document-zone{margin-top:18px;padding-top:18px;border-top:1px solid #e4edf2}.ns-document-upload-form{display:grid;grid-template-columns:minmax(180px,.6fr) minmax(260px,1.4fr) auto;gap:9px;align-items:center;padding:12px;border:1px solid #e0e9ef;border-radius:13px;background:#f8fbfd}.ns-document-list{display:grid;gap:7px;margin-top:12px}.ns-document-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid #e3ebf0;border-radius:11px;background:#fff}.ns-document-list a{font-weight:700;font-size:12px}.ns-document-list small{display:block;margin-top:2px;color:#718491;font-size:10px}

@media(max-width:1100px){.ns-supersalud-workspace,.ns-trace-import-grid{grid-template-columns:1fr}.ns-checklist-grid{grid-template-columns:1fr}.ns-document-upload-form{grid-template-columns:1fr}.ns-trace-page .tf-visor-layout{grid-template-columns:1fr!important}.ns-trace-invoice-list,.ns-trace-detail-panel{min-height:auto}}
@media(max-width:760px){.ns-enterprise-searchbar{grid-template-columns:1fr!important}.ns-enterprise-toolbar input[type=search]{min-width:100%}.ns-case-item{align-items:flex-start}.ns-case-progress{text-align:left}.ns-case-progress>em{justify-self:start}.ns-document-list article{align-items:flex-start;flex-direction:column}}

/* ===== V10 · HOME + FEV-RIPS + MIPRES VISUAL QA ===== */
.ns-fevrips-page,
.ns-mipres-page{max-width:var(--ns-content-max);margin:0 auto;}
.ns-fevrips-page > *,
.ns-mipres-page > *{margin-left:0!important;margin-right:0!important;}
.ns-fevrips-page > .alert,
.ns-mipres-page > .alert,
.ns-fevrips-page > .flash-wrap,
.ns-mipres-page > .flash-wrap{margin:0!important;}
.ns-fevrips-page .flash-wrap,
.ns-mipres-page .flash-wrap{margin:0!important;}

/* Home command center */
.ns-home-v10{max-width:var(--ns-content-max);margin:0 auto;padding:18px 24px 34px;gap:16px;}
.ns-home-hero-v10{
  min-height:230px;
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(300px,.55fr);
  align-items:stretch;
  gap:24px;
  padding:28px 30px;
  border:1px solid #d9e6ed;
  background:
    radial-gradient(circle at 82% 8%,rgba(35,166,219,.13),transparent 32%),
    linear-gradient(135deg,#ffffff 0%,#f5fbfe 72%,#edf8fc 100%);
  box-shadow:0 12px 34px rgba(13,30,43,.055);
}
.ns-home-hero-v10::before{display:none!important;}
.ns-home-hero-v10 .ns-home-hero-copy{display:flex;flex-direction:column;justify-content:center;max-width:860px;}
.ns-home-hero-v10 h2{font-size:clamp(27px,2.2vw,36px);margin:6px 0 8px;color:#102b3b;letter-spacing:-.035em;}
.ns-home-hero-v10 p{max-width:760px;font-size:13px;line-height:1.6;color:#536b7a;}
.ns-home-command-search{
  width:min(720px,100%);height:56px;margin-top:20px;padding:0 12px 0 16px;
  display:flex;align-items:center;gap:11px;border:1px solid #cfe0e9;border-radius:15px;background:#fff;
  box-shadow:0 9px 28px rgba(15,45,62,.07);transition:.16s ease;
}
.ns-home-command-search:focus-within{border-color:#70c7e7;box-shadow:0 0 0 4px rgba(13,143,202,.10),0 12px 30px rgba(15,45,62,.08);}
.ns-home-command-icon{width:20px;height:20px;color:#258ab5;display:grid;place-items:center;flex:0 0 20px;}
.ns-home-command-icon svg{width:20px;height:20px;}
.ns-home-command-search input{flex:1;min-width:0;border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;font-size:14px!important;font-weight:620;color:#183545;}
.ns-home-command-search kbd{margin:0;white-space:nowrap;background:#f3f7f9;border:1px solid #d7e2e8;color:#617481;box-shadow:none;font-size:10px;}
.ns-home-command-card{border:1px solid #d8e5ec;border-radius:18px;background:rgba(255,255,255,.88);padding:18px;box-shadow:0 8px 24px rgba(13,30,43,.045);display:grid;align-content:start;gap:0;}
.ns-home-command-state{display:flex;align-items:center;gap:10px;padding:2px 2px 14px;border-bottom:1px solid #e6edf2;}
.ns-home-command-state small,.ns-home-command-state strong{display:block;}.ns-home-command-state small{font-size:9px;text-transform:uppercase;letter-spacing:.09em;color:#758895;font-weight:800}.ns-home-command-state strong{font-size:13px;color:#1d4b39;margin-top:2px}
.ns-home-command-meta{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;padding:12px 2px;border-bottom:1px solid #eef3f6;align-items:start}.ns-home-command-meta:last-child{border-bottom:0}.ns-home-command-meta span{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:#778a96;font-weight:800}.ns-home-command-meta strong{font-size:12px;color:#203746;overflow-wrap:anywhere}
.ns-home-stats-v10{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.ns-home-stats-v10 article{min-height:92px;padding:15px 16px;border-radius:15px;box-shadow:var(--ns-shadow-xs);}
.ns-home-layout-v10{grid-template-columns:minmax(0,1.75fr) minmax(310px,.55fr);gap:16px;}
.ns-home-v10 .ns-home-main{border:1px solid #dfe8ee;border-radius:17px;background:#fff;box-shadow:var(--ns-shadow-xs);}
.ns-home-section-count{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;background:#eef7fb;color:#2b6781;border:1px solid #d7e8f0;font-size:10px;font-weight:800;white-space:nowrap;}
.ns-home-module-code{font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:#7d909c;font-weight:800;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ns-home-v10 .ns-home-module-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.ns-home-v10 .ns-home-module-card{min-height:150px;border-radius:14px;border-color:#e0e9ef;padding:15px;box-shadow:none;}
.ns-home-v10 .ns-home-module-card:hover{border-color:#9fd3e7;box-shadow:0 9px 22px rgba(13,78,107,.075);transform:translateY(-1px);}
.ns-home-v10 .ns-home-module-copy{min-height:112px;}

/* FEV-RIPS */
.ns-fevrips-page .ns-module-hero,
.ns-mipres-page .ns-module-hero,
.ns-fevrips-page .fevrips-hero,
.ns-mipres-page .mipres-hero,
.ns-mipres-page .mipres-query-hero{margin:0!important;border-radius:17px;border:1px solid #dbe7ed;box-shadow:var(--ns-shadow-xs);}
.ns-fevrips-page .fevrips-hero,
.ns-mipres-page .mipres-hero,
.ns-mipres-page .mipres-query-hero{padding:22px 24px;background:linear-gradient(135deg,#fff,#f7fbfd);border-left:1px solid #dbe7ed;}
.ns-fevrips-page .fevrips-hero h2,
.ns-mipres-page .mipres-hero h2,
.ns-mipres-page .mipres-query-hero h2{font-size:22px;margin:4px 0 6px;letter-spacing:-.025em;color:#18313f;}
.ns-fevrips-page .cm-center-context,
.ns-mipres-page .cm-center-context{margin-top:16px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.ns-fevrips-page .cm-center-context>div,
.ns-mipres-page .cm-center-context>div{padding:11px 13px;border:1px solid #dfe9ef;border-radius:12px;background:rgba(255,255,255,.84);min-width:0;}
.ns-fevrips-page .cm-center-context span,
.ns-mipres-page .cm-center-context span{font-size:9px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#748895;}
.ns-fevrips-page .cm-center-context strong,
.ns-mipres-page .cm-center-context strong{display:block;margin-top:3px;font-size:12px;color:#173342;overflow-wrap:anywhere;}
.ns-fevrips-page .ns-process-rail,
.ns-mipres-page .ns-process-rail{margin:0!important;}
.ns-fevrips-page .ns-kpi-grid,
.ns-mipres-page .ns-kpi-grid{margin:0!important;}
.ns-fevrips-page .fevrips-settings-grid,
.ns-mipres-page .settings-grid{margin:0!important;gap:16px;}
.ns-fevrips-page .fevrips-settings-grid>.panel,
.ns-mipres-page .settings-grid>.panel{margin:0!important;}
.ns-fevrips-page .settings-panel,
.ns-fevrips-page .fevrips-status-panel{padding:20px 22px;}
.ns-fevrips-page .settings-panel>h2,
.ns-fevrips-page .fevrips-status-panel>h2{font-size:18px;margin:3px 0 5px;}
.ns-fevrips-page .grid-form{gap:14px;}
.ns-fevrips-page .grid-form label{font-size:11px;font-weight:750;color:#314b5b;}
.ns-fevrips-page .grid-form small{font-size:10.5px;color:#728692;line-height:1.45;}
.ns-fevrips-page .ns-integration-status-list>div{border-radius:13px;background:#fbfdfe;border:1px solid #e1eaf0;padding:12px;}
.ns-fevrips-page .ns-integration-actions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:14px;}
.ns-fevrips-page .fevrips-test-form{margin:0;}
.ns-fevrips-page .fevrips-test-form button{min-height:42px;border-radius:11px;}
.ns-fevrips-page .browser-note{border-radius:12px;background:#f8fbfd;border:1px solid #e1eaf0;font-size:10.5px;line-height:1.5;}
.ns-fevrips-page .fevrips-upload-form,
.ns-fevrips-page .fevrips-result-grid,
.ns-fevrips-page .fevrips-operation-grid{gap:12px;}
.ns-fevrips-page .fevrips-upload-card{border-radius:14px;background:#fbfdfe;border-color:#cbdde7;}
.ns-fevrips-page .fevrips-two-col,
.ns-fevrips-page .fevrips-home-grid{margin:0!important;gap:16px;}
.ns-fevrips-page .batch-shell,
.ns-fevrips-page .bulk-cuv-shell{margin:0!important;}
.ns-fevrips-page .batch-toolbar,
.ns-fevrips-page .bulk-toolbar{border-radius:14px;background:#f8fbfd;border:1px solid #e0e9ef;}
.ns-fevrips-page .batch-table-wrap,
.ns-fevrips-page .bulk-table-wrap{border-radius:14px;border:1px solid #e0e9ef;overflow:auto;}
.ns-fevrips-page .fevrips-result{border-left:1px solid #dce7ed!important;border-top:4px solid #1d9fd2!important;border-radius:15px;}
.ns-fevrips-page .fevrips-result.success{border-top-color:#1b9a67!important}.ns-fevrips-page .fevrips-result.warning{border-top-color:#d18b18!important}
.ns-fevrips-page .fevrips-result-grid>div{border-radius:11px;background:#fbfdfe;}
.ns-fevrips-page .fevrips-raw pre{border-radius:12px;background:#0b1720;color:#dcebf2;}

/* MIPRES */
.ns-mipres-page .mipres-service-grid,
.ns-mipres-page .mipres-token-grid{margin:0!important;gap:14px;}
.ns-mipres-page .mipres-service-card,
.ns-mipres-page .mipres-token-card{margin:0!important;border-radius:15px;}
.ns-mipres-page .mipres-service-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
.ns-mipres-page .mipres-service-card{min-height:215px;padding:18px;display:flex;flex-direction:column;}
.ns-mipres-page .mipres-service-card>p{font-size:12px;line-height:1.55;color:#5d7280;}
.ns-mipres-page .ns-service-actions{margin-top:auto;padding-top:12px;}
.ns-mipres-page .mipres-token-card::before{width:3px;}
.ns-mipres-page .mipres-env-box{margin:0!important;padding:18px 20px;border-radius:15px;}
.ns-mipres-page .mipres-token-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
.ns-mipres-page .mipres-save-bar{margin:0!important;border-radius:15px;}
.ns-mipres-page .mipres-test-grid{gap:10px;}
.ns-mipres-page .mipres-test-grid form{border-radius:13px;background:#fbfdfe;border-color:#e0e9ef;}
.ns-mipres-page .mipres-query-hero{display:flex;justify-content:space-between;align-items:center;gap:18px;}
.ns-mipres-page .mipres-query-status{border-radius:13px;background:#fff;box-shadow:var(--ns-shadow-xs);}
.ns-mipres-page .mipres-page-switch{margin:0!important;border:1px solid #dfe8ee;border-radius:13px;background:#f8fbfd;padding:5px;display:flex;gap:4px;flex-wrap:wrap;}
.ns-mipres-page .mipres-page-switch a{border:0;background:transparent;border-radius:9px;padding:8px 11px;}
.ns-mipres-page .mipres-page-switch a.active{background:#fff;color:#0b759f;box-shadow:0 2px 8px rgba(13,30,43,.07);}
.ns-mipres-page .mipres-query-form,
.ns-mipres-page .mipres-filter-form,
.ns-mipres-page .mipres-write-form{gap:12px 14px;}
.ns-mipres-page .mipres-query-submit{border-top:1px solid #e7eef2;margin-top:5px;padding-top:12px;}
.ns-mipres-page .mipres-query-submit button,
.ns-mipres-page .mipres-filter-action button,
.ns-mipres-page .mipres-save-bar button,
.ns-mipres-page .mipres-test-grid button{border-radius:10px;min-height:40px;}
.ns-mipres-page .mipres-result-panel{border-top:4px solid #1f9ccf!important;border-left:1px solid #dfe8ed!important;border-radius:15px;}
.ns-mipres-page .mipres-mini-kpis{margin:12px 0 0!important;}
.ns-mipres-page .mipres-json-details{border-radius:12px;overflow:hidden;border:1px solid #dfe8ed;}
.ns-mipres-page .mipres-json-details pre{background:#0b1720;color:#dcebf2;border-radius:0;}
.ns-mipres-page .mipres-filter-form{align-items:end;}
.ns-mipres-page .mipres-param-cell{max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ns-mipres-page .mipres-report-guide{gap:10px;}
.ns-mipres-page .mipres-step{border-radius:13px;background:#fbfdfe;border-color:#e0e9ef;}
.ns-mipres-page .mipres-preview-panel{border-top:4px solid #d9962a!important;border-radius:15px;}
.ns-mipres-page .mipres-danger-confirm{border-radius:13px;}
.ns-mipres-page .table-wrap{border:1px solid #e1e9ee;border-radius:14px;overflow:auto;}
.ns-mipres-page table thead th{background:#f6f9fb;}

@media(max-width:1280px){
  .ns-home-v10 .ns-home-module-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .ns-home-stats-v10{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:1100px){
  .ns-home-hero-v10,.ns-home-layout-v10{grid-template-columns:1fr;}
  .ns-home-command-card{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
  .ns-home-command-state{grid-column:1/-1;}
  .ns-home-command-meta{display:block;border:1px solid #e4ecf1;border-radius:11px;padding:10px;}
  .ns-home-command-meta span,.ns-home-command-meta strong{display:block;}
  .ns-mipres-page .mipres-service-grid,.ns-mipres-page .mipres-token-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:800px){
  .ns-home-v10{padding:14px;}.ns-home-hero-v10{padding:22px;border-radius:15px;}.ns-home-command-card{grid-template-columns:1fr;}.ns-home-command-state{grid-column:auto;}
  .ns-home-stats-v10,.ns-home-v10 .ns-home-module-grid,.ns-mipres-page .mipres-service-grid,.ns-mipres-page .mipres-token-grid,.ns-fevrips-page .cm-center-context,.ns-mipres-page .cm-center-context{grid-template-columns:1fr;}
  .ns-home-command-search kbd{display:none;}
  .ns-mipres-page .mipres-query-hero{align-items:stretch;flex-direction:column;}
}

/* V10 in-app toast */
.ns-toast-stack{position:fixed;top:86px;right:22px;z-index:7000;width:min(420px,calc(100vw - 32px));display:grid;gap:9px;pointer-events:none}
.ns-toast{pointer-events:auto;display:grid;grid-template-columns:38px minmax(0,1fr) 28px;gap:10px;align-items:start;padding:13px;border:1px solid #dce7ed;border-radius:14px;background:rgba(255,255,255,.98);box-shadow:0 18px 45px rgba(12,30,42,.16);opacity:0;transform:translateY(-7px);transition:.18s ease;backdrop-filter:blur(12px)}
.ns-toast.is-visible{opacity:1;transform:translateY(0)}.ns-toast.is-leaving{opacity:0;transform:translateY(-5px)}
.ns-toast-icon{width:34px;height:34px;border-radius:11px;background:#e9f6fc;position:relative}.ns-toast-icon::after{content:'i';position:absolute;inset:0;display:grid;place-items:center;color:#147da8;font-weight:900;font-family:Georgia,serif}
.ns-toast-error{border-color:#f0cfd4;background:#fffafb}.ns-toast-error .ns-toast-icon{background:#ffe9ec}.ns-toast-error .ns-toast-icon::after{content:'!';color:#b42334;font-family:inherit}
.ns-toast-success{border-color:#cae9d9;background:#fbfffd}.ns-toast-success .ns-toast-icon{background:#e8f7ef}.ns-toast-success .ns-toast-icon::after{content:'✓';color:#147a55;font-family:inherit}
.ns-toast-copy strong,.ns-toast-copy span{display:block}.ns-toast-copy strong{font-size:12.5px;color:#1c3342;margin-bottom:3px}.ns-toast-copy span{font-size:11.5px;line-height:1.45;color:#5c7280;overflow-wrap:anywhere}.ns-toast>button{width:28px;height:28px;border:0;border-radius:8px;background:#f4f7f9;color:#71828d;font-size:18px;line-height:1;cursor:pointer}.ns-toast>button:hover{background:#e9eff3;color:#243d4b}
@media(max-width:600px){.ns-toast-stack{top:74px;right:12px;width:calc(100vw - 24px)}}

/* ========================================================================== */
/* NexSalud Enterprise UI v11 — visual closure                                */
/* ========================================================================== */

/* Final workspace consistency */
.ns-record-count{
  display:inline-flex;align-items:center;min-height:30px;padding:0 10px;border-radius:999px;
  border:1px solid #dce7ed;background:#f7fafc;color:#536b79;font-size:11px;font-weight:800;white-space:nowrap;
}
.ns-contracting-home-page > .ns-module-hero{margin-top:0!important}
.ns-tariff-types-page .module-tabs{margin:0!important}
.ns-tariff-workspace{grid-template-columns:minmax(320px,.72fr) minmax(0,1.65fr)!important;margin:0!important}
.ns-tariff-form{grid-template-columns:1fr 1fr}

/* Cartera / contactos */
.ns-contacts-page .ns-module-hero{margin-top:0!important}
.ns-contacts-workspace{
  grid-template-columns:minmax(360px,.78fr) minmax(0,1.75fr)!important;
  gap:16px!important;margin:0!important;
}
.ns-contacts-form-panel{position:sticky;top:88px}
.ns-contacts-form{grid-template-columns:1fr 1fr}
.ns-contacts-directory-panel{min-width:0}
.ns-contact-data{min-width:220px}
.ns-contact-data>div{display:flex;align-items:center;gap:7px;margin:4px 0;min-width:0}
.ns-contact-data>div>span:last-child,
.ns-contact-data>div>a,
.ns-contact-data code{overflow-wrap:anywhere;word-break:break-word}
.ns-contact-label{
  display:inline-flex;align-items:center;justify-content:center;min-width:49px;min-height:21px;padding:0 6px;
  border-radius:6px;background:#f0f5f8;color:#637786;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.05em;
}
.ns-secure-help{position:relative;padding-left:16px!important;color:#557083!important}
.ns-secure-help::before{
  content:"";position:absolute;left:1px;top:5px;width:8px;height:8px;border-radius:50%;background:#1b9668;
  box-shadow:0 0 0 3px rgba(27,150,104,.10);
}
.ns-secure-dot{display:inline-block;width:8px;height:8px;margin-left:4px;border-radius:50%;background:#1a9367;box-shadow:0 0 0 3px rgba(26,147,103,.10)}
.ns-security-footnote{
  display:flex;align-items:flex-start;gap:10px;margin-top:12px;padding:12px 13px;border-radius:12px;
  background:#f5fafc;border:1px solid #e0ebf0;color:#5b7180;
}
.ns-security-footnote>span{width:18px;height:18px;flex:0 0 18px;color:#2e7899}
.ns-security-footnote>span svg{width:18px;height:18px}
.ns-security-footnote p{margin:0;font-size:11px;line-height:1.5}

/* Visor CUPS: remove emoji dependency from search surfaces */
.ns-visor-search-glyph{width:22px;height:22px;display:grid;place-items:center;color:#1689ba}
.ns-visor-search-glyph svg{width:22px;height:22px}
.ns-visor-empty-icon span{width:24px;height:24px;display:grid;place-items:center}
.ns-visor-empty-icon span svg{width:24px;height:24px}

/* Standalone completion surfaces: setup / restore */
.ns-completion-page{
  min-height:100vh;margin:0;background:
  radial-gradient(circle at 15% 0,rgba(28,156,207,.11),transparent 28%),
  linear-gradient(180deg,#edf5f8 0,#f8fbfc 48%,#eef4f7 100%);
  color:var(--ns-text);font-family:"Segoe UI Variable","Segoe UI",Inter,system-ui,sans-serif;
}
.ns-completion-shell{width:min(100% - 32px,980px);margin:0 auto;padding:28px 0 46px}
.ns-completion-brand{display:flex;align-items:center;gap:11px;margin:0 0 16px 4px}
.ns-completion-logo{width:42px;height:42px;border-radius:12px;background:linear-gradient(145deg,#149bd5,#0b82b9);display:grid;place-items:center;box-shadow:0 8px 20px rgba(14,122,168,.16)}
.ns-completion-logo img{width:31px;height:31px;object-fit:contain}
.ns-completion-brand>div:last-child{display:flex;flex-direction:column}
.ns-completion-brand span{font-size:17px;font-weight:800;color:#173342;letter-spacing:-.02em}
.ns-completion-brand strong{font-size:10px;color:#71838f;font-weight:650;text-transform:uppercase;letter-spacing:.08em}
.ns-completion-card{
  background:#fff;border:1px solid #dce7ed;border-radius:22px;padding:34px 36px;
  box-shadow:0 20px 54px rgba(13,30,43,.10);overflow:hidden;position:relative;
}
.ns-completion-card::before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:linear-gradient(90deg,#159bd4,#35b8dc,#3bb888)}
.ns-completion-status{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;margin-bottom:18px}
.ns-completion-status.success{background:#eaf8f1;color:#16805a;border:1px solid #ccebdc}
.ns-completion-status span{font-size:29px;font-weight:900;line-height:1}
.ns-completion-card h1{margin:6px 0 7px;font-size:clamp(26px,3vw,36px);line-height:1.12;letter-spacing:-.04em;color:#15303f}
.ns-completion-card>p{margin:0 0 20px;color:#5c7180;max-width:720px;line-height:1.6}
.ns-completion-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}
.ns-completion-kpis>div,
.ns-install-summary-grid>div{padding:13px 14px;border:1px solid #e2ebf0;border-radius:13px;background:#f9fbfc;min-width:0}
.ns-completion-kpis small,
.ns-install-summary-grid small{display:block;color:#718491;font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;margin-bottom:4px}
.ns-completion-kpis strong,
.ns-install-summary-grid strong{display:block;color:#203743;font-size:13px;overflow-wrap:anywhere}
.ns-completion-messages{display:grid;gap:9px;margin:16px 0}
.ns-completion-messages .alert{margin:0}
.ns-completion-primary{
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin-top:6px;padding:0 18px;border-radius:11px;
  background:linear-gradient(135deg,#118fc8,#0879ad);color:#fff;text-decoration:none;font-size:12px;font-weight:800;
  box-shadow:0 8px 18px rgba(8,121,173,.18);
}
.ns-completion-primary:hover{color:#fff;filter:brightness(1.04);transform:translateY(-1px)}
.ns-completion-footnote{margin:12px 0 0!important;font-size:10px!important;color:#82929c!important}
.ns-install-summary{margin:11px 0;border:1px solid #e1eaf0;border-radius:14px;background:#fbfdfe;overflow:hidden}
.ns-install-summary summary{cursor:pointer;list-style:none;padding:13px 15px;color:#27404f;font-size:12px;font-weight:800;position:relative}
.ns-install-summary summary::-webkit-details-marker{display:none}
.ns-install-summary summary::after{content:"+";position:absolute;right:15px;color:#7290a1;font-size:17px;top:9px}
.ns-install-summary[open] summary::after{content:"−"}
.ns-install-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:0 13px 13px}
.ns-install-id{display:flex;align-items:center;gap:9px;margin:15px 0 12px;color:#6b7e8b;font-size:10px}
.ns-install-id span{text-transform:uppercase;font-weight:800;letter-spacing:.08em}
.ns-install-id code{padding:5px 8px;border-radius:7px;background:#f1f5f7;color:#365362;border:1px solid #e1e8ec}

/* Auth finishing pass */
.ns-auth-brand-panel{background:
  radial-gradient(circle at 85% 15%,rgba(51,187,232,.20),transparent 30%),
  radial-gradient(circle at 10% 95%,rgba(46,190,149,.11),transparent 30%),
  linear-gradient(145deg,#0b2230,#0b1822 72%)!important;
}
.ns-auth-form-panel{background:linear-gradient(180deg,#fff,#fbfdfe)!important}
.ns-auth-form-card{padding:6px}
.ns-auth-form input,
.ns-auth-form select{min-height:47px!important;border-color:#d7e3e9!important;background:#fff!important}
.ns-auth-form input:focus,
.ns-auth-form select:focus{border-color:#6fc4e5!important;box-shadow:0 0 0 4px rgba(13,143,202,.10)!important}
.ns-center-select-card select{font-weight:650;color:#223a48}

@media(max-width:1200px){
  .ns-contacts-workspace,.ns-tariff-workspace{grid-template-columns:1fr!important}
  .ns-contacts-form-panel{position:static}
}
@media(max-width:820px){
  .ns-completion-kpis,.ns-install-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ns-completion-card{padding:28px 24px}
}
@media(max-width:620px){
  .ns-contacts-form,.ns-tariff-form{grid-template-columns:1fr}
  .ns-completion-shell{width:min(100% - 20px,980px);padding-top:14px}
  .ns-completion-card{padding:24px 18px;border-radius:17px}
  .ns-completion-kpis,.ns-install-summary-grid{grid-template-columns:1fr}
}

/* Auth interaction polish */
.ns-auth-password-field{position:relative}
.ns-auth-password-field input{padding-right:76px!important}
.ns-password-toggle{
  position:absolute;right:7px;top:50%;transform:translateY(-50%);min-width:58px;height:32px;
  border:0;background:#f0f6f9;color:#3f6477;border-radius:8px;font-size:10.5px;font-weight:800;
}
.ns-password-toggle:hover{background:#e6f2f7;color:#176f96}
.ns-center-options{display:grid;gap:8px;margin-top:12px;max-height:250px;overflow:auto;padding-right:2px}
.ns-center-option{
  width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:11px;align-items:center;text-align:left;
  padding:11px 12px;border:1px solid #dce6eb;background:#fff;border-radius:12px;color:#253b48;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease,transform .15s ease;
}
.ns-center-option:hover{border-color:#b9dcea;background:#f8fcfe;transform:translateY(-1px)}
.ns-center-option.active{border-color:#70c5e4;background:#eef9fd;box-shadow:0 0 0 3px rgba(13,143,202,.08)}
.ns-center-option-code{min-width:54px;padding:6px 8px;border-radius:8px;background:#eff5f8;color:#436173;font-size:10px;font-weight:850;text-align:center;letter-spacing:.04em}
.ns-center-option-copy{display:flex;flex-direction:column;min-width:0}
.ns-center-option-copy strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ns-center-option-copy small{font-size:9.5px;color:#7b8c96}
.ns-center-option-check{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#edf3f6;color:transparent;font-size:12px;font-weight:900}
.ns-center-option.active .ns-center-option-check{background:#dff5ec;color:#16805a}

/* ========================================================================== */
/* NexSalud Enterprise UI v12 — final responsive & visual quality pass        */
/* ========================================================================== */
:root{
  --ns-sidebar-width:240px;
  --ns-content-max:1720px;
  --ns-page-x:20px;
  --ns-page-y:16px;
}

/* Shell proportions: more workspace, less chrome. */
.sidebar-brand{min-height:64px;padding:11px 13px;gap:10px}
.system-brand-mark{width:37px;height:37px;flex-basis:37px;border-radius:10px}
.system-brand-mark img{width:28px;height:28px}
.sidebar-brand strong{font-size:17px}
.system-brand-subtitle{font-size:9.5px}
.ns-sidebar-tools{padding:8px 10px 3px}
.user-box{margin-inline:8px;padding:10px 11px}
.context-box{margin:7px 8px 3px;padding:9px 10px}
.sidebar nav{padding-inline:7px}
.sidebar nav > a,
.menu-group > summary{min-height:36px;padding-top:8px;padding-bottom:8px}
.submenu-nested,.submenu-link{padding-top:6px!important;padding-bottom:6px!important}
.sidebar-logout{padding:6px 8px 10px}

.topbar{
  min-height:64px;
  padding:10px 20px;
  box-shadow:0 1px 0 rgba(13,30,43,.025);
}
.topbar h1{font-size:clamp(18px,1.22vw,21px)}
.topbar p{font-size:11px}
.top-user{min-height:32px;padding:0 10px;font-size:11px}

/* Consistent workspace geometry across every module. */
.ns-page-shell{
  width:min(100%,var(--ns-content-max));
  padding:var(--ns-page-y) var(--ns-page-x) 28px;
  gap:14px;
}
.ns-page-shell > .panel,
.ns-page-shell > .welcome-panel,
.ns-page-shell > .ns-master-detail-grid,
.ns-page-shell > .ns-dashboard-two-col,
.ns-page-shell > .ns-readiness-grid{
  border-radius:15px!important;
}
.ns-page-shell .panel .panel{
  margin-inline:0!important;
  box-shadow:none;
}
.ns-page-shell .section-heading-row{align-items:center}
.ns-page-shell .section-heading-row > div:first-child{min-width:0}
.ns-page-shell .section-heading-row h2{font-size:17px;line-height:1.25;margin-top:0}
.ns-page-shell .section-heading-row p{max-width:920px;line-height:1.48}

/* Cards/KPIs: tighter and more legible at 1366/1440/1920. */
.ns-kpi-grid{gap:10px!important}
.ns-kpi-card{min-height:84px!important;padding:13px 14px!important;border-radius:14px!important}
.ns-kpi-card .ns-kpi-icon{width:36px;height:36px;flex-basis:36px;border-radius:10px}
.ns-kpi-card small{font-size:9.5px!important;letter-spacing:.055em}
.ns-kpi-card strong{font-size:21px!important;line-height:1.08!important}
.ns-kpi-card span{font-size:10.5px!important}
.ns-module-hero{padding:20px 22px!important}
.ns-module-hero h2{font-size:clamp(20px,1.5vw,25px)!important;line-height:1.18}
.ns-module-hero p{max-width:920px;line-height:1.52}
.ns-module-hero-meta{gap:8px!important;flex-wrap:wrap}

/* Forms: compact enterprise rhythm, without shrinking click targets. */
.ns-page-shell label{margin-top:9px}
.ns-page-shell input:not([type="checkbox"]):not([type="radio"]),
.ns-page-shell select{min-height:39px}
.ns-page-shell textarea{min-height:88px}
.ns-page-shell .form-actions{margin-top:13px;padding-top:12px}
.ns-page-shell .form-grid,
.ns-page-shell .grid-form{row-gap:10px}
.ns-page-shell .inline-actions,
.ns-page-shell .form-actions,
.ns-page-shell .section-heading-row{flex-wrap:wrap}

/* Data grids: scan faster, waste less vertical space, stay readable. */
.ns-page-shell .table-wrap,
.ns-page-shell .cm-scroll-table,
.ns-page-shell .cartera-table-scroll{
  max-width:100%;
  position:relative;
  border-radius:10px;
  overscroll-behavior:contain;
}
.ns-page-shell th{height:36px;padding:7px 9px;font-size:9.5px}
.ns-page-shell td{padding:8px 9px;font-size:11.5px}
.ns-page-shell tbody tr:nth-child(even) td{background:rgba(246,249,251,.42)}
.ns-page-shell tbody tr:hover td{background:#f1f8fb!important}
.ns-page-shell td,.ns-page-shell th{max-width:520px}
.ns-page-shell td{overflow-wrap:anywhere}
.ns-page-shell .ns-grid-toolbar{min-height:44px;padding:6px 8px}
.ns-page-shell .ns-grid-search{height:32px!important;min-height:32px!important}
.ns-page-shell .ns-grid-records{font-size:10px}
.ns-page-shell .ns-grid-tool{height:30px;min-height:30px}
.ns-page-shell .ns-grid-code{font-size:10.25px!important}
.ns-page-shell .ns-grid-numeric{font-variant-numeric:tabular-nums}

/* Horizontal-scroll affordance generated by V12 JS. */
.ns-scroll-frame{position:relative}
.ns-scroll-frame::before,
.ns-scroll-frame::after{
  content:"";position:absolute;top:0;bottom:0;width:18px;z-index:8;pointer-events:none;opacity:0;transition:opacity .14s ease;
}
.ns-scroll-frame::before{left:0;background:linear-gradient(90deg,rgba(20,43,57,.12),transparent)}
.ns-scroll-frame::after{right:0;background:linear-gradient(270deg,rgba(20,43,57,.12),transparent)}
.ns-scroll-frame[data-ns-scroll-left="1"]::before,
.ns-scroll-frame[data-ns-scroll-right="1"]::after{opacity:1}

/* Empty states no longer become oversized blank canvases. */
.ns-page-shell .empty,
.ns-page-shell .empty-state,
.ns-page-shell .empty-state-soft{
  min-height:84px;
  padding:18px 20px!important;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  line-height:1.5;
}
.ns-page-shell .ns-grid-no-results{padding:20px 14px}

/* Modal / focus mode polish. */
.ns-confirm-dialog,.fev-connection-modal__dialog,.ns-command-dialog{max-height:min(86vh,760px);overflow:auto}
.panel.ns-grid-focus,section.ns-grid-focus{
  inset:14px 16px 14px calc(var(--ns-sidebar-width) + 16px)!important;
  border-radius:16px!important;
}
.ns-sidebar-collapsed .panel.ns-grid-focus,
.ns-sidebar-collapsed section.ns-grid-focus{left:calc(var(--ns-sidebar-collapsed) + 16px)!important}

/* 1920+: use the canvas confidently instead of floating in the middle. */
@media(min-width:1680px){
  :root{--ns-page-x:24px;--ns-page-y:18px}
  .ns-page-shell{padding-bottom:32px}
  .ns-page-shell .panel{padding:20px}
  .ns-module-hero{padding:22px 24px!important}
}

/* Standard business laptop: reclaim horizontal workspace. */
@media(max-width:1440px) and (min-width:921px){
  :root{--ns-sidebar-width:226px;--ns-page-x:16px;--ns-page-y:14px}
  .sidebar-brand strong{font-size:16px}
  .system-brand-subtitle{display:none}
  .context-box{padding:8px 9px}
  .sidebar nav > a,.menu-group > summary{font-size:11.8px}
  .submenu-nested,.submenu-link{font-size:10.4px!important}
  .topbar{padding-inline:16px}
  .ns-topbar-tool .ns-tool-label{display:none}
  .ns-topbar-tool{width:34px!important;padding-inline:0!important;justify-content:center}
  .ns-topbar-tool kbd{display:none}
  .ns-page-shell .panel{padding:18px}
  .ns-page-shell th{padding:7px 8px}
  .ns-page-shell td{padding:7px 8px}
}

/* Tablet / small laptop: navigation becomes an overlay sooner. */
@media(max-width:920px){
  .app-shell,.app-shell.ns-sidebar-collapsed{display:block!important}
  .sidebar{
    position:fixed!important;inset:0 auto 0 0!important;width:min(292px,86vw)!important;
    transform:translateX(-103%);transition:transform .22s ease;z-index:70;
    box-shadow:12px 0 38px rgba(5,19,28,.20);
  }
  body.ns-mobile-nav-open .sidebar{transform:translateX(0)}
  body.ns-mobile-nav-open::after{
    content:"";position:fixed;inset:0;background:rgba(5,19,28,.38);backdrop-filter:blur(1px);z-index:55;
  }
  .ns-mobile-menu-button{display:grid!important}
  .topbar{padding:9px 12px;min-height:60px}
  .top-user{display:none}
  .ns-topbar-actions{margin-left:auto}
  .ns-topbar-tool .ns-tool-label,.ns-topbar-tool kbd{display:none}
  .ns-page-shell{padding:12px 12px 22px;gap:12px}
  .ns-kpi-grid-4,.ns-kpi-grid-5{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .panel.ns-grid-focus,section.ns-grid-focus{inset:10px!important}
}

@media(max-width:620px){
  .topbar h1{max-width:58vw}
  .ns-page-shell{padding-inline:10px}
  .ns-page-shell .panel{padding:15px!important;border-radius:13px!important}
  .ns-module-hero{padding:17px!important}
  .ns-kpi-grid-4,.ns-kpi-grid-5,.ns-kpi-grid-3{grid-template-columns:1fr!important}
  .ns-kpi-card{min-height:76px!important}
  .ns-page-shell .section-heading-row{align-items:flex-start}
  .ns-page-shell .section-heading-row .inline-actions{width:100%}
  .ns-page-shell .section-heading-row .inline-actions>*{flex:1 1 auto}
  .form-actions{justify-content:stretch}
  .form-actions>*{flex:1 1 auto}
}

/* V12 JS-assisted wide-grid affordances. */
.ns-scroll-frame.ns-has-horizontal-scroll[data-ns-scroll-left="1"]{box-shadow:inset 12px 0 12px -14px rgba(20,43,57,.38)}
.ns-scroll-frame.ns-has-horizontal-scroll[data-ns-scroll-right="1"]{box-shadow:inset -12px 0 12px -14px rgba(20,43,57,.38)}
.ns-scroll-frame.ns-has-horizontal-scroll[data-ns-scroll-left="1"][data-ns-scroll-right="1"]{box-shadow:inset 12px 0 12px -14px rgba(20,43,57,.38),inset -12px 0 12px -14px rgba(20,43,57,.38)}
.ns-ultra-wide-grid table{min-width:1080px}
.ns-ultra-wide-grid th{font-size:9px!important;padding-inline:7px!important}
.ns-ultra-wide-grid td{font-size:11px!important;padding-inline:7px!important}

/* ===== MIPRES FACTURACIÓN · AUTODILIGENCIADO DESDE PRESCRIPCIÓN ===== */
.mipres-autofill-panel{
  grid-column:1/-1;
  margin:2px 0 4px;
  padding:18px;
  border:1px solid #cfe5ef;
  border-radius:16px;
  background:linear-gradient(145deg,#f8fdff 0%,#f4fbfe 58%,#eef9fd 100%);
  box-shadow:0 8px 24px rgba(19,92,126,.06);
}
.mipres-autofill-panel[hidden]{display:none!important}
.mipres-autofill-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:14px;
}
.mipres-autofill-head h3{margin:3px 0 4px;font-size:17px;line-height:1.25;color:#153243}
.mipres-autofill-head p{margin:0;max-width:850px;color:#5b7281;font-size:12.5px;line-height:1.45}
.mipres-autofill-safe{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:27px;
  padding:0 10px;
  border:1px solid #bbe5d1;
  border-radius:999px;
  background:#edf9f3;
  color:#14704e;
  font-size:10px;
  font-weight:850;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.mipres-autofill-row{display:grid;grid-template-columns:minmax(280px,1fr) auto;gap:10px;align-items:end}
.mipres-autofill-input{margin:0!important;display:grid;gap:6px}
.mipres-autofill-input span{font-size:11px;font-weight:800;color:#274454}
.mipres-autofill-input input{
  min-height:44px;
  margin:0!important;
  border-color:#bfd9e5!important;
  background:#fff!important;
  font-weight:700;
  letter-spacing:.015em;
}
.mipres-autofill-button{
  min-height:44px;
  padding:0 16px!important;
  border-radius:10px!important;
  border:1px solid #0e88bd!important;
  background:#0e8fc7!important;
  color:#fff!important;
  font-weight:800!important;
  white-space:nowrap;
}
.mipres-autofill-button:hover{background:#087baa!important}
.mipres-autofill-button:disabled{opacity:.65;cursor:wait}
.mipres-autofill-status{display:none;margin-top:12px;padding:10px 12px;border-radius:10px;font-size:12px;font-weight:650;line-height:1.45}
.mipres-autofill-status:not(:empty){display:block}
.mipres-autofill-status.loading{background:#eef7ff;border:1px solid #cfe5f6;color:#245e87}
.mipres-autofill-status.success{background:#edf9f3;border:1px solid #c9ead9;color:#176b4c}
.mipres-autofill-status.warning{background:#fff8e8;border:1px solid #f0dfa9;color:#865f0c}
.mipres-autofill-status.error{background:#fff1f3;border:1px solid #f0ccd2;color:#9d2e3b}
.mipres-autofill-candidates{
  margin-top:12px;
  padding:12px;
  border:1px solid #d8e7ee;
  border-radius:12px;
  background:rgba(255,255,255,.75);
}
.mipres-autofill-candidates[hidden]{display:none!important}
.mipres-autofill-candidates label{margin:0 0 6px!important;font-size:11px;font-weight:800;color:#274454}
.mipres-autofill-candidates select{margin:0!important;background:#fff!important}
.mipres-autofill-candidates p{margin:6px 0 0;font-size:11px;color:#657b89}
.mipres-autofill-summary{
  display:flex;
  align-items:center;
  gap:8px 14px;
  flex-wrap:wrap;
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #d7e7ed;
  border-radius:11px;
  background:#fff;
}
.mipres-autofill-summary[hidden]{display:none!important}
.mipres-autofill-summary strong{color:#0f7450;font-size:12px}
.mipres-autofill-summary span{color:#2e5062;font-size:11.5px;font-weight:700}
.mipres-autofill-summary small{flex-basis:100%;color:#687e8b;font-size:11px}
.mipres-autofill-note{
  margin-top:12px;
  padding-top:11px;
  border-top:1px dashed #cadde6;
  color:#607786;
  font-size:11px;
  line-height:1.45;
}
.mipres-autofill-note strong{color:#2a4b5d}
.mipres-fields-grid .mipres-autofilled{
  border-color:#55b78d!important;
  background:#f1fbf6!important;
  box-shadow:0 0 0 3px rgba(50,164,115,.09)!important;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease;
}
@media(max-width:760px){
  .mipres-autofill-head{flex-direction:column;gap:10px}
  .mipres-autofill-row{grid-template-columns:1fr}
  .mipres-autofill-button{width:100%;justify-content:center}
}

/* HF15 — Seguimiento de tareas compacto / acordeón */
.ns-operational-page .ops-task-filter-bar{
  grid-template-columns:repeat(6,minmax(120px,1fr))!important;
  align-items:end;
}
.ns-operational-page .ops-task-tracking-panel .section-heading-row{align-items:center}
.ns-operational-page .ops-list-controls{display:flex;align-items:center;gap:7px;font-size:11px;color:#647782;white-space:nowrap}
.ns-operational-page .ops-list-controls label{font-weight:700;color:#425967}
.ns-operational-page .ops-list-controls select{width:auto;min-width:66px;height:32px;padding:4px 26px 4px 9px}
.ns-operational-page .ops-list-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 2px 10px;border-bottom:1px solid #edf2f4;font-size:11px;color:#435a67}
.ns-operational-page .ops-task-list-compact{gap:7px!important;margin-top:10px!important}
.ns-operational-page .ops-task-list-compact .ops-task-accordion{
  display:block!important;
  grid-template-columns:none!important;
  border-left-width:4px!important;
  border-radius:9px!important;
  overflow:hidden;
  transition:border-color .16s ease,box-shadow .16s ease;
}
.ns-operational-page .ops-task-list-compact .ops-task-accordion.is-open{box-shadow:0 7px 18px rgba(31,58,71,.08);border-color:#cbdde6!important}
.ns-operational-page .ops-task-summary{
  width:100%;min-height:58px;margin:0!important;padding:9px 12px!important;
  display:grid!important;grid-template-columns:150px minmax(220px,1.6fr) minmax(170px,.9fr) minmax(130px,.7fr) 72px 68px;
  align-items:center;gap:12px;border:0!important;border-radius:0!important;background:#fff!important;color:#273e4b!important;
  box-shadow:none!important;text-align:left!important;font:inherit!important;cursor:pointer;
}
.ns-operational-page .ops-task-summary:hover{background:#f8fbfc!important}
.ns-operational-page .ops-task-summary:focus-visible{outline:2px solid #1794c2!important;outline-offset:-2px}
.ns-operational-page .ops-task-summary-state{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.ns-operational-page .ops-task-summary-title{display:flex;min-width:0;flex-direction:column;gap:2px}
.ns-operational-page .ops-task-summary-title strong{font-size:12px;line-height:1.28;color:#1d3644;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ns-operational-page .ops-task-summary-title small{font-size:10px;color:#647985;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ns-operational-page .ops-task-summary-meta,.ns-operational-page .ops-task-summary-progress{display:flex;min-width:0;flex-direction:column;gap:2px}
.ns-operational-page .ops-task-summary-meta small,.ns-operational-page .ops-task-summary-progress small{font-size:8.5px;text-transform:uppercase;letter-spacing:.045em;color:#8797a0;font-weight:700}
.ns-operational-page .ops-task-summary-meta strong{font-size:10.5px;color:#3a515d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ns-operational-page .ops-task-summary-progress{align-items:center;text-align:center}
.ns-operational-page .ops-task-summary-progress strong{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:24px;padding:0 7px;border-radius:999px;background:#edf7fb;color:#08749e;font-size:11px}
.ns-operational-page .ops-task-summary-meta.deadline-overdue strong{color:#b4232f}
.ns-operational-page .ops-task-summary-meta.deadline-today strong{color:#b35c00}
.ns-operational-page .ops-task-summary-meta.deadline-soon strong{color:#9a6900}
.ns-operational-page .ops-task-toggle{display:inline-flex;justify-content:flex-end;align-items:center;gap:5px;font-size:10px;font-weight:800;color:#087ba7}
.ns-operational-page .ops-task-chevron{font-size:16px;line-height:1;transition:transform .18s ease}
.ns-operational-page .ops-task-accordion.is-open .ops-task-chevron{transform:rotate(180deg)}
.ns-operational-page .ops-task-detail{border-top:1px solid #e4edf1;background:#fff}
.ns-operational-page .ops-task-detail-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(310px,.85fr)}
.ns-operational-page .ops-task-detail .ops-task-main{padding:16px 18px!important}
.ns-operational-page .ops-task-detail .ops-task-log{padding:16px!important;background:#f8fbfc!important;border-left:1px solid #e0e8ed!important;border-top:0!important}
.ns-operational-page .ops-task-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.ns-operational-page .ops-task-detail-head h3{margin:0!important;font-size:13px!important}
.ns-operational-page .ops-task-detail-head p{margin:3px 0 0;font-size:10px}
.ns-operational-page .ops-task-log-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}
.ns-operational-page .ops-task-log-title h4{margin:0!important}
.ns-operational-page .ops-task-log-title span{font-size:9px;color:#758893;background:#edf2f4;padding:3px 7px;border-radius:999px}
.ns-operational-page .ops-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid #edf2f4;font-size:10.5px;color:#5f7480}
.ns-operational-page .ops-pagination>div{display:flex;gap:7px}
.ns-operational-page .ops-pagination button{min-width:86px}
.ns-operational-page .ops-pagination button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:1250px){
  .ns-operational-page .ops-task-filter-bar{grid-template-columns:repeat(3,minmax(150px,1fr))!important}
  .ns-operational-page .ops-task-summary{grid-template-columns:130px minmax(210px,1.4fr) minmax(150px,.9fr) minmax(120px,.7fr) 62px 60px}
}
@media(max-width:980px){
  .ns-operational-page .ops-task-summary{grid-template-columns:120px minmax(200px,1fr) minmax(130px,.7fr) 72px 58px}
  .ns-operational-page .ops-task-summary-deadline{display:none}
  .ns-operational-page .ops-task-detail-grid{grid-template-columns:1fr}
  .ns-operational-page .ops-task-detail .ops-task-log{border-left:0!important;border-top:1px solid #e0e8ed!important}
}
@media(max-width:720px){
  .ns-operational-page .ops-task-filter-bar{grid-template-columns:1fr!important}
  .ns-operational-page .ops-list-status{align-items:flex-start;flex-direction:column}
  .ns-operational-page .ops-task-summary{grid-template-columns:1fr auto;gap:6px 10px;padding:10px!important}
  .ns-operational-page .ops-task-summary-state,.ns-operational-page .ops-task-summary-title,.ns-operational-page .ops-task-summary-meta{grid-column:1}
  .ns-operational-page .ops-task-summary-progress{grid-column:2;grid-row:1}
  .ns-operational-page .ops-task-toggle{grid-column:2;grid-row:2 / span 2;align-self:center}
  .ns-operational-page .ops-task-summary-deadline{display:flex}
  .ns-operational-page .ops-task-detail-head{flex-direction:column}
  .ns-operational-page .ops-pagination{align-items:flex-start;flex-direction:column}
}
