:root {
  --brand: #1f6f5c;
  --brand-strong: #154f42;
  --brand-soft: #e3f2ec;
  --accent: #f2a541;
  --ink: #1d2422;
  --muted: #5d6b67;
  --line: #dde5e2;
  --surface: #ffffff;
  --page: #f6f8f7;
  --danger: #b3261e;
  --ok: #1b7f4b;
  --warn: #9a5b00;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 50, 40, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Encabezado */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
/* La campana: el mismo ícono de la app. */
.logo-mark { width: 36px; height: 36px; display: block; }
.logo small { font-weight: 600; color: var(--brand); }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--brand); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }
/* Teléfono: el botón de arriba en una sola línea, sin apretarse con el logo. */
.topbar .btn { white-space: nowrap; }
@media (max-width: 420px) { .topbar .wrap { gap: 12px; } .topbar .btn-small { padding: 8px 14px; font-size: 14px; } }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-small { padding: 8px 14px; font-size: 14px; }
.btn-danger { background: #fbe9e7; color: var(--danger); }
.btn-ok { background: var(--brand-soft); color: var(--brand-strong); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Portada */
.hero { padding: 72px 0 56px; background: linear-gradient(180deg, #ffffff 0%, var(--page) 100%); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.eyebrow {
  display: inline-block; background: var(--brand-soft); color: var(--brand-strong);
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; margin: 16px 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.5vw, 38px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 14px; color: var(--muted); font-size: 14px; }

/* Maqueta de la app */
.mock {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 18px; display: grid; gap: 12px;
}
.mock-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--page); }
.mock-row strong { font-size: 18px; }
.mock-time { font-weight: 800; font-size: 20px; color: var(--brand); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip-ready { background: #e1f5ee; color: #085041; }
.chip-way { background: #e6f1fb; color: #0c447c; }
.chip-kitchen { background: #faece7; color: #712b13; }

/* Secciones */
section { padding: 64px 0; }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature h3 { margin: 12px 0 6px; font-size: 19px; }
.feature p { margin: 0; color: var(--muted); }
.icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong);
  display: grid; place-items: center; font-size: 22px;
}

/* Planes */
.plans { align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan-badge {
  position: absolute; top: -13px; left: 24px; background: var(--accent); color: #3a2400;
  font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 999px;
}
.plan h3 { margin: 0; font-size: 22px; }
.plan .tagline { color: var(--muted); margin: 4px 0 16px; }
.price { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.price small { font-size: 15px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { padding-left: 28px; position: relative; }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.plans-note { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* Pasos */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { counter-increment: step; }
.step::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 10px;
}
.step h3 { margin: 0 0 4px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* Formulario */
.form-card { max-width: 820px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; }
input, select, textarea {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.invalid input, input.invalid { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; min-height: 0; }
.plan-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .plan-picker { grid-template-columns: 1fr; } }
.plan-option { position: relative; }
.plan-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.plan-option span {
  display: block; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 700;
}
.plan-option span small { display: block; font-weight: 500; color: var(--muted); }
.plan-option input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.plan-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.notice { padding: 16px 18px; border-radius: 12px; margin-top: 16px; }
.notice.ok { background: #e1f5ee; color: #085041; }
.notice.error { background: #fbe9e7; color: var(--danger); }

/* Pie */
footer { padding: 36px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

/* Panel de administrador */
.admin-main { padding: 28px 0 60px; }
.tabs { display: flex; gap: 8px; margin: 12px 0 20px; flex-wrap: wrap; }
.tab { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.tab[aria-selected='true'] { background: var(--brand); color: #fff; border-color: var(--brand); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select, .filters input { width: auto; min-width: 180px; }
.list { display: grid; gap: 12px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 10px; }
.item-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.item-head h3 { margin: 0; font-size: 19px; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 18px; color: var(--muted); font-size: 14px; }
.meta b { color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.status.PENDING { background: #fff3db; color: var(--warn); }
.status.APPROVED { background: #e1f5ee; color: #085041; }
.status.REJECTED { background: #fbe9e7; color: var(--danger); }
.status.SUSPENDED { background: #eeeeee; color: #444; }
.rut-ok { color: var(--ok); font-weight: 700; }
.rut-bad { color: var(--danger); font-weight: 700; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: #fff; border: 1px dashed var(--line); border-radius: 14px; }
.login { max-width: 420px; margin: 60px auto; }

/* Panel · Pagos: un color por estado para verlo de un vistazo. */
.pay-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pay-chip { border: 2px solid transparent; border-radius: 12px; padding: 10px 14px; font: inherit; cursor: pointer;
  display: grid; gap: 2px; text-align: left; min-width: 120px; }
.pay-chip b { font-size: 24px; line-height: 1; }
.pay-chip span { font-size: 13px; font-weight: 700; }
.pay-chip[aria-pressed='true'] { border-color: var(--ink); }
.pay-table { display: grid; gap: 8px; }
.pay-row { display: grid; grid-template-columns: 6px 1.6fr 1fr 1.2fr 1fr auto; gap: 14px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 0; }
.pay-row.head { background: transparent; border: 0; padding-block: 0; font-size: 12px; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pay-bar { align-self: stretch; border-radius: 12px 0 0 12px; }
.pay-row.head .pay-bar { background: transparent; }
.pay-name b { display: block; font-size: 16px; }
.pay-name small, .pay-due small { color: var(--muted); font-size: 13px; }
.pay-due b { display: block; }
.pay-state { font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px; justify-self: start; }
.pay-row .actions { justify-content: flex-end; }
.st-ok { background: #e1f5ee; color: #085041; }       .bar-ok { background: #1b7f4b; }
.st-soon { background: #fff4d6; color: #7a5200; }     .bar-soon { background: #e0a100; }
.st-late { background: #ffe4cc; color: #8a3b00; }     .bar-late { background: #e06c00; }
.st-unpaid { background: #fbe1df; color: #a1150c; }   .bar-unpaid { background: #c62828; }
.st-trial { background: #e6f1fb; color: #0c447c; }    .bar-trial { background: #2f74c0; }
.st-off { background: #eceff1; color: #455a64; }      .bar-off { background: #90a4ae; }
@media (max-width: 760px) {
  .pay-row { grid-template-columns: 6px 1fr auto; }
  .pay-row.head { display: none; }
  .pay-row > .pay-plan, .pay-row > .pay-last { display: none; }
  .pay-row .actions { grid-column: 2 / -1; justify-content: flex-start; }
}

/* Panel · Ingresos */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi b { font-size: 26px; letter-spacing: -0.01em; color: var(--ink); }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi small.up { color: var(--ok); font-weight: 700; }
.kpi small.down { color: var(--danger); font-weight: 700; }
.chart-card { margin-top: 16px; padding: 18px; }
.bars { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 220px;
  align-items: end; border-bottom: 1px solid var(--line); padding-top: 22px; }
.bar-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.bar { width: min(56px, 70%); background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .55; }
.bar-col.current .bar { opacity: 1; }
.bar-col:hover .bar, .bar-col:focus .bar { opacity: 1; outline: 2px solid #fff; }
.bar-value { position: absolute; bottom: calc(var(--h) + 4px); font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.bar-labels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 6px; }
.bar-labels span { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.bar-tip { position: absolute; z-index: 2; background: var(--ink); color: #fff; font-size: 13px; padding: 6px 10px;
  border-radius: 8px; pointer-events: none; white-space: nowrap; transform: translate(-50%, -100%); }
.pay-list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pay-list th, .pay-list td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay-list th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--page); }
.pay-list td.num, .pay-list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-list tfoot td { font-weight: 800; border-bottom: 0; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-value { display: none; }
}

/* Ventanas del panel (registrar pago, cambiar fecha, rechazar…). */
.modal { border: 0; border-radius: 16px; padding: 22px; width: min(440px, calc(100% - 32px)); box-shadow: var(--shadow); color: var(--ink); }
.modal::backdrop { background: rgba(20, 30, 28, .45); }
.modal h3 { margin: 0; font-size: 19px; }

/* Panel · Uso */
.use-row { grid-template-columns: 6px 1.5fr 1.1fr .9fr 1.3fr .9fr auto; }
.use-days { display: grid; gap: 6px; }
.use-meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.use-meter i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
@media (max-width: 760px) {
  .use-row { grid-template-columns: 6px 1fr auto; }
  .use-row > .use-sales, .use-row > .use-days, .use-row > .use-login { display: none; }
}

/* Panel · Recordatorios de hoy */
.reminders { padding: 16px 18px; margin-bottom: 18px; display: grid; gap: 10px; }
.reminders h3 { margin: 0; font-size: 17px; }
.reminder { display: grid; grid-template-columns: 1.4fr 1.4fr auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); }
.reminder b { display: block; }
.reminder small { color: var(--muted); font-size: 13px; }
.pay-info { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
@media (max-width: 760px) { .reminder { grid-template-columns: 1fr; } }

/* Panel · Precios y ofertas */
.price-list { display: grid; gap: 10px; }
.price-row { display: grid; grid-template-columns: 1.4fr 1fr 180px auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); }
.price-row b { display: block; }
.price-row small { color: var(--muted); font-size: 13px; }
.offer-row { grid-template-columns: 6px 1.4fr 1.2fr 1.2fr .8fr auto; }
@media (max-width: 760px) {
  .price-row { grid-template-columns: 1fr 1fr; }
  .offer-row { grid-template-columns: 6px 1fr auto; }
  .offer-row > .offer-dates, .offer-row > .offer-count { display: none; }
}
/* Página · precio de oferta */
.price s { display: block; font-size: 18px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.offer-tag { display: inline-block; background: #fff4d6; color: #7a5200; font-weight: 800; font-size: 13px;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 6px; }
.offer-row .pay-due small { display: block; margin-top: 4px; }

/* Panel · Vendedores y finanzas */
.seller-row { grid-template-columns: 6px 1.6fr .7fr .7fr .9fr .9fr 290px; }
.my-client-row { grid-template-columns: 6px 1.6fr 1.2fr 1fr 120px; }
.share { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.share-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--brand); min-width: 2px; max-width: 120px; }
@media (max-width: 760px) {
  .seller-row { grid-template-columns: 6px 1fr auto; }
  .seller-row > :nth-child(3), .seller-row > :nth-child(4), .seller-row > :nth-child(6) { display: none; }
  .my-client-row { grid-template-columns: 6px 1fr auto; }
  .my-client-row > :nth-child(4) { display: none; }
}
.my-client-row .pay-due small { display: block; margin-top: 4px; }
.pay-state { white-space: nowrap; }

/* Panel · tabla de vendedores */
.table-scroll { overflow-x: auto; border-radius: 12px; }
.sellers-table { min-width: 1080px; }
.sellers-table td { vertical-align: top; }
.sellers-table tr.inactive td { opacity: .6; }
.cell-note { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.days-input { width: 72px; padding: 6px 8px; text-align: right; }
.sellers-table td:last-child { min-width: 250px; }

/* Panel · promoción de lanzamiento y registro con e-RUT */
.promo-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #e6f1fb; color: #0c447c; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.promo-card b { font-size: 15px; }
.promo-card.off { background: #eceff1; color: #455a64; }
.erut-box { display: grid; gap: 8px; padding: 12px; border: 1.5px dashed var(--brand); border-radius: 12px; background: var(--brand-soft); }
.erut-box .hint { margin: 0; }
.erut-status { font-size: 13px; font-weight: 700; color: var(--brand-strong); min-height: 1em; }
.form-section { margin: 18px 0 0; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
