/* html { font-size } vive en colors_and_type.css (una sola fuente). */

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
}

/* ===========================================================================
   HEADER FIJO superior + layout de pagina. Solo tokens.
   =========================================================================== */
.app-header { position: sticky; top: 0; z-index: 100; background: var(--panel); box-shadow: var(--shadow-md); }

/* Franja superior de marca (teléfono + enlaces + idioma). Solo si hay datos. */
.topstrip { background: var(--pv-primary-deep); color: rgba(255,255,255,.88); font-size: 12.5px; font-weight: 500; }
.topstrip-inner { max-width: 1280px; margin: 0 auto; padding: 7px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topstrip-phone { display: inline-flex; align-items: center; gap: 7px; }
.topstrip-phone i { font-size: 11px; opacity: .85; }
.topstrip-links { display: flex; align-items: center; gap: 20px; }
.topstrip-links a { color: rgba(255,255,255,.88); text-decoration: none; }
.topstrip-links a:hover { color: #fff; }
.topstrip-lang { color: #fff !important; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.topstrip-lang i { font-size: 11px; }

.header-accent { height: 3px; background: var(--brand); }
.header-bar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: 16px; padding: 12px 24px; max-width: 1280px; margin: 0 auto;
}

/* Marca (izquierda). */
.header-brand { display: flex; align-items: center; gap: 12px; justify-self: start; text-decoration: none; }
.header-brand img { height: 40px; width: auto; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; color: var(--pv-blue-600); font-size: 1.3rem; letter-spacing: -.02em; }
.brand-sub { font-size: .62rem; color: var(--pv-muted-extra); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }

/* Nav en píldoras (centro). */
.header-nav {
    display: flex; align-items: center; gap: 6px; justify-self: center;
    background: var(--soft); padding: 5px; border-radius: var(--radius-pill);
}
.header-nav > a, .header-admin > a {
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem;
    padding: 9px 18px; border-radius: var(--radius-pill); white-space: nowrap; cursor: pointer; transition: all .15s;
}
.header-nav > a:hover, .header-admin > a:hover { color: var(--text); }
.header-nav > a.active, .header-admin > a.active { color: #fff; background: var(--pv-accent); box-shadow: var(--pv-shadow-hover-soft); }
.header-admin { display: inline-flex; }
.header-admin .dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.header-admin .dropdown-item { font-size: .88rem; color: var(--text-label); }
.header-admin .dropdown-item:hover { background: var(--brand-50); color: var(--brand-dark); }

/* Usuario (derecha) con avatar. */
.header-user { display: flex; align-items: center; gap: 12px; justify-self: end; }
.hu-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: none; color: #fff;
    background: var(--pv-grad-summary); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.hu-meta { display: flex; flex-direction: column; line-height: 1.2; }
.header-user .hu-name { font-weight: 700; color: var(--text); font-size: 13.5px; white-space: nowrap; }
.header-user .hu-role { font-size: 11.5px; color: var(--pv-muted-extra); font-weight: 500; }
.hu-logout-form { margin: 0; display: inline-flex; }
.hu-exit-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--soft); color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s;
}
.hu-exit-btn:hover { background: var(--brand-50); color: var(--brand); }

.page { max-width: 1280px; margin: 0 auto; padding: 24px; }
.app-footer {
    padding: 16px 24px; text-align: center; color: var(--muted); font-size: .8rem;
    border-top: 1px solid var(--line); background: var(--panel);
}

/* Badge numerado de seccion (1 MEDIDAS, 2 PROPUESTAS) */

.sec-badge {
    width: 24px; height: 24px; flex-shrink: 0;
    background: var(--brand); color: white;
    border-radius: var(--radius-sm); font-weight: 700; font-size: .8rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.sec-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-label); }

@media (max-width: 768px) {
    .header-bar { grid-template-columns: 1fr 1fr; height: auto; padding: 8px 16px; gap: 8px; }
    .header-brand { grid-column: 1; justify-self: start; }
    .header-user { grid-column: 2; }
    .header-nav { grid-column: 1 / -1; overflow-x: auto; }
    .page { padding: 16px; }
}

/* ===========================================================================
   COMPONENTES BASE del sistema de diseño (panel, botones, badges).
   =========================================================================== */
.panel {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}
.panel-pad { padding: 20px; }
.panel-head {
    padding: 14px 20px; border-bottom: 1px solid var(--line);
    font-weight: 700; color: var(--text);
}

.btn.primary, .btn-pv-primary {
    background: var(--brand); color: white; border: none;
    border-radius: var(--radius-sm); padding: 10px 18px;
    font-weight: 600; font-size: .9rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 1px 2px var(--brand-shadow); transition: background .12s;
    text-decoration: none;
}
.btn.primary:hover, .btn-pv-primary:hover { background: var(--brand-dark); color: white; }
.btn.ghost, .btn-pv-ghost {
    background: var(--panel); color: var(--text-label);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 9px 16px; font-weight: 600; font-size: .9rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    transition: background .12s, border-color .12s;
}
.btn.ghost:hover, .btn-pv-ghost:hover { background: var(--soft); border-color: var(--muted); color: var(--text); }

/* ===========================================================================
   PUENTE BOOTSTRAP → design system. Las páginas de gestión usan primitivos
   de Bootstrap (card, table, form-control, btn-outline-*); aquí se les da el
   MISMO lenguaje visual que .panel/.data-table/.btn — solo tokens, para que
   los temas de marca los gobiernen igual que al resto.
   =========================================================================== */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: var(--soft-2); border-bottom: 1px solid var(--line); color: var(--text); font-weight: 700; }
.card-footer { background: var(--soft-2); border-top: 1px solid var(--line); }

.table { --bs-table-color: var(--text); --bs-table-border-color: var(--line); }
.table > thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700;
}
.table-light { --bs-table-bg: var(--soft-2); }

.form-control, .form-select {
    border: 1.5px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.form-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.input-group-text { border: 1.5px solid var(--line); background: var(--soft-2); color: var(--muted); font-size: .85rem; }

.btn { border-radius: var(--radius-sm); font-weight: 600; }
/* "Crear/Guardar" en verde no existe en la paleta: el éxito de acción es el primario de marca. */
.btn-success {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-red-deep); --bs-btn-active-border-color: var(--brand-red-deep);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
}
.btn-outline-secondary {
    --bs-btn-color: var(--text-label); --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--soft); --bs-btn-hover-border-color: var(--muted);
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--soft); --bs-btn-active-border-color: var(--muted);
}
.btn-outline-danger {
    --bs-btn-color: var(--pv-danger); --bs-btn-border-color: var(--pv-danger-bg);
    --bs-btn-hover-color: var(--pv-danger); --bs-btn-hover-bg: var(--pv-danger-bg); --bs-btn-hover-border-color: var(--pv-danger);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--pv-danger); --bs-btn-active-border-color: var(--pv-danger);
}

.btn-outline-success {
    --bs-btn-color: var(--pv-success-text); --bs-btn-border-color: var(--pv-success-border-soft);
    --bs-btn-hover-color: var(--pv-success-text); --bs-btn-hover-bg: var(--pv-success-bg); --bs-btn-hover-border-color: var(--pv-success);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--pv-success); --bs-btn-active-border-color: var(--pv-success);
}

/* Página estrecha (documentos, bitácora, salud) y media (config): mismo layout, menos ancho. */
.page-narrow { max-width: 900px; margin: 0 auto; }
.page-mid { max-width: 1020px; margin: 0 auto; }

/* AdminConfig: cabeceras de columna de las listas editables + celda de acciones. */
.cfg-cols { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
/* Inputs CE del vidrio (Ug/Ψ/Rw/g/TL): compactos en la fila de edición. */
.cfg-ce-num { width: 110px; flex: 0 0 auto; }
.cfg-ce-sub { margin-top: -2px; }
/* Prestaciones CE en el detalle del presupuesto (Uw + clases; NPD si no hay dato). */
.ce-prestaciones { color: var(--muted); display: flex; gap: 4px; flex-wrap: wrap; align-items: baseline; margin-top: 2px; }
.ce-input { width: 110px; flex: 0 0 auto; }
.ce-dir { max-width: 480px; }
.cfg-acciones { width: 150px; }
.cfg-star { color: var(--pv-warning); font-size: .7rem; vertical-align: middle; }

.badge-pv { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: .74rem; font-weight: 600; }
.badge-estado-borrador  { background: var(--soft); color: var(--text-label); }
.badge-estado-guardado  { background: var(--pv-info-bg); color: var(--pv-info-text); }
.badge-estado-enviado   { background: var(--pv-warning-bg); color: var(--pv-warning-text); }
.badge-estado-aceptado  { background: var(--pv-success-bg); color: var(--pv-success-text); }
.badge-estado-rechazado { background: var(--pv-danger-bg); color: var(--pv-danger); }
.badge-tag { background: var(--soft-2); color: var(--text-label); border: 1px solid var(--line); }

/* Bitácora: tarjetas de tarea con hover suave + barra de progreso tokenizada. */
.task-card { transition: box-shadow .15s ease, transform .15s ease; }
.task-card:hover { box-shadow: 0 .35rem 1rem rgba(0,0,0,.08); transform: translateY(-1px); }
.progress { background: var(--soft); }
.progress .progress-bar { background-color: var(--pv-success); }

/* ── Editor de esquemas de modelo (/Admin/Esquemas) ─────────────────────── */
.esq-draw { width: 56px; height: 44px; display: flex; align-items: center; justify-content: center; }
.esq-draw .win-svg, .esq-preview .win-svg { height: 40px; width: auto; }
.esq-preview { display: inline-flex; align-items: center; min-width: 40px; }
.esq-preview svg { max-height: 44px; max-width: 90px; }
.esq-editor > summary { list-style: none; cursor: pointer; }
.esq-editor > summary::-webkit-details-marker { display: none; }
.esq-editor-body { text-align: left; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft-2); max-width: 440px; }
.esq-svg-input { font-family: var(--pv-font-mono); font-size: .78rem; }

/* ── Tabla de resultados ─────────────────────────────────────────────────── */

.price-cell {
    font-weight: 700;
    color: var(--brand-dark);
    cursor: pointer;
    white-space: nowrap;
}

.excl-row { font-size: .74rem; color: var(--pv-muted-extra); padding: 2px 0; }
.excl-row i { color: var(--pv-indigo-300); }

/* ── Win SVG ─────────────────────────────────────────────────────────────── */

.win-svg { width: auto; height: 40px; }   /* alto fijo, ancho según el viewBox proporcional */

.variant-mini .win-svg { height: 26px; }

/* winSvg: colores por token (sin hex en el JS). El stroke-width del marco va en el atributo. */
.win-svg .ws-frame  { fill: none; stroke: var(--svg-frame); }
.win-svg .ws-cell   { fill: var(--svg-glass); stroke: var(--svg-cell-line); stroke-width: 1; }
.win-svg .ws-line   { stroke: var(--svg-line); stroke-width: 1.4; fill: none; }
.win-svg .ws-handle { fill: var(--svg-handle); }
.win-svg .ws-arrow  { stroke: var(--svg-arrow); stroke-width: 2; fill: none; }

/* ===========================================================================
   CARRITO (columna derecha de /Presupuesto). Solo tokens.
   =========================================================================== */

.win-flash { box-shadow: 0 0 0 3px var(--brand-ring); transition: box-shadow .2s; }

/* ===========================================================================
   TABLERO DE INICIO (/Index) + utilidades de tabla. Solo tokens.
   =========================================================================== */
.greeting-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 14px;
}
.kpi-ico { width: 44px; height: 44px; border-radius: var(--radius-sm); display: inline-flex;
    align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi-ico-red  { background: var(--brand-50); color: var(--brand); }
.kpi-ico-warn { background: var(--pv-warning-bg); color: var(--pv-warning-text); }
.kpi-ico-ok   { background: var(--pv-success-bg); color: var(--pv-success-text); }
.kpi-val { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.02em; }
.kpi-lbl { font-size: .78rem; color: var(--muted); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 0.9fr; gap: 24px; align-items: start; }
.dash-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.dash-link { color: var(--brand); text-decoration: none; font-size: .82rem; font-weight: 600; }
.dash-link:hover { text-decoration: underline; }
.aside-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.quick-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px;
    border-radius: var(--radius-sm); color: var(--text-label); text-decoration: none; font-weight: 600; font-size: .88rem;
    border: 1px solid var(--line); background: var(--soft-2);
}
.quick-link:hover { background: var(--brand-50); border-color: var(--pv-indigo-200); color: var(--brand-dark); }
.quick-link i { font-size: 1.05rem; }
.aside-note { background: var(--soft-2); }

/* Tabla de datos genérica */
.data-table { width: 100%; }
.tabla-mini { font-size: .8rem; }
.data-table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line);
    padding: 10px 14px; background: var(--soft-2);
}
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--soft-2); }
.btn-sm-pv { padding: 5px 12px; font-size: .8rem; }

/* Estado vacío elegante */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state i { font-size: 2.4rem; color: var(--pv-muted-extra); display: block; margin-bottom: 10px; }
.empty-state p { margin-bottom: 16px; font-size: .9rem; }

@media (max-width: 992px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-aside { position: static; }
}
@media (max-width: 560px) { .kpi-row { grid-template-columns: 1fr; } .greeting-bar { flex-direction: column; align-items: flex-start; } }

/* ===========================================================================
   HISTORIAL — cabecera + pills de filtro por estado. Solo tokens.
   =========================================================================== */
.hist-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--panel); border: 1px solid var(--line); color: var(--text-label);
    border-radius: var(--radius-pill); padding: 6px 14px; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.pill:hover { background: var(--soft); }
.pill.active { background: var(--brand); border-color: var(--brand); color: white; }
.pill-n { font-size: .72rem; font-weight: 700; background: var(--soft); color: var(--muted); border-radius: var(--radius-pill); padding: 1px 7px; }
.pill.active .pill-n { background: var(--brand-dark); color: white; }

/* Config. cliente — filas de taller */
.taller-row { border-top: 1px solid var(--line); }
.taller-row:first-of-type { border-top: none; }

/* ===========================================================================
   DETALLE DE PRESUPUESTO — aspecto de documento. Solo tokens.
   =========================================================================== */
.doc-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.doc {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-md); max-width: 820px; margin: 0 auto; overflow: hidden;
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 28px; border-bottom: 2px solid var(--brand); }
.doc-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.doc-brand img { border-radius: 6px; }
.doc-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.doc-code { font-weight: 800; font-size: 1.2rem; color: var(--brand-dark); }
.doc-meta { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.doc-client { padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--soft-2); display: flex; gap: 12px; align-items: baseline; }
.doc-client-lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

.doc-lines { margin: 0; }
.doc-lines thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 28px; border-bottom: 1px solid var(--line); }
.doc-lines tbody td { padding: 14px 28px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.doc-thumb { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

.doc-summary { padding: 16px 28px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ds-row { display: flex; justify-content: space-between; gap: 40px; min-width: 240px; font-size: .9rem; color: var(--text-label); }
.ds-total { font-size: 1.15rem; font-weight: 800; color: var(--text); border-top: 2px solid var(--line); padding-top: 8px; margin-top: 4px; }
.ds-total span:last-child { color: var(--brand-dark); }

/* Desglose de costes admin */
.cost-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.cost-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 18px; }
.cost-grid > div { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; padding: 6px 10px; background: var(--soft-2); border-radius: var(--radius-sm); }
.cg-lbl { color: var(--muted); }
.cg-strong { font-weight: 700; color: var(--text); background: var(--soft) !important; }
.cg-sub { background: transparent !important; font-size: .8rem; padding-top: 0 !important; padding-bottom: 0 !important; }
.cg-sub .cg-lbl, .cg-sub span { color: var(--pv-muted-extra); }
.persiana-detalle { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--pv-success-strong); background: var(--soft-2); border-radius: 6px; }
.cg-red span:last-child { color: var(--brand-dark); }
.cost-details { margin-top: 10px; }
.cost-details summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--brand); }

@media print {
    .app-header, .app-footer, .no-print { display: none !important; }
    .page { padding: 0; max-width: 100%; }
    .doc { box-shadow: none; border: none; max-width: 100%; }
    body { background: white; }
}
@media (max-width: 560px) { .cost-grid { grid-template-columns: 1fr; } }

/* ===========================================================================
   LOGIN (/Login) — página standalone, header simple + card centrada.
   =========================================================================== */
.login-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--bg) 0%, var(--brand-50) 100%);
    padding: 24px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-brand {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-bottom: 22px;
}
.login-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.login-brand-name { font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.01em; }
.login-brand-sub { font-size: .72rem; color: var(--muted); font-weight: 600; }

.login-card {
    background: white; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,.08); overflow: hidden;
}
.login-card-accent { height: 4px; background: linear-gradient(90deg, var(--brand) 0%, var(--pv-blue-light) 100%); }
.login-card-body { padding: 28px 28px 30px; }
.login-title { font-size: 1.35rem; font-weight: 800; color: var(--text); margin: 0 0 2px; letter-spacing: -.01em; }
.login-sub { font-size: .82rem; color: var(--muted); margin: 0 0 22px; }

.login-error {
    background: var(--brand-red-50); border: 1px solid var(--brand-red-200);
    color: var(--brand-red-deep); border-radius: 10px; padding: 10px 14px;
    font-size: .82rem; font-weight: 500; margin-bottom: 18px;
}

.login-field { margin-bottom: 16px; }
.login-label {
    display: block; font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--pv-muted-extra); margin-bottom: 6px;
}
.login-input-box {
    display: flex; align-items: center; gap: 9px;
    background: var(--pv-bg-subtle); border: 1.5px solid var(--line);
    border-radius: 12px; padding: 11px 14px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-input-box:focus-within {
    border-color: var(--brand); background: var(--brand-50);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.login-input-box i { color: var(--pv-indigo-300); font-size: .95rem; }
.login-input {
    border: none; background: transparent; outline: none; flex: 1;
    font-size: .95rem; font-weight: 500; color: var(--text);
}
.login-input::placeholder { color: var(--pv-placeholder); font-weight: 400; }

.login-submit { margin-top: 6px; padding: 11px 18px; font-size: .92rem; justify-content: center; }
.login-foot { text-align: center; color: var(--muted); font-size: .75rem; margin: 20px 0 0; }

/* Cards de propuesta (sustituyen la tabla) */

.prop-add, .prop-added {
    border: none; border-radius: 9px; font-size: .82rem; font-weight: 700;
    padding: 7px 12px; cursor: pointer; white-space: nowrap; transition: background .12s;
}
.prop-add { background: var(--brand); color: white; }
.prop-add:hover { background: var(--brand-dark); color: white; }
.prop-added { background: var(--brand-50); color: var(--brand-dark); }

/* ============================================================================
   BLOQUE 6 — Config cliente: aviso de guardado (solo tokens)
   ============================================================================ */
.cfg-aviso {
    background: var(--pv-success-bg); color: var(--pv-success-text);
    border: 1px solid var(--pv-success-text); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: .88rem; font-weight: 600;
}
.taller-row + .taller-row { border-top: 1px solid var(--line); }

/* ── B1: filtros del Historial (estado + buscador de cliente, admin) ───────── */
.hist-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hist-cliente-search { position: relative; display: inline-flex; align-items: center; }
.hist-cliente-search i { position: absolute; left: 10px; color: var(--muted); font-size: .85rem; pointer-events: none; }
.hist-cliente-search input {
    border: 1.5px solid var(--line); border-radius: var(--radius-pill);
    padding: 6px 12px 6px 30px; font-size: .85rem; min-width: 220px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.hist-cliente-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* ── B1: tabs de /AdminConfig ──────────────────────────────────────────────── */
.cfg-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.cfg-tab {
    background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
    padding: 9px 16px; font-size: .9rem; font-weight: 600; color: var(--muted); cursor: pointer;
    transition: color .12s, border-color .12s;
}
.cfg-tab:hover { color: var(--text); }
.cfg-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.cfg-pane { display: none; }
.cfg-pane.active { display: block; }

/* ── AdminConfig: edición inline por fila (vista/edición) + marca Manual ─────── */
.cfg-row .edit-mode { display: none; }
.cfg-row.editing .edit-mode { display: flex; }
.cfg-row.editing .view-mode { display: none; }
.cfg-row.editing { background: var(--vidrio-bg); border-radius: 8px; }
.badge-manual {
    display: inline-block; font-size: .62rem; font-weight: 700; vertical-align: middle;
    color: var(--vidrio-text); background: var(--vidrio-bg);
    border: 1px solid var(--vidrio-border-soft); border-radius: var(--radius-pill); padding: 1px 7px; margin-left: 6px;
}

/* ── B1: tabla de propuestas (Modelo/Sistema/Precio cliente/Acción) ────────── */
.prop-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.prop-table thead th {
    text-align: left; font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); padding: 6px 10px; border-bottom: 2px solid var(--line);
}
.prop-table tbody td { padding: 9px 10px; border-bottom: 1px solid var(--pv-bg-subtle); vertical-align: middle; }
.prop-row { transition: background .1s; }
.prop-row:hover { background: var(--soft-2); }
.prop-row.selected { background: var(--brand-50); }
.prop-modelo { display: flex; align-items: center; gap: 12px; }
.prop-svg .win-svg { height: 44px; width: auto; }
.prop-modelo-txt { display: flex; flex-direction: column; line-height: 1.25; }
.prop-modelo-name { font-weight: 700; color: var(--text); }
.prop-modelo-sub { font-size: .72rem; color: var(--muted); }

.prop-table .variant-row > td { background: var(--soft-2); padding: 8px 12px; }

/* ── Tabla pivote: una fila por modelo, una columna por sistema ─────────────── */
.prop-pivot thead th.pv-col-sys { text-align: right; }
.prop-pivot td.price-cell {
    text-align: right; cursor: pointer; white-space: nowrap;
    font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand);
    border-radius: 8px; transition: background .12s, box-shadow .12s;
}
.prop-pivot td.price-cell:hover { background: var(--brand-50); }
.prop-pivot td.price-cell.active {
    background: var(--brand-50); color: var(--brand-dark);
    box-shadow: inset 0 0 0 2px var(--brand);
}
.prop-pivot td.prop-na { text-align: right; color: var(--pv-muted-extra); font-weight: 600; }

/* ── B3: /Admin/Catalogo (filtros + tabla + form de ajuste) ────────────────── */
.cat-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.cat-filtro { display: flex; flex-direction: column; gap: 3px; }
.cat-filtro label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cat-filtro input, .cat-filtro select { min-width: 110px; }
.cat-filtro-btn { margin-left: auto; }
.cat-tabla td, .cat-tabla th { font-size: .85rem; }
.cat-ajuste { color: var(--brand-dark); font-weight: 700; }
.cat-ajuste-row > td { background: var(--brand-50); padding: 12px 16px !important; }
.cat-ajuste-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.caf { display: flex; flex-direction: column; gap: 3px; }
.caf label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.caf-grow { flex: 1; min-width: 200px; }
.caf-btns { display: flex; gap: 8px; }
.cat-del { color: var(--pv-danger); }
.cat-final { color: var(--brand); }

/* ── /Admin/Elementos: cabecera de sección + chips de activar/ocultar ──────── */
.sec-head { display: flex; align-items: center; gap: 8px; }
.elem-toggle { display: inline-flex; align-items: center; }

/* ── B4: indicador de precio con ajuste especial ───────────────────────────── */
.prop-especial { display: inline-block; margin-left: 6px; font-size: .58rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--brand-dark);
    background: var(--brand-50); border-radius: var(--radius-pill); padding: 1px 7px; vertical-align: middle; }

/* ── B1: página de error amigable ──────────────────────────────────────────── */
.error-page { display: flex; justify-content: center; padding: 48px 16px; }
.error-card { max-width: 460px; text-align: center; }
.error-icon { font-size: 2.6rem; color: var(--brand); margin-bottom: 12px; }
.error-title { font-size: 1.6rem; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.error-sub { color: var(--muted); margin: 0 0 20px; }
.error-reqid { margin: 22px 0 0; font-size: .8rem; }

/* ── Banner de suplantación (solo lectura) — tokens del tema ── */
.suplantacion-banner {
    background: var(--pv-warn-bg, var(--soft)); color: var(--pv-warn-text, var(--text));
    border-bottom: 2px solid var(--brand);
    padding: 8px 24px; font-size: .88rem; text-align: center;
    position: sticky; top: 0; z-index: 200;
}
.suplantacion-banner i { margin-right: 6px; }
.suplantacion-salir {
    border: 1px solid var(--brand); background: transparent; color: var(--brand);
    border-radius: var(--radius-pill); padding: 2px 12px; font-size: .8rem; font-weight: 600;
    cursor: pointer;
}
.suplantacion-salir:hover { background: var(--brand); color: white; }

/* ── Login: marca del despliegue (logo raster/vector + wordmark en color de marca) ── */
.login-logo { height: 52px; width: auto; border-radius: 8px; }
.login-brand-name { color: var(--pv-blue-600); font-size: 1.35rem; }
.login-brand-sub { text-transform: uppercase; letter-spacing: .12em; }

/* ── AdminConfig (B4): acciones integradas en su fila + filtro + ordenación ── */
/* Los botones de acción no saltan de línea: la fila no envuelve en escritorio y
   las columnas pueden encoger; las acciones se alinean a la derecha sin partirse. */
@media (min-width: 768px) {
    .cfg-row .row, .cfg-pane .add-form { flex-wrap: nowrap; }
    .cfg-row .row > [class^="col"] { min-width: 0; }
}
.cfg-acciones { width: auto; margin-left: auto; white-space: nowrap; flex: 0 0 auto; }
.cfg-acciones .btn { white-space: nowrap; }

/* Filtro de texto por pestaña. */
.cfg-filtro { max-width: 300px; }

/* Cabeceras ordenables (clic): cursor + flecha de dirección. */
.cfg-sortable { cursor: pointer; user-select: none; }
.cfg-sortable::after { content: "↕"; opacity: .35; margin-left: 4px; font-size: .85em; }
.cfg-sortable.asc::after  { content: "↑"; opacity: .9; }
.cfg-sortable.desc::after { content: "↓"; opacity: .9; }

/* ── Descripción enriquecida de línea (B7) — solo tokens ── */
.doc-thumb svg { width: 40px; height: 40px; }
.desc-rica ul, .desc-rica ol { margin: 2px 0 2px 18px; padding: 0; }
.desc-rica p { margin: 2px 0; }
.desc-editor summary { cursor: pointer; color: var(--brand); list-style: none; }
.desc-editor summary::-webkit-details-marker { display: none; }
.desc-toolbar { display: flex; gap: 4px; margin-bottom: 4px; }
.desc-edit-area { min-height: 64px; max-width: 420px; font-size: .85rem; }
.desc-edit-area:focus { outline: 2px solid var(--brand-ring); }
