/* =====================================================================
   Neontree · Hoja de estilo única (tema oscuro neón)
   ---------------------------------------------------------------------
   Punto único de edición del estilo para TODAS las apps de Neontree.
   Servida por la app raíz en /static/neontree.css.
   Diseño mobile-first: el layout base es para móvil y se amplía en
   pantallas grandes con @media (min-width: 700px).
   ===================================================================== */

/* ---------- Tokens de diseño ---------- */
:root {
    /* Fondos y superficies */
    --bg-1: #0b1220;
    --bg-2: #0f172a;
    --surface: #111827;
    --surface-2: #1e293b;
    --surface-3: #243044;

    /* Líneas / bordes */
    --line: #1f2937;
    --line-soft: #2b3a52;

    /* Texto */
    --text: #e2e8f0;
    --muted: #94a3b8;

    /* Acento neón (cian) */
    --accent: #22d3ee;
    --accent-hover: #38bdf8;
    --accent-contrast: #04121a;   /* texto sobre botón de acento */

    /* Estados */
    --ok: #4ade80;
    --ok-bg: rgba(74, 222, 128, 0.12);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --danger-btn: #ef4444;

    /* Macros (LibreDiet) */
    --macro-prote: #f472b6;
    --macro-hidra: #fbbf24;
    --macro-grasa: #a78bfa;

    /* Forma */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.35);
    --maxw: 1120px;

    /* Tipografía */
    --font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------- Reset básico ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2) 60%);
    background-attachment: fixed;
}

/* Centrado vertical para páginas tipo "card única" (login). */
body.centered {
    display: grid;
    place-items: center;
}

h1, h2, h3 {
    margin: 0 0 8px;
    line-height: 1.2;
}

p {
    margin: 0 0 10px;
    color: var(--muted);
}

a {
    color: var(--accent);
}

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

/* ---------- Topbar / navegación ---------- */
.topbar {
    max-width: var(--maxw);
    margin: 0 auto 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text);
    letter-spacing: 0.2px;
}

.top-actions {
    display: none;   /* oculto en móvil; se muestra en pantallas grandes */
    gap: 10px;
    align-items: center;
}

.top-action {
    display: inline-block;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.92rem;
}

.top-action:hover {
    border-color: var(--accent);
}

/* Menú hamburguesa (móvil) basado en <details> */
.mobile-menu {
    display: block;
    position: relative;
}

.mobile-menu summary {
    list-style: none;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 8px 13px;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.mobile-menu summary::-webkit-details-marker {
    display: none;
}

.mobile-menu-items {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    display: grid;
    gap: 8px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 30;
}

.mobile-menu-items a {
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 9px 11px;
    font-weight: 600;
    font-size: 0.92rem;
}

.mobile-menu-items a:hover {
    border-color: var(--accent);
}

/* ---------- Layout / tarjetas ---------- */
.layout {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.cards {
    display: grid;
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
}

.card h1 {
    font-size: 1.25rem;
}

/* Tarjeta estrecha y centrada (login y formularios cortos) */
.card-narrow {
    width: min(460px, 100%);
}

/* Rejilla de tarjetas auto-ajustable (landing / selectores) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* Tarjeta que es un enlace completo (con efecto hover) */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.card-link:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.card-link h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

/* ---------- Botones / acciones ---------- */
.action,
.btn {
    display: inline-block;
    margin-top: 6px;
    text-decoration: none;
    text-align: center;
    color: var(--accent-contrast);
    background: var(--accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.action:hover,
.btn:hover {
    background: var(--accent-hover);
}

/* Variante secundaria */
.btn-secondary {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--accent);
}

/* Botones del formulario de login (clases existentes) */
.btn-login {
    color: var(--accent-contrast);
    background: var(--accent);
}

.btn-login:hover {
    background: var(--accent-hover);
}

.btn-register {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.btn-register:hover {
    background: var(--surface-3);
    border-color: var(--accent);
}

/* ---------- Formularios ---------- */
form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

label {
    font-size: 0.9rem;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 11px 12px;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

input::placeholder {
    color: var(--muted);
}

button {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    color: var(--accent-contrast);
    background: var(--accent);
}

/* Fila de acciones flexible (varios botones, se ajusta y envuelve) */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* Dos botones en columnas iguales (login y formularios cortos) */
.btn-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

/* ---------- Mensajes ---------- */
.meta {
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

.error {
    margin: 0 0 12px;
    padding: 10px 12px;
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.message {
    margin: 0 0 12px;
    padding: 10px 12px;
    color: var(--ok);
    background: var(--ok-bg);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ---------- Responsive: pantallas grandes ---------- */
@media (min-width: 700px) {
    body {
        padding: 20px;
    }

    .top-actions {
        display: flex;   /* navegación visible en escritorio */
    }

    .mobile-menu {
        display: none;   /* hamburguesa solo en móvil */
    }

    .card {
        padding: 24px;
    }
}

/* =====================================================================
   Componentes de Workout (rutinas, crear/editar, listas) y formularios
   complejos. Reutilizables por cualquier app que los necesite.
   ===================================================================== */

/* Contenedor centrado con apilado vertical de tarjetas */
.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
}

.wrap > * + * {
    margin-top: 14px;
}

/* Sub-tarjeta anidada */
.subcard {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 12px;
}

/* Listas tipo "chip" (rutinas, ejercicios creados) */
.subcard ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.subcard li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px dashed var(--line-soft);
    border-radius: var(--radius-sm);
}

/* Variantes de botón */
.btn.secondary,
.btn-secondary {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    text-decoration: none;
    display: inline-block;
}

.btn.secondary:hover,
.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--accent);
}

.btn.danger,
.btn-danger {
    color: #ffffff;
    background: var(--danger-btn);
}

.btn.danger:hover,
.btn-danger:hover {
    background: #dc2626;
}

/* Mensaje de éxito (alias de .message en texto) */
.ok {
    color: var(--ok);
    margin: 8px 0 4px;
}

/* Rejillas de formulario (mobile-first: 1 columna) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* Bloques de día y filas de ejercicio (crear/editar rutina) */
.day-block {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
}

.exercise-row {
    background: var(--surface);
    border: 1px dashed var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-top: 8px;
}

.exercise-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

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

.rep-line .placeholder {
    display: none;
}

@media (min-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr 2fr auto;
    }

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

    .exercise-head {
        grid-template-columns: 1fr 1fr 160px;
    }

    .rep-line {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .rep-line .placeholder {
        display: block;
        visibility: hidden;
    }
}

/* =====================================================================
   Pantalla "Entrenar" (sidebar de ejercicios, detalle, métricas,
   formulario de series, gráfica de volumen y registros del día).
   ===================================================================== */

.main-card,
.logs-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.title {
    font-size: 1.5rem;
    margin: 0 0 4px;
}

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

.empty {
    color: var(--muted);
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Rejilla principal: lista lateral + detalle */
.panel-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.sidebar {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    min-height: 120px;
}

.sidebar h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.exercise-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.exercise-item {
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    cursor: pointer;
    transition: border 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.exercise-item:hover {
    border-color: var(--line-soft);
}

.exercise-item.active {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.10);
    transform: translateX(4px);
}

.detail {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.exercise-preview {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
}

.exercise-preview h3 {
    margin: 0 0 6px;
}

.exercise-preview p {
    margin: 0;
    color: var(--muted);
}

.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.metric {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.92rem;
    color: var(--muted);
}

.metric strong {
    color: var(--accent);
}

.form-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 12px;
}

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

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

.series-count {
    margin-top: 10px;
    font-weight: 600;
}

/* Gráfica de volumen (canvas) */
.volume-chart {
    position: relative;
    margin-top: 12px;
    margin-bottom: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}

.chart-tooltip {
    display: none;
    position: absolute;
    background: var(--surface-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--text);
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.chart-tip-date {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 2px;
}
.chart-tip-total {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line-soft);
}
.chart-tip-row {
    font-weight: 600;
    color: var(--text);
    padding: 1px 0;
}

.volume-chart h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.volume-chart canvas {
    width: 100%;
    height: 160px;
    display: block;
}

/* Registros del día */
.log-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin: 10px 0 16px;
}

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

.log-row {
    background: var(--surface);
    border: 1px dashed var(--line-soft);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: grid;
    gap: 6px;
}

.log-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

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

.log-pill {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.85rem;
    text-align: center;
}

@media (min-width: 700px) {
    .form-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-row.two {
        grid-template-columns: repeat(2, 1fr);
    }

    .log-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .panel-grid {
        grid-template-columns: 220px 1fr;
    }
}

/* =====================================================================
   LibreDiet (registro de ingestas, categorías/alimentos, progreso de
   macros, historial, modal de edición de alimentos).
   ===================================================================== */

/* Layout de dos columnas (contenido + historial) */
.layout-2col {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.top-user {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 600;
}

/* Botones de categoría y alimento (pills) */
.categories,
.food-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.food-grid {
    margin: 6px 0 12px;
}

.cat-btn,
.food-btn {
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.cat-btn:hover,
.food-btn:hover {
    border-color: var(--accent);
}

.cat-btn.active,
.food-btn.active {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

/* Categorías base (grasa / hidrato / proteína) destacadas en ámbar */
.cat-btn.base-category {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.10);
}

.cat-btn.base-category.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #04121a;
}

/* Acciones rápidas de gramos + botones de guardar/neutral */
.quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.quick button,
.save,
.neutral {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-weight: 700;
    cursor: pointer;
}

.quick button,
.save {
    background: var(--accent);
    color: var(--accent-contrast);
}

.neutral {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line-soft);
}

.save {
    width: 100%;
    margin-top: 8px;
}

/* Progreso diario / semanal de macros */
.daily-progress {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 12px;
}

.progress-item {
    margin-bottom: 12px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.progress-track {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-hover), var(--accent));
}

.progress-fill.weekly {
    background: linear-gradient(90deg, #86efac, #22c55e);
}

.daily-totals {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    margin-top: 8px;
}

.intake-summary {
    display: block;
    text-align: center;
    font-weight: 700;
    color: var(--text);
    margin: 4px 0 16px;
}

/* Historial de ingestas */
.history-item {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.history-filter {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 10px;
}

.history-scroll {
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 4px;
}

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

.delete-btn {
    border: 0;
    border-radius: 8px;
    padding: 6px 8px;
    background: var(--danger-btn);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

/* Panel admin / alta de alimentos */
.admin-panel {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

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

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

.btn.primary {
    border: 0;
    background: var(--accent);
    color: var(--accent-contrast);
    width: 100%;
    margin-top: 8px;
}

/* Modal (editor de alimentos) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

/* Variante ancha del modal (editor de alimentos de LibreDiet) */
.modal-card.modal-wide {
    width: min(980px, 100%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
}

.food-editor-item {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
}

.food-editor-item details {
    width: 100%;
}

.food-editor-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    font-weight: 600;
}

.food-editor-item summary::-webkit-details-marker {
    display: none;
}

.food-editor-item summary .meta {
    font-weight: 500;
    font-size: 0.86rem;
    color: var(--muted);
}

.food-editor-item summary .toggle {
    font-size: 0.9rem;
    color: var(--accent);
    white-space: nowrap;
}

.food-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Secciones desplegables (collapsible) */
.collapsible {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}

.collapsible + .collapsible {
    margin-top: 12px;
}

.collapsible summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.collapsible summary::-webkit-details-marker {
    display: none;
}

.collapsible summary::after {
    content: "\25B6";
    font-size: 0.8rem;
    color: var(--muted);
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.collapsible[open] summary::after {
    transform: rotate(90deg);
}

@media (min-width: 700px) {
    .grid-two {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 961px) {
    .layout-2col {
        grid-template-columns: 1fr 340px;
    }
}

/* =====================================================================
   Estado físico y estrategia (secciones, sliders, modales).
   ===================================================================== */

.section {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 12px;
}

.section h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.slider-wrap {
    margin-top: 8px;
}

.slider-value {
    font-weight: 600;
    color: var(--text);
    margin-top: 6px;
    font-size: 0.92rem;
}

.strategy-slider,
.macro-slider {
    accent-color: var(--accent);
    border-radius: 999px;
    height: 14px;
}

.strategy-slider {
    background: linear-gradient(
        to right,
        #ef4444 0%,
        #ef4444 12.5%,
        #facc15 12.5%,
        #facc15 25%,
        #22c55e 25%,
        #22c55e 75%,
        #facc15 75%,
        #facc15 87.5%,
        #ef4444 87.5%,
        #ef4444 100%
    );
}

.macro-slider {
    background: linear-gradient(to right, #22c55e 0%, var(--accent) 50%, #22c55e 100%);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-contrast);
}

.btn-cancel {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line-soft);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Bloque "último registro" dentro de los modales */
.last-record {
    margin-top: 14px;
    border: 1px dashed var(--line-soft);
    border-radius: var(--radius);
    padding: 10px;
    background: var(--surface-2);
}

/* ---- Constructor de platos ---- */
.plato-builder {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.plato-ing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.plato-ing-name {
    flex: 1;
    color: var(--text);
    line-height: 1.4;
}

.plato-del-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    font-size: 0.8rem;
    cursor: pointer;
    line-height: 1.4;
}

.plato-del-btn:hover {
    background: var(--danger-bg);
}

.plato-totals {
    padding: 8px 10px;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--line-soft);
}
