/* Mano Firme · Alquiler de herramientas — demo */
:root {
  --ink: #1d2025; --ink-2: #3d424a; --muted: #6b717b; --line: #e3e5e9; --bg: #f4f5f7; --surface: #fff;
  --brand: #23262b; --brand-2: #383c43; --accent: #f2b705; --accent-soft: #fdf3cf;
  --ok: #1f8a55; --ok-soft: #e2f4ea; --warn: #9a6a00; --warn-soft: #fcf0cf; --danger: #c0392b; --danger-soft: #fbe5e2;
  --info: #2f6fde; --info-soft: #e5eefc;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.05);
  --v-black: #08080a; --v-orange: #ff7028;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 14px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }

/* Barra de la demo (Varyon) */
.demobar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 18px; background: var(--v-black); color: #fff; font-size: 13px; }
.demobar .tag { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.demobar .tag b { color: var(--v-orange); }
.demobar .tag span { color: #b9b9c0; font-weight: 500; }
.demobar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--v-orange); }
.demobar .spacer { flex: 1; }
.demobar .dbtn { border: 1px solid #34343a; background: transparent; color: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.demobar .dbtn:hover { border-color: var(--v-orange); color: var(--v-orange); }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 44px); }
.side { background: var(--brand); color: #d7d9de; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.logo i { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--brand); font-style: normal; }
.logo i svg { width: 20px; height: 20px; }
.logo b { font-size: 16px; display: block; }
.logo small { font-size: 11px; color: #9a9ea6; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font-weight: 500; }
.nav svg { width: 18px; height: 18px; opacity: .8; }
.nav:hover { background: var(--brand-2); color: #fff; }
.nav[aria-current="page"] { background: var(--accent); color: var(--brand); font-weight: 700; }
.nav .count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side .foot { margin-top: auto; font-size: 12px; color: #8b8f97; padding: 8px 12px; }
main { padding: 28px 32px 60px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font-size: 26px; letter-spacing: -.02em; }
.head p { color: var(--muted); margin-top: 4px; }

/* Base */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--brand); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 15px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g2 { grid-template-columns: 1.4fr 1fr; }
.hint { font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-mute { background: #eceef1; color: var(--ink-2); }
.b-bronce { background: #f6e7da; color: #8a4b1c; } .b-plata { background: #e9ecf0; color: #4a5462; } .b-oro { background: var(--accent-soft); color: #7a5a00; }

/* KPIs */
.kpi { padding: 16px 18px; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font-size: 28px; letter-spacing: -.02em; margin-top: 6px; }
.kpi small { color: var(--muted); }
.kpi.alert b { color: var(--danger); }

/* Barras */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: #d9dce1; }
.bars div.now i { background: var(--accent); }
.bars small { font-size: 11px; color: var(--muted); }

/* Listas y tablas */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row b { display: block; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafbfc; }
.tablewrap { overflow-x: auto; padding: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Filtros */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.search { flex: 1; min-width: 200px; max-width: 320px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }

/* Equipos */
.equipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.eq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.eq.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.eq .tile { height: 86px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.eq .tile svg { width: 38px; height: 38px; }
.eq .code { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.eq b { font-size: 14px; }
.eq .foot { display: flex; justify-content: space-between; align-items: center; }
.eq .price { font-weight: 700; }
.eq button.pick { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius); }
.eq.off { opacity: .5; }

/* Formulario */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field select, .field input { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum .line { display: flex; justify-content: space-between; padding: 6px 0; }
.sum .line.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 800; }
.limit { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--accent-soft); border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.limit.full { background: var(--danger-soft); color: var(--danger); }
.sticky { position: sticky; top: 64px; }

/* Modal y toast */
#modal:empty { display: none; }
.overlay { position: fixed; inset: 0; background: rgba(15,17,20,.5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.dialog { background: var(--surface); border-radius: 18px; width: min(620px, 100%); max-height: 90vh; overflow: auto; padding: 22px; }
.dialog h2 { font-size: 20px; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.dev { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-top: 10px; }
.dev .top { display: flex; align-items: center; gap: 10px; }
.dev .dmg { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.dev .dmg input[type=number] { width: 140px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; transition: .25s; pointer-events: none; z-index: 200; font-weight: 600; }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* Celular */
.mtabs { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 18px 16px 96px; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .head h1 { font-size: 22px; }
  .demobar .hide-sm { display: none; }
  .mtabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 40; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mtabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 6px 0; cursor: pointer; position: relative; }
  .mtabs button svg { width: 21px; height: 21px; }
  .mtabs button[aria-current="page"] { color: var(--brand); }
  .mtabs button[aria-current="page"] svg { color: #b58900; }
  .mtabs .count { position: absolute; top: 2px; right: 22%; background: var(--danger); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 99px; }
  .equipos { grid-template-columns: 1fr 1fr; gap: 10px; }
  .eq .tile { height: 64px; }
  .sticky { position: static; }
  .hide-m { display: none; }
}
.eq .code, .eq b, .eq .hint { display: block; }
.eq .foot { flex-wrap: wrap; gap: 6px; }
@media (max-width: 860px) { #toast { bottom: 84px; width: max-content; max-width: 90vw; } }
.eq .tile { overflow: hidden; height: 120px; }
.eq .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eq.off .tile img { filter: grayscale(.6); }
@media (max-width: 860px) { .eq .tile { height: 92px; } }
