/* ══════════════════════════════════════════════════════
   YBT · Nutrición Parenteral
   Aesthetic: Precision Instrument — dark clinical, green accent
   Fonts: Outfit (UI) · JetBrains Mono (valores calculados)
══════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --bg:           #070b0f;
  --bg-2:         #0a0f15;
  --surface:      #0d1520;
  --surface-2:    #111e2e;
  --surface-3:    #162334;
  --border:       rgba(100, 160, 120, 0.08);
  --border-2:     rgba(100, 160, 120, 0.16);
  --border-input: rgba(100, 160, 120, 0.20);

  --text:         #e2edf5;
  --text-2:       #7a9db8;
  --text-3:       #3d5a70;

  --green:        #00c896;
  --green-dim:    rgba(0, 200, 150, 0.09);
  --green-glow:   rgba(0, 200, 150, 0.22);
  --green-2:      #00a07a;

  --amber:        #f5a623;
  --amber-dim:    rgba(245, 166, 35, 0.10);
  --red:          #ff6b6b;
  --blue:         #4da6ff;
  --blue-dim:     rgba(77, 166, 255, 0.10);

  /* componentes */
  --dex-color:    #4da6ff;
  --aa-color:     #00c896;
  --lip-color:    #f5a623;

  --font-ui:      'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Mono', monospace;

  --radius:       14px;
  --radius-sm:    9px;
  --radius-xs:    6px;
  --transition:   160ms cubic-bezier(.4,0,.2,1);
  --shadow:       0 8px 32px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.025) inset;
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font-ui); cursor: pointer; }
input, select { font-family: var(--font-mono); }

/* ── BASE ────────────────────────────────────────────── */
.body-style {
  background:
    radial-gradient(ellipse 900px 600px at -5% 0%, rgba(0,200,150,.045) 0%, transparent 55%),
    radial-gradient(ellipse 600px 500px at 105% 80%, rgba(77,166,255,.03) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── TOPBAR ──────────────────────────────────────────── */
.np-topbar {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 24px 0;
}
.np-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.np-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.np-topbar-brand__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--green-dim);
  border: 1px solid rgba(0,200,150,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}
.np-topbar-brand__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.np-topbar-brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: .04em;
}
.np-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.np-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--transition);
  letter-spacing: .01em;
}
.np-btn--primary {
  background: var(--green);
  color: #030d08;
  border-color: var(--green-2);
}
.np-btn--primary:hover {
  background: #00dea8;
  box-shadow: 0 4px 18px var(--green-glow);
  transform: translateY(-1px);
}
.np-btn--secondary {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text-2);
}
.np-btn--secondary:hover { background: var(--surface-3); color: var(--text); }
.np-btn--pdf {
  background: var(--blue-dim);
  border-color: rgba(77,166,255,.25);
  color: var(--blue);
}
.np-btn--pdf:hover { background: rgba(77,166,255,.18); transform: translateY(-1px); }
.np-btn--ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text-3);
}
.np-btn--ghost:hover { border-color: var(--red); color: var(--red); }
.np-btn:disabled { opacity: .45; pointer-events: none; }

/* ── MAIN LAYOUT ─────────────────────────────────────── */
.np-dash {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
  gap: 18px;
  max-width: 1360px;
  margin: 18px auto 48px;
  padding: 0 24px 100px;
  align-items: start;
}

/* ── LEFT COL ────────────────────────────────────────── */
.np-col-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── CARDS ───────────────────────────────────────────── */
.np-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fadeUp .35s ease both;
}
.np-card:nth-child(2) { animation-delay: .06s; }
.np-card:nth-child(3) { animation-delay: .12s; }

.np-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.np-card-header__num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(0,200,150,.2);
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: .06em;
  flex-shrink: 0;
}
.np-card-header__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.np-card-header__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 4px;
}

/* ── FORM GRID ───────────────────────────────────────── */
.np-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 18px;
}
@media (max-width: 680px) { .np-form-grid { grid-template-columns: 1fr; } }

.np-field { display: flex; flex-direction: column; gap: 6px; }
.np-field--full { grid-column: 1 / -1; }

.np-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.np-label-hint {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  font-weight: 400;
}

/* Input wraps */
.np-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.np-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}
.np-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  min-width: 0;
}
.np-input::placeholder { color: var(--text-3); }
.np-input::-webkit-inner-spin-button { opacity: .4; }
.np-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  padding: 0 10px 0 0;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .03em;
}
.np-select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233d5a70' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.np-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

/* Slider */
.np-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.np-slider-endpoint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}
.np-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green) var(--val, 60%), var(--surface-3) var(--val, 60%));
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
}
.np-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--green-glow);
  cursor: pointer;
  transition: transform var(--transition);
}
.np-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.np-slider-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(0,200,150,.2);
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: auto;
  letter-spacing: .03em;
}

/* Details / colapsable */
.np-details {
  border-top: 1px solid var(--border);
  margin: 0 18px 18px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.np-details-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  list-style: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.np-details-summary:hover { color: var(--text-2); }
.np-details[open] .np-details-summary { color: var(--green); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.np-details-body { padding-top: 4px; }
.np-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  padding: 8px 14px 14px;
  line-height: 1.6;
}

/* ── RIGHT COL: Panel de resultados ──────────────────── */
.np-col-right {
  position: sticky;
  top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fadeUp .25s ease both;
}

/* Panel header */
.np-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.np-panel-header__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .01em;
}
.np-panel-header__indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}
.np-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.np-live-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--green);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* KPIs */
.np-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}
.np-kpi {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--border);
  transition: background var(--transition);
}
.np-kpi:last-child { border-right: none; }
.np-kpi:hover { background: var(--surface-2); }
.np-kpi--accent { background: var(--green-dim); }
.np-kpi__label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.np-kpi__value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
}
.np-kpi--accent .np-kpi__value { color: var(--green); }
.np-kpi__unit {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text-3);
}

/* Result blocks */
.np-result-block {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.np-result-block:last-of-type { border-bottom: none; }
.np-result-block__title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.np-result-block__rule {
  width: 12px;
  height: 2px;
  background: var(--green);
  border-radius: 1px;
  flex-shrink: 0;
}

/* Tables */
.np-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.np-table th {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.np-table th:first-child { text-align: left; }
.np-table td {
  text-align: right;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  transition: background var(--transition);
}
.np-table td:first-child { text-align: left; }
.np-table tbody tr:hover td { background: var(--surface-2); color: var(--text); }
.np-table tbody tr:last-child td { border-bottom: none; }

.np-table__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: var(--text);
}
.np-table__foot td {
  border-top: 1px solid var(--border-2);
  font-weight: 600;
  color: var(--text) !important;
}
.np-table__conc { color: var(--green) !important; }

.np-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.np-dot--dex { background: var(--dex-color); box-shadow: 0 0 5px var(--dex-color); }
.np-dot--aa  { background: var(--aa-color);  box-shadow: 0 0 5px var(--aa-color);  }
.np-dot--lip { background: var(--lip-color); box-shadow: 0 0 5px var(--lip-color); }

/* Mono class for values */
.np-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.01em;
}

/* Stat list (volumen/osm) */
.np-stat-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.np-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.np-stat:last-child { border-bottom: none; }
.np-stat--highlight {
  background: var(--green-dim);
  margin: 0 -16px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(0,200,150,.12) !important;
}
.np-stat--highlight .np-stat__value { color: var(--green); }
.np-stat__label {
  font-size: 11.5px;
  color: var(--text-3);
}
.np-stat__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.np-via { color: var(--amber) !important; }

/* Disclaimer */
.np-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.5;
}
.np-disclaimer svg { flex-shrink: 0; margin-top: 1px; color: var(--amber); }

/* ── ANIMATIONS ──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50%       { opacity: .5; box-shadow: 0 0 3px var(--green); }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1080px) {
  .np-dash { grid-template-columns: 1fr; }
  .np-col-right { position: static; }
}
@media (max-width: 760px) {
  .np-topbar { padding: 12px 16px 0; }
  .np-dash { padding: 0 16px; margin-top: 14px; }
  .np-kpis { grid-template-columns: repeat(3, 1fr); }
  .np-kpi:nth-child(4), .np-kpi:nth-child(5) { border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .np-kpis { grid-template-columns: repeat(2, 1fr); }
  .np-actions { gap: 5px; }
  .np-btn { padding: 7px 10px; font-size: 11.5px; }
}

/* ── LIGHT THEME ─────────────────────────────────────── */
.light-theme {
  --bg:           #f0f5f2;
  --bg-2:         #e8f0ec;
  --surface:      #ffffff;
  --surface-2:    #f4f9f6;
  --surface-3:    #e8f2ee;
  --border:       rgba(0, 120, 80, 0.09);
  --border-2:     rgba(0, 120, 80, 0.18);
  --border-input: rgba(0, 120, 80, 0.22);
  --text:         #0a1f15;
  --text-2:       #2d6045;
  --text-3:       #7aaa90;
  --green-dim:    rgba(0, 160, 110, 0.07);
  --green-glow:   rgba(0, 160, 110, 0.15);
  --blue-dim:     rgba(0, 100, 200, 0.07);
  --amber-dim:    rgba(180, 100, 0, 0.07);
}
.light-theme .body-style {
  background:
    radial-gradient(ellipse 900px 600px at -5% 0%, rgba(0,160,110,.04) 0%, transparent 55%),
    var(--bg);
}
.light-theme .np-select { color: var(--text); background: var(--bg-2); }
.light-theme .np-input  { color: var(--text); }
.light-theme .np-table td { color: var(--text-2); }
.light-theme .np-table__name { color: var(--text); }
.light-theme .np-stat__label { color: var(--text-3); }