/* Impresoras 3D — paleta «Arctic» de DIOXI (DIOXI/wwwroot/css/dioxi-arctic.css), para PC con teclado y mouse:
   botones grandes, textos claros, estados con color y palabra (nunca solo color). */
:root {
    --primary-blue: #0078D4;
    --primary-blue-dark: #005A9E;
    --accent-cyan: #0EA5E9;
    --arctic-ice: #E0F7FF;
    --arctic-cobalt: #1D4ED8;
    --arctic-deep: #1E3A5F;
    --success-green: #0F7B0F;
    --warning-orange: #EA580C;
    --error-red: #C42B1C;
    --bg-main: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --text-primary: #1A1A1A;
    --text-secondary: #616161;
    --text-tertiary: #94A3B8;
    --border-color: #E0E0E0;
    --border-light: #F0F0F0;
    --temp-nozzle: #DC2626;
    --temp-nozzle-bg: #FEF2F2;
    --temp-bed: #D97706;
    --temp-bed-bg: #FFFBEB;
    --font-ui: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    --shadow-card: 0 3px 12px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 6px 20px rgba(0, 0, 0, 0.10);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --fast: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-ui); background: var(--bg-main); color: var(--text-primary); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary-blue); }
code, .mono { font-family: var(--font-mono); font-size: .9em; }

/* ---- cabecera ---- */
.app-header { background: var(--surface); border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-card);
    padding: 0 28px; height: 64px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.brand__title { font-size: 1.25rem; font-weight: 700; color: var(--arctic-cobalt); }
.brand__sub { font-size: .8rem; color: var(--text-tertiary); }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { padding: 10px 18px; border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav a.activo { background: var(--arctic-ice); color: var(--primary-blue); }
.nav .quien { color: var(--text-tertiary); font-size: .85rem; margin: 0 6px 0 14px; }

.main { max-width: 1280px; margin: 0 auto; padding: 28px; }
h1 { font-size: 1.6rem; color: var(--arctic-deep); margin-bottom: 6px; }
h2 { font-size: 1.2rem; color: var(--arctic-deep); margin-bottom: 12px; }
.sub { color: var(--text-secondary); margin-bottom: 22px; }

/* ---- avisos ---- */
.flash { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 18px; font-weight: 600; border-left: 6px solid; }
.flash.ok { background: #ECFDF5; color: var(--success-green); }
.flash.mal { background: #FEF2F2; color: var(--error-red); }
.flash.alerta { background: #FFF7ED; color: var(--warning-orange); }
.banner-aviso { display: none; background: var(--error-red); color: #fff; padding: 14px 28px; font-weight: 700; font-size: 1.05rem; }
.banner-aviso.visible { display: block; }
.banner-conexion { display: none; background: #FFFBEB; color: var(--warning-orange); padding: 8px 28px; font-weight: 600; text-align: center; }
.banner-conexion.visible { display: block; }

/* ---- tarjetas ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 22px; }
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 26px; }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.card__title { font-size: 1.35rem; font-weight: 700; color: var(--arctic-deep); }
.card.apagada { opacity: .7; }

.estado { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 9999px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.estado::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.estado.ok { background: #ECFDF5; color: var(--success-green); }
.estado.activo { background: var(--arctic-ice); color: var(--primary-blue); }
.estado.activo::before { animation: latido 1.4s ease-in-out infinite; }
.estado.mal { background: #FEF2F2; color: var(--error-red); }
.estado.alerta { background: #FFF7ED; color: var(--warning-orange); }
.estado.info { background: #EFF6FF; color: var(--arctic-cobalt); }
.estado.gris { background: var(--surface-hover); color: var(--text-secondary); }
@keyframes latido { 50% { opacity: .25; } }

.temps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 18px; }
.temp { border-radius: var(--radius-md); padding: 14px 18px; }
.temp.boquilla { background: var(--temp-nozzle-bg); }
.temp.cama { background: var(--temp-bed-bg); }
.temp__label { font-size: .85rem; font-weight: 600; color: var(--text-secondary); }
.temp__valor { font-size: 2.1rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.temp.boquilla .temp__valor { color: var(--temp-nozzle); }
.temp.cama .temp__valor { color: var(--temp-bed); }
.temp__obj { font-size: .9rem; color: var(--text-secondary); }

.barra { height: 22px; background: var(--surface-hover); border-radius: 9999px; overflow: hidden; margin: 8px 0 6px; }
.barra__relleno { height: 100%; background: linear-gradient(90deg, var(--primary-blue), var(--accent-cyan)); width: 0; transition: width .6s ease; }
.datos { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-secondary); font-size: .95rem; }
.datos b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.vacio { color: var(--text-tertiary); padding: 10px 0 16px; }
.avisos { margin: 12px 0 0; }
.avisos div { background: #FEF2F2; color: var(--error-red); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; margin-top: 8px; }

/* ---- botones (grandes: mouse y teclado) ---- */
.acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 14px 28px;
    font-family: var(--font-ui); font-size: 1.05rem; font-weight: 700; border-radius: var(--radius-md); border: 2px solid transparent;
    cursor: pointer; text-decoration: none; transition: all var(--fast); }
.btn:focus-visible { outline: 3px solid var(--accent-cyan); outline-offset: 3px; }
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; }
.btn-primario { background: var(--primary-blue); color: #fff; }
.btn-primario:hover { background: var(--primary-blue-dark); box-shadow: var(--shadow-elevated); }
.btn-peligro { background: var(--error-red); color: #fff; }
.btn-peligro:hover { background: #A1231A; box-shadow: var(--shadow-elevated); }
.btn-ok { background: var(--success-green); color: #fff; }
.btn-ok:hover { background: #0B5E0B; box-shadow: var(--shadow-elevated); }
.btn-secundario { background: var(--surface); color: var(--primary-blue); border-color: var(--primary-blue); }
.btn-secundario:hover { background: var(--arctic-ice); }
.btn:disabled { background: #CBD5E1; color: #fff; border-color: transparent; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ancho { width: 100%; }
.btn-chico { min-height: 40px; padding: 8px 16px; font-size: .9rem; }

/* ---- formularios ---- */
.form-group { margin-bottom: 18px; text-align: left; }
.form-label { display: block; font-size: .88rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, select.form-input { width: 100%; padding: 12px 16px; font-family: var(--font-ui); font-size: 1rem; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); background: var(--surface); min-height: 50px; outline: none; }
.form-input:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(0, 120, 212, .15); }

/* ---- ingreso ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-elevated); padding: 48px 44px; width: 100%; max-width: 440px; text-align: center; }
.login-card svg { width: 68px; height: 68px; margin-bottom: 14px; }
.login-card__title { font-size: 1.6rem; font-weight: 700; color: var(--arctic-cobalt); }
.login-card__sub { color: var(--text-tertiary); margin-bottom: 30px; }
.login-error { color: var(--error-red); font-weight: 600; margin-top: 16px; min-height: 22px; }

/* ---- subir ---- */
.zona { border: 3px dashed var(--accent-cyan); border-radius: var(--radius-lg); background: var(--surface); padding: 56px 24px; text-align: center;
    cursor: pointer; transition: all var(--fast); }
.zona:hover, .zona.encima { background: var(--arctic-ice); border-color: var(--primary-blue); }
.zona svg { width: 64px; height: 64px; color: var(--primary-blue); }
.zona__titulo { font-size: 1.3rem; font-weight: 700; color: var(--arctic-deep); margin-top: 10px; }
.zona__nota { color: var(--text-secondary); margin-top: 6px; }
.elegido { margin-top: 18px; font-size: 1.05rem; font-weight: 600; }
.pasos { list-style: none; counter-reset: paso; margin: 8px 0 0; }
.pasos li { counter-increment: paso; padding: 8px 0 8px 46px; position: relative; color: var(--text-secondary); }
.pasos li::before { content: counter(paso); position: absolute; left: 0; top: 6px; width: 32px; height: 32px; border-radius: 50%;
    background: var(--arctic-ice); color: var(--primary-blue); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---- controles de la revisión ---- */
.controles { list-style: none; }
.controles li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.controles li:last-child { border-bottom: 0; }
.marca { flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.marca.ok { background: var(--success-green); }
.marca.mal { background: var(--error-red); }
.marca.pend { background: #CBD5E1; }
.confirmar { display: flex; align-items: center; gap: 14px; background: #FFF7ED; border: 2px solid #FDBA74; border-radius: var(--radius-md);
    padding: 16px 18px; font-size: 1.05rem; font-weight: 600; cursor: pointer; margin-top: 8px; }
.confirmar input { width: 26px; height: 26px; accent-color: var(--success-green); }

/* ---- tablas ---- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
th { background: var(--surface-hover); font-size: .85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #FAFCFF; }
pre.log { background: #0F172A; color: #E2E8F0; padding: 16px; border-radius: var(--radius-md); overflow: auto; max-height: 360px; font-size: .82rem; white-space: pre-wrap; }
.descargas { display: flex; flex-wrap: wrap; gap: 10px; }
.dos-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dos-col > * { min-width: 0; }      /* un hijo ancho (tabla, log) no empuja ni pisa la otra columna */
.tabla-caja { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin-bottom: 22px; }
.tabla-caja table { box-shadow: none; }
.sin-corte { white-space: nowrap; }
.grid-formularios { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 22px; align-items: start; }
td form { margin: 0; }
@media (max-width: 1000px) { .dos-col, .grid { grid-template-columns: 1fr; } .main { padding: 18px; } }

/* Frenar en dos pasos (01/12/2026) */
.frenar__confirmar { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: var(--radius-md); background: #FEF2F2; border-left: 6px solid var(--error-red); }
.frenar__confirmar[hidden] { display: none; }
.frenar__confirmar p { flex-basis: 100%; margin: 0; font-weight: 600; color: var(--error-red); }
.accesos td { font-size: .92em; }

/* 01/12/2026: .btn (display: inline-flex) le ganaba al atributo hidden: «Ver el trabajo» aparecía sin trabajos y
   «Frenar» no se escondía al abrir la confirmación. Lo escondido se esconde siempre. */
[hidden] { display: none !important; }
