/* Portal nutricionista — shell dashboard (mockup) */
:root {
  --nd-bg: #0b0b0c;
  --nd-panel: #141416;
  --nd-card: #1a1a1d;
  --nd-border: rgba(255, 255, 255, 0.1);
  --nd-text: #eee;
  --nd-muted: #9a9a9e;
  --nd-orange: #ff7a00;
  --nd-orange-soft: #ffb366;
  --nd-green: #8bc34a;
  --nd-blue: #5b9cff;
  --nd-purple: #a78bfa;
  --nd-sidebar: 330px;
  --nd-radius: 0.85rem;
  --nd-font: 1.28rem;
}

html, body {
  background: var(--nd-bg) !important;
  color: var(--nd-text);
  min-height: 100%;
  font-size: var(--nd-font);
}

.nd-app {
  display: grid;
  grid-template-columns: var(--nd-sidebar) 1fr;
  min-height: 100vh;
}

.nd-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #101012;
  border-right: 1px solid var(--nd-border);
  padding: 1.75rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  z-index: 20;
}

.nd-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--nd-text);
  padding: 0.45rem 0.55rem;
}
.nd-brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  background: rgba(255, 122, 0, 0.15);
  border: 1px solid rgba(255, 122, 0, 0.45);
  display: grid;
  place-items: center;
  color: var(--nd-orange);
  font-size: 1.45rem;
}
.nd-brand strong { color: var(--nd-orange-soft); }
.nd-brand-title {
  font-size: 1.5rem;
  line-height: 1.25;
}

.nd-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.nd-nav a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  border-radius: 0.75rem;
  color: var(--nd-muted);
  text-decoration: none;
  font-size: 1.5rem;
  border: 1px solid transparent;
}
.nd-nav a:hover {
  color: var(--nd-text);
  background: rgba(255, 255, 255, 0.04);
}
.nd-nav a.is-active {
  color: #fff;
  background: rgba(255, 122, 0, 0.16);
  border-color: rgba(255, 122, 0, 0.35);
}
.nd-nav .ico {
  width: 1.7rem;
  text-align: center;
  opacity: 0.9;
  font-size: 1.4rem;
}

.nd-side-card {
  margin-top: auto;
  padding: 1.25rem;
  border-radius: var(--nd-radius);
  border: 1px solid rgba(255, 122, 0, 0.28);
  background: rgba(255, 122, 0, 0.08);
  color: #e8c9a8;
  font-size: 1.3rem;
  line-height: 1.45;
}

.nd-main {
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
}

.nd-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.nd-hello {
  font-size: 1.85rem;
  font-weight: 700;
}
.nd-hello span {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--nd-muted);
}
.nd-avatar {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  background: #2a2a2e;
  border: 1px solid var(--nd-border);
  display: grid;
  place-items: center;
  color: var(--nd-orange-soft);
  font-weight: 700;
  font-size: 1.2rem;
}

.nd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}
.nd-stat {
  background: var(--nd-card);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}
.nd-stat .label {
  font-size: 1.15rem;
  color: var(--nd-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nd-stat .value {
  font-size: 2.15rem;
  font-weight: 700;
  margin-top: 0.3rem;
}
.nd-stat .badge {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.nd-stat .badge.orange { background: rgba(255,122,0,.15); color: var(--nd-orange-soft); }
.nd-stat .badge.green { background: rgba(139,195,74,.15); color: var(--nd-green); }
.nd-stat .badge.purple { background: rgba(167,139,250,.15); color: var(--nd-purple); }
.nd-stat .badge.blue { background: rgba(91,156,255,.15); color: var(--nd-blue); }

.nd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.95fr);
  gap: 1.2rem;
  align-items: start;
}
.nd-grid--ficha {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.15rem;
  max-width: 1240px;
  margin: 0 auto;
  justify-content: center;
}
.nd-grid--ficha .nd-stack--main {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.nd-grid--ficha .nd-stack--side {
  width: 300px;
}
.nd-grid--ficha .nd-stack--side .nd-card {
  padding: 1.2rem 1.25rem;
}
.nd-grid--ficha .nd-stack--side .nd-card-h h2 {
  font-size: 1.35rem;
}
.nd-grid--ficha .nd-stack--side .nd-btn {
  font-size: 1.25rem;
  padding: 0.8rem 1rem;
}
.nd-grid--ficha .nd-stack--side .nd-timeline .when {
  font-size: 1.18rem;
}
.nd-grid--ficha .nd-stack--side .nd-timeline .what {
  font-size: 1.3rem;
}
.nd-stack { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }

.nd-card {
  background: var(--nd-card);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius);
  padding: 1.4rem 1.5rem;
}
.nd-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1.15rem;
}
.nd-card-h h2 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--nd-orange-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nd-muted { color: var(--nd-muted); font-size: 1.28rem; line-height: 1.5; }

.nd-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 0.6rem;
  padding: 0.85rem 1.25rem;
  font-size: 1.28rem;
  font-weight: 600;
  background: var(--nd-orange);
  color: #111;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.nd-btn:hover { filter: brightness(1.06); }
.nd-btn.ghost {
  background: #2a2a2e;
  color: #eee;
}
.nd-btn.outline {
  background: transparent;
  border: 1px solid rgba(255, 122, 0, 0.55);
  color: var(--nd-orange-soft);
}
.nd-btn.block { width: 100%; }
.nd-btn.sm { padding: 0.6rem 1rem; font-size: 1.18rem; }

.nd-patient-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: start;
}
.nd-patient-avatar {
  width: 4.8rem;
  height: 4.8rem;
  border-radius: 50%;
  background: #2a2a2e;
  border: 1px solid var(--nd-border);
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  color: var(--nd-muted);
}
.nd-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1.4rem;
  font-size: 1.35rem;
}
.nd-kv .k { color: var(--nd-muted); font-size: 1.15rem; }
.nd-kv .v { margin-top: 0.2rem; }

.nd-rings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(210px, 1.1fr);
  gap: 1.1rem;
  align-items: center;
}
.nd-ring {
  text-align: center;
}
.nd-ring svg { width: 130px; height: 130px; display: block; margin: 0 auto; }
.nd-ring .num {
  font-size: 1.3rem;
  font-weight: 700;
  fill: #fff;
}
.nd-ring .sub {
  margin-top: 0.5rem;
  color: var(--nd-muted);
  font-size: 1.2rem;
}
.nd-day-box {
  background: #121214;
  border: 1px solid var(--nd-border);
  border-radius: 0.75rem;
  padding: 1.05rem 1.15rem;
}
.nd-day-box h3 {
  margin: 0 0 0.7rem;
  font-size: 1.25rem;
  color: var(--nd-orange-soft);
}
.nd-day-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.25rem;
  padding: 0.35rem 0;
  color: #ccc;
}
.nd-day-row strong { color: #fff; font-weight: 600; }

.nd-an-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.nd-an-tile {
  appearance: none;
  border: 1px solid var(--nd-border);
  background: #121214;
  color: #eee;
  border-radius: 0.7rem;
  padding: 1rem 1.1rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.nd-an-tile:hover { border-color: rgba(255,122,0,.4); }
.nd-an-tile .t { font-size: 1.15rem; color: var(--nd-muted); }
.nd-an-tile .v {
  margin-top: 0.35rem;
  font-size: 1.35rem;
  word-break: break-word;
}
.nd-an-tile .v.empty { color: #666; }

.nd-actions { display: flex; flex-direction: column; gap: 0.65rem; }
.nd-timeline { list-style: none; margin: 0; padding: 0; }
.nd-timeline li {
  position: relative;
  padding: 0 0 1.15rem 1.25rem;
  border-left: 2px solid rgba(255,122,0,.35);
  margin-left: 0.4rem;
}
.nd-timeline li:last-child { padding-bottom: 0; }
.nd-timeline li::before {
  content: '';
  position: absolute;
  left: -0.45rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--nd-orange);
}
.nd-timeline .when { color: var(--nd-muted); font-size: 1.15rem; }
.nd-timeline .what { margin-top: 0.25rem; font-size: 1.35rem; }

.nd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}
.nd-tab {
  appearance: none;
  border: 1px solid var(--nd-border);
  background: transparent;
  color: var(--nd-muted);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-size: 1.25rem;
}
.nd-tab.is-on {
  color: #111;
  background: var(--nd-orange);
  border-color: var(--nd-orange);
}

.nd-patient-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1.15rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--nd-border);
  background: #121214;
  margin-top: 0.8rem;
}
.nd-patient-card .meta { color: var(--nd-muted); font-size: 1.22rem; margin-top: 0.3rem; }
.nd-patient-card strong { font-size: 1.4rem; }

.nd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 80;
}
.nd-modal-backdrop.is-open { display: flex; }
.nd-modal {
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: var(--nd-panel);
  border: 1px solid var(--nd-border);
  border-radius: 0.85rem;
  padding: 1.35rem 1.45rem 1.55rem;
}
.nd-modal h3 { margin: 0 0 0.8rem; color: var(--nd-orange-soft); font-size: 1.45rem; }
.nd-form label {
  display: block;
  margin-top: 0.95rem;
  color: var(--nd-muted);
  font-size: 1.22rem;
}
.nd-form input, .nd-form select, .nd-form textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.55rem;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  box-sizing: border-box;
}
.nd-msg { margin-top: 0.7rem; font-size: 1.25rem; }
.nd-msg.ok { color: var(--nd-green); }
.nd-msg.err { color: #ff6b6b; }

@media (min-width: 1200px) {
  :root {
    --nd-sidebar: 350px;
    --nd-font: 1.35rem;
  }
  .nd-main { padding: 2rem 2.4rem 3.2rem; }
  .nd-nav a { font-size: 1.6rem; padding: 1.15rem 1.2rem; }
  .nd-brand-title { font-size: 1.6rem; }
  .nd-side-card { font-size: 1.3rem; }
  .nd-hello { font-size: 2rem; }
  .nd-stat .value { font-size: 2.35rem; }
  .nd-card-h h2 { font-size: 1.55rem; }
  .nd-grid--ficha {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .nd-grid--ficha .nd-stack--side { width: 320px; }
}

.nd-mobile-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--nd-border);
  background: #1a1a1d;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .nd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nd-rings { grid-template-columns: 1fr 1fr; }
  .nd-ring:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nd-app { grid-template-columns: 1fr; }
  .nd-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: min(80vw, 280px);
  }
  .nd-app.nav-open .nd-sidebar { transform: none; }
  .nd-mobile-toggle { display: inline-flex; }
  .nd-grid,
  .nd-grid--ficha { grid-template-columns: 1fr; }
  .nd-grid--ficha .nd-stack--side { width: 100%; max-width: 420px; margin: 0 auto; }
  .nd-grid--ficha .nd-stack--main { max-width: none; }
  .nd-patient-hero { grid-template-columns: auto 1fr; }
  .nd-patient-hero .nd-btn { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .nd-stats { grid-template-columns: 1fr; }
  .nd-an-grid { grid-template-columns: 1fr; }
  .nd-kv { grid-template-columns: 1fr; }
  .nd-rings { grid-template-columns: 1fr; }
}

/* ===== Dashboard polish (ficha/plano level) ===== */
.dash-page,
.dash-page .nd-app {
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}
.dash-page .nd-app {
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(255, 122, 0, 0.12), transparent 58%),
    radial-gradient(720px 360px at 95% 0%, rgba(91, 156, 255, 0.06), transparent 55%),
    var(--nd-bg);
}
.dash-page .nd-main {
  padding: 1.5rem 2rem 3.2rem;
}
.dash-page .nd-hello {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.dash-page .nd-sidebar {
  background: linear-gradient(180deg, #121214 0%, #0e0e10 100%);
  border-right-color: rgba(255,255,255,.08);
}
.dash-page .nd-nav a {
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.dash-page .nd-nav a.is-active {
  box-shadow: inset 0 0 0 1px rgba(255,122,0,.15), 0 10px 24px rgba(255,122,0,.08);
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.4rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.dash-hero--compact {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
}
.dash-hero-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  min-width: 0;
}
.dash-hero-icon {
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 0.95rem;
  display: grid;
  place-items: center;
  background: rgba(255,122,0,.16);
  border: 1px solid rgba(255,122,0,.4);
  color: #ffb366;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(255,122,0,.16);
}
.dash-kicker {
  margin: 0 0 0.25rem;
  color: #ffb366;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dash-hero h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #f4f1ea;
  line-height: 1.15;
}
.dash-lead {
  margin: 0.4rem 0 0;
  color: var(--nd-muted);
  font-size: 1.18rem;
  line-height: 1.45;
  max-width: 38rem;
}
.dash-hero-code {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.95rem;
  background: linear-gradient(165deg, rgba(255,122,0,.12), rgba(255,255,255,.03));
  border: 1px solid rgba(255,122,0,.28);
  min-width: 11rem;
  text-align: center;
}
.dash-hero-code span {
  color: #ffb366;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dash-hero-code strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 650;
  color: #fff;
  letter-spacing: 0.02em;
}

.dash-page .nd-stats {
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.dash-page .nd-stat {
  background: linear-gradient(165deg, rgba(28,28,32,.98), rgba(16,16,18,.98));
  border-color: rgba(255,255,255,.09);
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  padding: 1.35rem 1.4rem;
  transition: border-color .15s ease, transform .15s ease;
}
.dash-page .nd-stat:hover {
  border-color: rgba(255,122,0,.35);
  transform: translateY(-1px);
}
.dash-page .nd-stat .label {
  font-size: 1.05rem;
  color: #b8b4ad;
  letter-spacing: 0.05em;
}
.dash-page .nd-stat .value {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  font-size: 2.35rem;
  letter-spacing: -0.02em;
  color: #f4f1ea;
}
.dash-page .nd-stat .value-sm {
  font-size: 1.35rem;
  line-height: 1.3;
  max-width: 14rem;
}
.dash-page .nd-stat .badge {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.dash-page .nd-card--lift {
  background: linear-gradient(165deg, rgba(28,28,32,.98), rgba(16,16,18,.98));
  border-color: rgba(255,255,255,.09);
  box-shadow: 0 16px 36px rgba(0,0,0,.24);
}
.dash-page .nd-card--accent {
  border-color: rgba(255,122,0,.28);
  background:
    linear-gradient(165deg, rgba(255,122,0,.08), transparent 42%),
    linear-gradient(165deg, rgba(28,28,32,.98), rgba(16,16,18,.98));
}
.dash-page .nd-card-h h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-transform: none;
  font-size: 1.45rem;
  color: #f4f1ea;
}
.dash-page .nd-card-h h2::after {
  content: none;
}
.dash-page .nd-patient-card {
  background: rgba(8,8,10,.55);
  border-color: rgba(255,255,255,.08);
  transition: border-color .15s ease, background .15s ease;
}
.dash-page .nd-patient-card:hover {
  border-color: rgba(255,122,0,.4);
  background: rgba(255,122,0,.06);
}
.dash-page .nd-patient-card strong {
  font-size: 1.35rem;
}
.dash-page .nd-btn {
  border-radius: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 20px rgba(255,122,0,.18);
}
.dash-page .nd-btn.ghost,
.dash-page .nd-btn.outline {
  box-shadow: none;
}
.dash-code-footnote {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--nd-muted);
  font-size: 1.15rem;
}
.dash-code-footnote strong {
  color: #ffb366;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
}
.dash-plan-list {
  margin-top: 0.85rem;
}
.dash-page .nd-timeline li {
  border-left-color: rgba(255,122,0,.4);
}
.dash-page .nd-form input,
.dash-page .nd-form select,
.dash-page .nd-form textarea {
  border-radius: 0.75rem;
  border-color: rgba(255,255,255,.12);
  background: #101012;
  font-size: 1.2rem;
  padding: 0.85rem 0.95rem;
}
.dash-page .nd-form input:focus,
.dash-page .nd-form select:focus,
.dash-page .nd-form textarea:focus {
  outline: none;
  border-color: rgba(255,122,0,.55);
  box-shadow: 0 0 0 3px rgba(255,122,0,.14);
}

@media (max-width: 900px) {
  .dash-hero-code { width: 100%; }
}
