:root {
  --bg: #f4f6fa; --surface: #fff; --text: #1a1f2b; --muted: #667085; --line: #e3e8ef;
  --brand: #0b5cab; --brand-ink: #fff; --ok: #0f7b4d; --ok-bg: #e6f6ee; --warn: #9a5b00; --warn-bg: #fff4e0;
  --bad: #b42318; --bad-bg: #fdecea;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f141c; --surface: #171e29; --text: #e6eaf0; --muted: #98a2b3; --line: #2a3442;
    --brand: #4c9be8; --brand-ink: #0b1220; --ok: #5fd39a; --ok-bg: #12301f; --warn: #f2b65a; --warn-bg: #33260f;
    --bad: #f28b82; --bad-bg: #3a1714; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: 0 0 16px; } h2 { font-size: 1.05rem; margin: 0 0 12px; }
.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); } .brand span, h1 span { color: var(--brand); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; flex: 1; } .top nav a { text-decoration: none; color: var(--text); }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; }
.kpi span { color: var(--muted); font-size: .85rem; } .kpi b { font-size: 1.7rem; font-variant-numeric: tabular-nums; } .kpi small { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid-quote { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-quote { grid-template-columns: 1fr; } }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; } .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; font-size: 1.05rem; } tr.sep td { border-top: 2px solid var(--line); }
.rows { list-style: none; margin: 0; padding: 0; } .rows li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.rows li:last-child { border-bottom: 0; } .right { margin-left: auto; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: .8rem; } .pre { white-space: pre-line; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
label.check { flex-direction: row; align-items: center; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-width: 0; }
input.qty { width: 72px; text-align: right; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; } .filters input { flex: 1; min-width: 180px; }
.btn { display: inline-block; font: inherit; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.small { padding: 4px 10px; font-size: .85rem; } .btn.wide { display: block; width: 100%; text-align: center; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-style: normal; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.por_aprobar { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.aprobada, .tag.enviada { background: var(--bg); color: var(--brand); }
.tag.ganada { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.perdida { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.src { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); min-width: 46px; display: inline-block; }
.src.zoho { color: var(--warn); } .src.trello { color: var(--brand); } .src.portal { color: var(--ok); }
.alert { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 8px; }
.ok { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: 8px; }
.hits { list-style: none; padding: 0; margin: -6px 0 10px; border: 1px solid var(--line); border-radius: 7px; }
.hits li { padding: 6px 10px; border-bottom: 1px solid var(--line); } .hits li:last-child { border-bottom: 0; }
.login { max-width: 420px; margin: 8vh auto; } .dev { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
code { font-size: .75rem; word-break: break-all; }
