/* ==========================================================================
   Panel Computex — hoja de estilos unica.
   Sin compilador de recursos: el hosting no tiene Node y un panel interno no
   justifica arrastrar uno.
   ========================================================================== */

:root {
  --ground: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #15181f;
  --ink-2: #39404e;
  --muted: #69707f;
  --line: #dee1e9;
  --line-soft: #eaecf2;

  --wp: #2f5fa8;
  --wp-soft: #e8eef8;
  --doli: #9a5b22;
  --doli-soft: #f7eee3;
  --pair: #1b7565;
  --pair-soft: #e4f1ee;
  --warn: #a8341f;
  --warn-soft: #f9eae6;
  --ok: #1b7565;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(21, 24, 31, .05), 0 8px 24px -14px rgba(21, 24, 31, .22);

  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Zilla Slab", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1116;
    --surface: #161a21;
    --surface-2: #1d222b;
    --ink: #edeff4;
    --ink-2: #c3c9d4;
    --muted: #8e96a6;
    --line: #2a303b;
    --line-soft: #222831;
    --wp: #7fa9e4;
    --wp-soft: #1b2432;
    --doli: #d69b5f;
    --doli-soft: #2a2118;
    --pair: #5fc3ae;
    --pair-soft: #152724;
    --warn: #e8836c;
    --warn-soft: #2c1c18;
    --ok: #5fc3ae;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--wp); }

/* ---------- encabezado ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand span { color: var(--pair); }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav a {
  padding: 6px 12px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--pair-soft); color: var(--pair); }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--pair-soft); color: var(--pair);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; font-family: var(--f-mono);
}

/* ---------- estructura ---------- */
.wrap { padding: 18px 20px 40px; }
.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
h1.page {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 600;
  margin: 0; letter-spacing: -.01em;
}
.page-head .sub { color: var(--muted); font-size: 13.5px; }

/* ---------- avisos ---------- */
.alert {
  border-left: 3px solid var(--pair);
  background: var(--pair-soft);
  padding: 11px 15px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.alert.warn { border-color: var(--warn); background: var(--warn-soft); }
.alert strong { color: var(--pair); }
.alert.warn strong { color: var(--warn); }

/* ---------- tres columnas ---------- */
.board {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.7fr) minmax(240px, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) { .board { grid-template-columns: 1fr; } }

.col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 130px);
}
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
}
.col-head .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.col-head .t { font-weight: 600; font-size: 13.5px; }
.col-head .c { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.col.wp .col-head { background: var(--wp-soft); }
.col.wp .dot { background: var(--wp); }
.col.doli .col-head { background: var(--doli-soft); }
.col.doli .dot { background: var(--doli); }
.col.pair .col-head { background: var(--pair-soft); }
.col.pair .dot { background: var(--pair); }

.col-tools { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.col-body { overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.col-foot { padding: 9px 12px; border-top: 1px solid var(--line-soft); background: var(--surface-2); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- formularios ---------- */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--pair);
  outline-offset: 1px;
}
label.field { display: block; margin-bottom: 12px; }
label.field .lbl { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 4px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err { font-size: 12.5px; color: var(--warn); margin-top: 4px; }

.row-inline { display: flex; gap: 8px; align-items: center; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.chip.on { background: var(--pair-soft); border-color: var(--pair); color: var(--pair); font-weight: 500; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 5px;
  border: 1px solid var(--pair);
  background: var(--pair);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: transparent; color: var(--warn); border-color: var(--warn); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- items de producto ---------- */
.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  display: block;
}
.item:hover { border-color: var(--muted); }
.item .nm { font-size: 12.5px; line-height: 1.35; font-weight: 500; color: var(--ink); }
.item .sub {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--muted);
  margin-top: 4px; display: flex; gap: 9px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.col.wp .item.sel { border-color: var(--wp); box-shadow: 0 0 0 2px var(--wp-soft); }
.col.doli .item.sel { border-color: var(--doli); box-shadow: 0 0 0 2px var(--doli-soft); }
.item.dim { opacity: .55; }

.tag-s { padding: 1px 6px; border-radius: 3px; font-size: 10px; font-family: var(--f-mono); }
.tag-s.ok { background: var(--pair-soft); color: var(--pair); }
.tag-s.no { background: var(--warn-soft); color: var(--warn); }
.tag-s.n { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-soft); }

/* ---------- comparador ---------- */
.cmp { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.cmp-head {
  padding: 10px 13px; border-bottom: 1px solid var(--line-soft);
  background: var(--pair-soft); display: flex; align-items: center; gap: 9px;
}
.cmp-head .n { font-weight: 600; font-size: 13.5px; color: var(--pair); }
.cmp-head .score { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--pair); }

.cmp-grid { display: grid; grid-template-columns: 82px 1fr 1fr; }
.cmp-grid > * { border-bottom: 1px solid var(--line-soft); }
.cmp-h {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 11px; background: var(--surface-2);
}
.cmp-h.w { color: var(--wp); }
.cmp-h.d { color: var(--doli); }
.cmp-f {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--muted);
  padding: 9px 11px; display: flex; align-items: center;
}
.cmp-v {
  padding: 8px 11px; font-size: 12.5px; line-height: 1.4;
  border-left: 1px solid var(--line-soft);
  display: flex; gap: 8px; align-items: flex-start;
  cursor: pointer; background: none; text-align: left; width: 100%;
  font-family: inherit; color: var(--ink);
}
.cmp-v:hover:not(.locked) { background: var(--surface-2); }
.cmp-v .rd {
  width: 13px; height: 13px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 1.5px solid var(--line); background: var(--surface);
}
.cmp-v.win { background: var(--pair-soft); }
.cmp-v.win .rd { border-color: var(--pair); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--pair); }
.cmp-v.win .tx { font-weight: 600; }
.cmp-v.locked { background: var(--doli-soft); cursor: not-allowed; }
.cmp-v.locked .rd { border-color: var(--doli); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--doli); }
.cmp-v.empty { opacity: .45; cursor: not-allowed; }
.cmp-v small { display: block; color: var(--muted); font-family: var(--f-mono); font-size: 10px; margin-top: 3px; }
.cmp-v .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.diff { color: var(--warn); font-weight: 600; }

.cmp-actions { display: flex; gap: 8px; padding: 11px 13px; background: var(--surface-2); align-items: center; }
.cmp-actions .hint { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); }

.empty-state { text-align: center; padding: 34px 20px; color: var(--muted); font-size: 13px; }
.empty-state b { display: block; color: var(--ink-2); margin-bottom: 5px; font-size: 14px; }

/* ---------- acceso ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.auth-card .brand { font-size: 21px; display: block; margin-bottom: 5px; }
.auth-card .tagline { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-foot { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--muted); }

/* ---------- tablas ---------- */
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.data thead th {
  background: var(--surface-2); font-family: var(--f-mono);
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
table.data td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- utilidades ---------- */
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.scroll-x { overflow-x: auto; }

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