/* TissueArg - Sistema de gestion. Federico Gomez Arevalo - federicogomez1989@gmail.com */
/* Estilo: marca TISSUEARG. Azul #153E76 y negro del logo, Montserrat + Manrope. */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  /* TISSUEARG S.A.S. — azul de marca y negro del logo sobre gris claro */
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel2: #f4f7fa;
  --line: #dde4ec;
  --line2: #b6c3d3;
  --txt: #1d2330;
  --mute: #566273;
  --dim: #7e8a9b;
  --ok: #1d7a4b;
  --warn: #a36500;
  --bad: #c0392b;
  --acc: #153e76;
  --acc-txt: #153e76;
  --on-acc: #ffffff;
  --negro: #211f20;
  --gold-hair: #153e76;
  --r: 8px;
  --f-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Montserrat", "Segoe UI", system-ui, sans-serif;
  font-family: var(--f-body);
}
/* TVs de planta: misma marca en fondo azul profundo */
body:has(.tv) {
  --bg: #0a1a31; --panel: #0f2546; --panel2: #143058; --line: #1e3c69; --line2: #36598c;
  --txt: #f3f6fa; --mute: #a9b9cf; --dim: #7f94b1; --acc: #4f86d6; --acc-txt: #8fb5ec; --on-acc: #0a1a31;
  --ok: #5fd08f; --warn: #f2b84b; --bad: #ff7a6b; --gold-hair: #4f86d6;
}
* { 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: 10px; letter-spacing: .2em; text-transform: uppercase; font-family: var(--f-mono); }
.hidden { display: none !important; }
::selection { background: var(--acc); color: var(--on-acc); }

/* ---------- paginas de trabajo (tablet / admin / indice) ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 96px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--f-mono); font-weight: 500; letter-spacing: .32em; font-size: 12px; color: var(--acc-txt); }
.brand small { color: var(--mute); letter-spacing: .16em; font-weight: 400; margin-left: 14px; text-transform: uppercase; font-size: 10px; }
h1 { font-family: var(--f-display); font-size: 34px; font-weight: 500; letter-spacing: .005em; line-height: 1.1; }
h2 { font-family: var(--f-mono); font-size: 11px; font-weight: 500; color: var(--acc-txt); letter-spacing: .22em; text-transform: uppercase; margin: 36px 0 14px; }
h3 { font-family: var(--f-display); font-weight: 600; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-top-color: var(--gold-hair); border-radius: var(--r); padding: 24px; text-decoration: none; transition: border-color .2s; }
a.card:hover { border-color: var(--line2); border-top-color: var(--acc); }
.grid { display: grid; gap: 16px; }
.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; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--txt); background: transparent; border: 1px solid var(--line2);
  border-radius: var(--r); padding: 13px 20px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
  transition: background .2s, border-color .2s, color .2s;
}
button:hover, .btn:hover { border-color: var(--acc); color: var(--acc-txt); background: rgba(21, 62, 118, .06); }
button:focus-visible, .btn:focus-visible, input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc-txt); outline-offset: 2px; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; }
.btn-ok { border-color: var(--acc); color: var(--acc-txt); }
.btn-ok:hover { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.btn-bad { border-color: var(--bad); color: var(--bad); }
.btn-bad:hover { background: rgba(236, 138, 122, .08); color: var(--bad); border-color: var(--bad); }
.btn-warn { border-color: var(--warn); color: var(--warn); }
.btn-warn:hover { background: rgba(226, 184, 96, .08); color: var(--warn); border-color: var(--warn); }
.mega.btn-ok, .btn-ok.mega { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.mega.btn-ok:hover { background: var(--acc-txt); color: var(--on-acc); }
.btn-sm { padding: 8px 12px; font-size: 10px; }
input, select, textarea {
  font: inherit; color: var(--txt); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 11px 12px; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-family: var(--f-mono); font-size: 10px; color: var(--mute); margin-bottom: 8px; letter-spacing: .16em; text-transform: uppercase; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--acc-txt); font-family: var(--f-mono); font-weight: 500; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; padding: 10px 8px; border-bottom: 1px solid var(--acc); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pill { display: inline-block; font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; border-radius: 0; border: 1px solid var(--line2); color: var(--mute); }
.pill.ok { color: var(--ok); border-color: currentColor; } .pill.warn { color: var(--warn); border-color: currentColor; } .pill.bad { color: var(--bad); border-color: currentColor; }
.bar { height: 6px; background: var(--panel); border-radius: 0; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--acc); border-radius: 0; transition: width .6s; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--acc); padding: 14px 20px; border-radius: 0; z-index: 50; font-size: 14px; }
.toast.bad { border-color: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(13, 27, 48, .45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-top: 1px solid var(--acc); border-radius: 0; padding: 28px; 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: 10px; padding: 10px 14px; border-radius: 0; background: var(--bg); color: var(--mute); border-color: var(--line2); }
.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: var(--panel2); border-bottom: 1px solid var(--acc); 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-top-color: var(--gold-hair); border-radius: 0; padding: 1.3vw 1.5vw; min-height: 0; }
.tv .lbl { font-family: var(--f-mono); font-size: .85vw; color: var(--acc-txt); letter-spacing: .24em; text-transform: uppercase; }
.tv-top { display: flex; align-items: center; justify-content: space-between; font-size: 1.25vw; padding-bottom: 1vw; border-bottom: 1px solid var(--line); }
.tv-top .brand { font-size: 1vw; }
.tv-top .mute { font-family: var(--f-display); font-size: 1.4vw; font-weight: 600; }
.tv-clock { font-family: var(--f-mono); font-size: 2.2vw; font-weight: 300; color: var(--txt); letter-spacing: .04em; }
.estado { display: inline-flex; align-items: center; gap: .7vw; font-family: var(--f-mono); font-size: 1.15vw; font-weight: 500; padding: .55vw 1.3vw; border-radius: 0; border: 1px solid currentColor; letter-spacing: .24em; }
.estado i { width: .7vw; height: .7vw; border-radius: 0; transform: rotate(45deg); background: currentColor; display: inline-block; }
.estado.produciendo { color: var(--ok); }
.estado.lenta { color: var(--warn); }
.estado.parada { color: var(--bad); animation: lat 1.6s infinite; }
.estado.sin_orden, .estado.pausada { color: var(--mute); }
@keyframes lat { 50% { opacity: .5; } }
.big { font-family: var(--f-display); font-size: 9vw; font-weight: 500; line-height: .95; letter-spacing: -.01em; }
.huge { font-family: var(--f-display); font-size: 13vw; font-weight: 500; line-height: .85; letter-spacing: -.02em; color: var(--txt); }
.tvbar { height: 1.1vw; background: var(--panel); border-radius: 0; overflow: hidden; border: 1px solid var(--line); }
.tvbar > i { display: block; height: 100%; background: var(--acc); border-radius: 0 !important; transition: width .8s; }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 1vw 1.8vw; }
.ficha div { border-bottom: 1px solid var(--line); padding-bottom: .5vw; }
.ficha div b { display: block; font-family: var(--f-display); font-size: 2.4vw; font-weight: 500; }
.ficha div span { font-family: var(--f-mono); font-size: .75vw; color: var(--mute); letter-spacing: .18em; text-transform: uppercase; }
.offline { position: fixed; inset: auto 0 0 0; background: #5b1d17; color: #fde8e4; border-top: 1px solid var(--bad); text-align: center; font-family: var(--f-mono); letter-spacing: .14em; font-size: 1.3vw; padding: .8vw; z-index: 10; }
.tv .firma { position: fixed; right: 1.2vw; bottom: .6vw; font-size: .55vw; }
/* Titulos grandes de TV en serif */
.tv #o-prod, .tv #e-txt, .tv #b-cod { font-family: var(--f-display); font-weight: 500 !important; }
.tv #o-prod { font-size: 3.8vw !important; }
.tv #cola > div { padding: .3vw 0 !important; }
.tv #causas > div { margin-bottom: .3vw !important; }


/* ---------- marca TISSUEARG ---------- */
h1, h2, h3 { font-family: var(--f-display); }
h1 { font-weight: 800; letter-spacing: -.01em; color: var(--txt); }
h3 { font-weight: 700; }
.brand img.logo { height: 30px; width: auto; vertical-align: middle; }
.tv .brand img.logo { height: 2.6vw; }
.card { box-shadow: 0 1px 2px rgba(17, 35, 64, .05), 0 6px 18px rgba(17, 35, 64, .04); border-top: 3px solid var(--acc); }
body:has(.tv) .card { box-shadow: none; }
button, .btn { border-radius: var(--r); letter-spacing: .08em; }
.btn-ok { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.btn-ok:hover { background: #0f2f5c; color: #fff; border-color: #0f2f5c; }
button:hover, .btn:hover { color: var(--acc); }
input, select, textarea { border-color: var(--line2); }
input:focus, select:focus, textarea:focus { border-color: var(--acc); outline: 2px solid rgba(21, 62, 118, .18); outline-offset: 0; }
.pill { border-radius: 99px; }
.modal { border-radius: 12px; border-top: 4px solid var(--acc); box-shadow: 0 30px 80px rgba(13, 27, 48, .3); }
.toast { border-radius: 10px; background: var(--negro); color: #fff; border-color: var(--negro); }
.toast.bad { background: #8e2a20; border-color: #8e2a20; }
th { color: var(--acc); border-bottom-color: var(--acc); }
.firma { color: var(--dim); }
