/* Terminale di reparto.
   Progettato per un tablet, con i guanti: bersagli grandi, contrasto alto,
   nessun elemento che richieda precisione. */

:root {
    --t-bg: #0f1310;
    --t-surface: #1a201b;
    --t-surface-2: #232a24;
    --t-line: #2f3830;
    --t-text: #eef1ec;
    --t-muted: #93a094;
    --t-green: #22c55e;
    --t-green-dark: #16a34a;
    --t-amber: #f59e0b;
    --t-red: #ef4444;
    --t-blue: #3b82f6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    background: var(--t-bg);
    color: var(--t-text);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 2rem;
}

.t-wrap { max-width: 900px; margin: 0 auto; padding: 0 1rem; }

.t-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(15, 19, 16, .96);
    border-bottom: 1px solid var(--t-line);
    padding: .875rem 0;
}
.t-header__inner { display: flex; align-items: center; gap: 1rem; }
.t-header__title { font-weight: 750; font-size: 1.0625rem; letter-spacing: -.01em; }
.t-header__meta { margin-left: auto; display: flex; align-items: center; gap: 1rem; color: var(--t-muted); font-size: .875rem; }
.t-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--t-text); }

.t-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 56px; padding: 0 1.5rem; border-radius: 12px;
    font-size: 1rem; font-weight: 700; border: 2px solid transparent;
    cursor: pointer; background: var(--t-surface-2); color: var(--t-text);
    font-family: inherit; text-decoration: none; width: 100%;
}
.t-btn:active { transform: scale(.985); }
.t-btn--go { background: var(--t-green); color: #06210f; }
.t-btn--pause { background: var(--t-amber); color: #2a1a00; }
.t-btn--done { background: var(--t-blue); color: #041428; }
.t-btn--warn { background: transparent; border-color: var(--t-red); color: var(--t-red); }
.t-btn--ghost { background: transparent; border-color: var(--t-line); color: var(--t-muted); }
.t-btn[disabled] { opacity: .35; }
.t-btn--lg { min-height: 68px; font-size: 1.125rem; }

.t-actions { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: 1rem; }
@media (min-width: 640px) { .t-actions--2 { grid-template-columns: 1fr 1fr; } }

.t-card { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; }
.t-card__label { font-size: .6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--t-muted); margin: 0 0 .5rem; }

.t-job__number { font-family: ui-monospace, Menlo, monospace; font-size: .8125rem; color: var(--t-muted); }
.t-job__customer { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: .25rem 0 0; }
.t-job__what { font-size: 1.125rem; margin: .5rem 0 0; color: var(--t-text); }
.t-job__spec { color: var(--t-muted); font-size: .9375rem; margin: .375rem 0 0; }

.t-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .875rem; }
.t-badge { border-radius: 999px; padding: .3rem .75rem; font-size: .8125rem; font-weight: 700; background: var(--t-surface-2); color: var(--t-muted); }
.t-badge--urgent { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.t-badge--today { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.t-badge--ok { background: rgba(34, 197, 94, .16); color: #86efac; }

.t-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .625rem; }
.t-step {
    background: var(--t-surface); border: 1px solid var(--t-line);
    border-left: 4px solid var(--t-line);
    border-radius: 12px; padding: 1rem 1.125rem;
}
.t-step--ready { border-left-color: var(--t-green); }
.t-step--running { border-left-color: var(--t-green); background: rgba(34, 197, 94, .07); }
.t-step--paused { border-left-color: var(--t-amber); background: rgba(245, 158, 11, .06); }
.t-step--done { border-left-color: var(--t-line); opacity: .6; }
.t-step__head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.t-step__seq { font-family: ui-monospace, Menlo, monospace; font-size: .8125rem; color: var(--t-muted); }
.t-step__name { font-weight: 700; font-size: 1.0625rem; }
.t-step__state { margin-left: auto; font-size: .8125rem; font-weight: 700; }
.t-step__state--running { color: var(--t-green); }
.t-step__state--paused { color: var(--t-amber); }
.t-step__state--done { color: var(--t-muted); }
.t-step__meta { color: var(--t-muted); font-size: .875rem; margin-top: .375rem; font-variant-numeric: tabular-nums; }
.t-step__over { color: var(--t-amber); font-weight: 700; }

.t-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.t-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--t-line); font-size: .9375rem; }
.t-list li:last-child { border-bottom: 0; }
.t-list span:last-child { color: var(--t-muted); font-variant-numeric: tabular-nums; text-align: right; }

.t-field { margin-bottom: 1rem; }
.t-field label { display: block; font-size: .875rem; font-weight: 700; margin-bottom: .375rem; color: var(--t-muted); }
.t-field input, .t-field select, .t-field textarea {
    width: 100%; min-height: 56px; padding: .75rem 1rem;
    font: inherit; font-size: 1.25rem; font-weight: 600;
    background: var(--t-bg); color: var(--t-text);
    border: 2px solid var(--t-line); border-radius: 12px;
}
.t-field textarea { min-height: 96px; font-size: 1rem; font-weight: 400; }
.t-field input:focus, .t-field select:focus, .t-field textarea:focus { border-color: var(--t-green); outline: none; }

.t-pin { display: grid; place-items: center; min-height: 100dvh; padding: 1.5rem; }
.t-pin__box { width: 100%; max-width: 380px; text-align: center; }
.t-pin input { text-align: center; letter-spacing: .6em; font-size: 2rem; }

.t-flash { border-radius: 12px; padding: .875rem 1.125rem; margin-bottom: 1rem; font-weight: 600; }
.t-flash--ok { background: rgba(34, 197, 94, .16); color: #86efac; }
.t-flash--error { background: rgba(239, 68, 68, .16); color: #fca5a5; }

.t-empty { text-align: center; padding: 3rem 1rem; color: var(--t-muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Controllo qualità sul terminale: la checklist si compila con i guanti. */
.t-qc { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.t-btn--qc { justify-content: flex-start; text-align: left; font-size: 1rem; background: var(--t-surface-2, #1b1f27); }
.t-btn--qc-ok { border-color: #22c55e; color: #86efac; }
.t-btn--qc-ko { border-color: #ef4444; color: #fca5a5; }
.t-qc-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--t-line); }
.t-qc-range { opacity: .7; font-weight: 400; }
.t-qc-hint { font-size: .875rem; opacity: .7; margin: 0 0 .35rem; }
