/* importarcoche.es · área de clientes y panel interno
   Sigue los diseños aprobados: cabecera negra, fondo cálido claro, naranja de marca #FF7E00. */
:root {
  --ink: #18191B;
  --ink-2: #3A3B3E;
  --muted: #6E6B65;
  --faint: #726E66;
  --bg: #F5F4F1;
  --panel: #FFFFFF;
  --line: #E6E3DC;
  --line-2: #EFECE6;
  --field: #FFFFFF;
  --brand: #FF7E00;
  --brand-ink: #B35400;
  --brand-soft: #FFF1E2;
  --brand-softer: #FFF8F0;
  --ok: #1E7A49;
  --ok-soft: #E5F2EA;
  --warn: #A15C00;
  --bad: #B3261E;
  --bad-soft: #FBEAE8;
  --info-soft: #EEF1F6;
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- Cabecera ---------- */
.top { background: var(--ink); color: #fff; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; gap: 18px; }
.top .logo img { height: 22px; width: auto; }
.chip-interno { background: var(--brand); color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 9px; border-radius: 99px; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { color: #C9C7C2; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: #fff; background: #26272A; }
.nav a[aria-current="page"] { color: #fff; background: #2C2D31; }
.nav .badge { background: var(--brand); color: var(--ink); border-radius: 99px; font-size: 11px; padding: 1px 7px; margin-left: 4px; font-weight: 800; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #C9C7C2; }
.top-r .quien { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--ink); display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.avatar.dark { background: var(--ink); color: #fff; }
.btn-salir { background: transparent; color: #fff; border: 1px solid #3A3B3F; border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn-salir:hover { border-color: #6A6B70; }
.top a.cuenta { color: #C9C7C2; text-decoration: none; }
.top a.cuenta:hover { color: #fff; }
@media (max-width: 860px) {
  .top-in { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 10px; row-gap: 8px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .top-r .nombres { display: none; }
}

/* ---------- Página ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 19px; font-weight: 800; }
.card h3 { font-size: 16px; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.grid-main > *, .cl-top > * { min-width: 0; }
@media (max-width: 980px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 16px; }

/* ---------- Indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
a.kpi:hover { border-color: #CFCAC0; }
.kpi.hot b { color: var(--brand-ink); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Botones ---------- */
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 700; font-size: 14px; padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: #C9C4B9; }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #2B2C30; }
.btn.brand { background: var(--brand); color: var(--ink); border-color: var(--brand); }
.btn.brand:hover { background: #F07400; }
.btn.outline { border-color: var(--ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--line-2); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger:hover { color: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }

/* ---------- Formularios ---------- */
label, .label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--field); border: 1px solid #DAD6CD; border-radius: 9px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236E6B65' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .fields, .fields.three { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 800; font-size: 16px; margin-bottom: 12px; }
.form-section + .form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2); }

/* ---------- Avisos ---------- */
.flash { border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; font-weight: 600; font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #C6E2D1; color: #14532F; }
.flash.aviso { background: var(--brand-soft); border-color: #F6D2AA; color: #7A3E00; }
.flash.error { background: var(--bad-soft); border-color: #F0C3BF; color: #7F1D17; }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .sub { display: block; color: var(--muted); font-size: 13px; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover td { background: var(--brand-softer); }
.table tr.urgente td { background: var(--brand-softer); }
.table a.strong { color: var(--ink); text-decoration: none; font-weight: 800; }
.table a.strong:hover { text-decoration: underline; }
.fecha-roja { color: var(--bad); font-weight: 800; }
.fecha-naranja { color: var(--brand-ink); font-weight: 800; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  .table.responsive td::before { content: attr(data-l); color: var(--muted); font-size: 13px; flex: none; }
  .table.responsive td:first-child::before { content: none; }
  .table.responsive td:first-child { display: block; }
}

/* ---------- Etiquetas de estado ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.dark { background: var(--ink); color: #fff; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.estado-nuevo { background: #E9EEF9; color: #2A4A8A; }
.estado-contactado { background: var(--line-2); color: var(--ink-2); }
.estado-presupuesto { background: var(--brand-soft); color: var(--brand-ink); }
.estado-negociando { background: #FCEBD0; color: #8A4B00; }
.estado-ganado { background: var(--ok-soft); color: var(--ok); }
.estado-espera { background: #EFEDF5; color: #514A6B; }
.estado-perdido { background: var(--bad-soft); color: var(--bad); }

/* ---------- Ficha interna: fases ---------- */
.fases-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.fase-btn { font: inherit; font-size: 13px; font-weight: 700; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.fase-btn.hecha { background: var(--ink); border-color: var(--ink); color: #fff; }
.fase-btn.actual { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.fase-btn:hover { border-color: var(--brand); }
.fase-btn.hecha:hover { background: #2B2C30; }
.ficha-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.ficha-head h1 { font-size: 24px; font-weight: 800; margin-top: 4px; }
.ficha-head .meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Documentos ---------- */
.drop { border: 1.5px dashed #CFCAC0; border-radius: var(--r); padding: 20px; text-align: center; background: var(--brand-softer); position: relative; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop b { display: block; margin-top: 6px; }
.drop .elegidos { margin-top: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.drop-opts { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }
.docs { margin-top: 14px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.doc:last-child { border-bottom: 0; }
.doc .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--line-2); flex: none; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 800; }
.doc .nm { flex: 1; min-width: 0; }
.doc .nm a { color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.doc .nm a:hover { text-decoration: underline; }
.doc .nm small { display: block; color: var(--faint); font-size: 12px; }
.vis { font: inherit; font-size: 13px; font-weight: 800; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.vis.si { color: var(--ok); }
.vis.no { color: var(--ink-2); }
.vis:hover { background: var(--line-2); }
.doc-more { position: relative; }
.doc-more summary { list-style: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: var(--muted); font-weight: 800; }
.doc-more summary::-webkit-details-marker { display: none; }
.doc-more summary:hover { background: var(--line-2); }
.doc-more .menu { position: absolute; right: 0; top: 100%; z-index: 10; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(24,25,27,.12); padding: 10px; width: 250px; }
.doc-more .menu > * + * { margin-top: 8px; }
.doc-more .menu input { min-height: 36px; padding: 7px 10px; font-size: 14px; }

/* ---------- Tareas y notas ---------- */
.tareas { list-style: none; margin: 0; padding: 0; }
.tareas li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; }
.tareas li.hecha span { text-decoration: line-through; color: var(--faint); }
.tareas input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--ink); margin: 1px 0 0; flex: none; }
.tareas li span { flex: 1; }
.tareas .x { opacity: 0; }
.tareas li:hover .x, .tareas li:focus-within .x { opacity: 1; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.nota { background: #F6F4F0; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.nota + .nota { margin-top: 8px; }
.nota .de { font-weight: 800; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.nota .de small { font-weight: 500; color: var(--faint); }
.nota p { white-space: pre-wrap; overflow-wrap: anywhere; }
.nota.sistema { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; padding: 7px 12px; }
.notas-lista { max-height: 520px; overflow: auto; }

/* ---------- Pagos ---------- */
.pagos { list-style: none; margin: 0; padding: 0; }
.pagos li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.pagos li:last-child { border-bottom: 0; }
.pagos .imp { font-weight: 800; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pagos .imp.pagado { color: var(--ok); }
.pagos .imp.pend { color: var(--brand-ink); }
.banco { background: #F6F4F0; border-radius: 10px; padding: 12px; font-size: 13px; color: var(--ink-2); margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Área del cliente ---------- */
.cl-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 900px) { .cl-top { grid-template-columns: minmax(0, 1fr); } }
.cl-hero h1 { font-size: 30px; font-weight: 800; margin-top: 6px; }
.cl-hero .ruta { color: var(--muted); margin-top: 2px; }
.cl-hero .fila { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.barra { margin-top: 20px; }
.barra .txt { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 7px; }
.barra .riel { height: 8px; background: #EFEAE1; border-radius: 99px; overflow: hidden; }
.barra .riel i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.siguiente { background: var(--ink); color: #fff; border-radius: 12px; padding: 16px 16px 16px 18px; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.siguiente .eyebrow { color: #B9B6AF; }
.siguiente b { display: block; font-size: 17px; margin-top: 3px; }
.siguiente small { color: #B9B6AF; display: block; margin-top: 3px; font-size: 12.5px; }
.gestor .persona { display: flex; gap: 12px; align-items: center; margin: 10px 0 14px; }
.gestor .persona b { display: block; }
.contacto { overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.contacto + .contacto { margin-top: 8px; }
.contacto:hover { border-color: #C9C4B9; }
.contacto svg { flex: none; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 24px 0 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }
.tabs a:hover { color: var(--ink); }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 12px; padding-bottom: 20px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { content: none; }
.timeline li.hecha::before { background: var(--ink); }
.timeline .bola { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; border: 1.5px solid #D6D1C7; background: var(--panel); color: var(--muted); position: relative; z-index: 1; }
.timeline .hecha .bola { background: var(--ink); border-color: var(--ink); color: #fff; }
.timeline .actual .bola { background: var(--brand); border-color: var(--brand); color: var(--ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline h4 { font-size: 15px; font-weight: 800; margin-top: 3px; }
.timeline .pendiente h4 { color: var(--muted); font-weight: 700; }
.timeline p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.timeline .when { align-self: start; margin-top: 2px; }
.ficha-coche .foto { aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; width: 100%; background: var(--line-2); }
.ficha-coche .sinfoto { aspect-ratio: 4 / 3; border-radius: 10px; background: var(--line-2); display: grid; place-items: center; color: var(--faint); font-size: 13px; font-weight: 600; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-top: 14px; font-size: 13px; }
.specs span { color: var(--muted); display: block; }
.specs b { display: block; font-size: 14px; }
.specs-extra { border-top: 1px solid var(--line-2); margin-top: 14px; padding-top: 12px; font-size: 12.5px; color: var(--muted); }
.specs-extra b { color: var(--ink); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.galeria a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--line-2); }
.galeria img { width: 100%; height: 100%; object-fit: cover; }
.vista-equipo { background: var(--brand); color: var(--ink); text-align: center; font-weight: 700; font-size: 13.5px; padding: 8px 16px; }
.vista-equipo a { color: var(--ink); }
.selector-exp { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.selector-exp a { text-decoration: none; }

/* ---------- Acceso ---------- */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); }
.acceso .lado { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; }
.acceso .lado .logo img { height: 26px; width: auto; }
.acceso .lado .msg { margin: auto 0; max-width: 520px; }
.acceso .lado h1 { font-size: 46px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; }
.acceso .lado p { color: #CFCDC8; font-size: 17px; margin-top: 18px; line-height: 1.6; }
.acceso .lado ul { list-style: none; padding: 0; margin: 26px 0 0; }
.acceso .lado li { display: flex; gap: 12px; align-items: center; font-weight: 600; margin-top: 10px; }
.acceso .lado li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.acceso .lado .pie { color: #8E8B85; font-size: 13px; }
.acceso .form-lado { display: grid; place-items: center; padding: 32px 16px; }
.acceso .caja { width: 100%; max-width: 390px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 24px; }
.acceso .caja h2 { font-size: 26px; font-weight: 800; }
.acceso .caja .intro { color: var(--muted); margin: 6px 0 20px; }
.acceso .caja .campo + .campo { margin-top: 16px; }
.acceso .caja .btn { margin-top: 20px; min-height: 50px; font-size: 16px; }
.acceso .enlaces { text-align: center; margin-top: 16px; font-size: 14px; }
.acceso .enlaces a { font-weight: 700; }
.acceso .otro { border-top: 1px solid var(--line-2); margin-top: 18px; padding-top: 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.acceso .logo-movil { display: none; }
@media (max-width: 860px) {
  .acceso { grid-template-columns: 1fr; }
  .acceso .lado { padding: 28px 20px 30px; }
  .acceso .lado .msg { margin: 26px 0 0; }
  .acceso .lado h1 { font-size: 32px; }
  .acceso .lado p { font-size: 15px; }
  .acceso .lado ul, .acceso .lado .pie { display: none; }
  .acceso .caja { padding: 24px 20px 20px; }
}

/* ---------- Leads ---------- */
.vistas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.vistas a { text-decoration: none; padding: 7px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); }
.vistas a span { color: var(--faint); margin-left: 4px; font-weight: 700; }
.vistas a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.vistas a[aria-current="page"] span { color: #B9B6AF; }
.buscador { display: flex; gap: 8px; }
.buscador input { min-height: 40px; padding: 8px 12px; }
.lead-row .contactos { display: flex; gap: 6px; margin-top: 6px; }
.lead-row .ultima { color: var(--muted); font-size: 13px; margin-top: 3px; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-accion { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; background: var(--panel); }
.mini-accion:hover { border-color: #C9C4B9; }
.mini-accion.wa { color: #12703C; }
.estados-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.estado-btn { font: inherit; font-size: 13px; font-weight: 700; padding: 7px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.estado-btn:hover { border-color: var(--ink); }
.estado-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.rapidos { display: flex; gap: 6px; flex-wrap: wrap; }
.rapidos label { margin: 0; }
.rapidos input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rapidos span { display: inline-block; font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; background: var(--panel); }
.rapidos input[type=radio]:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.rapidos input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.datos-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; font-size: 14px; }
.datos-lead span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.datos-lead b { font-weight: 700; overflow-wrap: anywhere; }
.origenes { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.origenes li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.origenes li:last-child { border: 0; }

/* ---------- Presupuestador ---------- */
.pres-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1040px) { .pres-grid { grid-template-columns: minmax(0, 1fr); } }
.pres-total { position: sticky; top: 12px; z-index: 4; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 16px; }
.pres-total .t { margin-right: auto; }
.pres-total .t span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.pres-total .t b { display: block; font-size: 26px; font-weight: 800; color: var(--brand-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.xrow { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #FBFAF8; display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; }
.xrow + .xrow { margin-top: 10px; }
.xrow .full { grid-column: 1 / -1; }
.xrow .pie { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.preview-pdf { width: 100%; aspect-ratio: 210 / 297; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.vigilar { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 12px; }
.vigilar b { display: block; margin-bottom: 4px; color: var(--brand-ink); }
.vigilar ul { margin: 0; padding-left: 18px; }

/* ---------- Varios ---------- */
.copiable { display: flex; gap: 8px; align-items: center; background: #F6F4F0; border-radius: 9px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }
.sep { border: 0; border-top: 1px solid var(--line-2); margin: 18px 0; }
.lista-simple { list-style: none; padding: 0; margin: 0; }
.lista-simple li { padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.lista-simple li:last-child { border-bottom: 0; }
.lista-simple a { color: var(--ink); font-weight: 700; text-decoration: none; }
.lista-simple a:hover { text-decoration: underline; }
.peligro { border-color: #F0C3BF; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top, .nav, .actions, .btn, form { display: none !important; } body { background: #fff; } .card { border: 0; } }

/* Editar expediente */
.fase-fila { grid-template-columns: 150px minmax(0, 1fr); margin-bottom: 10px; }
@media (max-width: 640px) { .fase-fila { grid-template-columns: minmax(0, 1fr); } }
.barra-guardar { margin-top: 20px; position: sticky; bottom: 0; background: var(--panel); padding: 12px 0; border-top: 1px solid var(--line-2); }
.rapidos input.fecha-libre { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; }

/* Fotos por álbum (panel interno) */
.fotos-barra { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel); padding: 10px 0; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.fotos-barra select { width: auto; min-height: 36px; padding: 6px 32px 6px 10px; font-size: 14px; }
.fotos-barra [data-contador] { font-weight: 700; min-width: 110px; }
.album-int { margin-top: 14px; }
.album-cab { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.album-cab .link-btn { margin-left: auto; }
.album-int .vacio { margin: 0 0 4px; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.foto-sel { position: relative; display: block; margin: 0; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: var(--line-2); cursor: pointer; border: 2px solid transparent; }
.foto-sel img { width: 100%; height: 100%; object-fit: cover; }
.foto-sel.oculta img { opacity: .45; }
.foto-sel .heic { display: grid; place-items: center; height: 100%; font-size: 12px; font-weight: 800; color: var(--muted); }
.foto-sel input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; accent-color: var(--brand); z-index: 2; margin: 0; }
.foto-sel:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.foto-sel .marcas { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; }
.foto-sel .marcas .pill { font-size: 11px; padding: 2px 7px; }
.foto-sel .ver { position: absolute; top: 4px; right: 4px; background: rgba(24,25,27,.65); color: #fff; text-decoration: none; border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; }
/* Fotos por álbum (área del cliente) */
.album-cli + .album-cli { margin-top: 26px; }
.album-cli h3 { margin-bottom: 12px; }
.album-cli h3 span { color: var(--muted); font-weight: 600; font-size: 14px; }

/* Claridad y manejo cómodo desde el móvil */
html { scroll-padding-top: 16px; }
h1, h2, h3, h4, .meta, .specs b, .timeline p, .siguiente b { overflow-wrap: anywhere; }
.btn-salir, .nav a, .cuenta { min-height: 40px; display: inline-flex; align-items: center; }
.pagos .imp small { display: block; font-size: 12px; font-weight: 600; }
.pago-resumen { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 0; margin-top: 8px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pago-resumen strong { color: var(--ink); font-size: 21px; font-variant-numeric: tabular-nums; }
.banco + [data-copiar] { margin-top: 10px; }
.password-campo { position: relative; }
.password-campo input { padding-right: 82px; }
.password-ver { position: absolute; right: 3px; top: 3px; bottom: 3px; padding: 0 10px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 6px; cursor: pointer; }
.password-ver:hover { background: var(--line-2); }
.galeria .galeria-archivo { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; gap: 5px; text-align: center; color: var(--ink-2); text-decoration: none; }
.galeria-archivo span { font-size: 12px; overflow-wrap: anywhere; }
.galeria-archivo small { font-size: 11px; color: var(--muted); }
.drop:focus-within { border-color: var(--brand-ink); outline: 2px solid var(--brand); outline-offset: 2px; }
.visor-fotos { width: min(1000px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); }
.visor-fotos::backdrop { background: rgba(0, 0, 0, .8); }
.visor-cab, .visor-pie { display: flex; align-items: center; gap: 10px; }
.visor-cab { justify-content: space-between; margin-bottom: 12px; }
.visor-cab p { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.visor-cab button { flex: none; }
.visor-imagen { height: min(65vh, 680px); display: grid; place-items: center; border-radius: 10px; background: var(--bg); overflow: hidden; }
.visor-imagen img { width: 100%; height: 100%; object-fit: contain; }
.visor-pie { justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.visor-pie [data-posicion] { font-size: 13px; color: var(--muted); }
.visor-pie a { margin-left: auto; }
@media (pointer: coarse) {
  .btn, .btn.sm, .btn-salir, .nav a, .link-btn, .mini-accion, .estado-btn, .fase-btn, .vis, .rapidos span, .cuenta, .vistas a { min-height: 44px; }
  .link-btn { display: inline-flex; align-items: center; }
  .tareas .x { opacity: 1; }
  .foto-sel .ver { width: 38px; height: 38px; }
  .doc-more summary { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
}
@media (max-width: 640px) {
  input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=search], select, textarea, .add-row input, .rapidos input.fecha-libre { font-size: 16px; }
  .wrap { padding: 16px 12px 40px; }
  .card { padding: 16px; }
  .top-in { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .top .logo img { max-width: 168px; height: auto; }
  .chip-interno { display: none; }
  .top-r { gap: 8px; }
  .top a.cuenta { font-size: 12px; }
  .top-cliente .top-r .quien { display: none; }
  .cl-hero h1 { font-size: 26px; }
  .cl-hero .siguiente { padding: 14px; }
  .siguiente .btn { width: 100%; }
  .tabs { margin-top: 18px; }
  .tabs a { padding: 12px 10px; font-size: 13px; }
  .timeline li { grid-template-columns: 26px minmax(0, 1fr); row-gap: 6px; padding-bottom: 22px; }
  .timeline .when { grid-column: 2; justify-self: start; white-space: normal; }
  .galeria { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc { flex-wrap: wrap; gap: 8px; }
  .doc .nm { flex-basis: calc(100% - 56px); }
  .doc > .btn, .doc > form { margin-left: 52px; }
  .table.responsive td { overflow-wrap: anywhere; }
  .table.responsive td > * { min-width: 0; }
  .fotos-barra select { max-width: 100%; }
  .visor-fotos { padding: 12px; }
  .visor-pie { gap: 6px; }
  .visor-pie .btn { padding: 9px; font-size: 13px; }
  .acceso .lado { padding: 24px 20px; }
  .acceso .lado .msg { margin-top: 20px; }
  .acceso .lado h1 { font-size: 28px; }
}
@media (max-width: 380px) {
  .top .logo img { max-width: 145px; }
  .top-r { gap: 5px; }
  .btn-salir { padding-left: 8px; padding-right: 8px; }
  .tabs a { padding-left: 8px; padding-right: 8px; }
}

/* Agenda del equipo: una cola de trabajo compartida, legible en el móvil. */
.agenda-cab { align-items: center; }
.agenda-cab > div { min-width: 0; }
.agenda-filtros { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) auto; align-items: end; gap: 16px; margin-bottom: 16px; }
.agenda-filtros > * { min-width: 0; }
.agenda-filtros input, .agenda-filtros select { max-width: 100%; }
.agenda-filtros .actions { padding-bottom: 2px; }
.agenda-resumen { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.agenda-resumen .kpi { min-width: 0; }
.agenda-resumen .kpi span { display: block; overflow-wrap: anywhere; }
.agenda-resumen .agenda-activa { border-color: var(--brand); background: var(--brand-softer); box-shadow: inset 0 0 0 1px var(--brand); }
.agenda-resumen .agenda-activa span { color: var(--ink); }
.agenda-lista { list-style: none; padding: 0; margin: 0; }
.agenda-tarea { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 260px); align-items: start; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line-2); }
.agenda-tarea:first-child { border-top: 0; padding-top: 4px; }
.agenda-tarea:last-child { padding-bottom: 4px; }
.agenda-tarea-datos, .agenda-tarea-acciones { min-width: 0; }
.agenda-tarea-datos h3 { margin: 5px 0 6px; line-height: 1.4; }
.agenda-tarea-datos > p { font-size: 13px; overflow-wrap: anywhere; }
.agenda-tarea-datos > .eyebrow { font-size: 11px; }
.agenda-tarea-datos a { font-weight: 700; text-underline-offset: 3px; }
.agenda-tarea-datos .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.agenda-tarea .pill.danger { color: var(--bad); background: var(--bad-soft); }
.agenda-hecha .agenda-tarea-datos h3 { color: var(--muted); text-decoration: line-through; }
.agenda-tarea-acciones > form .btn, .agenda-tarea-acciones > a.btn { width: 100%; white-space: normal; }
.agenda-editar { margin-top: 8px; }
.agenda-editar summary { display: inline-flex; align-items: center; min-height: 36px; line-height: 1.5; }
.agenda-editar summary::before { content: "+"; margin-right: 7px; text-decoration: none; font-weight: 800; }
.agenda-editar[open] summary::before { content: "−"; }
.agenda-editar form { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.agenda-editar form label:not(:first-child) { margin-top: 10px; }
.agenda-editar input, .agenda-editar select { min-width: 0; max-width: 100%; }
@media (max-width: 860px) {
  .agenda-filtros { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .agenda-filtros .actions { grid-column: 1 / -1; padding: 0; }
  .agenda-resumen { gap: 8px; }
  .agenda-resumen .kpi { padding: 12px; }
}
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; overflow-x: visible; }
  .nav a { font-size: 13px; padding-left: 10px; padding-right: 10px; }
  .agenda-cab { gap: 12px; }
  .agenda-cab h1 { font-size: 25px; }
  .agenda-cab p { font-size: 14px; }
  .agenda-filtros { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .agenda-filtros .actions .btn { flex: 1; }
  .agenda-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-resumen .kpi b { font-size: 26px; }
  .agenda-resumen .kpi:last-child { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .agenda-resumen .kpi:last-child b { margin-top: 0; }
  .agenda-tarea { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .agenda-tarea-acciones { padding-left: 12px; border-left: 2px solid var(--line); }
  .agenda-editar summary { min-height: 44px; }
  .agenda-grupo .card-head h2 { line-height: 1.35; }
}

/* ===================== v1.2 ===================== */
.chip-interno .ver { opacity: .7; font-weight: 700; margin-left: 2px; }
.copiable { overflow-wrap: anywhere; word-break: break-all; font-size: 13.5px; }
.banner-correo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Seguimiento: contrato, papeles y entrega */
.seguimiento .seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.seguimiento #papeles { grid-column: 1 / -1; order: 3; }
.seguimiento #papeles .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.seguimiento #papeles .seg-form > :not(.checklist) { max-width: 320px; }
@media (max-width: 760px) { .seguimiento .seg-grid, .seguimiento #papeles .checklist { grid-template-columns: minmax(0, 1fr); } }
.seg-bloque { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--brand-softer); scroll-margin-top: 80px; }
.seg-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg-form { display: grid; gap: 8px; margin-top: 10px; }
.seg-form label:not(.check) { margin: 4px 0 0; font-size: 13px; }
.seg-form .btn { justify-self: start; margin-top: 4px; }
.estado-pill { font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.est-enviado, .ent-propuesta { background: var(--brand-soft); color: var(--brand-ink); }
.est-firmado, .ent-confirmada { background: var(--ok-soft); color: var(--ok); }
.ent-cambio { background: var(--bad-soft); color: var(--bad); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.checklist .check { align-items: flex-start; font-size: 13.5px; line-height: 1.35; padding: 4px 0; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.checklist input:checked + span small { text-decoration: none; display: inline; }
.barra-mini { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.barra-mini span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }

/* Verificación de datos de pago */
.verif { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--brand-softer); border: 1px dashed #F6D2AA; }
.verif.ok { background: var(--ok-soft); border: 1px solid #C6E2D1; }
.verif.roto { background: var(--bad-soft); border: 1px solid #F0C3BF; }
.verif p { margin: 0; }
.verif select { min-height: 36px; padding: 6px 30px 6px 10px; font-size: 13px; }
.verif-cli { margin: 14px 0 8px; font-size: 13.5px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--brand-soft); color: #7A3E00; }
.verif-cli.ok { background: var(--ok-soft); color: #14532F; }

/* Invitación */
.invitacion { margin-top: 12px; padding: 12px; border-radius: var(--r); background: var(--brand-softer); border: 1px solid #F6D2AA; }
.invitacion p { margin: 0 0 8px; }

/* Área del cliente: hitos (entrega, ITV, contrato) */
.hitos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.hito { position: relative; overflow: hidden; scroll-margin-top: 90px; }
.hito::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line); }
.hito h3 { font-size: 19px; margin: 2px 0 4px; }
.hito.entrega-cli.ent-propuesta { background: linear-gradient(180deg, var(--brand-softer), var(--panel)); }
.hito.entrega-cli.ent-propuesta::before { background: var(--brand); }
.hito.entrega-cli.ent-confirmada::before { background: var(--ok); }
.hito-ok { color: var(--ok); font-weight: 800; margin: 8px 0 0; }
.hito-acciones { margin-top: 12px; }
.hito-cambio { margin-top: 10px; }
.hito-cambio form { display: grid; gap: 8px; margin-top: 8px; }
.hito-cambio .btn { justify-self: start; }

/* Tarjeta para instalar como app */
.instalar-app { display: flex; align-items: center; gap: 12px; margin-top: 18px; position: sticky; bottom: 12px; box-shadow: 0 8px 24px rgba(24,25,27,.14); }
.instalar-app img { border-radius: 11px; flex: none; }
.instalar-app > div { flex: 1; min-width: 0; display: grid; }
.instalar-app[hidden] { display: none; }

/* Comparador de presupuestos */
.cmp-check { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.tabla-scroll { overflow-x: auto; margin-top: 14px; -webkit-overflow-scrolling: touch; }
.tabla-comparar { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14px; }
.tabla-comparar th, .tabla-comparar td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tabla-comparar thead th { font-size: 15px; background: var(--ink); color: #fff; }
.tabla-comparar thead th:first-child { background: transparent; }
.tabla-comparar thead th .pill { margin-top: 4px; }
.tabla-comparar tbody th { color: var(--muted); font-weight: 600; width: 190px; }
.tabla-comparar tr.total td, .tabla-comparar tr.total th { font-size: 18px; font-weight: 800; color: var(--ink); background: var(--brand-soft); border-bottom: 0; }

/* Bandeja de salida */
.tabla-correos { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.tabla-correos th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); }
.tabla-correos td { padding: 9px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.nowrap { white-space: nowrap; }
.est-mail { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--line-2); }
.est-mail.ok { background: var(--ok-soft); color: var(--ok); }
.est-mail.pend { background: var(--brand-soft); color: var(--brand-ink); }
.est-mail.mal { background: var(--bad-soft); color: var(--bad); }

@media print {
  .no-print, .instalar-app { display: none !important; }
  .comparar .card { box-shadow: none; padding: 0; }
  .tabla-comparar thead th { background: #fff !important; color: #000; border-bottom: 2px solid #000; }
  .tabla-scroll { overflow: visible; }
}

/* Herramientas */
.herr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.herr { display: grid; gap: 8px; align-content: start; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.herr:hover { border-color: var(--brand); transform: translateY(-2px); }
.herr h2 { font-size: 20px; margin: 4px 0 0; }
.herr p { margin: 0; color: var(--muted); font-size: 14px; }
.herr-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; }
.herr-ir { color: var(--brand-ink); font-weight: 800; font-size: 14px; margin-top: 6px; }
.herr-pag .eyebrow { color: var(--brand-ink); }
.c576 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .c576 { grid-template-columns: minmax(0, 1fr); } }
.paso { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--ink); font-size: 12px; margin-right: 4px; }
.match { margin-top: 10px; font-size: 13.5px; background: var(--brand-softer); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; color: var(--muted); }
.match b { color: var(--ink); }
.liquidacion, .recibo { position: sticky; top: 16px; }
@media (max-width: 900px) { .liquidacion, .recibo { position: static; } }
.formula { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.veredicto { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 10px 0 14px; }
.veredicto .lbl { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.veredicto b { font-size: clamp(32px, 6vw, 44px); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.estado-pill.ep1 { background: var(--ok-soft); color: var(--ok); }
.estado-pill.ep2 { background: #FBF3D6; color: #8A6400; }
.estado-pill.ep3 { background: var(--brand-soft); color: var(--brand-ink); }
.estado-pill.ep4 { background: var(--bad-soft); color: var(--bad); }
.tramos-576 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
@media (max-width: 520px) { .tramos-576 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tramo { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; font-size: 12px; display: grid; gap: 2px; color: var(--muted); }
.tramo b { font-size: 15px; color: var(--ink); }
.tramo.on { border-width: 2px; color: var(--ink); }
.tramo.on.t1 { border-color: var(--ok); background: var(--ok-soft); }
.tramo.on.t2 { border-color: #D9A400; background: #FBF3D6; }
.tramo.on.t3 { border-color: var(--brand); background: var(--brand-soft); }
.tramo.on.t4 { border-color: var(--bad); background: var(--bad-soft); }
.calc-576 { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 14px; }
.calc-576 td { padding: 8px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.calc-576 td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; font-weight: 700; }
.calc-576 .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.calc-576 tr.tot td { border-bottom: 0; font-size: 17px; font-weight: 800; padding-top: 12px; }
.sec-c { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line-2); }
.sec-c:first-child { border-top: 0; padding-top: 0; }
.sec-c h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.escala { display: grid; gap: 4px; }
.barra-co2 { position: relative; display: grid; grid-template-columns: 120fr 40fr 40fr 60fr; height: 10px; border-radius: 3px; }
.barra-co2 i:nth-child(1) { background: #2E9D5B; } .barra-co2 i:nth-child(2) { background: #E0B300; } .barra-co2 i:nth-child(3) { background: var(--brand); } .barra-co2 i:nth-child(4) { background: var(--bad); }
.barra-co2 span { position: absolute; top: -5px; width: 3px; height: 20px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); transition: left .2s; }
.escala .ticks { display: grid; grid-template-columns: 120fr 40fr 40fr 60fr; font-size: 11px; color: var(--muted); }
.recibo { border-top: 6px solid var(--brand); }
.recibo-total { font-size: clamp(40px, 7vw, 56px); font-weight: 800; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.recibo-lineas { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px dashed var(--line); }
.recibo-lineas li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.recibo-lineas .k { font-weight: 600; }
.recibo-lineas .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.recibo-lineas .d { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.recibo-lineas li.cero .v { color: var(--muted); font-weight: 500; }
.recibo-cmp { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--brand-soft); font-weight: 700; }
.mini-576 { margin-top: 14px; padding: 14px; border-radius: var(--r); border: 1px solid #F6D2AA; background: var(--brand-softer); }
.mini-576 .card-head { margin-bottom: 10px; }
.lead-destino { width: auto; min-height: 40px; max-width: 260px; }
.herr-grid .card + .card, .c576 .card + .card { margin-top: 0; }
.c576 > .stack { display: grid; gap: 16px; }

/* v1.3 · pago con enlace y sección Web */
.pago-pag { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.pago-caja { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 20px 50px -30px rgba(0,0,0,.35); }
.pago-caja h1 { font-size: 24px; margin: 4px 0 10px; }
.pago-importe { font-size: 44px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.pago-ok { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 28px; font-weight: 800; margin-bottom: 14px; }
.servicio-edit { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.servicio-edit summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.servicio-edit[open] { border-color: var(--brand); }
.pagar-tarjeta { display: inline-flex; margin-top: 6px; }
.enlace-pago { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--brand-softer); border: 1px solid #F6D2AA; }
.grid-main > .card + .card, .grid-main > section + section { margin-top: 0; }
.web-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.web-foto { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; background: var(--panel); }
.web-foto.es-portada { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.web-foto img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.web-foto .pill { position: absolute; top: 8px; left: 8px; }
.web-foto form { padding: 10px; display: grid; gap: 8px; }
.web-foto input, .web-foto select { min-height: 36px; padding: 6px 10px; font-size: 14px; }

/* 1.3.3 · Calculadora del 576 con IA */
.aviso-ia { margin: 10px 0 0; font-size: 13px; background: #FBF3D6; color: #6B4E00; border-radius: var(--r-sm); padding: 8px 10px; }
.aviso-ia a { color: inherit; font-weight: 700; }
.drop-576 { margin-top: 10px; border: 1.5px dashed var(--line); border-radius: var(--r-sm); padding: 12px; display: flex; gap: 12px; align-items: center; cursor: pointer; font-size: 13.5px; }
.drop-576.over, .drop-576:hover { border-color: var(--brand); background: var(--brand-softer); }
.drop-576 img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; }
.drop-576 > div { flex: 1; min-width: 0; }
.conf { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.conf.alta { background: var(--ok-soft); color: var(--ok); }
.conf.media { background: #FBF3D6; color: #8A6400; }
.conf.baja { background: var(--bad-soft); color: var(--bad); }
