/* ============================================================================
   MUEBLES MIGUEL ÁNGEL — Sistema de Diseño Visual Moderno (MarcaNúcleo & UX/UI Pro)
   Estética: Estudio de Carpintería Arquitectónica Premium (Cedro, Parota y Tzalam)
   Prioridad: 1. Celular (Mobile-First) | 2. Computadora | 3. Impresión PDF
   ============================================================================ */

:root {
    --bg-app: #F5F2EB;
    --bg-surface: #FFFFFF;
    --bg-subtle: #FAF8F4;
    --bg-warm-tint: #F2ECE1;
    --bg-dark: #161311;
    --bg-dark-elevated: #221D19;
    --bg-dark-card: #1C1815;

    --text-primary: #181411;
    --text-secondary: #574E46;
    --text-muted: #84796E;
    --text-on-dark: #F7F4F0;

    --brand-parota: #9B6026;
    --brand-parota-light: #C68B4E;
    --brand-parota-hover: #7E4C1B;
    --brand-cedro: #B44C2B;
    --brand-tzalam: #4D3423;
    --brand-gold: #D4A359;
    --brand-gold-soft: rgba(212, 163, 89, 0.16);

    --border-light: #E6DFD5;
    --border-strong: #CFC4B6;

    --status-success: #157347;
    --status-success-bg: #E8F6EE;
    --status-warning: #B45309;
    --status-warning-bg: #FEF5E7;
    --status-danger: #C81E1E;
    --status-danger-bg: #FDECEC;
    --status-info: #1D4ED8;
    --status-info-bg: #EFF6FF;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;

    --shadow-xs: 0 1px 2px rgba(24, 20, 17, 0.04);
    --shadow-sm: 0 4px 14px -2px rgba(24, 20, 17, 0.06), 0 2px 6px -1px rgba(24, 20, 17, 0.04);
    --shadow-md: 0 12px 28px -6px rgba(24, 20, 17, 0.10), 0 4px 12px -2px rgba(24, 20, 17, 0.05);
    --shadow-lg: 0 24px 48px -12px rgba(24, 20, 17, 0.22);
    --shadow-glow: 0 6px 20px rgba(155, 96, 38, 0.32);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-Display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--bg-app);
    background-image:
        radial-gradient(at 0% 0%, rgba(212, 163, 89, 0.09) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(155, 96, 38, 0.07) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Utilidades generales */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.font-mono { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.87rem; }
.text-xs { font-size: 0.77rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--status-success); }
.text-warning { color: var(--status-warning); }
.text-danger { color: var(--status-danger); }
.mt-1 { margin-top: 0.3rem; }
.mt-2 { margin-top: 0.6rem; }
.mt-3 { margin-top: 1.1rem; }
.mt-4 { margin-top: 1.6rem; }
.mb-2 { margin-bottom: 0.6rem; }
.mb-3 { margin-bottom: 1.1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.55rem; }
.gap-3 { gap: 0.85rem; }
.flex-wrap { flex-wrap: wrap; }

@media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
}

/* ============================================================================
   PANTALLA DE ACCESO PRIVADO (LOGIN DE LUJO)
   ============================================================================ */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 20%, #2C2119 0%, #15110E 70%, #0E0B09 100%);
}

.auth-ambient-glow {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 163, 89, 0.16) 0%, transparent 70%);
    top: -120px;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.1rem;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(212, 163, 89, 0.25);
    text-align: center;
    animation: fadeUp 0.35s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    padding: 4px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-parota), var(--brand-tzalam));
    box-shadow: 0 10px 25px rgba(24, 20, 17, 0.2);
}

.auth-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
    background: #0B0A09;
    padding: 8px;
}

.auth-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--brand-parota);
    background: rgba(155, 96, 38, 0.1);
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.55rem;
}

.auth-title {
    font-family: var(--font-Display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-bottom: 1.15rem;
}

.wood-samples-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.wood-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.wood-pill i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.wood-cedro i { background: var(--brand-cedro); }
.wood-parota i { background: var(--brand-parota); }
.wood-tzalam i { background: var(--brand-tzalam); }

.auth-pin-input {
    font-size: 1.35rem !important;
    letter-spacing: 0.3em;
    text-align: center;
    height: 52px;
    border-radius: var(--radius-md) !important;
    background: var(--bg-subtle) !important;
}

.auth-pin-hint {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* ============================================================================
   HEADER Y NAVEGACIÓN GLASSMORPHISM
   ============================================================================ */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 2.5rem;
}

.topbar {
    background: rgba(22, 19, 17, 0.95);
    backdrop-filter: blur(14px);
    color: var(--text-on-dark);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(212, 163, 89, 0.22);
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-parota));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: #0A0908;
    padding: 3px;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-title {
    font-family: var(--font-Display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.01em;
}

.brand-badge-pro {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    background: var(--brand-gold-soft);
    color: var(--brand-gold);
    border: 1px solid rgba(212, 163, 89, 0.3);
}

.brand-tag {
    font-size: 0.75rem;
    color: #B8ACA0;
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.workshop-rate-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: #E2D9CE;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
}

.dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 8px #22C55E;
}

.main-nav-wrapper {
    background: #211C18;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    position: sticky;
    top: 61px;
    z-index: 45;
}

.main-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    gap: 0.35rem;
    padding: 0.45rem 1.25rem;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-btn {
    background: transparent;
    color: #C7BDB3;
    border: 1px solid transparent;
    padding: 0.52rem 0.95rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-btn svg {
    opacity: 0.78;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #FFFFFF;
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--brand-parota), #7D4B1B);
    color: #FFFFFF;
    border-color: rgba(212, 163, 89, 0.35);
    box-shadow: 0 4px 12px rgba(155, 96, 38, 0.35);
}

.nav-btn.active svg {
    opacity: 1;
    transform: scale(1.06);
}

.main-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.35rem 1.25rem;
    flex: 1;
}

/* ============================================================================
   HERO BANNER DEL PANEL PRINCIPAL (INICIO)
   ============================================================================ */
.hero-banner {
    background: linear-gradient(130deg, #191411 0%, #2E221A 55%, #4A3220 100%);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 1.65rem 1.85rem;
    margin-bottom: 1.35rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(212, 163, 89, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 163, 89, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-gold);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.hero-title {
    font-family: var(--font-Display);
    font-size: 1.6rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.3rem;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: #D5CBBF;
    max-width: 620px;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.hero-chip {
    font-size: 0.76rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #F3EDE4;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
}

/* ============================================================================
   TARJETAS Y PANELES MODERNOS
   ============================================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.15rem;
    transition: box-shadow 0.2s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Grid de Indicadores (KPIs Modernos con Icono) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-parota);
}

.kpi-card.kpi-cedro::before { background: var(--brand-cedro); }
.kpi-card.kpi-tzalam::before { background: var(--brand-tzalam); }
.kpi-card.kpi-success::before { background: var(--status-success); }
.kpi-card.kpi-warning::before { background: var(--status-warning); }

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-warm-tint);
    color: var(--brand-parota);
    flex-shrink: 0;
}

.kpi-card.kpi-success .kpi-icon { background: var(--status-success-bg); color: var(--status-success); }
.kpi-card.kpi-warning .kpi-icon { background: var(--status-warning-bg); color: var(--status-warning); }
.kpi-card.kpi-cedro .kpi-icon { background: #FDF2EE; color: var(--brand-cedro); }

.kpi-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.35rem;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

.kpi-sub {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================================================
   BOTONES MODERNOS
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-lg {
    min-height: 48px;
    font-size: 0.96rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    min-height: 35px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-parota), #7E4C1B);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(155, 96, 38, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #AC6C2D, #6C4016);
    box-shadow: var(--shadow-glow);
}

.btn-glow {
    box-shadow: 0 4px 14px rgba(212, 163, 89, 0.35);
}

.btn-dark {
    background: var(--bg-dark);
    color: #FFFFFF;
}
.btn-dark:hover { background: #2D2621; }

.btn-success {
    background: var(--status-success);
    color: #FFFFFF;
}
.btn-success:hover { filter: brightness(0.93); }

.btn-danger {
    background: #FEE2E2;
    color: var(--status-danger);
    border-color: #FECACA;
}
.btn-danger:hover {
    background: var(--status-danger);
    color: #FFFFFF;
}

.btn-outline {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
    background: var(--bg-warm-tint);
    border-color: var(--brand-parota);
}

.btn-ghost-light {
    background: rgba(255, 255, 255, 0.08);
    color: #E7DFD6;
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
}

/* ============================================================================
   FORMULARIOS Y CONTROLES INTELIGENTES
   ============================================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 0.95rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-control {
    min-height: 42px;
    padding: 0.52rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:hover {
    border-color: #B3A494;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-parota);
    box-shadow: 0 0 0 3.5px rgba(155, 96, 38, 0.15);
}

textarea.form-control {
    min-height: 82px;
    resize: vertical;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-parota);
}

/* ============================================================================
   STEPPER MODERNO DEL COTIZADOR (PANTALLA B)
   ============================================================================ */
.wizard-steps {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.45rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}

.step-pill {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.16s ease;
}

.step-pill:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.step-pill .step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-warm-tint);
    color: var(--brand-tzalam);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 800;
}

.step-pill.active {
    background: var(--bg-dark);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.step-pill.active .step-num {
    background: var(--brand-gold);
    color: #161311;
}

.step-pill.completed .step-num {
    background: var(--status-success-bg);
    color: var(--status-success);
}

/* ============================================================================
   TARJETAS DE DESPIECE Y DIAGRAMA VISUAL DE CANTOS (PANTALLA C)
   ============================================================================ */
.part-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--brand-parota);
    border-radius: var(--radius-md);
    padding: 1.05rem;
    margin-bottom: 0.8rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.part-card:hover {
    background: #FFFFFF;
    box-shadow: var(--shadow-xs);
}

.edge-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.edge-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.15s ease;
}

.edge-chip:hover {
    border-color: var(--brand-parota);
}

.edge-chip.edge-active {
    background: #FEF6EC;
    border-color: var(--brand-parota);
    color: var(--brand-parota);
    box-shadow: 0 0 0 2px rgba(155, 96, 38, 0.12);
}

/* Mini indicador visual 2D de los 4 bordes de la pieza */
.piece-visual-box {
    width: 44px;
    height: 30px;
    background: #EADBC8;
    border: 2px dashed #C7B6A2;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--brand-tzalam);
    flex-shrink: 0;
}
.piece-visual-box.edge-t { border-top: 3px solid var(--brand-parota); }
.piece-visual-box.edge-b { border-bottom: 3px solid var(--brand-parota); }
.piece-visual-box.edge-l { border-left: 3px solid var(--brand-parota); }
.piece-visual-box.edge-r { border-right: 3px solid var(--brand-parota); }

/* ============================================================================
   PANEL ECONÓMICO LATERAL CON BARRA VISUAL DE COSTOS (PANTALLA D)
   ============================================================================ */
.quoter-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .quoter-layout {
        grid-template-columns: 1fr 400px;
        align-items: start;
    }
    .economic-sidebar {
        position: sticky;
        top: 120px;
    }
}

.summary-box-internal {
    background: linear-gradient(160deg, #1E1916 0%, #15120F 100%);
    color: #F4EFEA;
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    margin-bottom: 1.1rem;
    border: 1px solid rgba(212, 163, 89, 0.25);
    box-shadow: var(--shadow-md);
}

.cost-distribution-bar {
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    display: flex;
    margin: 0.75rem 0 0.95rem;
}

.cost-seg { height: 100%; transition: width 0.3s ease; }
.cost-seg-wood { background: #D97706; }
.cost-seg-edge { background: #F59E0B; }
.cost-seg-hw { background: #3B82F6; }
.cost-seg-fin { background: #10B981; }
.cost-seg-work { background: #A855F7; }
.cost-seg-add { background: #EC4899; }

.summary-box-commercial {
    background: #FFFFFF;
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    border: 2px solid var(--brand-parota);
    box-shadow: var(--shadow-md);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.42rem 0;
    font-size: 0.89rem;
    border-bottom: 1px dashed rgba(150, 150, 150, 0.18);
}

.summary-row.total-line {
    font-size: 1.15rem;
    font-weight: 800;
    border-top: 2px solid currentColor;
    border-bottom: none;
    padding-top: 0.7rem;
    margin-top: 0.4rem;
}

.payment-split-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.split-pill-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    text-align: center;
}

/* ============================================================================
   TABLAS, ALERTAS Y BADGES
   ============================================================================ */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.89rem;
}

.data-table th,
.data-table td {
    padding: 0.78rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
    background-color: var(--bg-subtle);
}

.data-table th {
    background: var(--bg-warm-tint);
    color: var(--text-secondary);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 0.85rem;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.alert-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border-color: rgba(180, 83, 9, 0.2);
    border-left-color: var(--status-warning);
}

.alert-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border-color: rgba(200, 30, 30, 0.2);
    border-left-color: var(--status-danger);
}

.alert-success {
    background: var(--status-success-bg);
    color: var(--status-success);
    border-color: rgba(21, 115, 71, 0.2);
    border-left-color: var(--status-success);
}

.alert-info {
    background: var(--status-info-bg);
    color: var(--status-info);
    border-color: rgba(29, 78, 216, 0.2);
    border-left-color: var(--status-info);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-borrador { background: #EFECE6; color: #4B433B; }
.badge-emitida { background: #DBEAFE; color: #1E40AF; }
.badge-aprobada, .badge-contratado { background: #D1FAE5; color: #065F46; }
.badge-convertida, .badge-cerrado, .badge-entregado { background: #DCFCE7; color: #166534; }
.badge-en_produccion, .badge-instalacion { background: #FEF3C7; color: #92400E; }
.badge-rechazada, .badge-cancelada, .badge-cancelado { background: #FEE2E2; color: #991B1B; }

/* Documento Comercial Imprimible / PDF (M07, Criterio P13) */
.commercial-doc {
    background: #FFFFFF;
    color: #111111;
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #181512;
    padding-bottom: 1.25rem;
    margin-bottom: 1.6rem;
}

.doc-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

/* Notificación Toast */
.toast-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.toast {
    background: var(--bg-dark);
    color: #FFFFFF;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.88rem;
    font-weight: 600;
    border-left: 4px solid var(--brand-gold);
    animation: fadeUp 0.25s ease-out;
}

/* Reglas de Impresión PDF limpia (Sin menús ni costos internos) */
@media print {
    body {
        background: #FFFFFF !important;
        background-image: none !important;
        color: #000000 !important;
    }
    .no-print,
    .topbar,
    .main-nav-wrapper,
    .wizard-steps,
    .economic-sidebar,
    .toast-container {
        display: none !important;
    }
    .main-container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .commercial-doc {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
    }
}
