/* Cumbrera · Viajes y Turismo — demo */
:root {
  --ink: #17211f;
  --ink-2: #3b4744;
  --muted: #6b7570;
  --line: #e4dfd6;
  --bg: #f5f2ec;
  --surface: #ffffff;
  --brand: #1e5b5a;       /* lago */
  --brand-2: #2b7a78;
  --brand-soft: #e3efed;
  --accent: #e8833a;      /* atardecer serrano */
  --accent-soft: #fbeadc;
  --ok: #2e7d4f;
  --ok-soft: #e3f2e8;
  --warn: #9a6512;
  --warn-soft: #fbf0d9;
  --danger: #b4372b;
  --danger-soft: #f8e3e0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 33, 31, .06), 0 6px 20px rgba(23, 33, 31, .06);
  /* barra de la demo, con la paleta de Varyon */
  --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, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--brand); }

/* ---------- Barra de la demo (Varyon) ---------- */
.demobar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; 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); font-weight: 700; letter-spacing: .02em; }
.demobar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--v-orange); }
.demobar .spacer { flex: 1; }
.roleswitch { display: inline-flex; background: #1c1c20; border-radius: 999px; padding: 3px; }
.roleswitch button {
  border: 0; background: transparent; color: #c9c9cf; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600;
}
.roleswitch button[aria-pressed="true"] { background: #fff; color: var(--v-black); }
.demobar .clock { color: #c9c9cf; font-variant-numeric: tabular-nums; }
.demobar .dbtn {
  border: 1px solid #34343a; background: transparent; color: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.demobar .dbtn:hover { border-color: var(--v-orange); color: var(--v-orange); }
.demobar a.dbtn { text-decoration: none; }

/* ---------- Elementos base ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; white-space: nowrap;
}
.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: #fff; }
.btn.danger { color: var(--danger); border-color: #ecc4bf; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.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: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field.invalid input { border-color: var(--danger); }
.row { display: grid; gap: 8px; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: 1fr 1fr 1fr; }
.hint { font-size: 12px; color: var(--muted); }
.hint.warn { color: var(--warn); }
.seg { display: inline-flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.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-mute { background: #eeebe5; color: var(--muted); }
.b-brand { background: var(--brand-soft); color: var(--brand); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.alert.warn { background: var(--warn-soft); color: #6f4a0d; }
.alert.ok { background: var(--ok-soft); color: #1f5a38; }
.alert.danger { background: var(--danger-soft); color: #7d241c; }
.alert.info { background: var(--brand-soft); color: #164443; }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.kv.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* ---------- Vista vendedor: teléfono ---------- */
.vendor-stage { display: flex; gap: 32px; justify-content: center; align-items: flex-start; padding: 28px 16px 60px; }
.phone {
  width: 390px; max-width: 100%; height: 800px; background: var(--bg); border-radius: 38px;
  border: 10px solid #1b1b1f; box-shadow: 0 30px 60px rgba(0,0,0,.18); overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.phone-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.phone-top h2 { font-size: 19px; }
.phone-top .who { font-size: 12px; color: var(--muted); text-align: right; }
.phone-body { flex: 1; overflow-y: auto; padding: 14px; }
.tabbar { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar button { border: 0; background: transparent; padding: 10px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button[aria-current="true"] { color: var(--brand); }
.tabbar .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; margin-left: 2px; }

.line-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .t { font-weight: 600; }
.line-item .s { font-size: 12px; color: var(--muted); }
.x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; }

.resv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; margin-bottom: 10px; }
.resv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.resv-head .code { font-weight: 700; font-size: 13px; color: var(--muted); }
.resv .name { font-weight: 700; }
.resv .prod { font-size: 13px; color: var(--ink-2); }
.resv .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; }
.resv .nums b { display: block; font-size: 14px; }
.pay-inline { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

.voucher { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.voucher-head { background: var(--brand); color: #fff; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.voucher-head .code { font-size: 22px; font-weight: 800; letter-spacing: .03em; }
.voucher-body { padding: 16px; }
.voucher-cut { border-top: 2px dashed var(--line); margin: 0 12px; }

.side-notes { width: 330px; position: sticky; top: 76px; }
.side-notes h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.side-notes ol { margin: 0; padding-left: 18px; }
.side-notes li { margin-bottom: 8px; }
.side-notes .rule { font-size: 12px; color: var(--muted); }

/* ---------- Vista coordinación ---------- */
.coord { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 50px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand .bn { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.brand .bs { font-size: 11px; color: var(--muted); }
.nav button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; color: var(--ink-2); }
.nav button:hover { background: var(--bg); }
.nav button[aria-current="true"] { background: var(--brand-soft); color: var(--brand); }
.nav .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.sidebar .me { margin-top: 18px; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.main { padding: 26px 30px 60px; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.attn { border-color: #f0c9a6; background: #fffaf5; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #faf8f4; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters input { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; min-width: 240px; background: #fff; }

.bars .bar { display: grid; grid-template-columns: 180px 1fr 110px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13px; }
.bars .track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bars .fill.alt { background: var(--accent); }

/* ---------- Modal y toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 19, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 10px 20px 4px; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.msgbox { background: #e9f6e4; border-radius: 12px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; border: 1px solid #cfe7c7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; z-index: 120; box-shadow: var(--shadow); animation: up .2s ease-out; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); }
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }

.intro { max-width: 720px; margin: 16px auto 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .side-notes { display: none; }
}
@media (max-width: 760px) {
  .coord { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav button { width: auto; white-space: nowrap; }
  .sidebar .me { display: none; }
  .brand { padding-bottom: 10px; }
  .main { padding: 18px 14px 60px; }
  .bars .bar { grid-template-columns: 110px 1fr 90px; }
}
@media (max-width: 520px) {
  .vendor-stage { padding: 0; }
  .phone { width: 100%; height: calc(100vh - 92px); border: 0; border-radius: 0; box-shadow: none; }
  .demobar { gap: 8px; padding: 8px 10px; }
  .demobar .clock, .demobar .hide-sm { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* Fotos de productos (Pexels, ver CREDITOS.md) */
.prod-pick { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 10px; margin: 0 -2px 14px; padding: 2px 2px 6px; overflow-x: auto; scroll-snap-type: x mandatory; }
.prod-pick .pp { scroll-snap-align: start; }
.pp { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1.5px solid var(--line, #e3e3e3); border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.pp img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pp-t { font-weight: 700; font-size: 13px; line-height: 1.25; padding: 8px 10px 2px; }
.pp-p { font-size: 12px; opacity: .7; padding: 0 10px 10px; }
.pp[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.voucher-foto { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }
