body {
    background: #f4f6f9;
}

.bg-body {
    background: linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%);
}

.card {
    border-radius: 0.85rem;
}

.product-results {
    max-height: 65vh;
    overflow: auto;
}

.font-weight-semibold {
    font-weight: 600;
}

.nav-tabs .nav-link {
    color: #6c757d;
}

.nav-tabs .nav-link.active {
    color: #dc3545;
    font-weight: 600;
}

.gamerbit-login-page {
    background: radial-gradient(circle at top, #3f0d12 0%, #a71d31 38%, #f4f6f9 38%, #eef1f5 100%);
}

.gamerbit-login-page .login-box {
    width: 380px;
}


.gamerbit-save-modal .modal-content {
    border-radius: 1rem;
}

.save-modal-title {
    color: #5f6368;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.save-checkmark {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #d7ead1;
    transform: scale(1);
    opacity: 1;
}

.save-checkmark.animate {
    animation: save-pop 0.35s ease-out forwards;
}

.save-checkmark-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.save-checkmark-stem,
.save-checkmark-kick {
    position: absolute;
    background: #9bd184;
    border-radius: 4px;
    transform-origin: left top;
    opacity: 0;
}

.save-checkmark-stem {
    width: 6px;
    height: 34px;
    left: 49px;
    top: 22px;
    transform: rotate(42deg) scaleY(0);
}

.save-checkmark.animate .save-checkmark-stem {
    animation: save-stem 0.25s ease-out 0.25s forwards;
}

.save-checkmark-kick {
    width: 6px;
    height: 18px;
    left: 31px;
    top: 46px;
    transform: rotate(-45deg) scaleY(0);
}

.save-checkmark.animate .save-checkmark-kick {
    animation: save-kick 0.2s ease-out 0.1s forwards;
}

@keyframes save-pop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes save-stem {
    from {
        opacity: 0;
        transform: rotate(42deg) scaleY(0);
    }
    to {
        opacity: 1;
        transform: rotate(42deg) scaleY(1);
    }
}

@keyframes save-kick {
    from {
        opacity: 0;
        transform: rotate(-45deg) scaleY(0);
    }
    to {
        opacity: 1;
        transform: rotate(-45deg) scaleY(1);
    }
}


.cotizacion-actions .btn {
    min-width: 34px;
}

.cotizacion-actions .btn i {
    pointer-events: none;
}


.gamerbit-confirm-modal .modal-content,
.gamerbit-success-modal .modal-content {
    border-radius: 1rem;
}

.confirm-icon-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto;
    border-radius: 50%;
    border: 4px solid #f1c59f;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e8a35e;
    font-size: 3rem;
    font-weight: 700;
}

.confirm-modal-title {
    color: #5f6368;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.confirm-modal-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.productos-stock-cell {
    min-width: 180px;
    position: relative;
}

.productos-stock-badges {
    display: block;
    margin-bottom: 0.25rem;
}
.productos-stock-badges > div {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
}

.productos-stock-badge {
    font-size: 13px;
    padding: 4px 8px;
}

.productos-stock-labels {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}

.atributos-clave-row-dirty {
    background-color: #fff3cd;
}

.atributos-clave-saved {
    color: #1e7e34;
    font-weight: 600;
    animation: atributos-clave-pop 0.45s ease-out;
}

.atributos-clave-btn-saved {
    animation: atributos-clave-btn-pop 0.45s ease-out;
}

@keyframes atributos-clave-pop {
    0% {
        transform: scale(0.9);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes atributos-clave-btn-pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.productos-stock-summary {
    color: #495057;
    font-size: 0.85rem;
    cursor: default;
}

.productos-stock-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 20;
    min-width: 180px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.16);
    padding: 0.5rem 0.65rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.panel-maestro-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 15;
    margin-top: 1rem;
    padding-top: 0.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 24%, #fff 100%);
}

.panel-maestro-save-btn {
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.2);
}

.stock-log-panel {
    max-height: 260px;
    overflow-y: auto;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.45;
    background: #0f1115;
    color: #e6e6e6;
    border: 1px solid #1f2937;
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.stock-log-panel div {
    padding: 2px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
}

.stock-log-panel div:last-child {
    border-bottom: 0;
}

.catalogo-subcat-list {
    max-height: 260px;
    overflow-y: auto;
}

.catalogo-subcat-item {
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.catalogo-subcat-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.productos-stock-cell:hover .productos-stock-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.table.table-hover tbody tr:nth-of-type(odd) {
    background-color: #f8f9fb;
}

.table.table-hover tbody tr:nth-of-type(even) {
    background-color: #ffffff;
}

.table.table-hover tbody tr:hover {
    background-color: #e9eef5;
}

.scraping-lineas-panel {
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f6fb 100%);
    border: 1px solid #d8dee8;
    border-radius: 0.85rem;
    padding: 1rem;
}

.scraping-lineas-count {
    font-size: 0.8rem;
    padding: 0.45rem 0.65rem;
}

.scraping-lineas-list {
    max-height: 320px;
    overflow: auto;
    border: 1px solid #d8dee8;
    border-radius: 0.75rem;
    background: #fff;
}

.scraping-linea-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    margin: 0;
    border-bottom: 1px solid #eef1f5;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.scraping-linea-item:last-child {
    border-bottom: 0;
}

.scraping-linea-item:hover {
    background: #f7f9fc;
}

.scraping-linea-item-check {
    padding-top: 0.15rem;
}

.scraping-linea-item-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.scraping-linea-item-name {
    color: #1f2937;
    font-weight: 600;
    line-height: 1.3;
}

.scraping-linea-item-meta {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.panel-maestro-resumen {
    background: linear-gradient(180deg, #fafbfc 0%, #f3f6fa 100%);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    line-height: 1.7;
}

.panel-maestro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.85rem;
}

.panel-maestro-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.8rem;
    padding: 0.9rem 1rem;
    margin: 0;
    background: #fff;
}

.panel-maestro-item .custom-switch {
    padding-left: 2.25rem;
}

.panel-maestro-mapeos-listado {
    max-height: 360px;
    overflow: auto;
}

.panel-maestro-mapeos-listado thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.productos-preview-modal-image {
    max-height: 72vh;
    width: auto;
    border-radius: 0.75rem;
    background: #fff;
}

.productos-preview-thumbs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.productos-preview-thumb-btn {
    border: 2px solid transparent;
    background: transparent;
    border-radius: 0.6rem;
    padding: 0.2rem;
    line-height: 0;
}

.productos-preview-thumb-btn.active {
    border-color: #dc3545;
}

.productos-preview-thumb-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 0.45rem;
    background: #fff;
}

.proforma-stock-break {
    white-space: normal;
    line-height: 1.35;
}

#productos-table th,
#productos-table td {
    border-right: 1px solid #d9dee7;
}

#productos-table th:last-child,
#productos-table td:last-child {
    border-right: 0;
}

/* Banner de login requerido — reemplaza alert-warning amarillo */
.login-required-banner {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3b 100%);
    border: 1px solid rgba(99, 179, 237, 0.2);
    border-left: 4px solid #63b3ed;
    border-radius: 0.75rem;
    color: #e2e8f0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.login-required-banner strong {
    color: #90cdf4;
}

.login-required-banner .login-mensaje {
    color: #cbd5e0;
}

/* Botón confirmar login — aspecto inicial transparente/glass */
.btn-login-confirm {
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-login-confirm:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Estado confirmado — verde con marco brillante */
.scraping-login-confirmed {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45), 0 0 22px rgba(34, 197, 94, 0.35) !important;
    animation: scraping-confirm-glow 1.6s ease-in-out infinite;
}

@keyframes scraping-confirm-glow {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45), 0 0 22px rgba(34, 197, 94, 0.35);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.25), 0 0 40px rgba(34, 197, 94, 0.55), 0 0 65px rgba(34, 197, 94, 0.2);
    }
}

/* Botón confirmar login sobre fondo claro */
.btn-confirmar-login-light {
    background: transparent;
    border: 1.5px solid #ced4da;
    color: #6c757d;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    opacity: 0.75;
}

.btn-confirmar-login-light:hover:not(:disabled) {
    background: rgba(108, 117, 125, 0.08);
    border-color: #adb5bd;
    color: #495057;
    opacity: 1;
}

.ai-datos-counter {
    min-height: 31px;
    display: flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border: 1px solid #d9dee7;
    border-radius: 0.4rem;
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    font-size: 0.85rem;
}

.build-gamer-toolbar {
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f6fb 100%);
    border: 1px solid #d8dee8;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
}

.build-gamer-toolbar-help {
    line-height: 1.45;
}

.build-slot-card {
    border-radius: 0.9rem;
}

.build-slot-card .card-body {
    min-height: 220px;
}

.build-slot-results {
    font-weight: 600;
}

.build-slot-meta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    padding: 0.7rem 0.8rem;
    line-height: 1.45;
}

.build-slot-selected {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.build-slot-selected-image-wrap {
    width: 78px;
    min-width: 78px;
    height: 78px;
    border-radius: 0.7rem;
    overflow: hidden;
    border: 1px solid #dbe4f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.build-slot-selected-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.build-slot-selected-content {
    min-width: 0;
    flex: 1;
}

.build-component-line {
    background: #fbfcfe;
}

.build-rule-line {
    background: #fff;
}
