/* ================================================================
   TOKENS
================================================================ */
:root {
    /* Brand */
    --cyan:           #06B6D4;
    --cyan-dark:      #0891b2;
    --cyan-light:     #ecfeff;
    --cyan-dim:       rgba(6,182,212,0.10);
    --cyan-glow:      0 0 0 3px rgba(6,182,212,0.15);
    --cyan-shadow:    0 4px 24px rgba(6,182,212,0.22);

    /* Surface */
    --bg:             #f0f6fa;
    --card:           #ffffff;
    --card-elevated:  #f8fbfd;
    --border:         #e2eaf0;
    --border-strong:  #c8d8e4;

    /* Text */
    --text-primary:   #0f2030;
    --text-secondary: #4a6070;
    --text-muted:     #8aa0b0;

    /* Error */
    --error:          #e11d48;
    --error-dim:      rgba(225,29,72,0.08);

    /* Shape */
    --r-card:    18px;
    --r-input:   12px;
    --r-btn:     12px;
    --r-icon:    12px;

    /* Shadow */
    --shadow-card:     0 1px 3px rgba(15,32,48,0.06), 0 8px 24px rgba(15,32,48,0.07);
    --shadow-elevated: 0 2px 8px rgba(15,32,48,0.06), 0 16px 40px rgba(15,32,48,0.10);

    --font: 'Outfit', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
    font-family: var(--font);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg);
    padding: 24px 16px 72px;
    background-image:
        linear-gradient(rgba(6,182,212,0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,182,212,0.055) 1px, transparent 1px);
    background-size: 52px 52px;
}

/* ================================================================
   ANIMATIONS
================================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes sacudir {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-6px); }
    40%     { transform: translateX(6px); }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(4px); }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ================================================================
   SHARED BUTTONS
================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 22px;
    border: none;
    border-radius: var(--r-btn);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.12s, box-shadow 0.18s, background 0.18s;
}
.btn svg { flex-shrink: 0; width: 17px; height: 17px; fill: currentColor; }
.btn:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-cyan {
    background: var(--cyan);
    color: #ffffff;
    box-shadow: var(--cyan-shadow);
}
.btn-cyan:hover:not(:disabled) {
    background: var(--cyan-dark);
    box-shadow: 0 6px 32px rgba(6,182,212,0.32);
    opacity: 1;
}

.btn-ghost {
    background: var(--card);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-card);
}
.btn-ghost:hover:not(:disabled) {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-light);
    box-shadow: var(--cyan-glow);
    opacity: 1;
}

.btn-wa {
    background: #25D366;
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,211,102,0.25);
}
.btn-wa:hover:not(:disabled) { background: #1ebe5d; opacity: 1; }

.btn-danger {
    background: linear-gradient(135deg, #06B6D4, #0891b2);
    color: #fff;
    box-shadow: var(--cyan-shadow);
}
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 32px rgba(6,182,212,0.32);
    opacity: 1;
}

.btn-sm { font-size: 0.78rem; padding: 10px 16px; }


/* ================================================================
   PASSWORD SCREEN
================================================================ */
#pantallaAcceso {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 48px); /* body ya trae 24px de padding arriba/abajo */
    animation: fadeUp 0.5s ease both;
}

.acceso-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 44px 36px 36px;
    box-shadow: var(--shadow-elevated);
    position: relative;
    overflow: hidden;
}
.acceso-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan) 50%, transparent);
}

.acceso-marca { text-align: center; margin-bottom: 32px; }

.acceso-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    background: var(--cyan-dim);
    border: 1.5px solid rgba(6,182,212,0.25);
    border-radius: var(--r-icon);
    margin-bottom: 18px;
}
.acceso-logo-wrap svg { width: 32px; height: 32px; fill: var(--cyan); }

.acceso-nombre {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.acceso-nombre span { color: var(--cyan); }

.acceso-titulo {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.acceso-subtitulo {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.acceso-campo { margin-bottom: 14px; }
.acceso-campo > label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.input-pass-wrap { position: relative; }

.acceso-campo input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    background: var(--card-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--r-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    letter-spacing: 2px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.acceso-campo input:focus {
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
}
.acceso-campo input.campo-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-dim);
}

.toggle-pass {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color 0.2s;
}
.toggle-pass:hover { color: var(--cyan); }
.toggle-pass svg { width: 18px; height: 18px; fill: currentColor; }

.acceso-error {
    display: none;
    background: var(--error-dim);
    border: 1px solid rgba(225,29,72,0.2);
    border-radius: var(--r-input);
    padding: 11px 14px;
    margin-bottom: 14px;
    font-size: 0.83rem;
    color: var(--error);
    animation: sacudir 0.35s ease;
}

.acceso-wa {
    display: none;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.acceso-wa p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.55;
}


/* ================================================================
   CALCULATOR CONTAINER
================================================================ */
#contenedorPrincipal {
    display: none;
    max-width: 640px;
    margin: 0 auto;
    animation: fadeUp 0.4s ease both;
}

/* Header */
#encabezadoCotizador {
    display: none;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
#encabezadoCotizador::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan) 50%, transparent);
}

.logo-icono {
    flex-shrink: 0;
    width: 48px; height: 48px;
    fill: var(--cyan);
    background: var(--cyan-dim);
    border: 1.5px solid rgba(6,182,212,0.22);
    border-radius: var(--r-icon);
    padding: 10px;
}

.btn-cerrar-sesion {
    flex-shrink: 0;
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--r-icon);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.btn-cerrar-sesion:hover {
    color: var(--error);
    border-color: rgba(225,29,72,0.3);
    background: rgba(225,29,72,0.06);
}
.btn-cerrar-sesion svg { width: 19px; height: 19px; fill: currentColor; }

#tituloPrincipal {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin-bottom: 2px;
}
#tituloPrincipal span { color: var(--cyan); }
#subtituloPrincipal { font-size: 0.78rem; color: var(--text-muted); }

/* Form card */
#formularioImagen {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 28px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-card);
}

#formularioImagen label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 22px;
    margin-bottom: 7px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.9px;
}
#formularioImagen label:first-of-type { margin-top: 0; }
#formularioImagen label svg {
    flex-shrink: 0;
    width: 13px; height: 13px;
    fill: var(--cyan);
}

.guia-archivo {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: -4px;
    margin-bottom: 6px;
}

/* Upload zone */
.upload-zone {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--card-elevated);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r-input);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 4px;
}
.upload-zone:hover {
    border-color: var(--cyan);
    background: var(--cyan-light);
}
.upload-zone-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.upload-zone-icon svg { width: 20px; height: 20px; fill: var(--text-muted); }
.upload-zone-text { flex: 1; min-width: 0; }
.upload-zone-title { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.upload-zone-hint  { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }

/* Inputs */
#formularioImagen input[type="file"],
#formularioImagen input[type="text"],
#formularioImagen input[type="number"],
#formularioImagen select {
    width: 100%;
    padding: 11px 14px;
    background: var(--card-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--r-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    margin-bottom: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
#formularioImagen input[type="file"] {
    display: none;
}
#formularioImagen select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238aa0b0' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-color: var(--card-elevated);
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
#formularioImagen select option { background: #fff; color: var(--text-primary); }
#formularioImagen input:focus,
#formularioImagen select:focus {
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
    background: #fff;
}

.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px var(--error-dim) !important;
}
.mensaje-error {
    display: block;
    color: var(--error);
    font-size: 0.74rem;
    margin-top: 3px;
    margin-bottom: 6px;
}

/* Medidas */
.grupo-medidas { display: flex; gap: 10px; margin-bottom: 4px; }
.grupo-medidas input { width: 50%; min-width: 0; margin-bottom: 0; }

/* Quantity control */
#control-cantidad {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
#control-cantidad input[type="number"] {
    flex: 1;
    min-width: 0;
    text-align: center;
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 700;
    background: #fff;
}

.btn-cantidad {
    flex-shrink: 0;
    width: 44px; height: 44px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-input);
    color: var(--cyan);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-card);
    line-height: 1;
}
.btn-cantidad:hover {
    background: var(--cyan-light);
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
}

#formularioImagen .btn { margin-top: 18px; }

/* Live price preview */
#precioAproximado {
    display: none;
    text-align: center;
    padding: 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%);
    border-radius: var(--r-input);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: var(--cyan-shadow);
    animation: popIn 0.22s ease both;
}

/* Current item result */
#cotizacionActual { margin-top: 18px; }
.resultado-activo {
    background: var(--card);
    border: 1.5px solid rgba(6,182,212,0.3);
    border-radius: var(--r-card);
    padding: 22px;
    box-shadow: var(--shadow-card);
    animation: popIn 0.25s ease both;
}
#cotizacionActual h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cyan);
    text-align: center;
    margin-bottom: 14px;
}

.detalle-complemento {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.86rem;
}
.resultado-linea {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.resultado-linea:last-child { border-bottom: none; }
.resultado-etiqueta { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.resultado-valor { color: var(--text-primary); font-weight: 600; text-align: right; }

/* History */
#historialResultados {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
#historialResultados > h3 {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 14px;
}

.cotizacion-archivada {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-input);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.18s, box-shadow 0.18s;
    animation: popIn 0.22s ease both;
}
.cotizacion-archivada:hover {
    border-color: rgba(6,182,212,0.4);
    box-shadow: 0 2px 12px rgba(6,182,212,0.10);
}
.cotizacion-archivada h3 { font-size: 0.93rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.cotizacion-archivada h3 span { color: var(--cyan); }
.cotizacion-archivada p { font-size: 0.8rem; color: var(--text-muted); }

.item-historial { display: flex; align-items: center; gap: 12px; }
.miniatura-item {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--card-elevated);
    flex-shrink: 0;
}
.item-historial-info { flex: 1; min-width: 0; }
.item-historial-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

.nombre-item {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    border-bottom: 1.5px dashed transparent;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.93rem;
    font-weight: 700;
    outline: none;
    padding: 2px 0;
    transition: border-color 0.18s;
}
.nombre-item:hover, .nombre-item:focus { border-bottom-color: var(--border-strong); }

.precio-item {
    color: var(--cyan);
    font-weight: 800;
    white-space: nowrap;
    font-size: 0.95rem;
}

.btn-eliminar-item {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--card-elevated);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    padding: 0;
}
.btn-eliminar-item:hover {
    color: var(--error);
    border-color: rgba(225,29,72,0.3);
    background: rgba(225,29,72,0.06);
}
.btn-eliminar-item svg { width: 15px; height: 15px; fill: currentColor; }

.total-general-wrapper {
    margin-top: 14px;
    padding: 16px 20px;
    border-radius: var(--r-input);
    background: var(--cyan-dim);
    border: 1.5px solid rgba(6,182,212,0.2);
    text-align: right;
}
.total-general-wrapper h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cyan-dark);
    letter-spacing: -0.5px;
}

/* Final actions */
#accionesFinales {
    display: none;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
#accionesFinales .btn { width: 50%; margin-top: 0; padding: 11px 8px; font-size: 0.74rem; }
#terminarCotizacionBoton { display: none; margin-top: 14px; font-size: 0.92rem; }

.app-footer {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* ================================================================
   MODAL
================================================================ */
.modal-fondo {
    position: fixed;
    inset: 0;
    background: rgba(15,32,48,0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
    backdrop-filter: blur(6px);
}
.modal-contenido {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 36px 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-elevated);
    animation: fadeUp 0.3s ease both;
    position: relative;
    overflow: hidden;
}
.modal-contenido::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan) 50%, transparent);
}
.modal-contenido h3 { color: var(--text-primary); font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.modal-contenido p  { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.88rem; line-height: 1.65; }

/* ── Modal de recorte de imagen (nuevo) ───────────────────────── */
.modal-contenido.modal-recorte {
    max-width: 640px;
    text-align: left;
}
.modal-contenido.modal-recorte h3 { text-align: center; }
.recorte-ayuda {
    text-align: center;
    font-size: 0.82rem !important;
    margin-bottom: 18px !important;
}
.recorte-lienzo {
    width: 100%;
    height: 420px;
    background: #0f1420;
    border-radius: var(--r-input);
    overflow: hidden;
    margin-bottom: 22px;
}
.recorte-lienzo img { display: block; max-width: 100%; }
.recorte-acciones {
    display: flex;
    gap: 10px;
}
.recorte-acciones .btn { margin-top: 0; }
@media (max-width: 480px) {
    .recorte-lienzo { height: 280px; }
    .recorte-acciones { flex-direction: column; }
}

#modalCerrarBoton {
    background: var(--cyan);
    color: #fff;
    border: none;
    padding: 11px 32px;
    border-radius: var(--r-btn);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: var(--cyan-shadow);
}
#modalCerrarBoton:hover { background: var(--cyan-dark); }

/* ================================================================
   html2canvas export template (white — untouched)
================================================================ */
.descarga-contenedor {
    position: relative; padding: 28px; background: white;
    border-radius: 14px; width: fit-content; max-width: 600px;
    font-family: var(--font);
}
.logo-descarga { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; fill: #080f1e; }
.claim-descarga { font-size: 0.74rem; color: #888; text-align: center; margin-top: 18px; padding-top: 12px; border-top: 1px solid #eee; font-style: italic; }

/* ================================================================
   PANEL ADMINISTRATIVO
================================================================ */
.panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 960px;
    margin: 0 auto 20px;
    padding: 18px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.panel-topbar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan) 50%, transparent);
}
.panel-marca { display: flex; align-items: center; gap: 14px; }
.panel-marca h1 { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.panel-marca h1 span { color: var(--cyan); }
.panel-marca p { font-size: 0.72rem; color: var(--text-muted); }
.panel-topbar-right { display: flex; align-items: center; gap: 14px; }
.panel-usuario-actual { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; text-align: right; }
.panel-usuario-actual small { display: block; font-size: 0.68rem; color: var(--text-muted); font-weight: 500; }

.panel-tabs {
    display: flex;
    gap: 8px;
    max-width: 960px;
    margin: 0 auto 20px;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}
.panel-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: var(--r-btn);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.panel-tab:hover { color: var(--cyan-dark); }
.panel-tab.activo { background: var(--cyan); color: #fff; box-shadow: var(--cyan-shadow); }

.panel-contenido { max-width: 960px; margin: 0 auto; }
.panel-seccion {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 26px 24px;
    box-shadow: var(--shadow-card);
}
.panel-seccion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.panel-seccion-header h2 { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.panel-seccion-header .btn { width: auto; margin-top: 0; }

.panel-aviso {
    background: var(--cyan-dim);
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: var(--r-input);
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.55;
}

.panel-tabla-wrap { overflow-x: auto; }
.panel-tabla { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.panel-tabla th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}
.panel-tabla td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.panel-tabla tr:last-child td { border-bottom: none; }
.panel-tabla tr:hover td { background: var(--card-elevated); }

.pastilla {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}
.pastilla-verde { background: rgba(16,185,129,0.12); color: #059669; }
.pastilla-gris  { background: rgba(138,160,176,0.14); color: var(--text-muted); }
.pastilla-cyan  { background: var(--cyan-dim); color: var(--cyan-dark); }

.panel-acciones-fila { display: flex; gap: 6px; }
.btn-icono {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--card-elevated);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s ease;
}
.btn-icono svg { width: 15px; height: 15px; fill: currentColor; }
.btn-icono:hover { color: var(--cyan); border-color: rgba(6,182,212,0.3); background: var(--cyan-light); }
.btn-icono.peligro:hover { color: var(--error); border-color: rgba(225,29,72,0.3); background: rgba(225,29,72,0.06); }

.panel-vacio { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.88rem; }

/* Formularios del panel (dentro de modales o inline) */
.panel-campo { margin-bottom: 14px; }
.panel-campo label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 7px;
}
.panel-campo input[type="text"],
.panel-campo input[type="password"],
.panel-campo input[type="number"],
.panel-campo input[type="color"],
.panel-campo select {
    width: 100%;
    padding: 11px 14px;
    background: var(--card-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--r-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.panel-campo input:focus, .panel-campo select:focus {
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
    background: #fff;
}
.panel-campo-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.panel-campo-check input { width: 17px; height: 17px; accent-color: var(--cyan); cursor: pointer; }
.panel-campo-check label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.panel-campo-ayuda { font-size: 0.72rem; color: var(--text-muted); margin-top: 5px; }

.panel-form-acciones { display: flex; gap: 10px; margin-top: 22px; }
.panel-form-acciones .btn { margin-top: 0; }

.modal-contenido.modal-form { max-width: 440px; text-align: left; }
.modal-contenido.modal-form h3 { text-align: center; margin-bottom: 20px; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 480px) {
    .acceso-card { padding: 32px 20px 28px; }
    #formularioImagen { padding: 20px 16px; }
    .grupo-medidas { flex-direction: column; gap: 6px; }
    .grupo-medidas input { width: 100%; }
    #accionesFinales .btn { font-size: 0.68rem; padding: 9px 6px; }
    #tituloPrincipal { font-size: 1.05rem; }
    .upload-zone { flex-direction: column; text-align: center; gap: 10px; }
}

/* ================================================================
   PRINT
================================================================ */
@media print {
    button, .app-footer, #accionesFinales,
    #precioAproximado, #formularioImagen,
    #cotizacionActual, #pantallaAcceso, #modalRecorte { display: none !important; }
    body { background: white !important; color: black !important;
           padding: 0 !important; background-image: none !important; }
    #contenedorPrincipal { max-width: none !important; padding: 0 !important; }
    #historialResultados { border-top: none !important; padding-top: 0 !important; }
}
