/* ElectroMetrics Pro 2026 - familia Metalmetrics C.A. */
:root {
  --bg: #10151d;
  --bg2: #161d29;
  --card: #1c2534;
  --card2: #232f42;
  --line: #2c3a52;
  --txt: #e9eef6;
  --txt2: #9fb0c7;
  --txt3: #6c7e99;
  --accent: #d4a017;
  --ok: #3fa36c;
  --warn: #c9822e;
  --bad: #c05252;
  --l1: #b3541e;
  --l2: #1565c0;
  --l3: #2e7d32;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }

/* Splash */
#splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 20%, #1d2839 0%, var(--bg) 60%);
  transition: opacity .45s ease;
}
#splash img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 8px 28px rgba(0,0,0,.6)); }
#splash .splash-name { margin-top: 18px; font-size: 26px; font-weight: 800; letter-spacing: .5px; }
#splash .splash-name span { color: var(--accent); }
#splash .splash-sub { color: var(--txt2); margin-top: 4px; font-size: 14px; }
#splash.out { opacity: 0; pointer-events: none; }

/* Shell */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #182031 0%, #141b29 100%);
  border-bottom: 1px solid var(--line);
}
.topbar img { width: 34px; height: 34px; object-fit: contain; }
.topbar .t-name { font-weight: 800; font-size: 16px; letter-spacing: .3px; }
.topbar .t-name small { display: block; font-weight: 500; font-size: 11px; color: var(--txt2); }
.topbar .back {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 7px 12px; font-size: 14px; color: var(--txt);
}
.screen { max-width: 1060px; margin: 0 auto; padding: 14px 14px 90px; }

/* Home */
.hero {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(120deg, #1d2a40 0%, #16202f 70%);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  margin-bottom: 14px;
}
.hero img { width: 74px; height: 74px; object-fit: contain; }
.hero h1 { font-size: 19px; font-weight: 800; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--txt2); font-size: 12.5px; margin-top: 2px; }

.ficha {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; margin-bottom: 16px;
}
.ficha h2 { font-size: 13px; color: var(--txt2); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.ficha .f-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.ficha input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--txt); padding: 9px 10px; font-size: 14px;
}
.ficha .f-note { margin-top: 8px; font-size: 11.5px; color: var(--txt3); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--card); text-align: left; padding: 0;
  transition: transform .12s ease, border-color .12s ease;
}
.tile:active { transform: scale(.985); }
.tile .t-band, .tile .img-wrap, .tile .t-body, .tile .t-title, .tile .t-tag { display: block; }
.tile .img-wrap { position: relative; height: 108px; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .img-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(16,21,29,.92) 100%);
}
.tile .t-band { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.tile .t-body { padding: 10px 12px 12px; }
.tile .t-title { font-weight: 700; font-size: 14.5px; }
.tile .t-tag { color: var(--txt2); font-size: 11.5px; margin-top: 2px; min-height: 32px; }
.pill {
  display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .4px;
}
.pill.prueba { background: rgba(63,163,108,.16); color: #6fcf97; border: 1px solid rgba(63,163,108,.4); }
.pill.pendiente { background: rgba(201,130,46,.14); color: #e0a458; border: 1px solid rgba(201,130,46,.4); }
.pill.parcial { background: rgba(224,168,88,.12); color: #d8b878; border: 1px dashed rgba(224,168,88,.55); }
.pill.traslado { background: rgba(21,101,192,.14); color: #6fa8e8; border: 1px solid rgba(21,101,192,.4); }

.home-foot { margin-top: 18px; text-align: center; color: var(--txt3); font-size: 11.5px; }
.home-foot img { width: 120px; opacity: .9; display: block; margin: 10px auto 4px; }
.home-foot .disc { max-width: 560px; margin: 8px auto 0; }

/* Module screen */
.mod-head {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px;
  position: relative;
}
.mod-head img { width: 100%; height: 130px; object-fit: cover; display: block; }
.mod-head .mh-band { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.mod-head .mh-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px;
  background: linear-gradient(180deg, transparent, rgba(16,21,29,.95) 55%);
}
.mod-head h2 { font-size: 19px; font-weight: 800; }
.mod-head p { color: var(--txt2); font-size: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 14px;
}
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt2); margin-bottom: 10px; }
.note { color: var(--txt2); font-size: 12.5px; margin: 6px 0; }
.note.small { font-size: 11.5px; color: var(--txt3); }

.callout {
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 10px 0;
  background: rgba(201,130,46,.12); border: 1px solid rgba(201,130,46,.45); color: #ecd2ae;
}
.callout b { color: #f0bd7d; }

/* Form controls */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.chip {
  border: 1px solid var(--line); background: var(--bg2); border-radius: 999px;
  padding: 7px 14px; font-size: 13.5px; color: var(--txt2);
}
.chip.on { background: var(--card2); color: var(--txt); border-color: var(--accent); font-weight: 700; }
.chip:disabled { opacity: .38; cursor: not-allowed; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--txt2); margin-bottom: 4px; }
.field input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--txt); padding: 10px 12px; font-size: 15px;
}
.f2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }

.btn {
  display: inline-block; border-radius: 12px; padding: 11px 18px; font-size: 14.5px; font-weight: 700;
  border: 1px solid var(--line); background: var(--card2); color: var(--txt);
}
.btn.primary { background: linear-gradient(120deg, #2b6cb0, #1d4e89); border-color: #3b82c4; }
.btn.gold { background: linear-gradient(120deg, #8a6a1c, #6d5313); border-color: #b08a2e; }
.btn.danger { background: rgba(192,82,82,.16); border-color: rgba(192,82,82,.5); color: #e89a9a; }
.btn:disabled { opacity: .45; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Tablero: el tablero visual */
.board-wrap {
  background: linear-gradient(160deg, #232d3f 0%, #171f2d 100%);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 12px 16px;
  margin-bottom: 14px;
}
.board-title { text-align: center; font-size: 12px; color: var(--txt2); margin-bottom: 10px; letter-spacing: .5px; }
.main-brk {
  width: 120px; margin: 0 auto 12px; border-radius: 10px;
  background: linear-gradient(180deg, #2e3a4f, #202a3b);
  border: 2px solid #3c4c68; padding: 8px 6px; text-align: center;
}
.main-brk .mb-sw { width: 16px; height: 26px; margin: 0 auto 5px; border-radius: 4px; background: #10151d; border: 1px solid #4a5c7c; position: relative; }
.main-brk .mb-sw::after { content: ""; position: absolute; left: 3px; right: 3px; top: 4px; height: 8px; border-radius: 2px; background: #5a6f93; }
.main-brk span { font-size: 10px; color: var(--txt2); letter-spacing: .6px; text-transform: uppercase; }
.main-brk.lugs { background: linear-gradient(180deg, #3a3f2e, #2b2f20); border-style: dashed; }
.board-cap { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -2px 0 10px; font-size: 11px; color: var(--txt2); }
.board-cap span { padding: 3px 9px; background: #16202f; border: 1px solid #2b3a52; border-radius: 8px; }
.barras { margin-top: 12px; display: grid; gap: 6px; }
.barra { border-radius: 8px; padding: 7px 10px; text-align: center; border: 1px solid #3c4c68; }
.barra span { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--txt2); }
.barra-n { background: #1c2a45; }
.barra-t { background: #1e3328; border-color: #2f5a44; }
.board-cols { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.brk {
  position: relative; border-radius: 9px; border: 1.5px solid #3a4a66;
  background: linear-gradient(180deg, #28344a, #1d2637);
  min-height: 52px; padding: 6px 8px 6px 14px; text-align: left; width: 100%;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.brk .pos {
  position: absolute; left: 4px; top: 4px; font-size: 9px; color: var(--txt3); font-weight: 700;
}
.brk .ph {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 9px 0 0 9px;
}
.brk.empty { border-style: dashed; background: rgba(28,37,52,.5); color: var(--txt3); align-items: center; }
.brk.empty .plus { font-size: 18px; font-weight: 300; }
.brk .b-name { font-size: 11.5px; font-weight: 700; line-height: 1.15; word-break: break-word; }
.brk .b-sub { font-size: 9.5px; color: var(--txt2); }
.brk .b-I { font-size: 11px; color: var(--accent); font-weight: 700; }
.brk.multi { justify-content: center; }
.brk .sw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 9px; height: 20px; border-radius: 3px; background: #10151d; border: 1px solid #4a5c7c; }
.brk .sw::after { content: ""; position: absolute; left: 1.5px; right: 1.5px; top: 3px; height: 6px; border-radius: 2px; background: #5a6f93; }
.phase-chips { display: flex; gap: 3px; margin-top: 2px; }
.phase-chips i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.legend { display: flex; justify-content: center; gap: 14px; margin-top: 12px; font-size: 11px; color: var(--txt2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* Resultados */
.res-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.res-row:last-child { border-bottom: 0; }
.res-row .k { color: var(--txt2); min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.res-row .k small { display: block; font-size: 10.5px; color: var(--txt3); }
.res-row .v { font-weight: 800; text-align: right; min-width: 74px; flex: 0 1 auto; max-width: 62%; overflow-wrap: break-word; }
@media (max-width: 480px) {
  .res-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .res-row .v { text-align: left; max-width: 100%; }
}
.res-row .v.ph1 { color: #e08a54; } .res-row .v.ph2 { color: #6fa8e8; } .res-row .v.ph3 { color: #6fcf97; }
.res-row .v.warn { color: #e0a458; }
.ph-bar { height: 6px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin: 4px 0 8px; }
.ph-bar i { display: block; height: 100%; }

/* Sheet (panel inferior) */
.sheet-back {
  position: fixed; inset: 0; background: rgba(8,11,17,.66); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 16px 16px 26px;
}
.sheet h3 { font-size: 16px; margin-bottom: 4px; }
.sheet .s-sub { color: var(--txt2); font-size: 12px; margin-bottom: 12px; }
@media (min-width: 700px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 20px; border-bottom: 1px solid var(--line); }
}

/* Unifilar */
.uni-scroll { overflow-x: auto; border-radius: 12px; background: #f7f8fa; padding: 8px; }
.uni-scroll svg { display: block; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; font-size: 13.5px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line); color: var(--txt2);
}
.tab.on { color: var(--txt); border-color: var(--accent); background: var(--card2); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 13.5px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
