html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

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; }
.header-accent { height: 3px; background: var(--brand); }
.header-bar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: 16px; padding: 0 24px; height: 64px;
    background: var(--panel); box-shadow: var(--shadow-md);
}
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav > a, .header-admin > a {
    color: var(--text-label); text-decoration: none; font-weight: 600; font-size: .9rem;
    padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap; cursor: pointer;
}
.header-nav > a:hover, .header-admin > a:hover { background: var(--soft); color: var(--text); }
.header-nav > a.active, .header-admin > a.active { color: var(--brand); background: var(--brand-50); }
.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); }

.header-brand { display: flex; align-items: center; gap: 10px; justify-self: center; text-decoration: none; }
.header-brand img { border-radius: 7px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-weight: 800; color: var(--text); font-size: 1.02rem; letter-spacing: -.01em; }
.brand-sub { font-size: .68rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }

.header-user { display: flex; align-items: center; gap: 10px; justify-self: end; font-size: .85rem; color: var(--text-label); }
.header-user .hu-name { font-weight: 700; color: var(--text); white-space: nowrap; }
.header-user .hu-role {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); background: var(--soft); border: 1px solid var(--line);
    border-radius: var(--radius-pill); padding: 1px 8px;
}
.header-user .hu-logout-form { margin: 0; display: inline-flex; }
.header-user .hu-link { color: var(--brand); text-decoration: none; font-weight: 600; white-space: nowrap; background: none; border: none; padding: 0; cursor: pointer; font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; }
.header-user .hu-link:hover { text-decoration: underline; }
.header-user .hu-exit { color: var(--muted); }

.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);
}

/* Layout de dos columnas: contenido (1fr) + carrito sticky (380px) */
.presu-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.presu-cart { position: sticky; top: 80px; }

/* Badge numerado de seccion (1 MEDIDAS, 2 PROPUESTAS) */
.sec-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.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: 992px) {
    .presu-grid { grid-template-columns: 1fr; }
    .presu-cart { position: static; }
}
@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); }

.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); }

/* ── Navbar (legacy, por si alguna vista la usa) ─────────────────────────── */
.navbar { box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* ── Ventana card (izquierda) ────────────────────────────────────────────── */
.ventana-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    background: white;
    overflow: hidden;
}

.ventana-card .card-header {
    background: white;
    border-bottom: 1px solid var(--bg);
    padding: 12px 16px;
}

.win-num-badge {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--brand);
    color: white;
    font-size: .75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-ghost-danger {
    background: none;
    border: none;
    color: var(--pv-divider);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all .15s;
    line-height: 1;
}
.btn-ghost-danger:hover { background: var(--pv-indigo-100); color: var(--pv-danger); }

/* ── Dimension row ───────────────────────────────────────────────────────── */
.dim-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    justify-content: center;
    padding: 8px 0 16px;
    margin-bottom: 6px;
}
.dim-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.dim-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pv-muted-extra);
}
.dim-box {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--pv-bg-subtle);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.dim-box:focus-within {
    border-color: var(--brand);
    background: var(--brand-50);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.dim-input {
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    width: 96px;
    outline: none;
    -moz-appearance: textfield;
    font-variant-numeric: tabular-nums;
}
.dim-input::-webkit-outer-spin-button,
.dim-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dim-input::placeholder { color: var(--pv-divider); font-weight: 400; font-size: .9rem; }
.dim-sym { font-size: .9rem; color: var(--pv-indigo-200); user-select: none; }
.dim-unit { font-size: .7rem; color: var(--pv-muted-extra); font-weight: 600; letter-spacing: .02em; }
.dim-cross { font-size: 1.1rem; color: var(--line); padding-bottom: 10px; font-weight: 300; }

/* ── Ctrl row + segmented controls ──────────────────────────────────────── */
.ctrl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    padding: 0;
}

/* Segmented control group */
.opt-chip-group {
    display: inline-flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 10px;
    padding: 3px;
}

/* All opt-chips baseline */
.opt-chip {
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    padding: 5px 13px;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.opt-chip:hover { color: var(--pv-fg-cell); }
.opt-chip.active {
    background: white;
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.04);
}

/* Standalone toggle chip (not inside a group) */
.ctrl-row > .opt-chip {
    border: 1.5px solid var(--line);
    background: white;
    color: var(--muted);
    border-radius: 8px;
    box-shadow: none;
    padding: 7px 14px;
    font-weight: 500;
}
.ctrl-row > .opt-chip:hover { border-color: var(--pv-muted-extra); color: var(--pv-fg-cell); background: var(--pv-bg-subtle); }
.ctrl-row > .opt-chip.active {
    background: var(--pv-success-bg-soft);
    border-color: var(--pv-success-border-soft);
    color: var(--pv-success-text-soft);
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, .1);
}

/* ── Inline opts (persiana, tapajuntas…) ─────────────────────────────────── */
.inline-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background: var(--pv-success-bg-faint);
    border: 1px solid var(--pv-success-bg-soft);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    animation: slideDown .15s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.inline-opts-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-right: 4px;
    white-space: nowrap;
}
.opt-tag {
    border: 1.5px solid var(--pv-indigo-100);
    background: white;
    color: var(--pv-primary-soft);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: .74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .12s;
}
.opt-tag:hover { background: var(--pv-indigo-100); border-color: var(--pv-indigo-300); }
.opt-tag.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ── Glass selector ──────────────────────────────────────────────────────── */
.glass-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    padding-top: 4px;
    margin-bottom: 4px;
}
.glass-row-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pv-muted-extra);
    white-space: nowrap;
    margin-right: 6px;
}
.glass-option {
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    min-width: 95px;
    text-align: center;
    background: white;
    transition: all .15s;
    user-select: none;
    position: relative;
}
.glass-option:hover { border-color: var(--pv-indigo-300); background: var(--soft-2); transform: translateY(-2px); box-shadow: 0 2px 8px rgba(227, 43, 54,.08); }
.glass-option.selected {
    background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-50) 100%);
    border-color: var(--pv-blue-500);
    color: var(--pv-primary-deep);
    box-shadow: 0 4px 14px rgba(239, 68, 68,.2);
    transform: translateY(-2px);
}
.glass-name { font-weight: 700; font-size: .8rem; line-height: 1.3; }
.glass-comp { font-size: .68rem; color: var(--pv-muted-extra); margin-top: 3px; }
.glass-option.selected .glass-comp { color: var(--accent); font-weight: 500; }
.glass-stars { color: var(--pv-warning); font-size: .67rem; margin-top: 5px; letter-spacing: 1.5px; }
.glass-option.selected .glass-stars { color: var(--pv-warning); }
.glass-price { font-size: .67rem; color: var(--pv-muted-extra); margin-top: 3px; }
.glass-option.selected .glass-price { color: var(--brand-dark); font-weight: 600; }
.glass-extra { border-style: dashed !important; border-color: var(--pv-indigo-200) !important; background: var(--pv-bg-cool); }
.glass-extra:hover { background: var(--brand-50) !important; }
.glass-extra.selected { border-style: solid !important; background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-50) 100%); }

/* Sin vidrio — neutral/discreto */
.glass-none { border-style: dashed !important; border-color: var(--pv-divider) !important; background: var(--soft-2); color: var(--muted); }
.glass-none:hover { border-color: var(--pv-muted-extra) !important; background: var(--bg) !important; transform: translateY(-2px); }
.glass-none .glass-name { color: var(--muted); }
.glass-none .glass-comp { color: var(--pv-muted-extra); }
.glass-none.selected {
    border-style: solid !important;
    border-color: var(--pv-fg-heading) !important;
    background: linear-gradient(135deg, var(--bg) 0%, var(--line) 100%) !important;
    color: var(--text);
}
.glass-none.selected .glass-name { color: var(--text); }
.glass-none.selected .glass-comp { color: var(--pv-fg-heading); }
.glass-badge {
    display: inline-block;
    font-size: .58rem;
    background: var(--pv-warning-bg);
    color: var(--pv-warning-text);
    border-radius: 20px;
    padding: 1px 6px;
    margin-top: 4px;
    font-weight: 600;
}
.glass-more-btn {
    border: 1.5px dashed var(--pv-indigo-200);
    background: transparent;
    color: var(--pv-muted-extra);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: .73rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: stretch;
}
.glass-more-btn:hover { background: var(--brand-50); color: var(--pv-primary-soft); border-color: var(--pv-indigo-300); }

/* ── Tabla de resultados ─────────────────────────────────────────────────── */
.results-table { font-size: .875rem; }
.results-table thead th {
    font-size: .7rem;
    font-weight: 700;
    color: var(--pv-muted-extra);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid var(--bg);
    padding: 8px 10px;
}
.results-table tbody td { padding: 10px 10px; border-bottom: 1px solid var(--pv-bg-subtle); vertical-align: middle; }
.results-table tbody tr:last-child td { border-bottom: none; }

.results-table tbody tr.selectable { cursor: pointer; }
.results-table tbody tr.selectable td { transition: background .1s; }
.results-table tbody tr.selectable:hover td { background: var(--soft-2); }
.results-table tbody tr.selectable:hover .price-cell { color: var(--pv-primary-deep); }
.results-table tbody tr.selected-row td { background: var(--brand-50); }
.results-table tbody tr.selected-row td:first-child {
    border-left: 3px solid var(--pv-blue-500);
    padding-left: 7px;
}

.price-cell {
    font-weight: 700;
    color: var(--brand-dark);
    cursor: pointer;
    white-space: nowrap;
}
.price-cell.selected-cell { color: var(--pv-primary-deep); }
.price-check { color: var(--pv-success-strong); font-size: .82rem; }
.null-cell { color: var(--line); font-size: .8rem; }

.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-wrap { flex-shrink: 0; display: flex; align-items: center; }
.win-svg { width: 54px; height: 40px; }
.win-svg-wide { width: 70px; }

/* ── Cart card (derecha) ─────────────────────────────────────────────────── */
.cart-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.cart-accent-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--pv-blue-light) 100%);
    flex-shrink: 0;
}

.cart-header {
    background: white;
    border-bottom: 1px solid var(--bg);
    padding: 12px 16px;
    flex-shrink: 0;
}
.cart-header .win-label {
    font-size: .65rem;
    color: var(--pv-muted-extra);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}
.cart-header .win-title { font-weight: 700; font-size: .95rem; color: var(--text); line-height: 1.3; margin-top: 2px; }
.cart-header .win-sub   { font-size: .76rem; color: var(--pv-muted-extra); margin-top: 2px; }

.cart-body { flex: 1; padding: 14px 16px; overflow-y: auto; }

.cart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.cart-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .74rem;
    color: var(--muted);
    background: var(--pv-bg-subtle);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2px 8px;
}

.cart-glass-tag {
    display: inline-flex;
    align-items: center;
    font-size: .76rem;
    color: var(--muted);
    background: var(--pv-bg-subtle);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 4px;
}

.breakdown-table { width: 100%; font-size: .81rem; }
.breakdown-table td { padding: 5px 0; color: var(--pv-fg-cell); }
.breakdown-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown-table .breakdown-subtotal td {
    border-top: 1px solid var(--bg);
    padding-top: 8px;
    color: var(--muted);
    font-size: .77rem;
}
.breakdown-table .breakdown-iva td { color: var(--muted); font-size: .77rem; padding-bottom: 8px; }

.cart-total-box {
    background: var(--brand-50);
    border: 1px solid var(--pv-indigo-200);
    border-top: 3px solid var(--brand);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 4px;
}
.cart-total-label {
    font-size: .65rem;
    color: var(--pv-primary-soft);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    margin-bottom: 2px;
}
.cart-total-amount {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--pv-primary-deep);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.cart-total-sub { font-size: .7rem; color: var(--pv-muted-extra); margin-top: 3px; }

.cart-footer {
    border-top: 1px solid var(--bg);
    padding: 10px 16px;
    flex-shrink: 0;
    background: var(--pv-bg-faint);
}

.cart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 200px;
    gap: 10px;
    padding: 24px;
    text-align: center;
}
.cart-placeholder .placeholder-icon { font-size: 2rem; color: var(--line); }
.cart-placeholder p { color: var(--pv-muted-extra); font-size: .82rem; margin: 0; line-height: 1.5; }

/* ── Resumen ─────────────────────────────────────────────────────────────── */
.resumen-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    overflow: hidden;
}
.resumen-card .card-header {
    background: var(--pv-bg-subtle);
    color: var(--text);
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-top: 3px solid var(--pv-primary, var(--brand));
    border-bottom: 1px solid var(--line);
}
.resumen-card .card-header i { color: var(--pv-primary, var(--brand)); }
.resumen-total-row td, .resumen-total-row th {
    background: var(--pv-bg-subtle) !important;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
    border-top: 2px solid var(--line);
}
.resumen-total-row td.text-end { color: var(--pv-primary-deep, var(--pv-primary-deep)); }

/* ── Add button ──────────────────────────────────────────────────────────── */
.add-ventana-btn {
    border: 2px dashed var(--pv-indigo-200);
    background: white;
    color: var(--pv-primary-soft);
    border-radius: 12px;
    padding: 10px 28px;
    font-weight: 600;
    font-size: .85rem;
    transition: all .15s;
}
.add-ventana-btn:hover {
    background: var(--brand-50);
    border-color: var(--pv-blue-light);
    color: var(--pv-primary-darker);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 43, 54,.15);
}

/* ── New configuration sections ─────────────────────────────────────────── */
.config-section { margin-bottom: 14px; }
.section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pv-muted-extra);
    margin-bottom: 8px;
}

/* ── Color swatches ─────────────────────────────────────────────────────── */
.color-row { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch {
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 10px;
    padding: 5px 12px 5px 5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all .15s;
    font-size: .76rem;
    color: var(--muted);
    font-weight: 500;
}
.color-swatch:hover { border-color: var(--pv-indigo-300); background: var(--pv-bg-subtle); }
.color-swatch.active {
    border-color: var(--brand);
    background: var(--brand-50);
    color: var(--pv-primary-deep);
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(227, 43, 54,.1);
}
.color-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* ── Aperture filter (de-emphasized) ────────────────────────────────────── */
.aperture-filter {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 12px;
    padding: 0 2px;
}
.aperture-filter-label {
    color: var(--pv-muted-extra);
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
    font-size: .62rem;
    letter-spacing: .07em;
}
.filter-chip {
    border: none;
    background: transparent;
    color: var(--pv-muted-extra);
    padding: 3px 10px;
    font-size: .73rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all .12s;
}
.filter-chip:hover { color: var(--muted); background: var(--bg); }
.filter-chip.active {
    background: var(--pv-indigo-100);
    color: var(--pv-primary-deep);
    font-weight: 600;
}

/* ── Extras toggles row ─────────────────────────────────────────────────── */
.extras-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.extra-toggle {
    flex: 1 1 0;
    min-width: 130px;
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all .15s;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
    text-align: left;
}
.extra-toggle:hover { border-color: var(--pv-muted-extra); background: var(--pv-bg-subtle); }
.extra-toggle.active {
    background: var(--pv-success-bg);
    border-color: var(--pv-success-border);
    color: var(--pv-success-text);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(16,185,129,.12);
}
.extra-icon-status { font-size: 1rem; color: var(--pv-divider); }
.extra-toggle.active .extra-icon-status { color: var(--pv-success); }
.extra-icon-main { font-size: .9rem; opacity: .55; }
.extra-toggle.active .extra-icon-main { opacity: 1; }

/* ── Detail panel (persiana / tapajuntas / prolongador) ─────────────────── */
.detail-panel {
    background: var(--pv-bg-subtle);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    animation: slideDown .18s ease;
}
.detail-panel-title {
    font-size: .7rem;
    font-weight: 700;
    color: var(--pv-fg-heading);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-panel-title i { color: var(--muted); font-size: .85rem; }

/* ── Drive cards (manual / motor pulsador / motor mando) ────────────────── */
.drive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.drive-card {
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}
.drive-card:hover { border-color: var(--pv-indigo-300); transform: translateY(-1px); }
.drive-card.active {
    border-color: var(--brand);
    background: var(--brand-50);
    box-shadow: 0 2px 8px rgba(227, 43, 54,.15);
}
.drive-icon { font-size: 1.2rem; color: var(--muted); line-height: 1; margin-bottom: 4px; }
.drive-card.active .drive-icon { color: var(--brand); }
.drive-label { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.drive-sub { font-size: .65rem; color: var(--pv-muted-extra); margin-top: 2px; line-height: 1.2; }
.drive-price { font-size: .7rem; color: var(--pv-success-strong); font-weight: 700; margin-top: 5px; }
.drive-price.free { color: var(--muted); font-weight: 500; }

/* ── Position chips ─────────────────────────────────────────────────────── */
.position-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.position-label {
    color: var(--muted);
    font-weight: 500;
    margin-right: 4px;
    font-size: .73rem;
}
.position-chip {
    border: 1.5px solid var(--line);
    background: white;
    color: var(--muted);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: .73rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all .12s;
}
.position-chip:hover { border-color: var(--pv-muted-extra); }
.position-chip.active {
    background: var(--pv-indigo-100);
    border-color: var(--pv-blue-light);
    color: var(--pv-primary-deep);
    font-weight: 600;
}

/* ── Advanced toggle and grid ───────────────────────────────────────────── */
.advanced-toggle {
    background: transparent;
    border: 1px dashed var(--pv-indigo-200);
    color: var(--pv-primary-soft);
    font-size: .73rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    transition: all .12s;
}
.advanced-toggle:hover { background: var(--brand-50); border-color: var(--pv-blue-light); color: var(--pv-primary-darker); }
.advanced-grid {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--pv-divider);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
    animation: slideDown .15s ease;
}
.advanced-field { display: flex; flex-direction: column; gap: 5px; }
.advanced-field-full { grid-column: 1 / -1; }
.advanced-field label {
    font-size: .63rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.advanced-select {
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: .78rem;
    color: var(--text);
    cursor: pointer;
    outline: none;
}
.advanced-select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(227, 43, 54,.1); }
.mini-swatch-row { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 2px; }
.mini-swatch {
    width: 18px; height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 1.5px solid var(--line);
    transition: transform .12s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.mini-swatch:hover { transform: scale(1.15); }

/* ── Profile grid (tapajuntas) ──────────────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.profile-card {
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 10px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.profile-card:hover { border-color: var(--pv-indigo-300); transform: translateY(-1px); }
.profile-card.active {
    border-color: var(--brand);
    background: var(--brand-50);
    box-shadow: 0 2px 8px rgba(227, 43, 54,.15);
}
.profile-svg { width: 50px; height: 36px; margin-bottom: 4px; }
.profile-card.active .profile-svg rect,
.profile-card.active .profile-svg path { fill: var(--pv-indigo-200); stroke: var(--brand); }
.profile-label { font-size: .8rem; font-weight: 600; color: var(--text); }
.profile-sub { font-size: .68rem; color: var(--pv-muted-extra); }

/* ── Prolongador grid ───────────────────────────────────────────────────── */
.prolong-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.prolong-card {
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 70px;
}
.prolong-card:hover { border-color: var(--pv-indigo-300); transform: translateY(-1px); }
.prolong-card.active {
    border-color: var(--brand);
    background: var(--brand-50);
    box-shadow: 0 2px 8px rgba(227, 43, 54,.15);
}
.prolong-bar {
    width: 12px;
    background: linear-gradient(180deg, var(--pv-muted-extra), var(--pv-divider));
    border-radius: 2px 2px 0 0;
    margin-bottom: 6px;
    transition: background .15s, height .2s;
}
.prolong-card.active .prolong-bar { background: linear-gradient(180deg, var(--brand), var(--pv-indigo-300)); }
.prolong-label { font-size: .72rem; font-weight: 600; color: var(--text); }

/* ── Glass section centered ─────────────────────────────────────────────── */
.glass-section {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px dashed var(--line);
}
.glass-section-label {
    text-align: center;
    margin-bottom: 12px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--pv-fg-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.glass-icon { color: var(--muted); flex-shrink: 0; }
.glass-row-centered {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
}

/* ── Config 2-col grid (left config / right detail) ─────────────────────── */
.config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 18px;
    padding: 16px 18px;
}
.config-left { min-width: 0; }
.config-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.config-right .detail-panel { margin-bottom: 0; }

/* Empty state for the right column */
.detail-empty {
    background: linear-gradient(135deg, var(--soft-2) 0%, var(--soft-2) 100%);
    border: 1.5px dashed var(--pv-divider);
    border-radius: 12px;
    padding: 32px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 240px;
    height: 100%;
}
.detail-empty-icon { font-size: 1.8rem; color: var(--pv-divider); line-height: 1; }
.detail-empty-title {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em;
}
.detail-empty-text {
    font-size: .76rem;
    color: var(--pv-muted-extra);
    margin: 0;
    line-height: 1.5;
    max-width: 260px;
}
.detail-empty-text strong { color: var(--pv-fg-heading); font-weight: 600; }

/* ── Results section (emphasized) ───────────────────────────────────────── */
.results-section {
    background: linear-gradient(180deg, var(--pv-bg-subtle) 0%, var(--pv-bg-emphasis) 100%);
    border-top: 1px solid var(--line);
    padding: 16px 20px 20px;
    position: relative;
}
.results-section::before {
    content: "";
    position: absolute;
    top: -1px; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--pv-indigo-200) 25%, var(--pv-indigo-200) 75%, transparent 100%);
    opacity: .6;
}
.results-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--pv-divider);
}
.results-section-title {
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.results-section-title i { color: var(--pv-primary-deep); font-size: .95rem; }
.results-section-hint {
    font-size: .69rem;
    color: var(--muted);
    font-style: italic;
}
.results-section .table-responsive {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.results-section .results-table { margin: 0; }
.results-section .results-table thead th {
    background: var(--pv-bg-subtle);
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
}
.results-section .results-table tbody td { padding: 11px 12px; }

/* ── Cart at bottom (full width, horizontal) ────────────────────────────── */
.cart-card-bottom { margin-top: 0; height: auto; }
.cart-card-bottom .cart-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 22px;
}
.cart-card-bottom .cart-header > div { margin: 0 !important; }
.cart-card-bottom .cart-header .win-title { font-size: 1rem; margin-top: 0; }
.cart-card-bottom .cart-header .win-sub { margin-top: 0; font-size: .76rem; }
.cart-card-bottom .cart-header .win-sub::before {
    content: "·"; margin-right: 8px; color: var(--pv-divider); font-weight: 700;
}
.cart-card-bottom .cart-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(220px, 280px);
    gap: 12px 28px;
    padding: 18px 22px;
    align-items: start;
}
.cart-card-bottom .cart-meta      { grid-column: 1; grid-row: 1; margin: 0 !important; }
.cart-card-bottom .cart-glass-tag { grid-column: 1; grid-row: 2; margin: 0 !important; align-self: start; }
.cart-card-bottom .breakdown-table {
    grid-column: 2; grid-row: 1 / span 2;
    margin: 0 !important; align-self: start; width: 100%;
}
.cart-card-bottom .cart-total-box {
    grid-column: 3; grid-row: 1 / span 2;
    margin: 0 !important; align-self: stretch;
    display: flex; flex-direction: column; justify-content: center;
}
.cart-card-bottom .alert {
    grid-column: 2 / -1; grid-row: 1 / span 2;
    margin: 0 !important; align-self: start;
}

/* Responsive: stack everything on smaller screens */
@media (max-width: 991px) {
    .config-grid { grid-template-columns: 1fr; }
    .cart-card-bottom .cart-body { grid-template-columns: 1fr; }
    .cart-card-bottom .cart-meta,
    .cart-card-bottom .cart-glass-tag,
    .cart-card-bottom .breakdown-table,
    .cart-card-bottom .cart-total-box,
    .cart-card-bottom .alert { grid-column: 1; grid-row: auto; }
}

/* ===========================================================================
   CARRITO (columna derecha de /Presupuesto). Solo tokens.
   =========================================================================== */
.cart-panel { overflow: hidden; }
.cart-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
    font-weight: 700; color: var(--text);
}
.cart-count {
    background: var(--brand); color: white; font-size: .75rem; font-weight: 700;
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-pill);
    display: inline-flex; align-items: center; justify-content: center;
}
.cart-empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.cart-empty i { font-size: 1.8rem; color: var(--pv-muted-extra); display: block; margin-bottom: 8px; }
.cart-empty p { font-size: .85rem; margin: 0; }
.cart-lines { max-height: 52vh; overflow-y: auto; }
.cart-line { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.cart-line-top { display: flex; justify-content: space-between; align-items: baseline; }
.cart-line-title { font-weight: 700; color: var(--text); font-size: .9rem; }
.cart-line-price { font-weight: 800; color: var(--brand-dark); }
.cart-line-meta { font-size: .76rem; color: var(--muted); margin: 2px 0 8px; }
.cart-line-actions { display: flex; gap: 6px; }
.cart-act {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    background: var(--soft); border: 1px solid var(--line); color: var(--text-label);
    border-radius: var(--radius-sm); padding: 5px 6px; font-size: .74rem; font-weight: 600; cursor: pointer;
}
.cart-act:hover { background: var(--brand-50); border-color: var(--pv-indigo-200); color: var(--brand-dark); }
.cart-act.danger:hover { background: var(--pv-danger-bg); border-color: var(--pv-indigo-200); color: var(--pv-danger); }
.cart-totals { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ct-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-label); margin-bottom: 4px; }
.ct-total { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-top: 6px; }
.ct-total span:last-child { color: var(--brand-dark); }
.cart-foot { padding: 16px 18px; }

.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%; }
.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-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, #f4f5f7 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 rgba(227,43,54,.1);
}
.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; }

/* ============================================================================
   BLOQUE 2b — Hero de /Presupuesto + cards de propuesta (solo tokens --brand)
   ============================================================================ */
.presu-hero { margin: 4px 0 22px; }
.presu-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    color: var(--brand); margin-bottom: 8px;
}
.presu-hero-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.presu-hero-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 4px; }
.presu-hero-sub { color: var(--muted); font-size: .95rem; margin: 0; max-width: 60ch; }

/* Cards de propuesta (sustituyen la tabla) */
.prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    padding-top: 4px;
}
.prop-card {
    display: flex; flex-direction: column;
    border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
    overflow: hidden; transition: border-color .14s, box-shadow .14s, transform .14s;
}
.prop-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px var(--brand-ring); transform: translateY(-2px); }
.prop-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.prop-card-svg {
    display: flex; align-items: center; justify-content: center;
    padding: 18px 14px 6px; min-height: 118px; background: var(--soft-2);
}
.prop-card-svg .win-svg { width: auto; height: 92px; }
.prop-card-body { padding: 12px 14px 4px; flex: 1; }
.prop-card-name { font-weight: 700; color: var(--text); font-size: .92rem; line-height: 1.25; }
.prop-card-sys { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.prop-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px 14px;
}
.prop-card-price { font-size: 1.3rem; font-weight: 800; color: var(--brand); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.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; }
