/* =====================================================================
   RestPro — hoja de estilos única (landing + intranet)
   Paleta oficial (estructura_negocio v1.4, sección 13):
   primario #123A56 · secundario #1A7A8A · CTA #E8762D · éxito #1E8449
   advertencia #B9770E · error #A93226 · fondos #F4F7F9/#FFF · texto #1C2833
   Regla 60/30/10 · lenguaje semafórico · contraste AA
   ===================================================================== */

:root {
  --navy: #123A56;
  --navy-dark: #0D2C42;
  --teal: #1A7A8A;
  --teal-soft: #E3F0F2;
  --cta: #E8762D;
  --cta-dark: #CF6521;
  --ok: #1E8449;
  --ok-soft: #E8F5EE;
  --warn: #B9770E;
  --warn-soft: #FBF3E4;
  --err: #A93226;
  --err-soft: #F9EAE8;
  --bg: #F4F7F9;
  --card: #FFFFFF;
  --text: #1C2833;
  --muted: #5D6D7E;
  --line: #DCE4EA;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(18, 58, 86, .10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15.5px;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
img { max-width: 100%; }

/* ---------- Botones */
.btn {
  display: inline-block; border: 0; border-radius: 7px; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 10px 20px; text-decoration: none !important;
  transition: background .15s ease;
}
.btn-cta { background: var(--cta); color: #fff !important; }
.btn-cta:hover { background: var(--cta-dark); }
.btn-navy { background: var(--navy); color: #fff !important; }
.btn-navy:hover { background: var(--navy-dark); }
.btn-line { background: transparent; color: var(--navy) !important; border: 1.5px solid var(--navy); }
.btn-line:hover { background: var(--navy); color: #fff !important; }
.btn-ghost { background: transparent; color: #fff !important; border: 1.5px solid rgba(255,255,255,.65); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-sm { padding: 6px 13px; font-size: 13.5px; border-radius: 6px; }
.btn-ok { background: var(--ok); color: #fff !important; }
.btn-warn { background: var(--warn); color: #fff !important; }
.btn-err { background: var(--err); color: #fff !important; }
button.linklike { background: none; border: 0; color: var(--teal); cursor: pointer; font-size: inherit; padding: 0; }

/* ---------- Badges semafóricos */
.badge { display: inline-block; border-radius: 20px; font-size: 12.5px; font-weight: 600; padding: 3px 11px; white-space: nowrap; }
.badge-ok   { background: var(--ok-soft);  color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err  { background: var(--err-soft); color: var(--err); }
.badge-info { background: var(--teal-soft); color: var(--teal); }
.badge-navy { background: #E2EAF1; color: var(--navy); }

/* =====================================================================
   LANDING (prefijo lp-)
   ===================================================================== */
.lp-topbar {
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6vw; position: sticky; top: 0; z-index: 50;
}
.lp-logo { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: .3px; }
.lp-logo span { color: var(--cta); }
.lp-nav { display: flex; gap: 26px; align-items: center; }
.lp-nav a { color: #E5EDF3; font-weight: 500; }
.lp-nav a:hover { color: #fff; text-decoration: none; }

.lp-hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 60%, #0A2233 100%);
  color: #fff; padding: 72px 6vw 84px; text-align: center;
}
.lp-hook { color: #F5B183; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: 14px; margin-bottom: 18px; }
.lp-hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 50px); max-width: 880px; margin: 0 auto 18px; }
.lp-hero p.lead { color: #C9D6E0; font-size: clamp(16px, 1.8vw, 19.5px); max-width: 760px; margin: 0 auto 34px; }
.lp-hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.lp-hero-note { color: #8FA6B8; font-size: 13.5px; margin-top: 16px; }

.lp-strip { background: var(--teal); color: #fff; text-align: center; padding: 14px 6vw; font-weight: 600; font-size: 15.5px; }

.lp-section { padding: 66px 6vw; }
.lp-section.alt { background: #fff; }
.lp-section h2 { text-align: center; font-size: clamp(24px, 3vw, 34px); margin-bottom: 10px; }
.lp-section .sub { text-align: center; color: var(--muted); max-width: 720px; margin: 0 auto 44px; font-size: 16.5px; }

.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; max-width: 1180px; margin: 0 auto; }
.lp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.lp-card .icono {
  width: 46px; height: 46px; border-radius: 10px; background: var(--teal-soft);
  color: var(--teal); font-size: 22px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.lp-card h3 { font-size: 18px; margin-bottom: 8px; }
.lp-card p { color: var(--muted); margin: 0; font-size: 14.8px; }

.lp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; counter-reset: paso; }
.lp-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; position: relative; }
.lp-step::before {
  counter-increment: paso; content: counter(paso);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; margin-bottom: 12px;
}
.lp-step h3 { font-size: 16.5px; }
.lp-step p { color: var(--muted); font-size: 14.2px; margin: 0; }

/* Planes */
.lp-planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; max-width: 1180px; margin: 0 auto; align-items: stretch; }
.lp-plan {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 30px 28px; display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative;
}
.lp-plan.destacado { border-color: var(--cta); box-shadow: 0 6px 24px rgba(232, 118, 45, .18); }
.lp-plan .cinta {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--cta); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 5px 16px; border-radius: 20px; letter-spacing: .4px;
}
.lp-plan h3 { font-size: 21px; margin-bottom: 2px; }
.lp-plan .para { color: var(--muted); font-size: 14px; min-height: 42px; }
.lp-plan .precio { margin: 16px 0 2px; }
.lp-plan .precio .uf { font-size: 40px; font-weight: 800; color: var(--navy); }
.lp-plan .precio .unidad { color: var(--muted); font-size: 14px; }
.lp-plan .equiv { color: var(--muted); font-size: 12.8px; margin-bottom: 14px; }
.lp-plan .sucursales { background: var(--teal-soft); color: var(--teal); border-radius: 8px; font-weight: 700; text-align: center; padding: 9px; margin-bottom: 18px; font-size: 14.5px; }
.lp-plan ul { list-style: none; margin: 0 0 22px; padding: 0; flex: 1; }
.lp-plan li { padding: 6px 0 6px 26px; position: relative; font-size: 14.4px; }
.lp-plan li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 800; }
.lp-plan li.no { color: #9AA7B2; }
.lp-plan li.no::before { content: "—"; color: #C2CCD4; }
.lp-plan li strong { color: var(--navy); }
.lp-plan .btn { text-align: center; }
.lp-planes-nota { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 26px; }

.lp-final { background: linear-gradient(150deg, var(--teal) 0%, var(--navy) 90%); color: #fff; text-align: center; padding: 70px 6vw; }
.lp-final h2 { color: #fff; font-size: clamp(24px, 3vw, 32px); }
.lp-final p { color: #D3E2E8; max-width: 640px; margin: 0 auto 30px; }

.lp-footer { background: var(--navy-dark); color: #91A6B8; padding: 34px 6vw; font-size: 13.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.lp-footer a { color: #C4D3DF; }

/* =====================================================================
   INTRANET
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { font-size: 21px; font-weight: 800; padding: 22px 24px 12px; color: #fff; letter-spacing: .3px; }
.sidebar .brand span { color: var(--cta); }
.sidebar .empresa {
  padding: 0 24px 18px; font-size: 12.8px; color: #B9CBD9; line-height: 1.5;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.sidebar .empresa .plan-linea { display: block; color: #7E97AB; margin-top: 2px; }
.sidebar nav { padding: 10px 0 28px; flex: 1; }
.sidebar .grupo {
  font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #6C87A0;
  padding: 20px 24px 7px; font-weight: 700;
}
.sidebar a.item {
  display: flex; align-items: center; gap: 8px; color: #C6D4DF; padding: 8px 24px 8px 21px;
  font-size: 14.2px; border-left: 3px solid transparent; transition: background .15s ease, color .15s ease;
}
.sidebar a.item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar a.item.activo {
  background: rgba(26, 122, 138, .28); border-left-color: var(--cta); color: #fff; font-weight: 600;
}
.sidebar a.item .soon {
  margin-left: auto; font-size: 9.5px; letter-spacing: .4px; text-transform: uppercase;
  background: rgba(255,255,255,.12); border-radius: 8px; padding: 2px 8px; color: #9FB4C6; white-space: nowrap;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 12px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.topbar .local-select { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.topbar select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 14px; background: #fff; color: var(--text); }
.topbar .usuario { font-size: 13.8px; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.topbar .usuario b { color: var(--navy); }

.contenido { padding: 30px 32px 44px; max-width: 1240px; width: 100%; }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.encabezado h1 { font-size: 25px; margin: 0; letter-spacing: -.2px; }
.encabezado .sub { color: var(--muted); font-size: 14px; margin-top: 5px; max-width: 760px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 4px rgba(18, 58, 86, .07); padding: 24px 26px; margin-bottom: 22px;
}
.card h2 {
  font-size: 15px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--teal); font-weight: 700;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(18, 58, 86, .07);
}
.kpi .valor { font-size: 28px; font-weight: 800; color: var(--navy); }
.kpi .valor.ok { color: var(--ok); }
.kpi .valor.warn { color: var(--warn); }
.kpi .valor.err { color: var(--err); }
.kpi .nombre { color: var(--muted); font-size: 13.2px; margin-top: 2px; }

/* Tablas */
.tabla-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14.1px; }
.tabla th {
  background: var(--navy); color: #E9F0F5; text-align: left; padding: 10px 14px;
  font-weight: 600; white-space: nowrap; font-size: 12.6px; letter-spacing: .4px; text-transform: uppercase;
}
.tabla td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tr:hover td { background: #F6F9FA; }
.tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Formularios */
form.form { display: grid; gap: 14px; }
.form-fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
label.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--navy); }
.campo input, .campo select, .campo textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font-size: 14.5px;
  font-family: inherit; background: #fff; color: var(--text); width: 100%;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.campo .ayuda { font-weight: 400; color: var(--muted); font-size: 12.3px; }
.form-acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Alertas / flash */
.alerta { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; border: 1px solid; }
.alerta.ok { background: var(--ok-soft); color: var(--ok); border-color: #BFE3CE; }
.alerta.err { background: var(--err-soft); color: var(--err); border-color: #EFC9C4; }
.alerta.warn { background: var(--warn-soft); color: var(--warn); border-color: #EEDBB6; }
.alerta.info { background: var(--teal-soft); color: var(--teal); border-color: #C2DEE2; }

/* Checklist en ejecución (pantalla operario: grande, una acción por pantalla) */
.chk-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; max-width: 680px; margin: 0 auto; box-shadow: var(--shadow); }
.chk-progreso { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.chk-texto { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.chk-epp { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 14.5px; margin: 12px 0; font-weight: 600; }
.chk-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.chk-botones .btn { padding: 18px; font-size: 17px; }
.chk-rama { background: var(--err-soft); border: 1.5px solid #EFC9C4; border-radius: 12px; padding: 20px 22px; margin-top: 18px; }
.chk-rama h3 { color: var(--err); font-size: 16px; }
.chk-rama ol { margin: 10px 0 14px; padding-left: 22px; }
.chk-rama li { padding: 4px 0; font-size: 15.5px; }
.chk-rama .epp { background: #fff; border-radius: 8px; padding: 9px 12px; font-weight: 600; color: var(--warn); font-size: 14px; margin-bottom: 12px; }

/* Placeholder próximamente */
.proximamente { text-align: center; padding: 70px 20px; }
.proximamente .icono { font-size: 52px; margin-bottom: 12px; }
.proximamente h1 { font-size: 26px; }
.proximamente p { color: var(--muted); max-width: 540px; margin: 0 auto 22px; }

/* Auth (login / registro) */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--navy), var(--navy-dark)); padding: 30px 16px; }
.auth-card { background: #fff; border-radius: 14px; padding: 34px 34px 28px; width: 100%; max-width: 440px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.auth-card.ancha { max-width: 560px; }
.auth-logo { font-size: 26px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.auth-logo span { color: var(--cta); }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-pie { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* Utilidades */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.texto-muted { color: var(--muted); }
.texto-ok { color: var(--ok); } .texto-warn { color: var(--warn); } .texto-err { color: var(--err); }
.acciones-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

/* ---------- Despacho con foto contra comanda */
.desp-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 9px; margin-bottom: 9px;
  font-size: 15.5px; background: #fff;
}
.desp-item.ok { border-color: #BFE3CE; background: var(--ok-soft); }
.desp-item.falta { border-color: #EFC9C4; background: var(--err-soft); }
.desp-item .texto { flex: 1; }
.desp-item.ok .texto { color: var(--ok); font-weight: 600; }
.desp-item.falta .texto { color: var(--err); font-weight: 600; text-decoration: line-through; }
.desp-foto-preview {
  max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; margin-top: 10px;
}
.desp-foto-marco {
  border: 2px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center;
  color: var(--muted); font-size: 14px;
}
.foto-miniatura { width: 74px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- Cartillas y PTS */
.cart-paso {
  display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start;
}
.cart-paso:last-child { border-bottom: 0; }
.cart-paso .nro {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.cart-paso.critico .nro { background: var(--err); }
.cart-paso .cuerpo { flex: 1; font-size: 15px; }
.cart-paso .marca-critico { color: var(--err); font-weight: 700; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; }
.cart-epp-caja {
  background: var(--warn-soft); border: 1px solid #EEDBB6; color: var(--warn);
  border-radius: 9px; padding: 11px 15px; font-weight: 600; font-size: 14px; margin-bottom: 16px;
}
.cart-print-head { display: none; }

@media print {
  .sidebar, .topbar, .no-print, .alerta { display: none !important; }
  .app-shell { display: block; }
  .contenido { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .cart-print-head {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 16px;
  }
  body { background: #fff; }
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; }
  .sidebar .grupo { display: none; }
  .sidebar a.item { padding: 8px 12px; border-radius: 6px; }
  .contenido { padding: 16px; }
}
