/* Panel de renovaciones · Conektica */
:root {
  --ink: #141414;
  --ink-2: #262626;
  --brand-red: #ff1e29;
  --brand-orange: #ff6b00;
  --bg: #f5f5f4;
  --surface: #ffffff;
  --line: #e5e4e2;
  --line-2: #f0efed;
  --text: #18181b;
  --muted: #6b6870;
  --accent: #141414;
  --accent-ink: #b33c00;
  --accent-soft: #ffe8d9;
  --rojo: #c62f3b;   --rojo-s: #fdecee;
  --naranja: #cf5a22; --naranja-s: #fdf0e8;
  --ambar: #a57406;  --ambar-s: #fdf5e0;
  --azul: #3557c0;   --azul-s: #ebf0fd;
  --verde: #2b8253;  --verde-s: #e8f5ee;
  --gris: #7b7790;   --gris-s: #f0f0f4;
  --r: 12px;
  --r-s: 8px;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-head: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--f-body); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-orange) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 16px; margin-bottom: 10px; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.muted { color: var(--muted); margin: 6px 0 0; }
.strong { font-weight: 600; color: var(--text); }
.warn { color: var(--naranja); font-weight: 600; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #d4d4d4; padding: 22px 14px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.brand { display: grid; gap: 6px; padding: 4px 8px 0; text-decoration: none !important; }
.brand-logo { display: block; width: 168px; height: auto; }
.brand small { color: #a3a3a3; margin: 0; font-size: 12.5px; padding-left: 2px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #cfcfcf; position: relative; font-weight: 500; text-decoration: none; }
.side nav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .75; }
.side nav a:hover { background: var(--ink-2); color: #fff; }
.side nav a.on { background: #fff; color: var(--ink); font-weight: 600; }
.side nav a.on svg { opacity: 1; fill: var(--brand-red); }
.side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--brand-red), var(--brand-orange)); }
.side-foot { margin-top: auto; padding: 0 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.side-foot a { color: #a3a3a3; }
.main { padding: 28px clamp(16px, 3.2vw, 44px) 60px; min-width: 0; max-width: 1320px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.back::before { content: "‹ "; }

/* ---------- Botones ---------- */
.btn { appearance: none; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 14px/1 var(--f-body); padding: 11px 16px; border-radius: 10px; cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: #333; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--rojo); border-color: var(--rojo); }
.btn-block { width: 100%; justify-content: center; padding: 13px; }
.btn-s { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 12.5px/1 var(--f-body); padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none !important; display: inline-block; }
.btn-s:hover { border-color: #c9c6d8; }
.btn-ok { background: var(--verde-s); border-color: #bfe2cd; color: var(--verde); }
.btn-ok:hover { border-color: var(--verde); }
.btn-ghost.btn-s { background: transparent; border-color: transparent; color: var(--accent-ink); }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; cursor: pointer; font-size: 14px; }
.link.danger { color: var(--rojo); margin-top: 14px; }
.acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.acts form { margin: 0; }

/* ---------- Avisos de sistema ---------- */
.banner { background: var(--ambar-s); color: #6d4c00; border: 1px solid #f1dfae; padding: 9px 14px; border-radius: var(--r-s); font-size: 13.5px; margin-bottom: 16px; }
.alert { background: var(--rojo-s); border: 1px solid #f4c6cb; color: #7d1d26; padding: 12px 16px; border-radius: var(--r-s); margin-bottom: 18px; }
.flash { padding: 11px 14px; border-radius: var(--r-s); margin-bottom: 14px; font-weight: 500; background: var(--verde-s); color: #1f5e3c; border: 1px solid #c4e4d2; }
.flash-error { background: var(--rojo-s); color: #7d1d26; border-color: #f4c6cb; }
.warn-box { background: var(--naranja-s); border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.hint { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 4px; }

/* ---------- Pista de 90 días (elemento principal del tablero) ---------- */
.runway { background: var(--ink); color: #e5e5e5; border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--brand-red), var(--brand-orange)) 1; border-radius: 0 0 16px 16px; border-radius: 16px; padding: 22px 26px 18px; margin-bottom: 18px; overflow: hidden; }
.runway-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.runway h2 { color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #b5b5b5; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-rojo, .mark-rojo { background: #ff6b76; }
.dot-naranja, .mark-naranja { background: #ff9a5c; }
.dot-ambar, .mark-ambar { background: #ffcf5c; }
.dot-azul, .mark-azul { background: #8fa8ff; }
.dot-verde, .mark-verde { background: #6fd3a0; }
.track { position: relative; height: 92px; margin: 14px 8px 0 18px; }
.track-line { position: absolute; left: 0; right: 0; top: 40px; height: 2px; background: linear-gradient(90deg, #ff9a5c 0 8%, #ffcf5c 8% 33%, #8fa8ff 33% 66%, #6fd3a0 66%); opacity: .55; border-radius: 2px; }
.tick:last-of-type { transform: translateX(-100%); }
.tick { position: absolute; left: var(--x); top: 62px; transform: translateX(-50%); font-size: 11.5px; color: #8c8c8c; white-space: nowrap; }
.tick::before { content: ""; position: absolute; left: 50%; top: -18px; width: 1px; height: 8px; background: #4a4a4a; }
.mark { position: absolute; left: var(--x); top: 41px; transform: translate(-50%, -50%); min-width: 18px; height: 18px; border-radius: 9px; color: var(--ink); font: 700 11px/18px var(--f-body); text-align: center; padding: 0 4px; box-shadow: 0 0 0 3px var(--ink); text-decoration: none !important; transition: transform .15s; }
.mark:hover, .mark:focus-visible { transform: translate(-50%, -50%) scale(1.35); z-index: 2; }
.mark-past { left: -14px; box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #ff6b76; }

/* ---------- Estadísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 22px; }
.stat { background: var(--surface); padding: 16px 18px; color: var(--text); text-decoration: none !important; }
a.stat:hover { background: #fcfbfa; }
.stat b { display: block; font-family: var(--f-head); font-size: 28px; line-height: 1.1; font-weight: 700; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat-rojo b { color: var(--rojo); }

/* ---------- Paneles y tablas ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; min-width: 0; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-soft { background: transparent; border-style: dashed; }
.empty { color: var(--muted); padding: 22px 0 8px; margin: 0; }
.empty-s { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fcfbfa; }
.tbl .nowrap { white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.wrap, .wrap { word-break: break-word; max-width: 280px; }
.t-rojo { color: var(--rojo) !important; font-weight: 600; }
.t-naranja { color: var(--naranja) !important; font-weight: 600; }
.t-ambar { color: var(--ambar) !important; font-weight: 600; }
.t-azul { color: var(--azul) !important; }
.t-verde { color: var(--verde) !important; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 9px 4px 8px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-rojo { background: var(--rojo-s); color: var(--rojo); }
.pill-naranja { background: var(--naranja-s); color: var(--naranja); }
.pill-ambar { background: var(--ambar-s); color: var(--ambar); }
.pill-azul { background: var(--azul-s); color: var(--azul); }
.pill-verde { background: var(--verde-s); color: var(--verde); }
.pill-gris { background: var(--gris-s); color: var(--gris); }
.tag { display: inline-block; font-size: 12.5px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.tag-azul { border-color: #cdd8f8; color: var(--azul); background: var(--azul-s); }
.tag-verde { border-color: #c4e4d2; color: var(--verde); background: var(--verde-s); }
.tag-rojo { border-color: #f4c6cb; color: var(--rojo); background: var(--rojo-s); }

.todo { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.todo li { margin: 6px 0; }

/* ---------- Filtros ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 260px; }
.filters select { flex: 0 1 auto; width: auto; }

/* ---------- Formularios ---------- */
input, select, textarea { width: 100%; font: 15px/1.4 var(--f-body); color: var(--text); background: var(--surface); border: 1px solid #d6d8e3; border-radius: 9px; padding: 9px 11px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px var(--accent-soft); }
.form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.form label > input, .form label > select, .form label > textarea { margin-top: 6px; font-weight: 400; }
.form .check, label.check { display: flex; gap: 9px; align-items: center; font-weight: 500; margin-bottom: 14px; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand-red); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
fieldset { border: 1px dashed var(--line); border-radius: var(--r-s); padding: 12px 14px 0; margin: 0 0 14px; }
legend { font-weight: 600; font-size: 13px; padding: 0 6px; color: var(--text); }
.narrow { max-width: 720px; }
.switch { display: grid !important; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-weight: 400 !important; padding: 12px 0; border-top: 1px solid var(--line-2); margin: 0 !important; }
.switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-red); }
.switch b { display: block; font-size: 14.5px; }
.switch span { color: var(--muted); font-size: 13.5px; }
.switch span b { color: var(--text); }
.settings .panel .switch:last-child { padding-bottom: 0; }
.settings .grid2 { margin-top: 16px; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; justify-content: flex-end; margin-bottom: 18px; }

.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.cols-even { grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 10px; }
.stack .panel { margin-bottom: 18px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0 9px 16px; border-left: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-orange); }
.timeline li.empty-s::before { display: none; }

/* ---------- Correos ---------- */
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.rules > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.rules b { display: block; font-family: var(--f-head); margin-bottom: 4px; }
.rules span { font-size: 13.5px; color: var(--muted); }
.previews { display: grid; gap: 10px; margin-top: 14px; }
.preview { border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.preview summary { cursor: pointer; padding: 12px 14px; display: grid; gap: 4px; background: #fcfbfa; }
.preview summary .tag { justify-self: start; }
.mail-frame { width: 100%; height: 560px; border: 0; border-top: 1px solid var(--line); background: #f4f4f5; }

/* ---------- Diálogos ---------- */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(20, 20, 20, .28); }
.dlg::backdrop { background: rgba(20, 20, 20, .5); }
.dlg form { padding: 22px; }
.dlg h2 { margin-bottom: 4px; }
.dlg .muted { margin: 0 0 16px; }
.dlg label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.dlg label > input { margin-top: 6px; font-weight: 400; }
.dlg .check { display: flex; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg[open] { animation: aparece .18s ease-out; }
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Login / instalación ---------- */
.login-body { background: var(--ink); min-height: 100vh; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; display: flex; align-items: flex-end; padding: 48px; overflow: hidden; }
.login-art p { position: relative; color: #fff; font: 700 clamp(28px, 3.4vw, 46px)/1.08 var(--f-head); max-width: 13ch; margin: 0; letter-spacing: -.02em; }
.arcs { position: absolute; top: 50%; right: 9%; transform: translateY(-62%); display: flex; gap: clamp(18px, 2.4vw, 34px); }
.arcs span { width: clamp(150px, 17vw, 250px); height: clamp(300px, 34vw, 500px); border: clamp(46px, 5.4vw, 80px) solid; }
.arc-c { border-color: var(--brand-red) transparent var(--brand-red) var(--brand-red) !important; border-radius: 999px 0 0 999px; border-right: 0 !important; clip-path: inset(0 0 0 0); }
.arc-d { border-color: var(--brand-orange) var(--brand-orange) var(--brand-orange) transparent !important; border-radius: 0 999px 999px 0; border-left: 0 !important; }
.login-card, .install { background: var(--surface); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.login-card .brand, .install .brand { padding: 0; margin-bottom: 34px; }
.login-card .brand-logo, .install .brand-logo { width: 210px; }
.login-card .brand small, .install .brand small { color: var(--muted); }
.login-card h1 { margin-bottom: 22px; }
.login-card label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 14px; max-width: 380px; }
.login-card label input { margin-top: 6px; }
.login-card .btn, .login-card .flash { max-width: 380px; }
.install { max-width: 560px; margin: 40px auto; border-radius: 18px; min-height: 0; }
.install h1 { margin-bottom: 12px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-foot span { display: none; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
  .side nav { display: flex; overflow-x: auto; order: 3; width: 100%; gap: 4px; }
  .side nav a { padding: 7px 10px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 25px; }
  .rules, .grid3, .cols-even { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 200px; padding: 28px 16px; }
  .arcs { right: -60px; transform: translateY(-50%) scale(.55); transform-origin: right center; }
  .brand-logo { width: 130px; }
  .runway { padding: 18px 16px 14px; }
  .tick:nth-of-type(even) { display: none; }
}
@media (max-width: 560px) {
  .grid2, .stats { grid-template-columns: 1fr; }
  .acts { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.banner-demo { background: var(--accent-soft); border-color: #ffd2b3; color: #6b2a00; }
