/* Tissuar - Produccion. Federico Gomez Arevalo - federicogomez1989@gmail.com */
:root {
  --bg: #121416;
  --panel: #191c1f;
  --panel2: #1f2326;
  --line: #2a2f33;
  --txt: #e7e6e2;
  --mute: #8d9298;
  --dim: #5d6267;
  --ok: #7fb594;
  --warn: #d2a957;
  --bad: #cf6b5f;
  --acc: #a9b8c4;
  --r: 10px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--txt); }
body { -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
a { color: inherit; }
.mute { color: var(--mute); }
.dim { color: var(--dim); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.firma { color: var(--dim); font-size: 11px; letter-spacing: .02em; opacity: .7; }
.hidden { display: none !important; }

/* ---------- paginas de trabajo (tablet / admin / indice) ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 90px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { font-weight: 600; letter-spacing: .18em; font-size: 13px; color: var(--acc); }
.brand small { color: var(--dim); letter-spacing: .05em; font-weight: 400; margin-left: 10px; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 14px; font-weight: 600; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; margin: 26px 0 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
button, .btn {
  font: inherit; color: var(--txt); background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 16px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
  transition: background .15s, border-color .15s;
}
button:hover, .btn:hover { border-color: #3a4045; background: #24282c; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
.btn-ok { border-color: #3d5a48; background: #1e2a23; }
.btn-bad { border-color: #6a3a35; background: #2b1d1b; }
.btn-warn { border-color: #5f4e2b; background: #2a241a; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
input, select, textarea {
  font: inherit; color: var(--txt); background: #101214; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--mute); margin-bottom: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 9px 6px; border-bottom: 1px solid #202427; vertical-align: middle; }
.pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--mute); }
.pill.ok { color: var(--ok); border-color: #34503f; } .pill.warn { color: var(--warn); border-color: #5a4a28; } .pill.bad { color: var(--bad); border-color: #5f3530; }
.bar { height: 8px; background: #101214; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--acc); border-radius: 99px; transition: width .6s; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #24282c; border: 1px solid var(--line); padding: 12px 18px; border-radius: 10px; z-index: 50; font-size: 15px; }
.toast.bad { border-color: #6a3a35; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }

/* ---------- pedir un cambio ---------- */
#pc-btn { position: fixed; right: 18px; bottom: 18px; z-index: 30; font-size: 13px; padding: 9px 14px; border-radius: 99px; background: #1b1e21; color: var(--mute); }
.pc-pick * { cursor: crosshair !important; }
.pc-hover { outline: 2px solid var(--acc) !important; outline-offset: 2px; }
.pc-banner { position: fixed; top: 0; left: 0; right: 0; background: #22272b; border-bottom: 1px solid var(--line); padding: 10px; text-align: center; z-index: 60; font-size: 14px; }

/* ---------- TV (pensado para 1920x1080, escala con vw) ---------- */
.tv { width: 100vw; height: 100vh; overflow: hidden; padding: 1.6vw 1.9vw; display: flex; flex-direction: column; gap: 1.2vw; cursor: none; }
.tv .panel { background: var(--panel); border: 1px solid var(--line); border-radius: .8vw; padding: 1.3vw 1.5vw; min-height: 0; }
.tv .lbl { font-size: .95vw; color: var(--mute); letter-spacing: .12em; text-transform: uppercase; }
.tv-top { display: flex; align-items: center; justify-content: space-between; font-size: 1.25vw; }
.tv-top .brand { font-size: 1.05vw; }
.tv-clock { font-size: 2.2vw; font-weight: 300; color: var(--txt); }
.estado { display: inline-flex; align-items: center; gap: .7vw; font-size: 1.5vw; font-weight: 600; padding: .5vw 1.2vw; border-radius: 99px; border: 1px solid var(--line); letter-spacing: .06em; }
.estado i { width: 1vw; height: 1vw; border-radius: 50%; background: currentColor; display: inline-block; }
.estado.produciendo { color: var(--ok); border-color: #34503f; }
.estado.lenta { color: var(--warn); border-color: #5a4a28; }
.estado.parada { color: var(--bad); border-color: #5f3530; animation: lat 1.6s infinite; }
.estado.sin_orden, .estado.pausada { color: var(--mute); }
@keyframes lat { 50% { opacity: .55; } }
.big { font-size: 9vw; font-weight: 300; line-height: .95; letter-spacing: -.02em; }
.huge { font-size: 12vw; font-weight: 200; line-height: .9; letter-spacing: -.03em; }
.tvbar { height: 1.6vw; background: #101214; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.tvbar > i { display: block; height: 100%; background: var(--acc); transition: width .8s; }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: .9vw 1.6vw; }
.ficha div b { display: block; font-size: 2.3vw; font-weight: 400; }
.ficha div span { font-size: .85vw; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.offline { position: fixed; inset: auto 0 0 0; background: #3a1f1c; color: #f0d2cd; text-align: center; font-size: 1.6vw; padding: .8vw; z-index: 10; }
.tv .firma { position: fixed; right: 1vw; bottom: .5vw; font-size: .6vw; }
