:root {
    --bg: #0e150e;
    --surface: #161d16;
    --surface-2: #1a221a;
    --surface-3: #242c24;
    --border: #3d4a3d;
    --outline: #869585;
    --text: #dce5d9;
    --text-dim: #9fb09c;
    --primary: #4be277;
    --primary-container: #22c55e;
    --on-primary: #04240f;
    --money: #4be277;
    --danger: #ffb4ab;
    --danger-bg: #93000a;
    --blue: #adc6ff;
    --brand: var(--primary);
}

.theme-light {
    --bg: #f7f9fb;
    --surface: #ffffff;
    --surface-2: #f2f4f6;
    --surface-3: #e6e8ea;
    --border: #bccbb9;
    --outline: #6d7b6c;
    --text: #191c1e;
    --text-dim: #3d4a3d;
    --primary: #16a34a;
    --primary-container: #22c55e;
    --on-primary: #ffffff;
    --money: #006e2f;
    --danger: #ba1a1a;
    --danger-bg: #ffdad6;
    --blue: #3b82f6;
    /* Identidad de marca del diseño claro: gris-azulado discreto para textos e
       iconos de navegación; el verde queda reservado para CTA, drum y dinero. */
    --brand: #515f74;
}

* { box-sizing: border-box; }

/* App.razor usa <FocusOnNavigate Selector="h1" /> (accesibilidad: anuncia el
   cambio de página a lectores de pantalla) haciendo foco programático en el
   h1 de cada página al navegar. Como h1 no es parte del tab order normal
   (sin tabindex), el usuario nunca llega ahí con teclado — así que el
   contorno de foco por defecto del navegador solo se ve como un destello
   que aparece y desaparece al cargar, sin aportar nada. Se apaga sin
   afectar el foco real de teclado en elementos interactivos. */
h1:focus { outline: none; }

html, body {
    margin: 0;
    height: 100%;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

#app { height: 100vh; }

@font-face {
    font-family: "Material Symbols Outlined";
    font-style: normal;
    font-weight: 100 700;
    src: url("../fonts/MaterialSymbolsOutlined.woff2") format("woff2");
}
.material-symbols-outlined { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; }

.simtoc-loader { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 22px; padding: 24px; background: #f4f7f6; color: #172018; }
.simtoc-loader img { width: min(210px, 72vw); height: auto; filter: drop-shadow(0 16px 26px rgba(18,109,53,0.12)); }
.loader-flow { display: grid; grid-template-columns: 18px 54px 18px 54px 18px; align-items: center; justify-content: center; gap: 0; }
.loader-flow span { width: 18px; height: 18px; border-radius: 6px; border: 2px solid #22c55e; background: #fff; box-shadow: 0 8px 18px rgba(18,109,53,0.12); animation: loader-node 1.2s ease-in-out infinite; }
.loader-flow span.active { background: #22c55e; border-color: #006e2f; animation-delay: .16s; }
.loader-flow span:last-child { animation-delay: .32s; }
.loader-flow i { height: 3px; background: linear-gradient(90deg, #bbf7d0, #22c55e); transform-origin: left center; animation: loader-line 1.2s ease-in-out infinite; }
.loader-flow i:nth-of-type(2) { animation-delay: .18s; }
.loader-track { width: min(360px, 78vw); height: 8px; overflow: hidden; border-radius: 999px; background: #e2e8f0; box-shadow: inset 0 0 0 1px rgba(109,123,108,0.12); }
.loader-fill { height: 100%; width: var(--blazor-load-percentage, 0%); min-width: 16px; border-radius: inherit; background: linear-gradient(90deg, #006e2f, #22c55e); transition: width .08s ease-out; }
.loading-progress-text { min-height: 20px; text-align: center; color: #536258; font-size: 13px; font-weight: 850; letter-spacing: .02em; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Preparando simulacion"); }
@keyframes loader-node { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes loader-line { 0%, 100% { transform: scaleX(.62); opacity: .64; } 50% { transform: scaleX(1); opacity: 1; } }

#blazor-error-ui { background: var(--danger-bg); color: #fff; bottom: 0; display: none; left: 0; padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---- App shell ---- */
.sim-app { display: grid; grid-template-columns: 56px 260px minmax(0, 1fr); grid-template-rows: 1fr auto; height: 100vh; min-height: 100vh; overflow-x: auto; }
.sidebar { grid-column: 2; grid-row: 1 / 3; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; min-width: 200px; position: relative; }
.canvas-area { grid-column: 3; grid-row: 1 / 2; position: relative; overflow: auto; min-width: 0; background:
    radial-gradient(rgba(255,255,255,0.14) 1.4px, transparent 1.4px) 0 0 / 22px 22px, var(--bg); }
.no-grid-dots .canvas-area { background: var(--bg); }
.canvas-area.pan-mode { cursor: grab; }
.canvas-area.pan-mode.panning { cursor: grabbing; }

/* ---- Riel de íconos: navegación (Info/Eventos/Analytics) y herramientas
   (tema/sonido/pan/info de nodo) que antes vivían repartidas entre el
   sidebar y el footer. Solo íconos: Recursos queda fuera porque se usa
   para arrastrar y soltar, y necesita estar siempre visible. ---- */
.icon-rail { grid-column: 1; grid-row: 1 / 3; background: var(--surface-3); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; }
.rail-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.rail-btn { width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.rail-btn:hover { background: var(--surface-2); color: var(--text); }
.rail-btn.active { background: var(--surface-2); color: var(--brand); }
.rail-divider { width: 28px; height: 1px; background: var(--border); margin: 8px 0; }
.rail-spacer { flex: 1; }

/* En pantallas angostas, el ancho fijo de riel+sidebar puede superar el
   viewport; con overflow-x:auto en .sim-app queda alcanzable haciendo
   scroll horizontal en vez de quedar recortado sin forma de llegar a él. */
@media (max-width: 1150px) {
    .sim-app { grid-template-columns: 56px 220px 1fr; }
    .sidebar { min-width: 180px; }
}

/* La cartera de pedidos ya NO reserva una columna del grid: es un panel
   deslizante que se sobrepone al canvas (evita robarle ancho permanente
   cuando no se está usando). */
/* Cartera de pedidos: centrada y de alto completo, igual que el resto de los
   paneles grandes (Reportes, configuración de nodo) -- antes era un cajón
   deslizante pegado al borde derecho, inconsistente con ese patrón. */
.orderbook {
    position: fixed; top: 0; bottom: 0; left: 50%; width: 400px; max-width: 92vw;
    background: var(--surface); border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: translateX(-50%) scale(0.97); opacity: 0; visibility: hidden;
    transition: transform .18s ease, opacity .18s ease, visibility .18s;
    z-index: 70; box-shadow: 0 12px 40px #000a;
}
.orderbook.open { transform: translateX(-50%) scale(1); opacity: 1; visibility: visible; }
.ob-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 65; }

/* Panel de nodo (restricción/horario/mejoras): mismo patrón de cajón
   deslizante que la cartera de pedidos — reemplaza al popover angosto que
   se quedaba corto para toda la información de un nodo. */
.node-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 90vw;
    background: var(--surface); color: var(--text); border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .22s ease;
    z-index: 70; box-shadow: -12px 0 32px #0006;
}
.node-panel.open { transform: translateX(0); }
.node-panel .ob-body { overflow-y: auto; }
.node-panel .ob-body .btn { flex: none; }
.rotation-panel { width: 420px; }
.rotation-card { padding: 10px 0 14px; border-bottom: 1px solid var(--border); }
.rotation-card:last-child { border-bottom: none; }
.rotation-order { margin: 6px 0; padding-left: 18px; display: grid; gap: 3px; font-size: 12px; color: var(--text-dim); }
.rotation-order li.current { color: var(--brand, #22c55e); font-weight: 700; }
.rotation-step-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.drum-row .btn { flex: none; }
.controlbar { grid-column: 3 / 4; grid-row: 2 / 3; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; min-height: 52px; background: var(--surface-3); border-top: 1px solid rgba(75,226,119,0.12); box-shadow: 0 0 8px rgba(75,226,119,0.08); overflow-x: auto; position: relative; }
.theme-light .controlbar { background: rgba(255,255,255,0.95); border-top: 1px solid var(--surface-2); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08); }
.theme-light .controlbar .divider { background: var(--surface-2); }
.ob-head-actions { display: flex; align-items: center; gap: 4px; }
.ob-collapse { background: none; border: none; color: var(--text-dim); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ob-collapse:hover { color: var(--primary); }

.bell-btn { position: relative; background: none; border: none; color: var(--text-dim); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.bell-btn:hover { color: var(--primary); background: rgba(255,255,255,0.05); }
.bell-badge { position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: var(--danger); color: #4a0004; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; }


.brand { font-size: 22px; font-weight: 700; color: var(--brand); }
.brand small { display: block; font-size: 12px; color: var(--text-dim); font-weight: 400; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin: 20px 0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--text-dim); font-size: 13px; font-weight: 500; text-decoration: none; border-left: 2px solid transparent; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { color: var(--brand); font-weight: 700; border-left-color: var(--brand); background: var(--surface-3); }
.nav a .material-symbols-outlined { font-size: 20px; }

/* Header de secciones (Recursos/Eventos/Analytics): tira horizontal
   compacta en vez de 3 filas apiladas, para no comerse espacio vertical
   del sidebar. */
.nav.nav-tabs { flex-direction: row; gap: 2px; margin: 14px 0 18px; }
.nav.nav-tabs a { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px; border-left: none; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; font-size: 10px; text-align: center; }
.nav.nav-tabs a .material-symbols-outlined { font-size: 18px; }
.nav.nav-tabs a.active { border-left: none; border-bottom-color: var(--brand); }

.section-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 8px 0 12px; }
.section-title.with-icon { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; font-weight: 700; color: var(--text-dim); }
.section-title.with-icon .material-symbols-outlined { font-size: 16px; color: var(--brand); }
.hint { font-size: 11px; color: var(--text-dim); font-style: italic; margin: 0 0 10px; }

.res-card { position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.res-card[draggable="true"] { cursor: grab; }
.res-card.dragging { opacity: 0.4; }
.res-card-top { display: flex; align-items: center; gap: 10px; }
.res-card .chip { width: 26px; height: 26px; border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; }
.res-card .name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-status { flex: none; font-size: 9px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; }
.res-status.idle { background: var(--surface-3); color: var(--text-dim); }
.res-status.setup { background: rgba(234,179,8,0.18); color: #eab308; }
.res-status.working { background: rgba(34,197,94,0.18); color: var(--primary); animation: res-status-pulse 1.6s ease-in-out infinite; }
@keyframes res-status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.res-meta-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; font-size: 11px; color: var(--text-dim); }
.res-meta-grid .meta-val { text-align: right; font-weight: 600; color: var(--text); }
.buy-resource-icon { flex: none; background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; display: inline-flex; }
.buy-resource-icon .material-symbols-outlined { font-size: 20px; }
.buy-resource-icon:hover { color: var(--money); }

.color-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.color-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.color-chip.active { border-color: var(--brand); color: var(--brand); background: var(--surface-3); }
.color-chip.dot { width: 20px; height: 20px; padding: 0; border-radius: 50%; background: var(--chip-color); border: 2px solid transparent; }
.color-chip.dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--chip-color); }

.events-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.events-table th { text-align: left; color: var(--text-dim); font-weight: 500; padding: 8px; background: var(--surface-3); border-bottom: 1px solid var(--border); }
.events-table td { padding: 8px; border-bottom: 1px solid rgba(61,74,61,0.5); color: var(--text); }
.go-btn { background: var(--primary-container); color: var(--on-primary); border: none; border-radius: 999px; padding: 3px 12px; font-weight: 700; cursor: pointer; font-size: 11px; }

.info-text { font-style: normal; line-height: 1.5; color: var(--text); }
.info-table { width: 100%; border-collapse: collapse; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.info-table th { text-align: left; color: var(--text-dim); font-weight: 500; padding: 6px 8px; background: var(--surface-3); border-bottom: 1px solid var(--border); }
.info-table td { padding: 6px 8px; border-bottom: 1px solid rgba(61,74,61,0.5); color: var(--text); }

.side-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.new-sim-btn { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; background: var(--primary-container); color: var(--on-primary); border-radius: 10px; font-weight: 700; font-size: 13px; text-decoration: none; border: none; cursor: pointer; }
.new-sim-btn .material-symbols-outlined { font-size: 18px; }
.new-sim-btn:hover { filter: brightness(1.05); }

/* ---- Order book ---- */
.ob-head { padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.theme-light .ob-head { color: #111827; }
.ob-head-title { display: flex; flex-direction: column; gap: 2px; }
.ob-sub { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.ob-tabs { display: flex; padding: 6px 12px 0; border-bottom: 1px solid var(--border); }
.ob-tabs button { padding: 8px 14px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim); font-weight: 500; font-size: 13px; cursor: pointer; }
.ob-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.ob-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.order-card { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 14px 18px; overflow: hidden; }
.order-card .stripe { position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.order-card.hot { border-color: rgba(255,180,171,0.4); }
.order-card.hot .stripe { background: var(--danger); }
.order-card .stripe.std { background: var(--blue); }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order-id { font-size: 12px; color: var(--text-dim); }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tag.hot { background: var(--danger-bg); color: #ffdad6; }
.tag.std { background: #0566d9; color: #e6ecff; }
.order-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.order-grid .lbl { color: var(--text-dim); font-size: 11px; align-self: center; }
.order-grid .val { text-align: right; font-weight: 600; }
.order-grid .val.price { color: var(--primary); font-variant-numeric: tabular-nums; }
.order-grid .val.late { color: var(--danger); }
.order-grid .val.no-drum { grid-column: 1 / -1; text-align: left; color: var(--text-dim); font-size: 11px; font-style: italic; font-weight: 500; }
.order-actions { display: flex; gap: 8px; }
.btn { flex: 1; border-radius: 6px; padding: 7px; font-weight: 700; cursor: pointer; font-size: 12px; border: 1px solid var(--outline); background: transparent; color: var(--text); }
.btn.accept { background: var(--primary-container); color: var(--on-primary); border: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.order-status { font-size: 11px; color: var(--text-dim); text-align: center; padding: 6px; border: 1px dashed var(--border); border-radius: 6px; }
.order-status.accepted { color: var(--primary); border-color: rgba(75,226,119,0.3); }
.order-card.hist .order-grid { margin-bottom: 0; }

/* ---- Control bar ---- */
/* Tamaño/forma iguales en ambos temas (solo el color cambia vía variables),
   para que alternar tema no "salte" el tamaño de los botones del footer. */
.ctrl-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease, color .2s ease;
}
.ctrl-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    transform: scale(1.05);
}
.ctrl-btn:active {
    transform: scale(0.97);
}
.ctrl-btn.primary {
    width: 38px;
    height: 38px;
    background: var(--primary-container);
    color: var(--on-primary);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(34,197,94,0.15);
}
.ctrl-btn.primary:hover {
    filter: brightness(1.05);
}
.ctrl-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.ctrl-btn .material-symbols-outlined {
    font-size: 19px;
}
.ctrl-btn.sm .material-symbols-outlined {
    font-size: 16px;
}
.theme-light .speed-wrap,
.theme-light .zoom-wrap,
.theme-light .readout {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: 999px;
    padding: 5px 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.theme-light .speed-wrap {
    gap: 8px;
}
.theme-light .zoom-wrap {
    gap: 8px;
}
.theme-light .readout {
    gap: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}
.theme-light .readout.money {
    color: var(--money);
    font-weight: 700;
}
.theme-light .zoom-pct,
.theme-light .speed-wrap span {
    color: var(--text-dim);
    font-size: 11px;
}
.theme-light .readout .material-symbols-outlined {
    color: var(--primary);
}
.theme-light .speed-wrap input[type=range] {
    margin: 0 6px;
}
.speed-val {
    color: var(--text);
    font-size: 11px;
    min-width: 20px;
    text-align: center;
}
.ctrl-btn.sm {
    width: 28px;
    height: 28px;
}
.ctrl-btn.sm .material-symbols-outlined {
    font-size: 16px;
}
.divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 2px;
    flex: none;
}
.readout { font-variant-numeric: tabular-nums; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; color: var(--text); white-space: nowrap; flex: none; }
.readout .material-symbols-outlined { font-size: 15px; color: var(--primary); }
.readout.money { color: var(--money); font-weight: 700; font-size: 13px; }
.readout.throughput { color: var(--primary); }
.readout-warn { color: var(--danger, #e5484d); font-weight: 700; }
.readout-warn .material-symbols-outlined { color: var(--danger, #e5484d); }
.readout.throughput .material-symbols-outlined { color: var(--primary); }
.spacer { flex: 1; }
.speed-wrap { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); white-space: nowrap; flex: none; }
.speed-wrap .material-symbols-outlined { font-size: 15px; }
.zoom-wrap { display: flex; gap: 2px; align-items: center; flex: none; }
.zoom-pct { font-size: 11px; color: var(--text-dim); width: 34px; text-align: center; }
.zoom-preset { font-size: 11px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 4px; text-align: center; cursor: pointer; }
input[type=range] { accent-color: var(--primary); }

/* ---- Canvas layers ---- */
.canvas-sizer { position: relative; }
.canvas-inner { position: relative; }
.wire-layer { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; }
/* La línea punteada moviéndose comunica "flujo activo": si sigue animando en
   pausa, sugiere que algo se mueve cuando no — por eso solo anima con
   .running (la simulación efectivamente corriendo), no siempre. */
.wire-layer .flow-line { stroke-dasharray: 7 5; }
.wire-layer.running .flow-line { animation: simtoc-dash 1s linear infinite; }
.no-flow-animations .wire-layer.running .flow-line { animation: none; }
@keyframes simtoc-dash { to { stroke-dashoffset: -12; } }

/* Encabezados tipo Excel (columna A,B,C.. arriba / fila 1,2,3.. a la
   izquierda) para referenciar la ubicación de cada nodo, como en la
   versión original. Viven dentro de canvas-inner para escalar y
   desplazarse junto con los nodos. */
.grid-headers { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.grid-col-label { position: absolute; top: 4px; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--text-dim); }
.grid-row-label { position: absolute; left: 4px; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: var(--text-dim); }

/* Estado activo del botón de paneo (mano) en la barra de control. */
.ctrl-btn.sm.on { background: var(--primary-container); color: var(--on-primary); border-color: transparent; }

/* ---- Nodes (dark cards con acento de color) ---- */
.node {
    position: absolute; width: 64px; height: 64px; border-radius: 12px; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border); text-align: center;
    box-shadow: 0 4px 12px #0007;
}
.node.wc { border-left-width: 4px; }
.node-name { font-size: 13px; font-weight: 700; line-height: 1.1; max-width: 58px; white-space: normal; word-break: break-word; padding: 0 2px; }
.node-name.sm { font-size: 10.5px; max-width: 60px; }
.node-name.xs { font-size: 9px; max-width: 62px; }
.node-time { font-size: 10px; color: var(--text-dim); }
.node-time-row { margin-top: 3px; }
.node.warehouse .material-symbols-outlined,
.node.market .material-symbols-outlined { font-size: 26px; color: var(--text-dim); }
.node.market .material-symbols-outlined { color: var(--primary); }
.node .io-label { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--text-dim); }
.node .io-label.sm { font-size: 10px; }
.node .io-label.xs { font-size: 9px; white-space: normal; max-width: 84px; line-height: 1.05; text-align: center; }

.node.wc.droppable { outline: 2px dashed var(--primary); outline-offset: 4px; box-shadow: 0 0 0 4px rgba(75,226,119,0.15), 0 4px 12px #0007; }

/* ---- Sensación de proceso: pulso + barra de progreso mientras trabaja ---- */
.node.wc.busy { animation: simtoc-busy-pulse 1.4s ease-in-out infinite; }
@keyframes simtoc-busy-pulse {
    0%, 100% { box-shadow: 0 4px 12px #0007; }
    50% { box-shadow: 0 4px 12px #0007, 0 0 0 5px color-mix(in srgb, var(--primary) 40%, transparent); }
}
.node.wc.drum.busy { animation: simtoc-busy-pulse-drum 1.4s ease-in-out infinite; }
@keyframes simtoc-busy-pulse-drum {
    0%, 100% { box-shadow: 0 0 0 2px var(--danger), 0 0 18px rgba(255,180,171,0.45); }
    50% { box-shadow: 0 0 0 2px var(--danger), 0 0 24px rgba(255,180,171,0.75); }
}
.no-flow-animations .node.wc.busy,
.no-flow-animations .node.wc.drum.busy { animation: none; }
/* Icono girando junto al tiempo: señal de movimiento inequívoca, no depende
   de ningún ancho ni porcentaje. */
.node-time-row { display: flex; align-items: center; justify-content: center; gap: 4px; }
.node-spin { font-size: 12px !important; color: var(--node-accent, var(--primary)); animation: simtoc-spin 0.9s linear infinite; }
@keyframes simtoc-spin { to { transform: rotate(360deg); } }

/* Barra de proceso: vive en el flujo normal (no pegada al borde), así no
   choca con los badges de las esquinas. La PISTA completa siempre tiene un
   rayado animado (se ve movimiento desde el primer instante, incluso con
   0% de avance); el RELLENO sólido, sin rayas, crece encima mostrando el
   progreso real de la tarea. */
.node-progress {
    position: relative;
    width: 42px;
    height: 6px;
    margin-top: 5px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(0,0,0,0.35);
}
.theme-light .node-progress { background: rgba(17,24,39,0.18); }
.node-progress::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.55) 0 4px, transparent 4px 8px);
    background-size: 12px 12px;
    animation: simtoc-progress-stripes 0.6s linear infinite;
}
.node-progress-fill {
    position: relative;
    z-index: 1;
    height: 100%;
    background-color: var(--node-accent, var(--primary));
    transition: width .3s linear;
}
@keyframes simtoc-progress-stripes { to { background-position: 12px 0; } }

.node .badge { position: absolute; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px #0008; white-space: nowrap; }
.node .badge.queue { top: -8px; right: -8px; background: #fff; color: #0b0f14; }
.theme-light .node .badge.queue { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.theme-light .node.drum .badge.queue { background: var(--money); color: #fff; border-color: transparent; }
.node .badge.queue.kanban-full { background: var(--danger); color: #fff; border-color: transparent; }
.node .badge.reject { top: -8px; left: -8px; background: var(--danger); color: #4a0004; }
.node .node-res { position: absolute; bottom: -8px; right: -6px; display: inline-flex; align-items: center; gap: 2px; font-size: 10px; background: #0b0f14; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 1px 5px; color: #fff; font-weight: 700; }
.node .node-res .material-symbols-outlined { font-size: 12px; line-height: 1; }
.node-info-tip { position: absolute; top: calc(100% + 6px); left: 0; transform-origin: top left; white-space: nowrap; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 10px; line-height: 1.5; box-shadow: 0 6px 16px #0008; z-index: 20; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .1s ease; }
.node.wc:hover .node-info-tip { opacity: 1; visibility: visible; }

/* ---- DBR: drum, buffer, rope ---- */
.node.drum { box-shadow: 0 0 0 2px var(--danger), 0 0 18px rgba(255,180,171,0.45); }

/* Resalta el nodo cuyo modal de configuración está abierto — memoria visual
   de "qué estoy mirando" en plantas con muchos nodos. outline (no box-shadow)
   para no pisar el anillo del drum ni el dashed de droppable, que ya usan
   box-shadow/outline propios. */
.node.selected { outline: 3px solid var(--primary); outline-offset: 3px; z-index: 3; }
.drum-toggle { position: absolute; bottom: -9px; left: -9px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-3); color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 2; }
.drum-toggle .material-symbols-outlined { font-size: 14px; }
.drum-toggle:hover { border-color: var(--danger); color: var(--danger); }
.drum-toggle.on { background: var(--danger); color: #4a0004; border-color: var(--danger); }
.drum-tag { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: var(--danger); color: #4a0004; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; padding: 1px 6px; border-radius: 4px; box-shadow: 0 1px 4px #0008; }
.node.wc.closed { opacity: 0.55; filter: grayscale(0.6); }
.closed-tag, .overtime-tag { position: absolute; top: -10px; right: -8px; font-size: 13px; line-height: 1; background: var(--surface); border-radius: 50%; padding: 2px; box-shadow: 0 1px 4px #0008; }
.buffer-gauge { position: absolute; width: 12px; z-index: 1; background: #0e150e; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.buffer-fill { position: absolute; bottom: 0; left: 0; width: 100%; transition: height .2s ease, background .2s; }
.buffer-label { position: absolute; z-index: 1; font-size: 9px; font-weight: 700; color: var(--text-dim); white-space: nowrap; width: 40px; text-align: center; }
.wire-layer .rope-line { stroke-dasharray: 4 4; animation: rope-dash 3s linear infinite; }
@keyframes rope-dash { to { stroke-dashoffset: 16; } }

.dbr-control { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.dbr-control .dbr-drum { color: var(--danger); font-weight: 700; }
.dbr-control b { color: var(--text); min-width: 16px; text-align: center; }
.dbr-control button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.dbr-control button:hover { border-color: var(--primary); }
.dbr-hint { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.rope-select { display: flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid var(--border); }
.rope-select select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; padding: 2px 4px; }

.node.warehouse.clickable { cursor: pointer; }
.node.warehouse.clickable:hover { border-color: var(--primary); }

/* ---- Sidebar: tarjetas de drum (DBR) ---- */
.drum-card { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--danger); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.drum-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zone-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.drum-card-name { font-weight: 700; font-size: 13px; }
.drum-card-lvl { margin-left: auto; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.drum-remove { width: 20px; height: 20px; border: none; background: none; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 4px; }
.drum-remove:hover { color: var(--danger); background: rgba(255,180,171,0.1); }
.drum-remove .material-symbols-outlined { font-size: 16px; }
.drum-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.overtime-cost-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-dim); margin-top: 8px; padding: 8px; background: var(--surface-2); border-radius: 6px; }
.overtime-cost-preview b { color: var(--primary); text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper b { color: var(--text); min-width: 16px; text-align: center; }
.stepper button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; }
.stepper button:hover { border-color: var(--primary); }
.anchor-select { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; padding: 3px 6px; max-width: 140px; }

.reassign-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.reassign-res { font-size: 11px; color: var(--text-dim); flex: none; min-width: 60px; }
.reassign-count { width: 60px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; padding: 3px 6px; }

/* ---- Popover de restricción (anclado al nodo) ---- */
.dbr-popover { position: absolute; top: 74px; left: 0; transform-origin: top left; width: 240px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: 0 10px 28px #000c; z-index: 10; cursor: default; text-align: left; }
.dbr-pop-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.dbr-pop-hint { font-size: 11px; color: var(--text-dim); margin: 8px 0 0; line-height: 1.4; }
.dbr-mark { width: 100%; padding: 8px; }
.dbr-unmark { width: 100%; padding: 7px; margin-top: 10px; border: 1px solid var(--border); color: var(--danger); background: transparent; }
.zone-lvl { font-variant-numeric: tabular-nums; }
.upgrade-head { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.upgrade-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.upgrade-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upgrade-info b { font-size: 11px; color: var(--text); line-height: 1.3; }
.upgrade-desc { font-size: 10px; color: var(--text-dim); line-height: 1.3; }
.upgrade-buy { flex-shrink: 0; padding: 5px 10px; font-size: 11px; border-radius: 6px; border: 1px solid var(--primary); color: var(--primary); background: transparent; cursor: pointer; }
.upgrade-buy:hover { background: var(--primary); color: #fff; }
.dbr-popover .err { color: var(--danger); font-size: 11px; margin-top: 8px; }

/* ---- Modal de compra ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; width: 420px; max-width: 92vw; max-height: 86vh; overflow-y: auto; box-shadow: 0 12px 40px #000a; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-body { padding: 16px; }
.mp-buffer-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.mp-buffer-row .mp-buffer-lvl { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.supplier-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: var(--surface-2); }
.supplier-card:hover { border-color: var(--outline); }
.supplier-card.sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.supplier-card .s-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.supplier-card .s-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--text-dim); }
.purchase-form { margin-top: 14px; }
.purchase-form label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.purchase-form input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 8px 10px; font-size: 14px; }
.cost-row { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; font-size: 13px; color: var(--text-dim); }
.cost-row .money { color: var(--money); font-size: 17px; }
.purchase-form .err { color: var(--danger); font-size: 12px; margin-bottom: 10px; }
.purchase-form .btn.accept { width: 100%; padding: 9px; }
.pending-row { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; border-bottom: 1px solid rgba(61,74,61,0.5); }
.pending-row .pend-time { color: var(--text-dim); }

/* ---- Analytics / KPIs ---- */
.kpi-modal { width: 640px; max-width: 92vw; height: 620px; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.info-modal { width: 560px; max-width: 92vw; max-height: 82vh; }
/* El modal de configuración de nodo usa el mismo patrón de pestañas
   verticales que Analytics, pero a diferencia de este ocupa casi toda
   la altura de pantalla — tiene bastante más contenido variable
   (horario, mantenimiento, mejoras, reasignación) y no tiene sentido
   fijarlo a una altura corta como el resumen de KPIs. */
.node-config-modal { height: 100vh; max-height: 100vh; border-radius: 0; }
/* Reportes: mismo criterio adoptado para paneles grandes (editor-node-modal,
   simlab-props-modal) — ocupan el alto completo de la pantalla en vez de
   quedar flotando a media altura. */
.report-modal { height: 100vh; max-height: 100vh; border-radius: 0; }
/* Info de la planta: mismo criterio de alto completo que los demás paneles grandes. */
.plant-info-modal { width: 640px; height: 100vh; max-height: 100vh; border-radius: 0; display: flex; flex-direction: column; overflow: hidden; }
.plant-info-modal .modal-body { flex: 1; overflow-y: auto; }
.info-badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.info-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 700; }
.info-badge .material-symbols-outlined { font-size: 17px; color: var(--brand, #22c55e); }
.info-badge strong { font-weight: 900; }
.info-badge.muted { color: var(--text-dim); font-weight: 600; border-style: dashed; }
.info-badge.muted .material-symbols-outlined { color: var(--text-dim); }
.kpi-modal-body { display: flex; flex: 1; min-height: 0; }
.kpi-tabs { display: flex; flex-direction: column; gap: 2px; width: 170px; flex: none; border-right: 1px solid var(--border); padding: 10px; background: var(--surface-2); overflow-y: auto; }
.kpi-tabs button { text-align: left; background: none; border: none; color: var(--text-dim); font-size: 12px; font-weight: 600; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.kpi-tabs button:hover { background: var(--surface-3); color: var(--text); }
.kpi-tabs button.active { background: var(--surface-3); color: var(--brand); }
.kpi-tab-content { flex: 1; overflow-y: auto; min-width: 0; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.kpi-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.kpi-value { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-value.money { color: var(--money); }
.kpi-value.danger { color: var(--danger); }
.util-row { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-top: 10px; }
.drum-idle-cost { margin: 2px 0 0; }
.util-row > span:first-child { width: 26px; font-weight: 700; flex: none; }
.util-bar { flex: 1; height: 8px; background: rgba(127,127,127,0.25); border-radius: 4px; overflow: hidden; }
.util-fill { height: 100%; background: var(--primary); border-radius: 4px; }
.util-pct { width: 46px; text-align: right; color: var(--text-dim); flex: none; }
.color-util-list { margin-top: 8px; }
.color-util-row.util-row > span:first-child { width: auto; font-weight: normal; }
.color-util-label { width: 70px; font-weight: 700; flex: none; }
.buffer-charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; margin-top: 10px; }
.buffer-chart { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px; }


.theme-light .hint {
    color: #374151;
}

.theme-light .order-grid .val {
    color: #111827;
}

.theme-light .order-grid .val.price {
    color: #14532d;
}

    .theme-light .tag.hot {
        color: #991b1b;
    }

    .theme-light .sidebar,
    .theme-light .orderbook,
    .theme-light .res-card,
    .theme-light .events-table,
    .theme-light .order-card,
    .theme-light .modal,
    .theme-light .dbr-popover {
        background: var(--surface-2);
        border-color: var(--border);
    }

    .theme-light .orderbook {
        background: var(--surface);
    }

    .theme-light .canvas-area {
        background: radial-gradient(rgba(29,41,61,0.16) 1.4px, transparent 1.4px) 0 0 / 22px 22px, var(--bg);
    }
    .theme-light.no-grid-dots .canvas-area {
        background: var(--bg);
    }

    .theme-light .speed-wrap,
    .theme-light .zoom-wrap,
    .theme-light .readout {
        background: var(--surface);
        border: 1px solid var(--surface-2);
        border-radius: 999px;
        padding: 5px 12px;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    }

    .theme-light .speed-wrap {
        gap: 8px;
    }

    .theme-light .zoom-wrap {
        gap: 8px;
    }

    .theme-light .readout {
        gap: 6px;
        color: var(--text);
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
    }

    .theme-light .readout.money {
        color: var(--money);
        font-weight: 700;
    }

    .theme-light .zoom-pct,
    .theme-light .speed-wrap span {
        color: var(--text-dim);
        font-size: 11px;
        font-weight: 700;
    }

    .theme-light .readout .material-symbols-outlined {
        color: var(--primary);
        font-size: 14px;
    }

    .theme-light .speed-wrap input[type=range] {
        margin: 0 6px;
        height: 5px;
        border-radius: 999px;
    }

/* ---- Editor de plantas ---- */
.ed-field { margin-bottom: 10px; }
.ed-field label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.ed-field input, .ed-field select, .ed-field textarea { width: 100%; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 12px; font-family: inherit; }
.ed-inline-input { width: 70px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 11px; text-align: right; }
.ed-actions { display: flex; align-items: center; gap: 8px; }
.ed-actions .btn { flex: none; white-space: nowrap; }
.ed-cell { position: absolute; border: 1.5px dashed transparent; border-radius: 10px; cursor: default; }
.ed-cell.placing { border-color: var(--border); cursor: crosshair; }
.ed-cell.placing:hover { border-color: var(--primary); background: rgba(75,226,119,0.08); }
.ed-canvas { position: relative; }

.theme-light .ob-head {
    color: #111827;
}

/* ---- Editor: rail + modal de configuración ---- */
.editor-app {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: 1fr;
    overflow: hidden;
}

.editor-app .canvas-area {
    grid-column: 2;
    grid-row: 1;
    background:
        radial-gradient(rgba(255,255,255,0.14) 1.4px, transparent 1.4px) 0 0 / 22px 22px,
        var(--bg);
}
.editor-app.theme-light .canvas-area {
    background:
        radial-gradient(rgba(29,41,61,0.13) 1.4px, transparent 1.4px) 0 0 / 22px 22px,
        var(--bg);
}

.editor-rail {
    grid-column: 1;
    grid-row: 1;
    z-index: 40;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 0;
    box-shadow: 10px 0 28px rgba(15,23,42,0.05);
}

.editor-rail .rail-btn {
    color: var(--text-dim);
}

.editor-rail .rail-btn:hover,
.editor-rail .rail-btn.active {
    background: var(--surface-3);
    color: var(--brand);
}

.editor-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(18,24,20,0.48);
}

.editor-config-modal {
    position: fixed;
    top: 0;
    left: 50%;
    bottom: 0;
    z-index: 90;
    width: min(980px, calc(100vw - 40px));
    max-width: none;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 26px 80px rgba(0,0,0,0.28);
    transform: translateX(-50%) scale(0.985);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}

.editor-config-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

.editor-modal-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 82px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(22,29,22,0.94);
}
.theme-light .editor-modal-head {
    background: rgba(255,255,255,0.94);
}

.editor-modal-head .brand {
    color: var(--brand);
}

.editor-modal-head p {
    margin: 4px 0 0;
    color: var(--text-dim);
    font-size: 13px;
}

.editor-modal-tabs {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 12px;
    border-right: 1px solid var(--border);
    background: var(--surface-2);
}

.editor-modal-tabs a {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.editor-modal-tabs a:hover,
.editor-modal-tabs a.active {
    background: var(--surface-3);
    color: var(--brand);
}

.editor-modal-tabs .material-symbols-outlined {
    font-size: 20px;
}

.editor-modal-body {
    grid-column: 2;
    grid-row: 2;
    overflow: auto;
    padding: 22px;
    background: var(--surface);
}

.editor-modal-body .side-footer {
    display: none;
}

.editor-config-modal .res-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 10px 26px rgba(26,36,30,0.06);
}

.editor-config-modal .ed-field label {
    color: var(--text-dim);
}

.editor-config-modal .ed-field input,
.editor-config-modal .ed-field select,
.editor-config-modal .ed-field textarea,
.editor-config-modal .ed-inline-input {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border);
}

.editor-config-modal .section-title.with-icon {
    color: var(--text-dim);
}

.editor-config-modal .btn {
    color: var(--text);
    border-color: var(--border);
}

.editor-config-modal .btn.accept {
    color: #052d14;
}

.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }

.editor-app .canvas-top {
    position: sticky;
    top: 0;
    z-index: 20;
    min-width: max-content;
    min-height: 64px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 10px 16px;
    background: rgba(22,29,22,0.94);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 34px rgba(15,23,42,0.08);
    backdrop-filter: blur(16px);
}
.editor-app.theme-light .canvas-top {
    background: rgba(255,255,255,0.94);
}

.editor-app .ct-title {
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
}

.editor-app .ct-readouts {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-app .ed-actions {
    justify-content: flex-end;
}

.editor-app .ctrl-btn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-dim);
    box-shadow: 0 8px 18px rgba(25,32,30,0.06);
}

.editor-app .ctrl-btn:hover,
.editor-app .ctrl-btn.on {
    background: var(--surface-3);
    color: var(--brand);
    border-color: var(--brand);
}

.editor-app .btn {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    border-radius: 8px;
}

.editor-app .btn.accept {
    background: #22c55e;
    color: #052d14;
}

@media (max-width: 850px) {
    .editor-config-modal {
        width: 100vw;
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .editor-modal-tabs a {
        justify-content: center;
        padding: 0;
    }

    .editor-modal-tabs a {
        font-size: 0;
    }

    .editor-modal-tabs .material-symbols-outlined {
        font-size: 22px;
    }
}

/* ---- Login / registro ---- */
.auth-page { height: 100vh; overflow-y: auto; display: flex; align-items: center; justify-content: center; background: #f4f7f6; padding: 24px; }
.auth-card { width: 400px; max-width: 100%; background: #ffffff; border: 1px solid #d8e1d7; border-radius: 8px; padding: 30px; box-shadow: 0 20px 50px rgba(15,23,42,0.08); }
.auth-card-wide { width: min(680px, 100%); }
.auth-brand { display: inline-flex; width: 152px; height: 42px; margin-bottom: 16px; }
.auth-brand img { width: 100%; height: 100%; object-fit: contain; }
.auth-card h1 { font-size: 24px; font-weight: 850; color: #172018; margin: 0 0 8px; letter-spacing: 0; }
.auth-copy { margin: 0 0 18px; color: #536258; line-height: 1.5; font-size: 14px; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-card .ed-field { margin-bottom: 12px; }
.auth-grid .ed-field { margin-bottom: 0; }
.auth-card .ed-field label { color: #536258; }
.auth-card .ed-field input, .auth-card .ed-field select { background: #ffffff; color: #172018; border: 1px solid #c9d6c8; }
.auth-card .err { border: 1px solid #fecaca; background: #fff1f2; color: #991b1b; font-size: 13px; line-height: 1.45; margin: 12px 0; padding: 10px 12px; border-radius: 8px; }
.auth-success { border: 1px solid #bbf7d0; background: #f0fdf4; color: #126d35; font-size: 14px; line-height: 1.55; margin: 14px 0; padding: 14px; border-radius: 8px; font-weight: 700; }
.auth-main-btn { width: 100%; padding: 10px; margin-top: 14px; }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #7a887d; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1; height: 1px; background: #d8e1d7; }
.google-button { display: flex; justify-content: center; min-height: 44px; }
.google-fallback { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #c9d6c8; border-radius: 8px; background: #fff; color: #3f4d45; font-weight: 800; cursor: not-allowed; opacity: 0.72; }
.google-fallback span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; border: 1px solid #d8e1d7; color: #1f1f1f; font-weight: 900; }
.auth-hint { margin: 10px 0 0; color: #647167; font-size: 12px; text-align: center; line-height: 1.45; }
.auth-switch { text-align: center; font-size: 13px; color: #536258; margin: 16px 0 0; }
.auth-switch a { color: #126d35; font-weight: 800; }
.auth-forgot { text-align: center; font-size: 13px; margin: 12px 0 0; }
.auth-forgot a { color: #126d35; font-weight: 700; text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
@media (max-width: 640px) {
    .auth-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
}

/* ---- Catálogo de plantas ---- */
.plants-page { height: 100vh; overflow: auto; background: #f4f7f6; color: #18201b; }
.plants-topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 20px; min-height: 64px; padding: 10px 24px; background: rgba(255,255,255,0.92); border-bottom: 1px solid #d8e1d7; backdrop-filter: blur(18px); }
.plants-brand { display: inline-flex; align-items: center; width: 164px; height: 46px; text-decoration: none; }
.plants-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
.plants-nav { display: flex; justify-content: center; gap: 8px; }
.plants-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; color: #4b5b51; text-decoration: none; font-size: 13px; font-weight: 700; }
.plants-nav a:hover, .plants-nav a.active { background: #dcfce7; color: #126d35; }
.plants-nav .material-symbols-outlined, .plants-btn .material-symbols-outlined { font-size: 20px; }
.plants-actions { display: flex; gap: 10px; }
.plants-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid #c9d6c8; border-radius: 8px; background: #fff; color: #126d35; text-decoration: none; font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(25,32,30,0.06); }
.plants-btn.primary { border-color: #22c55e; background: #22c55e; color: #052d14; }
.plants-btn.ghost:hover { border-color: #22c55e; }
.plants-btn.compact { min-height: 36px; padding-inline: 12px; white-space: nowrap; }
.plants-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 56px; }
.learning-layout { width: min(1420px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; padding: 28px 0 56px; }
.learning-layout .plants-shell { width: 100%; margin: 0; padding: 0; }
.learning-sidebar { position: sticky; top: 92px; display: grid; gap: 16px; padding: 16px; border: 1px solid #d6dfd5; border-radius: 12px; background: rgba(255,255,255,0.86); box-shadow: 0 14px 36px rgba(28,38,33,0.07); }
.learning-sidebar-head h2 { margin: 0; color: #111814; font-size: 20px; line-height: 1.18; letter-spacing: 0; }
.learning-product-list { display: grid; gap: 8px; }
.learning-product { width: 100%; min-height: 74px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border: 1px solid #d8e1d7; border-radius: 12px; background: #fff; color: #334139; text-align: left; text-decoration: none; cursor: pointer; }
.learning-product > .material-symbols-outlined { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; background: #eef7f1; color: #126d35; font-size: 22px; }
.learning-product strong { display: block; color: #172018; font-size: 14px; line-height: 1.2; }
.learning-product small { display: block; margin-top: 4px; color: #647167; font-size: 12px; line-height: 1.25; }
.learning-product.active { border-color: #22c55e; background: #f0fdf4; box-shadow: inset 3px 0 0 #22c55e; }
.learning-product.disabled { opacity: .62; cursor: not-allowed; }
.learning-product.disabled > .material-symbols-outlined { background: #eef2f0; color: #7a887d; }
.learning-product.disabled small { color: #4656a8; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.plants-hero { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 28px; align-items: end; margin-bottom: 28px; }
.plants-eyebrow { margin: 0 0 8px; color: #126d35; font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.plants-hero h1 { max-width: 760px; margin: 0; color: #111814; font-size: 38px; line-height: 1.08; letter-spacing: 0; }
.plants-hero p:not(.plants-eyebrow) { max-width: 640px; margin: 14px 0 0; color: #536258; font-size: 16px; line-height: 1.55; }
.plants-search-card { padding: 14px; border: 1px solid #d6dfd5; border-radius: 12px; background: rgba(255,255,255,0.86); box-shadow: 0 14px 36px rgba(28,38,33,0.08); }
.plants-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid #c9d6c8; border-radius: 8px; background: #fff; color: #637266; }
.plants-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #172018; font: inherit; }
.plants-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filter-chip { min-height: 32px; padding: 0 12px; border: 1px solid #d0dbcf; border-radius: 999px; background: #fff; color: #4d5b52; font-size: 12px; font-weight: 800; cursor: pointer; }
.filter-chip.active { border-color: #22c55e; background: #dcfce7; color: #126d35; }
.plants-section { margin-top: 30px; }
.plants-section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.plants-section-head h2 { margin: 0; color: #111814; font-size: 23px; letter-spacing: 0; }
.plants-section-head > span { color: #647167; font-size: 13px; font-weight: 800; }
.active-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.active-card, .plant-card { border: 1px solid #d6dfd5; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(26,36,30,0.06); cursor: pointer; overflow: hidden; }
.active-card { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: stretch; min-height: 180px; }
.active-card:hover, .plant-card:hover { border-color: #22c55e; box-shadow: 0 16px 34px rgba(18,109,53,0.12); }
.active-card > .plants-btn { align-self: end; margin: 0 16px 16px 0; }
.active-card-body { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 18px; }
.active-card h3, .plant-card h3 { margin: 8px 0 8px; color: #151c18; font-size: 18px; line-height: 1.25; letter-spacing: 0; }
.active-card p, .plant-card p { margin: 0; color: #58665c; font-size: 14px; line-height: 1.45; }
.progress-block { display: grid; gap: 7px; color: #68766b; font-size: 12px; font-weight: 700; }
.progress-line { height: 7px; border-radius: 999px; background: #e6ede5; overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: #22c55e; }
.plants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.plant-card.locked { opacity: 0.76; }
.plant-card-body { padding: 16px; }
.plant-card-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.plant-card-title h3 { margin-top: 0; }
.plant-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 16px; color: #4e5d53; font-size: 12px; font-weight: 800; }
.plant-meta span { display: inline-flex; align-items: center; gap: 4px; }
.plant-meta .material-symbols-outlined { font-size: 16px; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 0 9px; border-radius: 999px; background: #eef2f0; color: #4f5d53; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.status-pill.active { background: #dcfce7; color: #126d35; }
.status-pill.premium { background: #eef2ff; color: #4656a8; }
.plant-cover { position: relative; min-height: 148px; overflow: hidden; background: #dce5df; }
.active-card .plant-cover { min-height: 100%; }
.plant-cover::before, .plant-modal-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,0.14), transparent 42%), radial-gradient(circle at 80% 24%, rgba(255,255,255,0.35), transparent 18%), repeating-linear-gradient(90deg, rgba(255,255,255,0.14) 0 3px, transparent 3px 28px); mix-blend-mode: soft-light; }
.plant-cover::after, .plant-modal-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 58%; background: linear-gradient(to top, rgba(9,16,12,0.68), transparent); }
.plant-cover > span { position: absolute; left: 14px; bottom: 12px; z-index: 1; color: #fff; font-size: 12px; font-weight: 900; text-shadow: 0 1px 12px rgba(0,0,0,0.45); }
.plant-cover strong { position: absolute; z-index: 2; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px; border-radius: 999px; background: rgba(255,255,255,0.92); color: #4656a8; font-size: 12px; box-shadow: 0 8px 22px rgba(0,0,0,0.14); }
.plant-cover strong .material-symbols-outlined { font-size: 17px; }
.visual-bottling { background: linear-gradient(120deg, rgba(9,43,24,0.1), rgba(4,17,12,0.15)), radial-gradient(circle at 24% 34%, rgba(218,240,229,0.75) 0 5%, transparent 5.2%), repeating-linear-gradient(90deg, rgba(230,238,235,0.62) 0 18px, rgba(150,168,158,0.55) 18px 22px, transparent 22px 46px), linear-gradient(135deg, #d7e5de, #7e9a8b 48%, #193d2b); }
.visual-wood { background: repeating-linear-gradient(15deg, rgba(80,44,20,0.18) 0 8px, transparent 8px 26px), linear-gradient(135deg, #ecd8b7, #a96d3e 48%, #41311f); }
.visual-robotics { background: radial-gradient(circle at 72% 28%, rgba(95,130,255,0.7), transparent 18%), repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 4px, transparent 4px 34px), linear-gradient(135deg, #e9eef8, #7a8fa8 48%, #182334); }
.visual-textile { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.26) 0 4px, transparent 4px 18px), repeating-linear-gradient(0deg, rgba(28,67,68,0.16) 0 3px, transparent 3px 22px), linear-gradient(135deg, #d9f0eb, #5aa7a0 52%, #1c4246); }
.visual-pharma { background: radial-gradient(circle at 20% 24%, rgba(255,255,255,0.8), transparent 15%), repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 12px, transparent 12px 36px), linear-gradient(135deg, #eef7ff, #91b7ce 50%, #244659); }
.plant-cover.plant-photo, .plant-modal-hero.plant-photo { background: linear-gradient(120deg, rgba(8,22,14,0.08), rgba(4,12,8,0.18)), var(--plant-image) center / cover no-repeat, #dce5df; }
.plant-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: center; padding: 0; background: rgba(18,24,20,0.58); }
.plant-modal { position: relative; width: min(1220px, calc(100vw - 40px)); height: 100vh; max-height: 100vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; color: #172018; box-shadow: 0 28px 80px rgba(0,0,0,0.34); }
.plant-modal-close { position: absolute; z-index: 4; top: 18px; left: 18px; width: 42px; height: 42px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.94); color: #172018; cursor: pointer; box-shadow: 0 12px 28px rgba(0,0,0,0.2); }
.plant-modal-hero { position: relative; flex: 0 0 245px; overflow: hidden; }
.plant-modal-hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(5,12,9,0.9) 0%, rgba(5,12,9,0.22) 48%, rgba(5,12,9,0.1) 100%); }
.plant-modal-actions { position: absolute; z-index: 3; top: 20px; right: 22px; display: flex; gap: 8px; }
.plant-modal-actions button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.9); color: #172018; font-weight: 800; cursor: pointer; }
.plant-modal-title { position: absolute; z-index: 3; left: 42px; right: 42px; bottom: 34px; color: #fff; }
.plant-modal-title p { margin: 12px 0 6px; font-size: 14px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.plant-modal-title h2 { margin: 0; font-size: 36px; line-height: 1.05; letter-spacing: 0; text-shadow: 0 10px 32px rgba(0,0,0,0.34); }
.plant-modal-content { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; padding: 24px 30px 92px; overflow: auto; background: #f8faf9; }
.plant-modal-main { display: grid; gap: 16px; }
.plant-info-block, .plant-specs, .toc-note { border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; padding: 20px; }
.plant-info-block h3, .plant-specs h3, .toc-note h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: #172018; font-size: 19px; letter-spacing: 0; }
.plant-info-block h3 .material-symbols-outlined { color: #16a34a; }
.plant-info-block p { margin: 0; color: #4e5b52; font-size: 16px; line-height: 1.65; }
.plant-info-block ul { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; color: #4d5b52; font-size: 15px; line-height: 1.5; }
.plant-info-block li { display: flex; align-items: start; gap: 10px; }
.plant-info-block li .material-symbols-outlined { color: #16a34a; font-size: 19px; margin-top: 1px; }
.plant-modal-side { display: grid; align-content: start; gap: 16px; }
.plant-specs { display: grid; gap: 14px; }
.plant-specs div { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid #e0e8df; }
.plant-specs div:first-of-type { border-top: 0; padding-top: 0; }
.plant-specs span { color: #617066; font-size: 13px; font-weight: 800; }
.plant-specs strong { color: #172018; text-align: right; }
.toc-note { background: #eef7f1; }
.toc-note > .material-symbols-outlined { color: #16a34a; font-size: 32px; }
.toc-note p { margin: 0; color: #334139; line-height: 1.55; font-weight: 700; }
.plant-modal-footer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid #dbe5da; background: rgba(255,255,255,0.94); backdrop-filter: blur(16px); }

/* ---- Panel de usuario / cuenta ---- */
.user-page { height: 100vh; overflow: hidden; background: #f4f7f6; color: #172018; }
.user-dashboard { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.user-sidebar { min-height: 0; display: flex; flex-direction: column; gap: 18px; padding: 18px; border-right: 1px solid #d6dfd5; background: #fff; }
.user-sidebar-brand { display: inline-flex; width: 132px; height: 42px; align-items: center; }
.user-sidebar-brand img { width: 100%; height: 100%; object-fit: contain; }
.user-side-nav { display: grid; gap: 6px; }
.user-side-nav a { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border-radius: 8px; color: #536258; text-decoration: none; font-size: 13px; font-weight: 900; }
.user-side-nav a:hover { background: #f4f7f6; color: #172018; }
.user-side-nav a.active { background: #dcfce7; color: #126d35; }
.user-side-nav .material-symbols-outlined { font-size: 20px; }
.user-logout { margin-top: auto; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; color: #536258; font-weight: 900; cursor: pointer; }
.user-logout:hover { background: #fff1f2; color: #b91c1c; border-color: #fecaca; }
.user-logout .material-symbols-outlined { font-size: 18px; }
.user-main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.user-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 28px; border-bottom: 1px solid #d6dfd5; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); }
.user-header h1 { margin: 2px 0 0; color: #172018; font-size: 28px; line-height: 1.1; letter-spacing: 0; }
.user-header-profile { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid #dbe5da; border-radius: 10px; background: #fff; }
.user-header-profile > span { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; background: #dcfce7; color: #126d35; font-size: 12px; font-weight: 950; }
.user-header-profile strong { display: block; color: #172018; font-size: 13px; line-height: 1.15; }
.user-header-profile small { display: block; margin-top: 2px; color: #647467; font-size: 11px; font-weight: 800; }
.classroom-topbar { min-height: 64px; }
.classroom-search { flex: 1; max-width: 380px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 40px; border: 1px solid #d6dfd5; border-radius: 8px; background: #f8faf9; }
.classroom-search .material-symbols-outlined { color: #647467; font-size: 19px; }
.classroom-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #172018; font: inherit; font-size: 13px; font-weight: 700; }
.classroom-search input:focus { outline: none; }
.user-content-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 44px; overflow-y: auto; }
.account-shell { display: grid; gap: 16px; }
.account-overview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px; padding: 22px; border: 1px solid #d6dfd5; border-radius: 12px; background: linear-gradient(135deg, #ffffff 0%, #f3faf5 100%); box-shadow: 0 18px 46px rgba(24,36,28,0.08); }
.account-overview h2 { margin: 2px 0 6px; color: #172018; font-size: 32px; line-height: 1.1; letter-spacing: 0; overflow-wrap: anywhere; }
.account-overview p { margin: 0; color: #536258; font-size: 14px; font-weight: 800; }
.account-overview-stats { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 10px; min-width: 340px; }
.account-overview-stats div { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid #dbe5da; border-radius: 8px; background: rgba(255,255,255,0.78); }
.account-overview-stats span { color: #647467; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.account-overview-stats strong { color: #172018; font-size: 21px; font-weight: 950; font-variant-numeric: tabular-nums; }
.account-tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid #dbe5da; border-radius: 10px; background: #eaf0ec; overflow-x: auto; }
.account-tabs button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: #536258; font-weight: 900; cursor: pointer; white-space: nowrap; }
.account-tabs button.active { background: #fff; color: #126d35; box-shadow: 0 8px 18px rgba(24,36,28,.08); }
.account-tabs .material-symbols-outlined { font-size: 18px; }
.account-tab-panel { display: grid; gap: 16px; padding: 20px; border: 1px solid #d6dfd5; border-radius: 12px; background: #fff; box-shadow: 0 14px 38px rgba(24,36,28,0.06); }
.account-panel-head { display: flex; align-items: flex-start; gap: 11px; }
.account-panel-head > .material-symbols-outlined { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px; background: #eef7f1; color: #126d35; font-size: 22px; }
.account-panel-head h2 { margin: 0; color: #172018; font-size: 22px; line-height: 1.15; letter-spacing: 0; }
.account-panel-head p { margin: 3px 0 0; color: #647467; font-size: 13px; }
.account-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-form-grid .ed-field { margin: 0; }
.account-form-grid .ed-field input { min-height: 42px; border-radius: 8px; border-color: #d6dfd5; background: #f8faf9; color: #172018; font-weight: 750; }
.account-form-grid .ed-field input:focus { outline: none; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.14); background: #fff; }
.account-form-grid.security-grid { grid-template-columns: repeat(2, minmax(0, 360px)); }
.account-card { display: grid; gap: 4px; border: 1px solid #d6dfd5; border-radius: 12px; background: #fff; padding: 20px; }
.account-card > p { margin: 0 0 12px; color: #536258; font-size: 14px; line-height: 1.5; }
.account-card-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.account-message { font-size: 13px; font-weight: 800; }
.account-message.ok { color: #126d35; }
.account-message.error { color: #b91c1c; }
.account-integration-card, .account-activity-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid #dbe5da; border-radius: 10px; background: #f8faf9; }
.account-integration-card > .material-symbols-outlined, .account-activity-card > .material-symbols-outlined { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 8px; background: #eef7f1; color: #126d35; font-size: 24px; }
.account-integration-card strong, .account-activity-card strong { display: block; color: #172018; font-size: 15px; font-weight: 950; }
.account-integration-card p, .account-activity-card p { margin: 3px 0 0; color: #647467; font-size: 13px; line-height: 1.4; }
.account-plan-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; background: #f8faf9; }
.account-progress-table { display: grid; gap: 1px; border: 1px solid #d6dfd5; border-radius: 12px; overflow: hidden; background: #d6dfd5; }
.account-progress-row { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1fr 1fr; gap: 8px; align-items: center; padding: 10px 14px; background: #fff; font-size: 13px; color: #26372b; }
.account-progress-head { background: #f4f7f6; font-weight: 900; color: #536258; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 1050px) {
    .user-dashboard { grid-template-columns: 1fr; }
    .user-sidebar { min-height: auto; flex-direction: row; align-items: center; position: sticky; top: 0; z-index: 35; padding: 10px 14px; }
    .user-sidebar-brand { width: 112px; }
    .user-side-nav { display: flex; gap: 4px; overflow-x: auto; }
    .user-logout { margin-top: 0; margin-left: auto; padding: 0 12px; }
    .user-header { padding: 14px 18px; }
    .user-content-shell { width: min(100% - 28px, 1180px); }
    .account-overview { grid-template-columns: 1fr; }
    .account-overview-stats { min-width: 0; }
}
@media (max-width: 720px) {
    .user-sidebar { align-items: flex-start; flex-wrap: wrap; }
    .user-side-nav { width: 100%; order: 3; }
    .user-logout { min-height: 34px; }
    .user-header { align-items: flex-start; flex-direction: column; }
    .user-header-profile { width: 100%; }
    .account-overview-stats, .account-form-grid, .account-form-grid.security-grid { grid-template-columns: 1fr; }
    .account-integration-card, .account-activity-card { grid-template-columns: 42px minmax(0, 1fr); }
    .account-integration-card .plants-btn, .account-activity-card .plants-btn { grid-column: 1 / -1; justify-content: center; }
    .account-progress-row { grid-template-columns: 1fr; gap: 2px; }
    .account-progress-head { display: none; }
}
@media (max-width: 1050px) {
    .plants-topbar { grid-template-columns: 1fr; }
    .plants-nav { justify-content: flex-start; overflow-x: auto; }
    .plants-actions { justify-content: flex-start; flex-wrap: wrap; }
    .learning-layout { width: min(100% - 32px, 1180px); grid-template-columns: 1fr; gap: 18px; }
    .learning-sidebar { position: static; }
    .learning-product-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .plants-hero, .active-strip { grid-template-columns: 1fr; }
    .plants-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plant-modal-content { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .plants-shell { width: min(100% - 24px, 1180px); padding-top: 22px; }
    .learning-layout { width: min(100% - 24px, 1180px); padding-top: 18px; }
    .learning-product-list { grid-template-columns: 1fr; }
    .plants-hero h1 { font-size: 30px; }
    .plants-grid { grid-template-columns: 1fr; }
    .active-card { grid-template-columns: 1fr; }
    .active-card > .plants-btn { margin: 0 16px 16px; }
    .plant-modal { width: 100vw; height: 100vh; border-radius: 0; }
    .plant-modal-backdrop { padding: 0; }
    .plant-modal-hero { flex-basis: 230px; }
    .plant-modal-title { left: 22px; right: 22px; }
    .plant-modal-title h2 { font-size: 30px; }
    .plant-modal-actions { display: none; }
    .plant-modal-content { padding: 20px 16px 116px; }
    .plant-modal-footer { justify-content: stretch; overflow-x: auto; }
}

/* ---- Registro inspirado en register.html ---- */
/* html/body tienen overflow:hidden a nivel global (el simulador es un shell
   fijo que nunca hace scroll de página) — esta y .auth-page son las únicas
   páginas con contenido que puede superar el alto de la ventana, así que
   necesitan su propio scroll interno en vez de depender del de body. */
.register-page { height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: #f8fafc; color: #0b1c30; font-family: Inter, system-ui, sans-serif; }
.register-topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 24px; border-bottom: 1px solid #bccbb9; background: #f8f9ff; }
.register-logo { display: inline-flex; width: 142px; height: 40px; }
.register-logo img { width: 100%; height: 100%; object-fit: contain; }
.register-login-link { color: #006e2f; text-decoration: none; font-size: 14px; font-weight: 800; padding: 8px 12px; border-radius: 4px; }
.register-login-link:hover { background: #eff4ff; }
.register-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.register-card { position: relative; width: min(480px, 100%); overflow: hidden; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.register-progress { height: 4px; background: #22c55e; overflow: hidden; }
.register-progress span { display: block; width: 33%; height: 100%; background: #006e2f; }
.register-card-body { padding: 30px; }
.register-heading { text-align: center; margin-bottom: 22px; }
.register-heading h1, .register-success-card h1 { margin: 0; color: #0b1c30; font-size: 30px; line-height: 38px; font-weight: 650; letter-spacing: 0; }
.register-heading p, .register-success-card p { margin: 6px 0 0; color: #565e74; font-size: 14px; line-height: 20px; }
.register-alert { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid rgba(186,26,26,0.2); border-radius: 4px; background: #ffdad6; color: #93000a; font-size: 12px; font-weight: 700; line-height: 16px; }
.register-alert > .material-symbols-outlined { font-size: 19px; }
.register-alert button { margin-left: auto; border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .74; }
.register-form { display: grid; gap: 16px; }
.register-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.register-field { display: flex; flex-direction: column; gap: 4px; }
.register-field span, .register-role-block > span { color: #0b1c30; font-size: 14px; line-height: 20px; font-weight: 700; }
.register-field input, .register-field select { width: 100%; height: 42px; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; color: #0b1c30; font: inherit; font-size: 14px; }
.register-field input::placeholder { color: #9ca3af; }
.register-field input:focus, .register-field select:focus { outline: none; border-color: #006e2f; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #22c55e; }
.register-role-block { display: flex; flex-direction: column; gap: 8px; }
.register-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.register-role { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; color: #0b1c30; font-size: 14px; font-weight: 800; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.register-role:hover { background: #eff4ff; }
.register-role.active { border-color: #006e2f; background: rgba(34,197,94,0.1); color: #006e2f; }
.register-role .material-symbols-outlined { font-size: 20px; }
.register-primary { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 4px; background: #22c55e; color: #fff; text-decoration: none; font-weight: 900; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.register-primary:hover { filter: brightness(.96); }
.register-primary:active { transform: scale(.99); }
.register-primary:disabled { opacity: .72; cursor: wait; }
.register-spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 999px; animation: register-spin 0.8s linear infinite; }
.register-separator { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: #565e74; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.register-separator::before, .register-separator::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.register-google { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; color: #131b2e; font-size: 14px; font-weight: 800; cursor: not-allowed; opacity: .76; }
.google-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; border: 1px solid #d3d8e0; color: #1f1f1f; font-weight: 900; }
.register-google-note { margin: 14px 0 0; color: #565e74; text-align: center; font-size: 12px; font-style: italic; line-height: 16px; }
.register-switch { margin: 28px 0 0; color: #3d4a3d; text-align: center; font-size: 14px; line-height: 20px; }
.register-switch a { color: #006e2f; font-weight: 900; text-decoration: none; }
.register-switch a:hover { text-decoration: underline; }
.register-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 24px; border-top: 1px solid #bccbb9; background: #f8f9ff; color: #565e74; font-size: 12px; }
.register-footer strong { color: #0b1c30; font-size: 14px; }
.register-footer nav { display: flex; gap: 16px; }
.register-footer a { color: #565e74; text-decoration: none; }
.register-footer a:hover { color: #006e2f; }
.register-success-card { padding-bottom: 30px; text-align: center; }
.register-success-card .register-primary { width: calc(100% - 60px); margin: 24px 30px 0; }
.register-success-icon { margin: 30px 0 16px; color: #006e2f; }
.register-success-icon .material-symbols-outlined { font-size: 64px; font-variation-settings: 'FILL' 1; }
@keyframes register-spin { to { transform: rotate(360deg); } }

/* Modal para completar perfil (país/ciudad) tras validar con Google:
   la cuenta ya está autenticada, solo faltan estos campos obligatorios. */
.register-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(11,28,48,.55); animation: register-fade .15s ease; }
.register-modal { width: min(460px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: #fff; border-radius: 12px; padding: 26px; box-shadow: 0 24px 60px rgba(11,28,48,.28); animation: register-pop .18s ease; }
.register-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.register-modal-head h2 { margin: 0; color: #0b1c30; font-size: 22px; line-height: 28px; }
.register-modal-close { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f1f5f9; color: #475569; cursor: pointer; }
.register-modal-close:hover { background: #e2e8f0; }
.register-modal .register-grid { margin-top: 6px; }
.register-modal .register-role-block { margin-top: 18px; }
.register-modal .register-primary { margin-top: 22px; }
@keyframes register-fade { from { opacity: 0; } }
@keyframes register-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (max-width: 720px) {
    .register-grid, .register-role-grid { grid-template-columns: 1fr; }
    .register-card-body { padding: 24px; }
    .register-heading h1, .register-success-card h1 { font-size: 24px; line-height: 32px; }
    .register-footer { flex-direction: column; text-align: center; }
    .register-footer nav { flex-wrap: wrap; justify-content: center; }
}

/* ---- Simulator classroom settings ---- */
.exam-freeze-banner {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 95;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    max-width: min(720px, calc(100vw - 112px));
    padding: 8px 12px 8px 14px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    background: rgba(24, 18, 8, 0.92);
    color: #fff7ed;
    box-shadow: 0 14px 38px rgba(0,0,0,0.28);
    backdrop-filter: blur(14px);
    font-size: 13px;
    font-weight: 800;
}
.theme-light .exam-freeze-banner {
    background: rgba(255,255,255,0.96);
    color: #422006;
    box-shadow: 0 14px 36px rgba(20, 16, 10, 0.16);
}
.exam-freeze-banner .material-symbols-outlined { color: #f59e0b; }
.exam-freeze-banner .btn { padding: 4px 10px; }
.settings-body .drum-row { min-height: 34px; }
.settings-number {
    width: 64px;
    min-height: 28px;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 800;
}
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.settings-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.settings-actions .material-symbols-outlined { font-size: 18px; }
.colorblind-mode .flow-line { stroke-opacity: 0.72 !important; }
@media (max-width: 780px) {
    .exam-freeze-banner {
        left: 58px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    .settings-actions { justify-content: stretch; flex-direction: column; }
}

.editor-new-plant-backdrop { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; background: rgba(18,32,22,.42); }
.editor-new-plant-dialog { width: min(410px, 100%); display: grid; gap: 12px; padding: 24px; border: 1px solid #d6dfd5; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(17,30,21,.25); }
.editor-new-plant-dialog > .material-symbols-outlined { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: #dcfce7; color: #126d35; font-size: 23px; }
.editor-new-plant-dialog h2 { margin: 2px 0 0; color: #172018; font-size: 21px; letter-spacing: 0; }
.editor-new-plant-dialog p { margin: 0; color: #536258; font-size: 14px; line-height: 1.5; }
.editor-new-plant-dialog > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.editor-node-error { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; padding: 11px 12px; border: 1px solid #fecaca; border-radius: 8px; background: #fff1f2; color: #991b1b; font-size: 13px; line-height: 1.4; font-weight: 750; }
.editor-node-error > .material-symbols-outlined { flex: 0 0 auto; color: #dc2626; font-size: 19px; }
.editor-node-error > span:nth-child(2) { flex: 1; }
.editor-node-error-close { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #991b1b; cursor: pointer; }
.editor-node-error-close:hover { background: #fecdd3; }
.editor-node-error-close .material-symbols-outlined { font-size: 17px; }
.saved-plant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.saved-plant-visibility { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; min-height: 25px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.saved-plant-visibility .material-symbols-outlined { font-size: 15px; }
.saved-plant-visibility.private { background: #f1f5f2; color: #647467; }
.saved-plant-visibility.public { background: #dcfce7; color: #166534; }
.saved-plant-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.saved-plant-thumb { flex: none; width: 40px; height: 40px; border-radius: 8px; background-size: cover; background-position: center; border: 1px solid var(--border); }
.saved-plant-thumb.none { display: grid; place-items: center; background: var(--surface-2); color: var(--text-dim); }
.saved-plant-thumb.none .material-symbols-outlined { font-size: 18px; }
.plant-image-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.plant-image-option { width: 52px; height: 52px; border-radius: 8px; border: 2px solid var(--border); background: var(--surface-2) center/cover no-repeat; background-image: var(--plant-image); cursor: pointer; padding: 0; }
.plant-image-option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.plant-image-option.none { display: grid; place-items: center; color: var(--text-dim); }
.plant-image-preview { margin-top: 8px; width: 100%; max-width: 240px; aspect-ratio: 16/9; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; background: var(--surface-2); }
.plant-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plant-image-preview-error { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-dim); font-size: 0.85em; text-align: center; padding: 8px; }
.saved-plant-actions .btn .material-symbols-outlined { font-size: 17px; }
/* ---- Editor: lista compacta de recursos ---- */
.resource-list-actions { display: flex; gap: 8px; margin: -2px 0 12px; }
.resource-list-actions .btn { flex: 1; justify-content: center; }
.resource-editor-card { padding: 10px 12px; }
.resource-editor-card .res-card-top { min-height: 32px; }
.resource-fold { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: #edf2ef; color: #536258; cursor: pointer; }
.resource-fold:hover { background: #dcfce7; color: #126d35; }
.resource-fold .material-symbols-outlined { font-size: 19px; }
.resource-card-actions { display: inline-flex; gap: 5px; margin-left: auto; }
.resource-editor-fields { display: grid; gap: 10px; padding-top: 12px; margin-top: 10px; border-top: 1px solid #edf2ef; }
.account-repository-note { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid #dbe5da; border-radius: 8px; background: #f8faf9; color: #536258; font-size: 13px; line-height: 1.4; }
.account-repository-note .material-symbols-outlined { color: #126d35; font-size: 19px; }
.account-repository-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.account-repository-card { display: grid; gap: 9px; padding: 15px; border: 1px solid #dbe5da; border-radius: 8px; background: #f8faf9; }
.account-repository-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #126d35; }
.account-repository-card-head > .material-symbols-outlined { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: #eef7f1; font-size: 20px; }
.account-repository-card h3 { margin: 0; color: #172018; font-size: 15px; overflow-wrap: anywhere; }
.account-repository-card p { margin: 0; color: #647467; font-size: 11px; }
.account-repository-actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.account-repository-actions .plants-btn { flex: 1; justify-content: center; }
.account-repository-actions .classroom-icon-btn { flex: 0 0 32px; }
/* ---- Repositorios comunitarios ---- */
.community-section { min-height: 420px; }
.repository-list { display: grid; gap: 16px; }
.repository-group { padding: 16px; border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; }
.repository-head { display: flex; align-items: center; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid #edf2ef; }
.repository-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #dcfce7; color: #126d35; font-size: 14px; font-weight: 950; }
.repository-head div { min-width: 0; }
.repository-head p { margin: 0; color: #647467; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.repository-head h3 { margin: 2px 0 0; color: #172018; font-size: 14px; }
.repository-head > span:last-child { margin-left: auto; color: #647467; font-size: 12px; font-weight: 800; }
.repository-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; padding-top: 13px; }
.repository-plant { min-height: 72px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 22px; align-items: center; gap: 10px; padding: 11px; border: 1px solid #dbe5da; border-radius: 8px; background: #f8faf9; color: #172018; text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.repository-plant:hover { border-color: #22c55e; box-shadow: 0 10px 24px rgba(18,109,53,.09); transform: translateY(-1px); }
.repository-plant-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: #eef7f1; color: #126d35; font-size: 19px; }
.repository-plant-thumb { width: 34px; height: 34px; border-radius: 7px; background-size: cover; background-position: center; }
.repository-plant strong, .repository-plant small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repository-plant strong { color: #172018; font-size: 13px; }
.repository-plant small { margin-top: 4px; color: #647467; font-size: 11px; font-weight: 700; }
.repository-open { color: #126d35; font-size: 19px; }
/* ---- Aulas ---- */
.classrooms-page { height: 100vh; overflow: hidden; background: #f4f7f6; }
.classrooms-page .user-dashboard { height: 100vh; min-height: 0; }
.classrooms-page .user-sidebar { height: 100vh; overflow: hidden; }
.classrooms-page .user-main { height: 100vh; min-height: 0; }
.classrooms-page .classroom-topbar { flex: 0 0 auto; }
.classrooms-page .user-content-shell { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.classrooms-shell { display: grid; align-content: start; gap: 14px; padding-top: 16px; padding-bottom: 32px; }
.classroom-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 18px 20px; border: 1px solid #dbe5da; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(24,36,28,0.04); }
.classroom-hero h1 { margin: 2px 0 8px; color: #172018; font-size: 36px; line-height: 1.05; letter-spacing: 0; }
.classroom-hero p { max-width: 680px; margin: 0; color: #536258; font-size: 15px; line-height: 1.55; }
.classroom-hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 10px; min-width: 330px; }
.classroom-hero-metrics div, .classroom-stat-grid div, .classroom-result-summary div { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid #e0e8df; border-radius: 8px; background: #f8faf9; }
.classroom-hero-metrics span, .classroom-stat-grid span, .classroom-result-summary span { color: #647467; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.classroom-hero-metrics strong, .classroom-stat-grid strong, .classroom-result-summary strong { color: #172018; font-size: 22px; font-weight: 950; font-variant-numeric: tabular-nums; }
.classroom-command-panel { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); align-items: center; gap: 18px; padding: 16px; border: 1px solid #dbe5da; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(24,36,28,0.04); }
.classroom-command-copy { display: flex; align-items: center; gap: 12px; min-width: 0; }
.classroom-command-copy > .material-symbols-outlined { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 8px; background: #dcfce7; color: #126d35; font-size: 23px; }
.classroom-command-copy strong { display: block; color: #172018; font-size: 15px; font-weight: 950; }
.classroom-command-copy p { margin: 3px 0 0; color: #647467; font-size: 13px; line-height: 1.35; }
.classroom-command-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.classroom-command-form input { min-height: 42px; width: 100%; padding: 0 14px; border: 1px solid #d6dfd5; border-radius: 8px; background: #f8faf9; color: #172018; font: inherit; font-size: 14px; font-weight: 750; }
.classroom-command-form input:focus { outline: none; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.14); background: #fff; }
.classroom-command-form.code-form input { text-transform: uppercase; letter-spacing: .12em; }
.classroom-alert { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid #fecaca; border-radius: 8px; background: #fff1f2; color: #b91c1c; font-size: 13px; font-weight: 850; }
.classroom-alert .material-symbols-outlined { font-size: 18px; }
.classroom-workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.classroom-list-panel, .classroom-detail-panel { min-width: 0; border: 1px solid #dbe5da; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(24,36,28,0.04); }
.classroom-list-panel { position: sticky; top: 82px; display: grid; gap: 12px; padding: 14px; }
.classroom-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px; }
.classroom-panel-head div { display: flex; align-items: baseline; gap: 8px; }
.classroom-panel-head span { color: #647467; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.classroom-panel-head strong { color: #172018; font-size: 18px; font-weight: 950; }
.classroom-table-search { width: min(360px, 48%); max-width: none; min-height: 36px; background: #fff; }
.user-sidebar-footer { display: grid; gap: 8px; margin-top: auto; }
.user-sidebar-footer .user-logout { margin-top: 0; width: 100%; }
.user-sidebar-profile { min-width: 0; padding: 9px; background: #f8faf9; }
.user-sidebar-profile > div { min-width: 0; }
.user-sidebar-profile strong, .user-sidebar-profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classroom-list { display: grid; gap: 10px; }
.classroom-card { display: grid; gap: 12px; padding: 13px; border: 1px solid #e0e8df; border-radius: 8px; background: #fff; color: #172018; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.classroom-card:hover { border-color: #22c55e; box-shadow: 0 12px 28px rgba(18,109,53,.10); transform: translateY(-1px); }
.classroom-card.sel { border-color: #126d35; background: #f3faf5; box-shadow: inset 4px 0 0 #22c55e, 0 12px 28px rgba(18,109,53,.10); }
.classroom-card-main { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; }
.classroom-avatar { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px; background: #eef7f1; color: #126d35; }
.classroom-avatar .material-symbols-outlined { font-size: 22px; }
.classroom-card h3 { margin: 0; color: #172018; font-size: 14px; line-height: 1.2; letter-spacing: 0; overflow-wrap: anywhere; }
.classroom-card p { margin: 4px 0 0; color: #647467; font-size: 12px; font-weight: 800; }
.classroom-code-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px dashed #b7c7b5; border-radius: 8px; background: #f8faf9; }
.classroom-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 950; letter-spacing: .12em; color: #006e2f; font-size: 13px; }
.classroom-icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: #dcfce7; color: #126d35; cursor: pointer; }
.classroom-icon-btn .material-symbols-outlined { font-size: 17px; }
.classroom-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; color: #647467; font-size: 12px; font-weight: 850; }
.classroom-card-meta span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 28px; border-radius: 7px; background: #f4f7f6; }
.classroom-card-meta .material-symbols-outlined { font-size: 15px; color: #536258; }
.classroom-detail-panel { min-height: 520px; padding: 18px; }
.classroom-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.classroom-detail-head h2 { margin: 2px 0 0; color: #172018; font-size: 26px; line-height: 1.14; letter-spacing: 0; overflow-wrap: anywhere; }
.classroom-share-code { display: grid; gap: 5px; justify-items: end; }
.classroom-share-code > span { color: #647467; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.classroom-share-code button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid #b7c7b5; border-radius: 8px; background: #f3faf5; color: #006e2f; cursor: pointer; }
.classroom-share-code strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.classroom-share-code .material-symbols-outlined { font-size: 17px; }
.classroom-stat-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin: 0 0 14px; }
.classroom-stat-list div { display: inline-flex; align-items: baseline; gap: 7px; }
.classroom-stat-list dt { color: #647467; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.classroom-stat-list dd { margin: 0; color: #172018; font-size: 15px; font-weight: 950; font-variant-numeric: tabular-nums; }
.classroom-tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid #dbe5da; border-radius: 10px; background: #f4f7f6; margin-bottom: 16px; overflow-x: auto; }
.classroom-tabs button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: #536258; font-weight: 900; cursor: pointer; white-space: nowrap; }
.classroom-tabs button.active { background: #fff; color: #126d35; box-shadow: 0 8px 18px rgba(24,36,28,.08); }
.classroom-tabs .material-symbols-outlined { font-size: 18px; }
.classroom-tab-body { min-height: 260px; }
.classroom-section-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.classroom-section-title > .material-symbols-outlined { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; background: #eef7f1; color: #126d35; font-size: 20px; }
.classroom-section-title strong { display: block; color: #172018; font-size: 15px; font-weight: 950; }
.classroom-section-title p { margin: 2px 0 0; color: #647467; font-size: 13px; }
.classroom-scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 10px; }
.classroom-scenario-card { min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; color: #172018; text-align: left; text-decoration: none; cursor: pointer; font: inherit; }
.classroom-scenario-card:hover { border-color: #22c55e; }
.classroom-scenario-card.active { border-color: #86efac; background: #f0fdf4; color: #126d35; }
.classroom-scenario-card .material-symbols-outlined { font-size: 22px; color: #126d35; }
.classroom-scenario-card strong { font-size: 13px; line-height: 1.25; }
.classroom-scenario-grid.playable .classroom-scenario-card { justify-content: flex-start; }
.classroom-result-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.classroom-result-summary div { background: #f8faf9; }
.classroom-table { font-size: 12px; background: #fff; border-color: #dbe5da; }
.classroom-table th { padding: 9px 10px; background: #f4f7f6; color: #536258; font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.classroom-table td { padding: 10px; color: #26372b; border-bottom-color: #edf2ef; }
.classroom-table .money { color: #006e2f; font-weight: 900; }
.results-scroll { overflow-x: auto; margin-top: 8px; }
.results-table { min-width: 860px; white-space: nowrap; }
.results-table td.late { color: #b91c1c; font-weight: 900; }
.status-pill.active { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.assignment-composer { display: grid; gap: 14px; margin-bottom: 16px; padding: 16px; border: 1px solid #dbe5da; border-radius: 8px; background: #f8faf9; }
.assignment-form-grid { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(180px, .9fr); gap: 10px; }
.assignment-composer label { display: grid; gap: 6px; color: #536258; font-size: 12px; font-weight: 900; }
.assignment-composer label span { color: #7b8a7e; font-weight: 700; }
.assignment-composer input, .assignment-composer select, .assignment-composer textarea { width: 100%; min-height: 40px; box-sizing: border-box; padding: 9px 11px; border: 1px solid #d6dfd5; border-radius: 7px; background: #fff; color: #172018; font: inherit; font-size: 13px; font-weight: 700; }
.assignment-composer textarea { min-height: 76px; resize: vertical; line-height: 1.45; font-weight: 600; }
.assignment-composer input:focus, .assignment-composer select:focus, .assignment-composer textarea:focus { outline: 0; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.14); }
.assignment-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #647467; font-size: 12px; font-weight: 700; }
.assignment-list { display: grid; gap: 10px; }
.assignment-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; }
.assignment-card.overdue { border-color: #fecaca; background: #fffafa; }
.assignment-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: #eef7f1; color: #126d35; }
.assignment-card-icon .material-symbols-outlined { font-size: 21px; }
.assignment-card-main { min-width: 0; }
.assignment-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.assignment-card h3 { margin: 0; color: #172018; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.assignment-scenario { margin: 3px 0 0; color: #126d35; font-size: 12px; font-weight: 900; }
.assignment-copy { margin: 8px 0 0; color: #536258; font-size: 13px; line-height: 1.45; white-space: pre-line; }
.assignment-due { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 25px; padding: 0 8px; border: 1px solid #dbe5da; border-radius: 999px; background: #f8faf9; color: #536258; font-size: 11px; font-weight: 850; white-space: nowrap; }
.assignment-due.late { border-color: #fecaca; background: #fff1f2; color: #b91c1c; }
.assignment-statuses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.assignment-state, .assignment-closed { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.assignment-state.pending { background: #f1f5f2; color: #536258; }
.assignment-state.progress { background: #dbeafe; color: #1d4ed8; }
.assignment-state.submitted, .assignment-closed { background: #dcfce7; color: #166534; }
.assignment-state.expired, .assignment-closed.overdue { background: #fff1f2; color: #b91c1c; }
.assignment-closed { align-self: center; }
.assignment-closed .material-symbols-outlined { font-size: 16px; }
.submit-result-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.submit-final-warning { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px; border: 1px solid #fbbf24; border-radius: 8px; background: #fffbeb; color: #78350f; }
.submit-final-warning > .material-symbols-outlined { color: #d97706; }
.submit-final-warning strong { display: block; }
.submit-final-warning p { margin: 3px 0 0; font-size: 12px; line-height: 1.4; }
.status-pill.late { border-color: #fecaca; background: #fff1f2; color: #b91c1c; }
.assignment-delete { align-self: center; color: #b91c1c; background: #fff1f2; }
.assignment-submit-note { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 10px; border: 1px solid #bbf7d0; border-radius: 8px; background: #f0fdf4; color: #166534; font-size: 13px; font-weight: 800; }
.assignment-submit-note .material-symbols-outlined { font-size: 18px; }
.classroom-empty { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; border: 1px dashed #c9d8c7; border-radius: 10px; background: #f8faf9; text-align: center; color: #536258; }
.classroom-empty.compact { min-height: 150px; }
.classroom-empty.detail-empty { min-height: 480px; }
.classroom-empty > .material-symbols-outlined { color: #126d35; font-size: 34px; }
.classroom-empty strong { color: #172018; font-size: 15px; }
.classroom-empty p { max-width: 360px; margin: 0; color: #647467; font-size: 13px; line-height: 1.45; }
.plants-btn.compact { padding: 6px 12px; font-size: 12px; }

@media (max-width: 1050px) {
    .user-sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: 0; margin-left: auto; }
    .user-sidebar-profile { max-width: 230px; }
    .user-sidebar-footer .user-logout { width: auto; margin-left: 0; }
    .classrooms-page { height: auto; min-height: 100vh; overflow: visible; }
    .classrooms-page .user-dashboard, .classrooms-page .user-main { height: auto; min-height: 0; }
    .classrooms-page .user-sidebar { height: auto; overflow: visible; }
    .classrooms-page .user-content-shell { flex: none; min-height: auto; overflow: visible; }
    .classroom-hero, .classroom-command-panel, .classroom-workspace { grid-template-columns: 1fr; }
    .classroom-hero-metrics { min-width: 0; }
    .classroom-list-panel { position: static; }
    .classroom-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .classroom-panel-head { align-items: stretch; flex-direction: column; }
    .classroom-table-search { width: 100%; }
    .user-sidebar-profile { display: none; }
    .classroom-hero, .classroom-command-panel, .classroom-detail-panel, .classroom-list-panel { border-radius: 10px; }
    .classroom-hero { padding: 18px; }
    .classroom-hero h1 { font-size: 30px; }
    .classroom-hero-metrics, .classroom-result-summary { grid-template-columns: 1fr; }
    .classroom-stat-list { gap: 7px 18px; }
    .classroom-command-form { grid-template-columns: 1fr; }
    .assignment-form-grid { grid-template-columns: 1fr; }
    .assignment-composer-actions { align-items: stretch; flex-direction: column; }
    .assignment-card { grid-template-columns: 38px minmax(0, 1fr); }
    .repository-grid { grid-template-columns: 1fr; }
    .assignment-card > .plants-btn, .assignment-card > .assignment-delete { grid-column: 2; justify-self: start; }
    .classroom-list { grid-template-columns: 1fr; }
    .classroom-detail-head { flex-direction: column; }
    .classroom-share-code { justify-items: start; }
}
/* ---- Simulation Lab: visual isometric prototype ---- */
.simlab-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; background: #edf2ef; color: #172018; overflow: hidden; }
.simlab-palette, .simlab-props { min-height: 0; overflow-y: auto; background: #f8faf9; border-right: 1px solid #dbe5da; padding: 18px; }
.simlab-props { border-right: 0; border-left: 1px solid #dbe5da; }
.simlab-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.simlab-brand img { width: 36px; height: 36px; }
.simlab-brand strong { display: block; font-size: 15px; }
.simlab-brand span { display: block; margin-top: 2px; color: #647467; font-size: 12px; font-weight: 700; }
.simlab-back { width: 100%; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; color: #24402c; font-weight: 800; cursor: pointer; }
.simlab-back .material-symbols-outlined { font-size: 18px; }
.simlab-section-title { margin: 18px 0 10px; color: #55645a; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.simlab-assets { display: grid; gap: 10px; }
.simlab-asset-card { min-height: 88px; display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 10px; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; padding: 8px 10px; color: #172018; text-align: left; cursor: grab; box-shadow: 0 8px 18px rgba(24,36,28,.04); }
.simlab-asset-card:active { cursor: grabbing; }
.simlab-asset-card:hover { border-color: #22c55e; box-shadow: 0 12px 24px rgba(18,109,53,.10); }
.simlab-asset-card img { width: 82px; height: 66px; object-fit: contain; }
.simlab-asset-card span { font-size: 13px; font-weight: 900; line-height: 1.2; }
.simlab-main { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.simlab-topbar { flex: none; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-bottom: 1px solid #dbe5da; background: rgba(255,255,255,.86); backdrop-filter: blur(14px); }
.simlab-topbar p { margin: 0 0 3px; color: #5d6c62; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.simlab-topbar h1 { margin: 0; color: #162019; font-size: 24px; line-height: 1.1; letter-spacing: 0; }
.simlab-actions { display: flex; gap: 8px; }
.simlab-actions button, .simlab-prop-actions button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; color: #172018; font-weight: 900; cursor: pointer; }
.simlab-actions button { padding: 0 13px; }
.simlab-actions button.primary { border-color: #16a34a; background: #16a34a; color: #fff; }
.simlab-actions .material-symbols-outlined, .simlab-prop-actions .material-symbols-outlined { font-size: 18px; }
.simlab-metrics { flex: none; display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; padding: 12px 22px 0; background: #edf2ef; }
.simlab-metrics div { min-height: 58px; display: grid; gap: 4px; align-content: center; padding: 10px 12px; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(24,36,28,.04); }
.simlab-metrics span { color: #607067; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.simlab-metrics strong { color: #162019; font-size: 20px; font-weight: 950; font-variant-numeric: tabular-nums; }
.simlab-stage-wrap { flex: 1; min-height: 0; padding: 22px; overflow: auto; }
.simlab-stage { position: relative; width: 1400px; height: 800px; overflow: hidden; touch-action: none; border: 1px solid #d1ddd3; border-radius: 8px; background: linear-gradient(180deg, #f9fbfa, #edf4ef); box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 18px 48px rgba(26,36,30,.09); }
.simlab-grid { position: absolute; inset: -140px; opacity: .52; transform: rotateX(60deg) rotateZ(45deg) scale(1.2); transform-origin: center; background-image: linear-gradient(#cbd8ce 1px, transparent 1px), linear-gradient(90deg, #cbd8ce 1px, transparent 1px); background-size: 42px 42px; }
.simlab-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 42%, transparent 0 42%, rgba(237,244,239,.7) 72%); }
.simlab-links { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.simlab-links line { stroke: #16a34a; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 8; opacity: .58; }
.simlab-links circle { fill: #16a34a; opacity: .8; }
.simlab-token { position: absolute; width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; background: #22c55e; color: #fff; font-size: 9px; font-weight: 950; font-variant-numeric: tabular-nums; box-shadow: 0 8px 18px rgba(18,109,53,.25); pointer-events: none; }
.simlab-token span { transform: translateY(-.5px); }
.simlab-object { position: absolute; width: 160px; min-height: 138px; display: grid; place-items: end center; cursor: grab; user-select: none; touch-action: none; }
.simlab-object:active { cursor: grabbing; }
.simlab-object.moving { cursor: grabbing; filter: saturate(1.05); }
.simlab-object img { width: 154px; height: 122px; object-fit: contain; filter: drop-shadow(0 16px 15px rgba(29,40,34,.18)); pointer-events: none; }
.simlab-object span { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); max-width: 142px; padding: 4px 8px; border: 1px solid rgba(214,223,213,.9); border-radius: 999px; background: rgba(255,255,255,.92); color: #26372b; font-size: 11px; font-weight: 900; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 18px rgba(24,36,28,.08); }
.simlab-object.selected::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 42px; border: 2px solid #22c55e; border-radius: 50%; background: rgba(34,197,94,.08); }
.simlab-empty { position: absolute; left: 50%; top: 50%; z-index: 20; transform: translate(-50%, -50%); width: 330px; display: grid; justify-items: center; gap: 8px; padding: 24px; border: 1px dashed #b7c6bb; border-radius: 8px; background: rgba(255,255,255,.78); text-align: center; color: #5b6a60; }
.simlab-empty .material-symbols-outlined { color: #16a34a; font-size: 38px; }
.simlab-empty strong { color: #172018; font-size: 16px; }
.simlab-empty p { margin: 0; font-size: 13px; line-height: 1.45; }
.simlab-muted-card { display: grid; justify-items: center; gap: 8px; margin-top: 8px; padding: 20px; border: 1px dashed #cbd8ce; border-radius: 8px; background: #fff; color: #607067; text-align: center; }
.simlab-muted-card .material-symbols-outlined { color: #16a34a; font-size: 32px; }
.simlab-muted-card p { margin: 0; font-size: 13px; line-height: 1.45; }
.simlab-prop-hero { height: 150px; display: grid; place-items: center; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; }
.simlab-prop-hero img { max-width: 220px; max-height: 132px; object-fit: contain; filter: drop-shadow(0 14px 14px rgba(29,40,34,.15)); }
.simlab-field, .simlab-prop-grid label { display: grid; gap: 6px; margin-top: 12px; }
.simlab-field span, .simlab-prop-grid span { color: #627169; font-size: 12px; font-weight: 900; }
.simlab-field input, .simlab-prop-grid input { width: 100%; min-height: 36px; border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; color: #172018; padding: 0 10px; font-weight: 800; }
.simlab-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.simlab-prop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.simlab-prop-actions .danger { color: #b91c1c; }
.simlab-port-card { display: grid; gap: 7px; margin-top: 14px; padding: 12px; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; color: #526159; font-size: 12px; }
.simlab-port-card b { color: #172018; font-size: 13px; }
@media (max-width: 1050px) {
    .simlab-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .simlab-props { display: none; }
}
@media (max-width: 760px) {
    .simlab-shell { grid-template-columns: 1fr; }
    .simlab-palette { max-height: 280px; border-right: 0; border-bottom: 1px solid #dbe5da; }
    .simlab-assets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .simlab-topbar { align-items: stretch; flex-direction: column; }
    .simlab-actions { flex-wrap: wrap; }
    .simlab-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px 0; }
}

/* ---- Simulator compact rail tabs ---- */
.icon-rail { gap: 8px; padding: 12px 0 10px; }
.rail-tabs { display: grid; gap: 6px; padding: 4px; border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--surface) 62%, transparent); }
.rail-tab { position: relative; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--text-dim); cursor: pointer; }
.rail-tab:hover { background: var(--surface-2); color: var(--text); }
.rail-tab.active { background: color-mix(in srgb, var(--primary) 18%, var(--surface-2)); color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 34%, transparent); }
.rail-tab .material-symbols-outlined { font-size: 20px; }
.rail-actions { display: grid; gap: 6px; justify-items: center; }
.theme-light .rail-tabs { background: rgba(255,255,255,.62); }
.theme-light .rail-tab.active { background: #dcfce7; color: #126d35; }


/* ---- Simulator financial reports ---- */
.report-modal { width: min(1120px, 94vw); height: min(760px, 92vh); }
.report-modal .kpi-tabs { width: 210px; }
.report-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.report-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-width: 0; }
.report-card h3 { margin: 0 0 10px; font-size: 13px; color: var(--text); font-weight: 800; }
.report-metrics { margin: 0; display: grid; gap: 8px; }
.report-metrics div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.report-metrics dt { color: var(--text-dim); font-size: 11px; }
.report-metrics dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

/* ---- Informe de resultados (documento imprimible) ---- */
.report-overlay { overflow-y: auto; padding: 24px 16px; align-items: flex-start; }
.report-doc { width: min(860px, 100%); margin: auto; background: #fff; color: #172018; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.report-doc-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e0e8df; background: #f8faf9; color: #172018; font-weight: 800; }
.report-doc-toolbar > span { display: inline-flex; align-items: center; gap: 8px; }
.report-doc-toolbar .material-symbols-outlined { font-size: 20px; color: #126d35; }
.report-doc-actions { display: flex; align-items: center; gap: 8px; }
.report-doc-body { padding: 28px 34px 34px; }
.rpt-head { border-bottom: 2px solid #edf2ef; padding-bottom: 16px; margin-bottom: 20px; }
.rpt-brand { display: inline-flex; align-items: center; gap: 7px; color: #126d35; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.rpt-brand .material-symbols-outlined { font-size: 18px; }
.rpt-head h1 { margin: 6px 0 8px; font-size: 30px; line-height: 1.1; color: #172018; }
.rpt-meta { display: flex; flex-wrap: wrap; gap: 14px; color: #536258; font-size: 13px; font-weight: 700; }
.rpt-meta span { display: inline-flex; align-items: center; gap: 5px; }
.rpt-meta .material-symbols-outlined { font-size: 16px; color: #647467; }
.rpt-objective { margin: 12px 0 0; color: #26372b; font-size: 13px; line-height: 1.5; }
.rpt-verdict { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 8px; border: 1px solid; }
.rpt-verdict .material-symbols-outlined { font-size: 28px; }
.rpt-verdict strong { display: block; font-size: 15px; }
.rpt-verdict span { font-size: 12.5px; }
.rpt-verdict.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.rpt-verdict.warn { background: #fffbeb; border-color: #fde68a; color: #92620e; }
.rpt-verdict.bad { background: #fff1f2; border-color: #fecaca; color: #b91c1c; }
.rpt-section { margin-top: 26px; break-inside: avoid; }
.rpt-section h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; color: #172018; padding-bottom: 7px; border-bottom: 1px solid #edf2ef; }
.rpt-section h2 .material-symbols-outlined { font-size: 19px; color: #126d35; }
.rpt-pl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rpt-pl td { padding: 8px 4px; border-bottom: 1px solid #f0f4f1; color: #26372b; }
.rpt-pl td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.rpt-pl tr.rev td { color: #126d35; font-weight: 800; }
.rpt-pl tr.net td { border-top: 2px solid #d6dfd5; border-bottom: none; padding-top: 11px; font-size: 15px; font-weight: 900; color: #172018; }
.rpt-pl tr.net.neg td:last-child { color: #b91c1c; }
.rpt-pl tr.net.pos td:last-child { color: #126d35; }
.rpt-chart { border: 1px solid #e0e8df; border-radius: 8px; padding: 10px 12px; background: #fcfdfc; }
.rpt-buffers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 440px)); justify-content: start; gap: 16px; }
.rpt-buffer .buffer-chart { background: #fcfdfc; border: 1px solid #e0e8df; }
.rpt-buffer .buffer-chart svg { width: 100%; max-width: 440px; }
.rpt-zonebar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin-top: 8px; background: #eef2ef; }
.rpt-zonebar span { display: block; height: 100%; }
.rpt-zonebar .z-red { background: #ef4444; } .rpt-zonebar .z-yellow { background: #eab308; } .rpt-zonebar .z-green { background: #22c55e; }
.rpt-zonelegend { display: flex; justify-content: space-between; margin-top: 4px; color: #647467; font-size: 11px; font-weight: 700; }
.rpt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rpt-kpis div { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid #e0e8df; border-radius: 8px; background: #f8faf9; }
.rpt-kpis span { color: #647467; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.rpt-kpis strong { color: #172018; font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rpt-kpis strong.neg { color: #b91c1c; }
.rpt-narrative { margin: 0; color: #26372b; font-size: 13.5px; line-height: 1.6; }
.rpt-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid #edf2ef; color: #8a9a8c; font-size: 11px; text-align: center; }

@media (max-width: 640px) { .rpt-kpis { grid-template-columns: repeat(2, 1fr); } .report-doc-body { padding: 20px 18px 24px; } }

@media print {
    @page { margin: 14mm; }
    /* Oculta el resto de la app (riel, lienzo, barra) dejando solo el informe.
       El overlay del informe es hijo directo de .sim-app. */
    .sim-app > *:not(.report-overlay) { display: none !important; }
    .no-print { display: none !important; }
    /* Saca el informe del "modo modal" para que fluya en el flujo normal del
       documento y el navegador lo pagine (fixed/absolute + overflow lo cortaban
       en una sola página). */
    html, body, .sim-app, .plants-page { height: auto !important; overflow: visible !important; }
    .sim-app { display: block !important; }
    .report-overlay { position: static !important; inset: auto !important; display: block !important; overflow: visible !important; height: auto !important; padding: 0 !important; background: #fff !important; }
    .report-doc { position: static !important; width: 100% !important; max-width: none !important; margin: 0 !important; overflow: visible !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; }
    .report-doc-body { overflow: visible !important; padding: 0 !important; }
    .rpt-section, .rpt-buffer, .rpt-verdict, .rpt-pl tr { break-inside: avoid; page-break-inside: avoid; }
    .rpt-buffers { grid-template-columns: 1fr 1fr; }
}
.report-metrics .money, .report-table .money { color: var(--money); }
.report-metrics .danger, .report-table .danger { color: var(--danger); }
.report-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.report-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; overflow: hidden; }
.report-table th { position: sticky; top: 0; z-index: 1; text-align: center; color: var(--text-dim); font-weight: 700; padding: 9px 10px; background: var(--surface-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.report-table td { padding: 9px 10px; border-bottom: 1px solid rgba(127,127,127,0.16); color: var(--text); vertical-align: middle; text-align: center; }
.report-table th:first-child,
.report-table td:first-child { text-align: left; }
.report-table tbody tr:nth-child(even) td { background: rgba(127,127,127,0.06); }
.report-table tr.total td { border-top: 1px solid var(--border); font-weight: 900; background: rgba(127,127,127,0.1); }
.report-table .num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.report-input { display: grid; gap: 5px; color: var(--text-dim); font-size: 11px; font-weight: 700; min-width: 132px; }
.report-input input { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 8px 9px; font: inherit; font-size: 13px; }
.node-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,0.18); vertical-align: -1px; }
.report-bar { display: inline-block; width: min(150px, 14vw); height: 8px; margin-right: 8px; background: rgba(127,127,127,0.2); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.report-bar span { display: block; height: 100%; border-radius: inherit; }
.status-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.status-pill.good { color: #166534; background: #dcfce7; }
.status-pill.warn { color: #92400e; background: #fef3c7; }
.status-pill.bad { color: #991b1b; background: #fee2e2; }
.status-pill.idle { color: var(--text-dim); background: rgba(127,127,127,0.14); border-color: var(--border); }
.node-report { min-width: 920px; }
.capacity-report { min-width: 760px; }

@media (max-width: 860px) {
    .report-modal { width: 96vw; height: 92vh; }
    .report-modal .kpi-modal-body { flex-direction: column; }
    .report-modal .kpi-tabs { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
    .report-modal .kpi-tabs button { white-space: nowrap; }
    .report-groups { grid-template-columns: 1fr; }
    .report-toolbar { flex-direction: column; }
    .report-input { width: 160px; }
}

/* ---- Simulator confirmation modal ---- */
.confirm-overlay { background: rgba(15, 23, 18, 0.48); backdrop-filter: blur(6px); }
.confirm-modal { width: min(420px, 92vw); max-height: none; display: grid; justify-items: center; gap: 14px; padding: 24px; text-align: center; overflow: visible; }
.confirm-icon { width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; background: color-mix(in srgb, var(--primary) 16%, var(--surface-2)); color: var(--brand); border: 1px solid color-mix(in srgb, var(--primary) 32%, transparent); }
.confirm-icon.danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.confirm-icon .material-symbols-outlined { font-size: 28px; }
.confirm-copy { width: 100%; display: grid; gap: 8px; }
.confirm-copy h2 { margin: 0; color: var(--text); font-size: 20px; line-height: 1.2; letter-spacing: 0; }
.confirm-copy p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.confirm-cost { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.confirm-cost span { color: var(--text-dim); font-size: 12px; font-weight: 700; }
.confirm-cost b { color: var(--money); font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.confirm-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.confirm-actions .ctrl-btn { width: auto; height: 42px; min-height: 42px; padding: 0 16px; border-radius: 8px; justify-content: center; font-size: 13px; font-weight: 800; transform: none; }
.confirm-actions .ctrl-btn:hover { transform: none; }
.confirm-actions .ctrl-btn.primary { width: auto; height: 42px; box-shadow: none; }
.confirm-actions .danger-action { background: var(--danger); color: #4a0004; border-color: transparent; }
.confirm-actions .danger-action:hover { filter: brightness(0.96); }
.theme-light .confirm-icon.danger { color: #991b1b; }
.theme-light .confirm-actions .danger-action { color: #fff; background: #b91c1c; }
/* ---- Node output configuration ---- */
.output-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.output-metric { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.output-metric span { color: var(--text-dim); font-size: 11px; font-weight: 700; }
.output-metric b { color: var(--text); font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.output-metric.single-stat { grid-template-columns: 1fr auto; grid-auto-flow: column; align-items: center; margin-top: 12px; }
.output-route-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-dim); font-size: 12px; }
.output-route-card.closed { opacity: .72; }
.output-route-card.open { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.output-route-card strong { display: block; color: var(--text); font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.output-route-card span { display: block; color: var(--text-dim); font-size: 11px; line-height: 1.35; }
.output-route-card .btn { flex: none; min-width: 84px; padding: 4px 12px; }
@media (max-width: 760px) { .output-summary-grid { grid-template-columns: 1fr; } .output-route-card { align-items: center; } }
/* ---- Plant editor node modal and quick actions ---- */
.editor-node-modal-overlay { align-items: stretch; padding: 0 18px; }
.editor-node-modal { width: min(860px, 94vw); height: 100vh; max-height: 100vh; border-radius: 0; }
.editor-node-modal .modal-head small { color: var(--text-dim); font-size: 12px; font-weight: 700; margin-left: 8px; }
.editor-node-modal-actions { display: inline-flex; gap: 8px; }
.editor-node-modal .kpi-tabs { width: 190px; }
.editor-node-actions { position: absolute; top: -13px; right: -13px; display: inline-flex; gap: 3px; padding: 2px; border: 1px solid rgba(143, 169, 148, .45); border-radius: 999px; background: rgba(255,255,255,.96); box-shadow: 0 8px 18px rgba(24,36,28,.14); z-index: 8; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(4px) scale(.96); transition: opacity .14s ease, visibility .14s ease, transform .14s ease; }
.editor-app .node:hover .editor-node-actions, .editor-app .node:focus-within .editor-node-actions { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
@media (hover: none) {
    .editor-node-actions { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
}

.editor-node-action { width: 23px; height: 23px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-dim); cursor: pointer; transition: background .12s ease, color .12s ease, transform .12s ease; }
.editor-node-action:hover { background: var(--surface-3); color: var(--accent); transform: translateY(-1px); }
.editor-node-action.danger { color: #b91c1c; }
.editor-node-action.danger:hover { background: #fee2e2; color: #991b1b; }
.editor-node-action .material-symbols-outlined { font-size: 14px; }
.editor-app .node { cursor: grab; user-select: none; touch-action: none; }
.editor-app .node:active { cursor: grabbing; }
.editor-app .node-name, .editor-app .io-label { overflow-wrap: anywhere; word-break: break-word; line-height: 1.05; text-align: center; }
.editor-app .node-name.sm, .editor-app .io-label.sm { font-size: 10.5px; }
.editor-app .node-name.xs, .editor-app .io-label.xs { font-size: 9px; }
.editor-app .node-name.sm { max-width: 60px; }
.editor-app .node-name.xs { max-width: 62px; }
.editor-app .io-label.xs { max-width: 86px; }
.editor-app .ctrl-btn:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 760px) {
    .editor-node-modal-overlay { padding: 0; }
    .editor-node-modal { width: 100vw; }
    .editor-node-modal .kpi-modal-body { flex-direction: column; }
    .editor-node-modal .kpi-tabs { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
    .editor-node-modal .kpi-tabs button { white-space: nowrap; }
}
/* ---- Simulation Lab canvas-first layout ---- */
.simlab-shell { grid-template-columns: 72px minmax(0, 1fr); min-height: 100vh; height: 100vh; overflow: hidden; }
.simlab-rail { width: 72px; min-height: 100vh; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; overflow: visible; background: #fbfdfb; border-right: 1px solid #dbe5da; }
.simlab-rail-brand { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #d6dfd5; border-radius: 12px; background: #fff; cursor: pointer; box-shadow: 0 8px 18px rgba(24,36,28,.05); }
.simlab-rail-brand img { width: 28px; height: 28px; }
.simlab-rail-group { display: grid; gap: 8px; width: 100%; justify-items: center; overflow-y: auto; padding: 2px 0 8px; }
.simlab-tool { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid #dbe5da; border-radius: 12px; background: #fff; cursor: grab; box-shadow: 0 8px 18px rgba(24,36,28,.04); }
.simlab-tool:active { cursor: grabbing; }
.simlab-tool:hover { border-color: #22c55e; box-shadow: 0 12px 24px rgba(18,109,53,.12); }
.simlab-tool img { width: 44px; height: 38px; object-fit: contain; pointer-events: none; }
.simlab-tool span { position: absolute; left: 62px; top: 50%; transform: translateY(-50%); min-width: 132px; max-width: 180px; padding: 7px 9px; border: 1px solid #dbe5da; border-radius: 8px; background: rgba(255,255,255,.98); color: #172018; font-size: 12px; font-weight: 900; line-height: 1.15; box-shadow: 0 12px 24px rgba(24,36,28,.12); opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; z-index: 80; }
.simlab-tool:hover span { opacity: 1; transform: translateY(-50%) translateX(3px); }
.simlab-topbar { min-height: 64px; padding: 12px 18px; }
.simlab-topbar h1 { font-size: 22px; }
.simlab-metrics { display: none; }
.simlab-stage-wrap { padding: 10px; overflow: auto; background: #edf2ef; }
.simlab-stage { width: max(1400px, 100%); height: calc(100vh - 84px); min-height: 720px; border-radius: 10px; }
.simlab-canvas-metrics { position: absolute; top: 12px; left: 12px; z-index: 35; display: flex; flex-wrap: wrap; gap: 8px; max-width: min(780px, calc(100% - 24px)); pointer-events: none; }
.simlab-canvas-metrics div { min-width: 118px; display: grid; gap: 2px; padding: 7px 10px; border: 1px solid rgba(214,223,213,.82); border-radius: 8px; background: rgba(255,255,255,.88); box-shadow: 0 8px 18px rgba(24,36,28,.07); backdrop-filter: blur(10px); }
.simlab-canvas-metrics span { color: #607067; font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.simlab-canvas-metrics strong { color: #162019; font-size: 17px; font-weight: 950; font-variant-numeric: tabular-nums; }
.simlab-props-modal-overlay { align-items: stretch; padding: 0 18px; z-index: 2000; }
.simlab-props-modal { width: min(920px, 94vw); height: 100vh; max-height: 100vh; border-radius: 0; }
.simlab-props-modal .modal-head small { margin-left: 8px; color: var(--text-dim); font-size: 12px; font-weight: 800; }
.simlab-props-modal-body { min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; padding: 18px; overflow-y: auto; }
.simlab-prop-preview { align-self: start; display: grid; gap: 12px; padding: 16px; border: 1px solid #dbe5da; border-radius: 8px; background: #fff; }
.simlab-prop-preview img { width: 100%; height: 210px; object-fit: contain; filter: drop-shadow(0 16px 16px rgba(29,40,34,.16)); }
.simlab-prop-preview strong { display: block; color: #172018; font-size: 18px; font-weight: 950; }
.simlab-prop-preview span { display: block; margin-top: 3px; color: #607067; font-size: 12px; font-weight: 900; }
.simlab-prop-form { min-width: 0; }
@media (max-width: 900px) {
    .simlab-shell { grid-template-columns: 60px minmax(0, 1fr); }
    .simlab-rail { width: 60px; padding: 8px 5px; }
    .simlab-tool { width: 48px; height: 48px; }
    .simlab-actions { flex-wrap: wrap; }
    .simlab-stage { height: calc(100vh - 116px); }
    .simlab-props-modal-overlay { padding: 0; }
    .simlab-props-modal { width: 100vw; }
    .simlab-props-modal-body { grid-template-columns: 1fr; }
    .simlab-prop-preview img { height: 150px; }
}

/* ---- Guided tour for simulator demo ---- */
.guided-tour-scrim { position: fixed; inset: 0; z-index: 92; pointer-events: none; background: radial-gradient(circle at 52% 46%, transparent 0 38%, rgba(10, 20, 14, .18) 72%); }
.guided-tour-card { position: fixed; z-index: 97; width: min(430px, calc(100vw - 28px)); display: grid; gap: 12px; padding: 18px; border: 1px solid color-mix(in srgb, var(--border) 86%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--surface) 96%, white); box-shadow: 0 24px 70px rgba(4, 16, 8, .24); color: var(--text); cursor: grab; }
.guided-tour-card.dragging { cursor: grabbing; user-select: none; box-shadow: 0 28px 80px rgba(4, 16, 8, .34); }
.guided-tour-card button { cursor: pointer; }
.guided-tour-card.bottom-right { right: 18px; bottom: 88px; }
.guided-tour-card.bottom { left: 50%; bottom: 88px; transform: translateX(-50%); }
.guided-tour-card.left { left: 92px; top: 124px; }
.guided-tour-card.canvas-top-left { left: 540px; top: 100px; }
.guided-tour-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.guided-tour-kicker .material-symbols-outlined { font-size: 18px; }
.guided-tour-card h2 { margin: 0; color: var(--text); font-size: 22px; line-height: 1.08; letter-spacing: 0; }
.guided-tour-card p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.48; }
.guided-tour-concept { display: grid; gap: 4px; padding: 12px; border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--primary) 9%, var(--surface-2)); }
.guided-tour-concept span { color: var(--brand); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.guided-tour-concept strong { color: var(--text); font-size: 13px; line-height: 1.35; }
.guided-tour-progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.guided-tour-progress i { height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--border) 80%, transparent); }
.guided-tour-progress i.done { background: var(--primary); }
.guided-tour-actions { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
.guided-tour-actions .ctrl-btn { width: auto; min-height: 38px; justify-content: center; padding: 0 12px; }
.guided-tour-actions .ctrl-btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 760px) {
    .guided-tour-card, .guided-tour-card.left, .guided-tour-card.bottom, .guided-tour-card.bottom-right, .guided-tour-card.canvas-top-left { left: 14px; right: 14px; bottom: 76px; top: auto; width: auto; transform: none; }
    .guided-tour-actions { grid-template-columns: 1fr; }
}
/* ---- Guided tour refinements ---- */
/* Spotlight real: en vez de un agujero de gradiente en coordenadas fijas (no
   sirve si el elemento a explicar cambia de tamaño o posición), el elemento
   señalado sube por encima del scrim oscuro con z-index -- así queda
   iluminado sin tener que calcular su posición en pantalla. */
.guided-tour-scrim { background: rgba(8, 14, 10, .58); }
.tour-spotlight { position: relative; z-index: 95; border-radius: 10px; box-shadow: 0 0 0 3px var(--primary), 0 18px 50px rgba(0,0,0,.45); }
.guided-tour-card.dock-right { right: 18px; top: 96px; bottom: auto; width: min(390px, calc(100vw - 28px)); }
.guided-tour-check { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--border) 82%, transparent); border-radius: 8px; background: var(--surface-2); color: var(--text-dim); font-size: 13px; }
.guided-tour-check .material-symbols-outlined { font-size: 18px; }
.guided-tour-check.done { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); color: var(--brand); background: color-mix(in srgb, var(--primary) 10%, var(--surface-2)); }
/* La mano es una guia fija (no arrastrable, ver JS): senala el elemento real
   al que se refiere el paso posicionandose como hijo de su contenedor real
   (position:absolute) en vez de coordenadas sueltas en el viewport -- asi no
   se desalinea si cambia el ancho del sidebar u otra parte del layout. */
.guided-hand { position: absolute; z-index: 96; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 999px; background: color-mix(in srgb, var(--primary) 16%, var(--surface)); color: var(--brand); box-shadow: 0 12px 30px rgba(18,109,53,.24); pointer-events: none; animation: guided-hand-pulse 1.2s ease-in-out infinite; }
.guided-hand::after { content: ""; position: absolute; inset: -7px; border: 2px solid color-mix(in srgb, var(--primary) 48%, transparent); border-radius: 999px; opacity: .55; animation: guided-ring 1.2s ease-out infinite; }
.guided-hand .material-symbols-outlined { font-size: 25px; font-variation-settings: 'FILL' 1; }
.guided-hand.hand-anchor-card { top: -10px; right: -10px; width: 32px; height: 32px; }
.guided-hand.hand-anchor-card .material-symbols-outlined { font-size: 18px; }
.guided-hand.hand-anchor-play { left: 58px; top: -54px; }
@keyframes guided-hand-pulse {
    0%, 100% { margin-top: 0; transform: scale(1); }
    50% { margin-top: -5px; transform: scale(1.04); }
}
@keyframes guided-ring {
    from { transform: scale(.78); opacity: .65; }
    to { transform: scale(1.32); opacity: 0; }
}
@media (max-width: 760px) {
    .guided-tour-card.dock-right { left: 14px; right: 14px; top: auto; bottom: 76px; width: auto; }
    .guided-hand.hand-info, .guided-hand.hand-warehouse, .guided-hand.hand-resources, .guided-hand.hand-play, .guided-hand.hand-wip, .guided-hand.hand-analytics { left: 18px; top: 86px; bottom: auto; transform: none; }
}
/* Full-height simulator settings with vertical categories */
.settings-modal-overlay {
    padding: 0;
    align-items: stretch;
}
.settings-modal {
    width: min(1120px, 100vw);
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    margin: 0 auto;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.settings-modal > .modal-head {
    flex: 0 0 auto;
}
.settings-layout {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
}
.settings-vertical-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 12px;
    border-right: 1px solid var(--border);
    background: var(--surface-2);
}
.settings-vertical-tabs button {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}
.settings-vertical-tabs button:hover {
    background: var(--surface);
    color: var(--text);
}
.settings-vertical-tabs button.active {
    border-color: rgba(29, 168, 84, .28);
    background: rgba(29, 168, 84, .12);
    color: var(--primary);
}
.settings-vertical-tabs .material-symbols-outlined {
    font-size: 21px;
}
.settings-panel {
    min-height: 0;
    overflow-y: auto;
    padding: 28px clamp(18px, 4vw, 52px) 36px;
}
.settings-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.settings-section-heading > .material-symbols-outlined {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 28px;
}
.settings-section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}
.settings-section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.settings-panel .drum-row {
    min-height: 48px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.settings-panel .hint {
    margin: 12px 0 18px;
}
@media (max-width: 700px) {
    .settings-modal {
        width: 100vw;
    }
    .settings-layout {
        display: flex;
        flex-direction: column;
    }
    .settings-vertical-tabs {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .settings-vertical-tabs button {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 8px 10px;
        white-space: nowrap;
    }
    .settings-vertical-tabs button span:last-child {
        font-size: 12px;
    }
    .settings-panel {
        padding: 20px 14px 28px;
    }
    .settings-panel .drum-row {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
}.plants-advanced-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.plants-advanced-filters label { display: grid; gap: 5px; color: #647167; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.plants-advanced-filters select { width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid #d0dbcf; border-radius: 8px; background: #fff; color: #334139; font: inherit; font-size: 12px; font-weight: 800; outline: none; }
.plants-advanced-filters select:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
@media (max-width: 720px) { .plants-advanced-filters { grid-template-columns: 1fr; } }/* Classroom directory: scalable list with full-width detail view */
.classroom-workspace.browse-mode { display: block; }
.classroom-workspace.browse-mode .classroom-list-panel { width: 100%; position: static; }
.classroom-workspace.browse-mode .classroom-detail-panel { display: none; }
.classroom-workspace.detail-mode { display: block; }
.classroom-workspace.detail-mode .classroom-list-panel { display: none; }
.classroom-workspace.detail-mode .classroom-detail-panel { min-height: 640px; }
.classroom-table-wrap { overflow-x: auto; }
.classroom-directory-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 700px; }
.classroom-directory-table th { padding: 11px 14px; border-bottom: 1px solid #dbe5da; background: #f4f7f6; color: #647467; text-align: left; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.classroom-directory-table th:first-child { border-top-left-radius: 8px; }
.classroom-directory-table th:last-child { border-top-right-radius: 8px; }
.classroom-directory-table td { padding: 12px 14px; border-bottom: 1px solid #edf2ef; color: #26372b; vertical-align: middle; }
.classroom-directory-table tbody tr { cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.classroom-directory-table tbody tr:hover { background: #f8faf9; }
.classroom-directory-table tbody tr.sel { background: #f0fdf4; box-shadow: inset 3px 0 0 #22c55e; }
.classroom-directory-name { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.classroom-directory-name strong { display: block; color: #172018; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.classroom-directory-name small { display: block; margin-top: 3px; color: #647467; font-size: 12px; }
.classroom-code-row.compact { display: inline-flex; align-items: center; gap: 7px; padding: 4px 5px 4px 9px; }
.classroom-number { display: inline-flex; align-items: center; gap: 6px; color: #334139; font-weight: 850; }
.classroom-number .material-symbols-outlined { color: #126d35; font-size: 17px; }
.classroom-muted { color: #647467; font-size: 13px; font-weight: 750; white-space: nowrap; }
.classroom-row-arrow { color: #126d35; font-size: 21px; }
.classroom-back-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; margin-bottom: 15px; padding: 0 9px; border: 1px solid #d6dfd5; border-radius: 8px; background: #fff; color: #536258; font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; }
.classroom-back-button:hover { border-color: #22c55e; color: #126d35; background: #f0fdf4; }
.classroom-back-button .material-symbols-outlined { font-size: 17px; }
.classroom-detail-hero { margin-bottom: 18px; }
.classroom-crumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #647467; }
.classroom-crumbs .sep { color: #b7c7b5; }
.classroom-crumbs .cur { color: #126d35; }
.classroom-detail-hero h2 { margin: 0; color: #172018; font-size: 28px; line-height: 1.12; letter-spacing: 0; overflow-wrap: anywhere; }
.classroom-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.classroom-code-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; border: 1px solid #d6dfd5; border-radius: 8px; background: #f8faf9; color: #26372b; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.classroom-code-chip:hover { border-color: #22c55e; background: #f0fdf4; }
.classroom-code-chip strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; color: #006e2f; }
.classroom-code-chip .material-symbols-outlined { font-size: 16px; color: #126d35; }
.classroom-code-chip .copy { color: #8a9a8c; }
.classroom-meta-item { display: inline-flex; align-items: center; gap: 6px; color: #536258; font-size: 13px; font-weight: 750; }
.classroom-meta-item .material-symbols-outlined { font-size: 17px; color: #647467; }
@media (max-width: 720px) { .classroom-directory-table { min-width: 620px; } .classroom-workspace.detail-mode .classroom-detail-panel { min-height: 0; } }.classroom-section-title-with-action { align-items: center; }
.classroom-section-title-with-action > .plants-btn { margin-left: auto; flex: none; }
.classroom-scenario-picker { margin-bottom: 18px; padding: 14px; border: 1px solid #dbe5da; border-radius: 10px; background: #f8faf9; }
.classroom-scenario-search { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid #cbd9ca; border-radius: 8px; background: #fff; color: #647467; }
.classroom-scenario-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #172018; font: inherit; font-size: 13px; }
.classroom-scenario-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.classroom-scenario-filters select { min-height: 36px; padding: 0 9px; border: 1px solid #d0dbcf; border-radius: 8px; background: #fff; color: #334139; font: inherit; font-size: 12px; font-weight: 800; }
.classroom-plant-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 4px; border: 1px solid #dbe5da; border-radius: 9px; background: #f4f7f6; }
.classroom-plant-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: #536258; font: inherit; font-size: 12px; font-weight: 900; cursor: pointer; }
.classroom-plant-tabs button.active { background: #fff; color: #126d35; box-shadow: 0 5px 14px rgba(24,36,28,.08); }
.classroom-plant-tabs .material-symbols-outlined { font-size: 17px; }
.classroom-plant-tabs strong { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 10px; text-align: center; }
.classroom-topic-chip { position: absolute; z-index: 3; left: 12px; bottom: 12px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.94); color: #126d35; font-size: 10px; font-style: normal; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.classroom-added-grid { margin-top: 0; }
.classroom-catalog-grid { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.classroom-catalog-card { min-width: 0; text-align: left; }
.classroom-catalog-card.selected { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.12); }
.classroom-catalog-card .plant-cover { height: 132px; }
.classroom-catalog-card .plant-cover > strong { position: absolute; z-index: 3; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; background: rgba(240,253,244,.94); color: #166534; font-size: 11px; font-weight: 900; }
.classroom-catalog-card .plant-cover > strong .material-symbols-outlined { font-size: 16px; }
.classroom-catalog-card .plant-card-body > p { min-height: 58px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.classroom-catalog-card .plant-meta { flex-wrap: wrap; }
.classroom-catalog-card .plant-meta > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classroom-plant-modal { z-index: 1; }
.plants-btn.danger { border-color: #fecaca; background: #fff1f2; color: #b91c1c; }
.plants-btn.danger:hover { border-color: #f87171; background: #ffe4e6; }
.classroom-scenario-card.picker-card { min-height: 72px; align-items: flex-start; }
.classroom-scenario-card.picker-card span:not(.material-symbols-outlined) { display: grid; gap: 4px; }
.classroom-scenario-card.picker-card small { color: #647467; font-size: 11px; font-weight: 750; }
.assigned-scenarios-title { margin-top: 18px; }
@media (max-width: 720px) { .classroom-section-title-with-action { align-items: flex-start; flex-wrap: wrap; } .classroom-section-title-with-action > .plants-btn { margin-left: 44px; } .classroom-scenario-filters { grid-template-columns: 1fr; } }
/* ================= Manual ================= */
.manual-page { height: 100vh; overflow-y: auto; background: #f4f7f6; color: #172018; }
.manual-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid #dbe5da; }
.manual-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.manual-brand img { height: 30px; }
.manual-brand span { color: #126d35; font-weight: 900; letter-spacing: .02em; }
.manual-topbar-actions { display: flex; gap: 8px; }
.manual-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid #22c55e; background: #22c55e; color: #052d14; font-weight: 800; font-size: 13px; text-decoration: none; }
.manual-btn.ghost { background: #fff; color: #126d35; border-color: #cfe0cd; }
.manual-btn .material-symbols-outlined { font-size: 19px; }
.manual-layout { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 32px; padding: 28px 24px 60px; }
.manual-toc { position: sticky; top: 74px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; }
.manual-toc-inner { display: flex; flex-direction: column; gap: 2px; }
.manual-toc-title { margin: 0 0 8px; color: #172018; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.manual-toc-group { margin: 14px 0 4px; color: #126d35; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.manual-toc a { padding: 6px 10px; border-radius: 7px; color: #536258; text-decoration: none; font-size: 13px; font-weight: 650; border-left: 2px solid transparent; }
.manual-toc a:hover { background: #eef4ef; color: #126d35; }
.manual-content { min-width: 0; }
.manual-section { scroll-margin-top: 84px; margin-bottom: 40px; }
.manual-section h1 { font-size: 34px; line-height: 1.1; margin: 0 0 12px; }
.manual-section h2 { font-size: 23px; line-height: 1.15; margin: 6px 0 12px; padding-bottom: 8px; border-bottom: 2px solid #e6ede5; }
.manual-section h3 { font-size: 15px; margin: 0 0 6px; }
.manual-section p, .manual-list li, .manual-steps li { color: #2a3a2f; font-size: 15px; line-height: 1.6; }
.manual-lead { font-size: 17px; color: #3a4a3f; }
.manual-kicker { display: inline-block; margin-bottom: 6px; padding: 3px 9px; border-radius: 999px; background: #dcfce7; color: #126d35; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.manual-kicker.teacher { background: #e0e7ff; color: #4338ca; }
.manual-kicker.ref { background: #f1f5f9; color: #475569; }
.manual-list, .manual-steps { padding-left: 20px; display: grid; gap: 7px; margin: 12px 0; }
.manual-steps { counter-reset: step; list-style: none; padding-left: 0; }
.manual-steps li { position: relative; padding-left: 40px; }
.manual-steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #126d35; color: #fff; font-size: 13px; font-weight: 900; }
.manual-callout { display: flex; gap: 12px; padding: 14px 16px; margin: 16px 0; border-radius: 10px; border: 1px solid #dbe5da; background: #fff; }
.manual-callout .material-symbols-outlined { font-size: 22px; color: #126d35; flex: none; }
.manual-callout div { font-size: 14px; line-height: 1.55; color: #2a3a2f; }
.manual-callout.success { border-color: #bbf7d0; background: #f0fdf4; }
.manual-callout.warn { border-color: #fde68a; background: #fffbeb; }
.manual-callout.warn .material-symbols-outlined { color: #b7791f; }
.manual-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.manual-card { padding: 14px; border: 1px solid #e0e8df; border-radius: 10px; background: #fff; }
.manual-card > .material-symbols-outlined { font-size: 26px; color: #126d35; margin-bottom: 6px; }
.manual-card p { font-size: 13px; color: #536258; margin: 0; }
.manual-diagram { width: 100%; max-width: 520px; height: auto; margin: 12px 0; }
.manual-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.manual-table th { text-align: left; padding: 9px 12px; background: #eef4ef; color: #334139; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid #d6dfd5; }
.manual-table td { padding: 10px 12px; border-bottom: 1px solid #edf2ef; color: #2a3a2f; vertical-align: top; }
.manual-table td:first-child { font-weight: 800; white-space: nowrap; }
.manual-shot { margin: 16px 0; border: 1px solid #e0e8df; border-radius: 10px; overflow: hidden; background: #fff; }
.manual-shot img { display: block; width: 100%; height: auto; }
.manual-shot figcaption { padding: 9px 14px; font-size: 12.5px; color: #647467; background: #f8faf9; border-top: 1px solid #edf2ef; }
.manual-shot.missing img { display: none; }
.manual-shot.missing::before { content: "📷  Captura pendiente: " attr(data-file); display: flex; align-items: center; justify-content: center; min-height: 150px; color: #8a9a8c; font-size: 13px; font-weight: 700; background: repeating-linear-gradient(45deg, #f8faf9, #f8faf9 12px, #f2f6f2 12px, #f2f6f2 24px); }
.manual-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid #e6ede5; color: #647467; font-size: 14px; }
.manual-section code { background: #eef4ef; color: #126d35; padding: 1px 6px; border-radius: 5px; font-size: .92em; }
@media (max-width: 900px) {
    .manual-layout { grid-template-columns: 1fr; }
    .manual-toc { position: static; max-height: none; border: 1px solid #e0e8df; border-radius: 10px; padding: 12px; background: #fff; }
    .manual-toc-inner { flex-flow: row wrap; }
    .manual-toc-group { width: 100%; }
}
