/* PtyTaller — estilo propio: negro, rojo y blanco, letras Barlow */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');
:root {
  --ink: #0E0E10; --ink2: #3B4452; --mut: #667085; --line: #E3E6EB; --bg: #F3F4F6; --card: #fff;
  --pri: #E0161E; --pri-d: color-mix(in srgb, var(--pri) 72%, #000); --on: #fff; --side: #0E0E10; --ok: #047857; --bad: #B91C1C; --warn: #B45309;
  --r: 14px; --sh: 0 1px 2px rgba(20,24,31,.06), 0 6px 20px rgba(20,24,31,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 Barlow, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { font-family: 'Barlow Condensed', Barlow, sans-serif; font-weight: 700; letter-spacing: .01em; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.55rem; } h3 { font-size: 1.2rem; }
p { margin: 0 0 .7em; } a { color: var(--pri-d); }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; vertical-align: -4px; }
.muted { color: var(--mut); } .small { font-size: .86rem; } .right { text-align: right; } .bold { font-weight: 700; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: 9px; font: 700 1.5rem 'Barlow Condensed', sans-serif; color: inherit; text-decoration: none; }
.logo b { color: var(--pri); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #C6CBD3; } .btn:disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: var(--on); } .btn.pri:hover { filter: brightness(1.1); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.bad { color: var(--bad); }
.btn.ghost { background: transparent; } .btn.sm { min-height: 36px; padding: 0 11px; font-size: .9rem; border-radius: 9px; } .btn.block { width: 100%; }
:focus-visible { outline: 3px solid #1D6FF2; outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); white-space: nowrap; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700; background: #EEF0F3; color: var(--ink2); }
.tag.bad { background: #FEE4E2; color: var(--bad); } .tag.warn { background: #FEF0C7; color: var(--warn); } .tag.ok { background: #D1FADF; color: var(--ok); }
.plate { display: inline-block; padding: 2px 9px; border: 2px solid var(--ink); border-radius: 6px; font: 700 1.05rem 'Barlow Condensed', sans-serif; letter-spacing: .08em; background: #fff; }

.fld { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; color: var(--ink2); }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #C9CED6; border-radius: 10px; background: #fff; font-weight: 400; color: var(--ink); }
textarea { resize: vertical; } input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--pri); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid2 > * { grid-column: 1 / -1; } .grid2 > .half { grid-column: auto; }
.search { position: relative; } .search .ic { position: absolute; left: 12px; top: 12px; color: var(--mut); } .search input { padding-left: 40px; }

table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FAFAFB; } td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.empty { padding: 28px 16px; text-align: center; color: var(--mut); }

/* Pantallas del personal */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 8px 14px; } .side .who { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: .9rem; color: #B8C0CC; }
.nav { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; border: 0; background: none; color: #C9D0DA; font-weight: 600; cursor: pointer; text-align: left; width: 100%; min-height: 44px; }
.nav:hover { background: rgba(255,255,255,.09); color: #fff; } .nav.on { background: var(--pri); color: var(--on); }
.nav .n { margin-left: auto; background: #fff; color: var(--ink); border-radius: 99px; font-size: .75rem; padding: 1px 7px; }
.main { padding: 22px 26px 60px; min-width: 0; } .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; } .head h1 { margin: 0; flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); } .kpi b { display: block; font: 700 1.9rem 'Barlow Condensed', sans-serif; } .kpi span { color: var(--mut); font-size: .88rem; }
.kpi.alert b { color: var(--bad); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #E9EBEF; border-radius: var(--r); padding: 10px; min-height: 140px; } .col h3 { display: flex; justify-content: space-between; font-size: 1rem; margin: 2px 4px 10px; color: var(--c); }
.job { background: #fff; border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; border-left: 4px solid var(--c); cursor: pointer; box-shadow: 0 1px 2px rgba(20,24,31,.08); display: grid; gap: 4px; width: 100%; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; }
.job:hover { box-shadow: var(--sh); } .job .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; } .tabs button { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; } .tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.list > * + * { border-top: 1px solid var(--line); } .li { display: flex; gap: 12px; align-items: center; padding: 11px 2px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; } .bars div { flex: 1; background: var(--pri); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; } .bars div:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .75rem; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 9px; font-size: .92rem; } .hbar i { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--pri); min-width: 3px; }

/* Hoja lateral */
.sheet { position: fixed; inset: 0; z-index: 50; } .sheet-bg { position: absolute; inset: 0; background: rgba(20,24,31,.5); }
.sheet-box { color: var(--ink); position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.2); animation: in .18s ease-out; }
.sheet.wide .sheet-box { width: min(860px, 100%); } .sheet.small .sheet-box { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); border-radius: 16px; width: min(420px, 92%); animation: none; }
.sheet-in { padding: 22px 22px 40px; } .sheet .x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: #EEF0F3; border-radius: 50%; cursor: pointer; z-index: 2; display: grid; place-items: center; }
@keyframes in { from { transform: translateX(40px); opacity: 0; } }
.sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); } .sec > h3 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .95rem; } .kv dt { color: var(--mut); } .kv dd { margin: 0; }
.tot { margin-left: auto; width: min(300px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-variant-numeric: tabular-nums; } .tot .big { font: 700 1.5rem 'Barlow Condensed', sans-serif; border-top: 2px solid var(--ink); padding-top: 6px; margin-top: 4px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; } .steps button { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; cursor: pointer; } .steps button.on { background: var(--c); border-color: var(--c); color: #fff; }
.qty { width: 74px; min-height: 38px; padding: 6px 8px; text-align: right; }
.note { background: #F6F7F9; border-radius: 10px; padding: 9px 12px; margin-bottom: 7px; font-size: .93rem; } .note b { font-size: .82rem; color: var(--mut); display: block; }
.banner { padding: 11px 14px; border-radius: 11px; font-weight: 600; margin-bottom: 12px; display: flex; gap: 9px; align-items: center; } .banner.warn { background: #FEF0C7; color: #7A2E0E; } .banner.ok { background: #D1FADF; color: #054F31; } .banner.bad { background: #FEE4E2; color: #7A271A; }

/* Buscador al escribir */
.sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 8; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(20,24,31,.22); overflow: hidden; min-width: min(450px, 88vw); }
.sug:empty { display: none; } .sug button { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; font-weight: 400; color: var(--ink); }
.sug button:last-child { border-bottom: 0; } .sug button:hover, .sug button.on { background: color-mix(in srgb, var(--pri) 10%, #fff); } .sug .plate { font-size: .9rem; }

/* Logo y tema de cada taller */
.tlogo { max-height: 46px; max-width: 180px; object-fit: contain; background: #fff; border-radius: 9px; padding: 4px 6px; display: block; }
.temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.tema { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; cursor: pointer; text-align: left; font-weight: 600; font-size: .9rem; display: grid; gap: 7px; min-height: 44px; }
.tema.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); } .tema i { display: block; height: 40px; border-radius: 8px; background: linear-gradient(90deg, var(--d) 0 62%, var(--p) 62% 100%); }
.logobox { display: grid; place-items: center; min-height: 96px; border: 1px dashed #C9CED6; border-radius: 12px; background: var(--side); padding: 14px; }

/* PIN */
.gate { position: fixed; inset: 0; z-index: 90; background: var(--side); color: #fff; display: grid; place-items: center; padding: 20px; }
.gate-box { width: min(330px, 100%); text-align: center; } .gate h1 { margin: 16px 0 2px; } .gate .muted { color: #9AA4B2; }
.dots { display: flex; gap: 14px; justify-content: center; margin: 18px 0 6px; } .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #5B6676; } .dots i.on { background: var(--pri); border-color: var(--pri); }
.gate-msg { min-height: 1.4em; color: #FDA29B; font-weight: 600; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 14px; } .pad button { height: 62px; border-radius: 14px; border: 0; background: rgba(255,255,255,.11); color: #fff; font: 700 1.5rem 'Barlow Condensed', sans-serif; cursor: pointer; } .pad button:active { background: var(--pri); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 99; max-width: 92vw; }
#toast.on { opacity: 1; transform: translate(-50%, 0); } #toast.bad { background: var(--bad); }
.pie { text-align: center; color: var(--mut); font-size: .86rem; padding: 26px 16px; }
#print { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .main { padding: 16px 14px 96px; } .two { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; z-index: 30; overflow-x: auto; gap: 2px; }
  .side .logo, .side .who { display: none; } .nav { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 9px; min-width: 62px; justify-content: center; text-align: center; } .nav .n { position: absolute; margin: -30px 0 0 26px; }
  .sheet-box { width: 100% !important; } h1 { font-size: 1.7rem; }
  .hide-m { display: none; }
}
@media print {
  body > *:not(#print) { display: none !important; } #print { display: block; color: #000; font-size: 12pt; } body { background: #fff; }
  #print h1 { font-size: 20pt; } #print table { margin: 10pt 0; } #print td, #print th { padding: 5pt 6pt; border-bottom: 1px solid #999; }
  #print .firma { margin-top: 44pt; display: flex; gap: 40pt; } #print .firma div { flex: 1; border-top: 1px solid #000; padding-top: 4pt; text-align: center; font-size: 10pt; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
