:root {
  --bg: #0a0a0a;
  --panel: #131313;
  --panel-2: #1a1a1a;
  --line: #2a2a2a;
  --line-2: #3a3a3a;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --dim: #6f6f6f;
  --accent: #c4f23e;
  --accent-ink: #0a0a0a;
  --danger: #ff6b5e;
  --warn: #ffb547;
  --ok: #7fe0a0;
  --info: #7cc4ff;
  --radius: 12px;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.2px; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 800; }
h3 { font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.boot { padding: 40px; color: var(--muted); }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 800; letter-spacing: 1.5px; font-size: 13px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 17px; }
.brand small { display: block; color: var(--muted); letter-spacing: 1px; font-weight: 600; font-size: 10px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--panel-2); color: var(--accent); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.main { padding: 26px 30px 60px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* Componentes */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
a.btn { color: var(--text); text-decoration: none; }
a.btn.primary { color: var(--accent-ink); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }
.mt2 { margin-top: 24px; }

.kpi .label { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kpi.accent { border-color: var(--accent); }
.kpi.accent .value { color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); background: var(--panel-2); border-radius: 10px; padding: 8px 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #5a2a26; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  background: #0d0d0d; border: 1.5px solid var(--line-2); border-radius: 9px; padding: 8px 10px; width: 100%; color: var(--text); font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
input.num { text-align: right; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.b-nuevo { color: var(--info); border-color: #24435e; }
.b-contactado { color: #b8a6ff; border-color: #3d3466; }
.b-enviado, .b-enviada { color: var(--warn); border-color: #5e4421; }
.b-negociando { color: #ffd166; border-color: #5e5221; }
.b-aceptado, .b-aceptada { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.b-perdido, .b-rechazada { color: var(--danger); border-color: #5a2a26; }
.b-borrador { color: var(--muted); }
.b-red { color: #fff; background: var(--danger); border-color: var(--danger); }
.b-est { color: var(--warn); border-color: #5e4421; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line-2); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip .n { color: var(--dim); margin-left: 4px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.red { color: var(--danger); }
.green { color: var(--ok); }
.amber { color: var(--warn); }
.accent { color: var(--accent); }
.strong { font-weight: 800; }

/* Cotizador */
.quote-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.sticky { position: sticky; top: 20px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 76px 64px auto; gap: 8px; align-items: center; }
.line-head { margin-bottom: 4px; }
.line + .line { margin-top: 8px; }
.line .meta { grid-column: 1 / -1; font-size: 11.5px; color: var(--dim); margin-top: -2px; }
.seg { display: inline-flex; border: 1.5px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 8px 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.price-big { font-size: 40px; font-weight: 800; line-height: 1; color: var(--accent); }
.price-big small { font-size: 15px; color: var(--muted); font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.kv > .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .sep { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 4px 0; }
.warn { background: #2a1f0d; border: 1px solid #5e4421; color: #ffd59a; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.danger-box { background: #2a1210; border: 1px solid #5a2a26; color: #ffb4ab; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.textbox { background: #0d0d0d; border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 12px; font-size: 13px; white-space: pre-wrap; }
.bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* Lead */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; }
.tl .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); margin-top: 5px; }
.tl.propuesta .dot { background: var(--accent); }
.tl.estado .dot { background: var(--info); }
.tl.llamada .dot, .tl.whatsapp .dot, .tl.email .dot, .tl.reunion .dot { background: var(--warn); }
.tl .when { font-size: 11px; color: var(--dim); }
.qcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel-2); }
.qcard + .qcard { margin-top: 10px; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth h1 { margin: 14px 0 4px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; padding: 22px; }
.modal.wide { max-width: 860px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #fff; }

.empty { color: var(--muted); padding: 22px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 12px; }

@media (max-width: 980px) {
  .quote-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--bg); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand small, .side-foot { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .main { padding: 18px 16px 50px; }
  .g2, .g4 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .hide-m { display: none; }
}

@media (max-width: 760px) { .line { grid-template-columns: minmax(0, 1fr) 60px 52px auto; } }
.chkline{display:flex;gap:8px;align-items:flex-start;cursor:pointer;line-height:1.45}
.chkline input[type=checkbox]{width:auto;margin-top:3px;accent-color:#C4F23E;flex:0 0 auto}
.line .chkline{grid-column:1 / -1}
