/* Inventario Activos EASO — estilos del dashboard y de campo.html */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #1a2230; --muted: #5d6b7e; --line: #e2e7ee;
  --brand: #0b3d6b; --brand-2: #1363a8; --ok: #1e9e5a; --warn: #d9870f; --bad: #d23c3c; --info: #4a6fa5;
  --rail: #0e2a47; --rail-ink: #cfe0f3; --radius: 10px; --shadow: 0 1px 3px rgba(16, 30, 50, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 7px 12px; }
button.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input[type=email], select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; width: 100%; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
h1, h2, h3 { margin: 0 0 8px; }
h2 { font-size: 20px; } h3 { font-size: 15px; color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
.grid.dos { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.tres { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.panel .tabla { overflow-x: auto; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi .panel { min-width: 0; overflow: hidden; }
.kpi .panel b { font-size: 26px; display: block; } .kpi .panel span { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eef2f7; color: var(--ink); }
.pill.ok { background: #e3f6ea; color: var(--ok); } .pill.warn { background: #fdf1dc; color: var(--warn); } .pill.bad { background: #fde5e5; color: var(--bad); } .pill.info { background: #e7eef8; color: var(--info); }
.pill.on { background: #dbeafe; color: var(--brand-2); } .pill.off { background: #f1f3f6; color: #9aa6b5; text-decoration: line-through; }
.progress { height: 14px; background: #e6ebf2; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #4cc98a); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfd; position: sticky; top: 0; }
tr.click { cursor: pointer; } tr.click:hover { background: #f3f7fc; }
td.num, th.num { text-align: right; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1a2230; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.toast.err { background: var(--bad); }
.banner { padding: 10px 14px; border-radius: 8px; background: #fde5e5; color: var(--bad); border: 1px solid #f5bcbc; margin-bottom: 12px; }
.banner.warn { background: #fdf1dc; color: #7a4d00; border-color: #f2d59b; }
/* layout */
#app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
#rail { background: var(--rail); color: var(--rail-ink); padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
#rail .logo { color: #fff; font-weight: 700; font-size: 15px; padding: 6px 8px 14px; letter-spacing: .2px; }
#rail .logo small { display: block; font-weight: 400; color: #8fb0d6; font-size: 11px; }
#rail nav button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--rail-ink); padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; }
#rail nav button.on { background: rgba(255,255,255,.14); color: #fff; }
#rail .foot { position: absolute; bottom: 14px; left: 12px; right: 12px; font-size: 12px; color: #8fb0d6; }
#main { padding: 18px 22px 60px; max-width: 1400px; min-width: 0; }
#topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
section.view { display: none; } section.view.on { display: block; }
.drawer { position: fixed; top: 0; right: 0; width: min(640px, 100vw); height: 100vh; background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.18); z-index: 40; overflow: auto; padding: 18px 20px; }
.drawer .close { position: absolute; top: 12px; right: 14px; }
.backdrop { position: fixed; inset: 0; background: rgba(10,20,35,.35); z-index: 39; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
td.chips { display: table-cell; } td.chips .pill { padding: 1px 6px; font-size: 11px; }
.mono { overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); }
.dropzone.ok { border-color: var(--ok); color: var(--ok); }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
#login { position: fixed; inset: 0; background: var(--rail); display: flex; align-items: center; justify-content: center; z-index: 100; }
#login .box { background: #fff; border-radius: 14px; padding: 28px 28px 22px; width: min(380px, 92vw); }
@media (max-width: 820px) {
  #app { grid-template-columns: 1fr; }
  #rail { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; padding: 6px 6px 8px; display: flex; gap: 2px; overflow-x: auto; z-index: 30; }
  #rail .logo, #rail .foot { display: none; }
  #rail nav { display: flex; gap: 2px; width: 100%; }
  #rail nav button { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  #main { padding: 14px 14px 80px; }
  .drawer { width: 100vw; }
}
/* campo.html */
html.campo, body.campo { background: #0e2a47; min-height: 100%; }
.campo-wrap { max-width: 520px; margin: 0 auto; padding: 16px; color: #fff; }
.campo-wrap .card { background: #fff; color: var(--ink); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.campo-wrap input.big { font-size: 22px; padding: 14px; text-transform: uppercase; }
.campo-wrap button.big { width: 100%; padding: 16px; font-size: 18px; border-radius: 12px; }
.resultado { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.resultado:hover { background: #f3f7fc; }
.ok-big { background: var(--ok); color: #fff; border-radius: 14px; padding: 18px; text-align: center; font-size: 20px; }
/* lector de código de barras / QR (campo.html) */
.scan { position: fixed; inset: 0; background: #000; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-marco { position: absolute; left: 50%; top: 42%; width: min(78vw, 360px); height: min(40vw, 200px); transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.scan-msg { position: relative; color: #fff; text-align: center; margin: 0 16px 12px; font-size: 16px; text-shadow: 0 1px 3px #000; }
.scan button { position: relative; margin: 0 16px 24px; width: calc(100% - 32px); max-width: 480px; }
