/* ============ SETUP & LOGIN ============ */
.setup-pantalla {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(91, 141, 239, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(52, 211, 153, 0.05) 0%, transparent 50%);
}

.setup-card {
    background: var(--bg-glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 580px;
    max-width: 95vw;
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.setup-card h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.setup-card .subtitulo {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.setup-paso { display: none; }
.setup-paso.activo { display: block; animation: fadeIn 0.3s ease; }

.setup-paso h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ STEPPER MODERNO ONBOARDING ============ */
.stepper-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    position: relative;
    padding: 0 4px;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.stepper-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(22, 27, 44, 0.95);
    border: 2px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 6px;
}

.stepper-step.active .stepper-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 14px rgba(91, 141, 239, 0.4);
    transform: scale(1.08);
}

.stepper-step.completed .stepper-circle {
    background: rgba(52, 211, 153, 0.2);
    border-color: #34d399;
    color: #34d399;
}

.stepper-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.3s;
    white-space: nowrap;
}

.stepper-step.active .stepper-label { color: #5b8def; }
.stepper-step.completed .stepper-label { color: #34d399; }

.stepper-line {
    position: absolute;
    top: 16px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.stepper-line-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.35s ease;
    width: 0%;
}

/* ============ RUBROS GRID INTERACTIVA ============ */
.rubros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 210px;
    overflow-y: auto;
    padding-right: 4px;
}

.rubro-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
}

.rubro-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(91, 141, 239, 0.4);
    transform: translateY(-2px);
}

.rubro-card.selected {
    background: rgba(91, 141, 239, 0.12);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(91, 141, 239, 0.25);
    transform: translateY(-2px);
}

.rubro-card .rubro-icon {
    font-size: 24px;
    line-height: 1;
}

.rubro-card .rubro-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ PREVIEW CARD DEL COMERCIO ============ */
.comercio-preview-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.comercio-preview-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.comercio-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comercio-preview-info {
    flex: 1;
    min-width: 0;
}

.comercio-preview-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comercio-preview-rubro {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 2px;
}

/* ============ FORTALEZA DE CONTRASEÑA ============ */
.pwd-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pwd-input-wrap input {
    width: 100%;
    padding-right: 40px !important;
}

.pwd-toggle-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.pwd-toggle-btn:hover { color: var(--text-primary); }

.pwd-strength-wrap {
    margin-top: 6px;
    margin-bottom: 12px;
}

.pwd-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 4px;
}

.pwd-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s, background-color 0.3s;
}

.pwd-strength-text {
    font-size: 11px;
    color: var(--text-muted);
}

.login-pantalla {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 30% 50%, rgba(91, 141, 239, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(52, 211, 153, 0.04) 0%, transparent 50%);
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 400px;
    max-width: 92vw;
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-card .emprendimiento-nombre {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.login-card .rubro-tag {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 28px;
    font-weight: 600;
}

.login-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 22px;
}

/* ============ CARRITO DE VENTA ============ */
.carrito-lista {
    margin-bottom: 16px;
}

.carrito-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xs);
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.carrito-item .item-info {
    flex: 1;
}

.carrito-item .item-nombre {
    font-weight: 600;
    font-size: 14px;
}

.carrito-item .item-detalle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.carrito-item .item-subtotal {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    margin-right: 12px;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(91, 141, 239, 0.06);
    border: 1px solid rgba(91, 141, 239, 0.15);
    border-radius: var(--radius-xs);
    margin-top: 12px;
}

.carrito-total .total-label {
    font-weight: 600;
    font-size: 14px;
}

.carrito-total .total-valor {
    font-weight: 700;
    font-size: 20px;
    color: var(--accent);
}

.busqueda-productos {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1f35;
    border: 1px solid var(--border-card);
    border-radius: 0 0 var(--radius-xs) var(--radius-xs);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 2px;
}

.producto-sugerencia {
    padding: 10px 15px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.producto-sugerencia:last-child {
    border-bottom: none;
}

.producto-sugerencia:hover {
    background: rgba(91, 141, 239, 0.12);
    color: var(--text-primary);
}

.busqueda-wrapper {
    position: relative;
}

/* ============ PAGO DIVIDIDO ============ */
.pago-dividido-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    user-select: none;
}

.pago-dividido-toggle input[type="checkbox"] {
    accent-color: var(--accent);
}

.pago-dividido-campos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xs);
    animation: fadeIn 0.2s ease;
}

.pago-dividido-campos .pago-restante {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    text-align: right;
}

/* ============ CLICK EN VENTA ============ */
.tabla td.fila-clickeable {
    cursor: pointer;
}

.tabla tr.fila-clickeable:hover td {
    background: rgba(91, 141, 239, 0.06);
}

/* ============ DETALLE VENTA MODAL ============ */
.detalle-venta-grid {
    display: grid;
    gap: 12px;
}

.detalle-venta-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xs);
    margin-bottom: 16px;
}

.detalle-venta-info .dv-item .dv-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
}

.detalle-venta-info .dv-item .dv-valor {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

/* ============ CARRITO INLINE EDIT ============ */
.input-editar-cantidad:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ============ GRILLA DE PRODUCTOS (VENTA) ============ */
.grilla-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.producto-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.producto-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.producto-card:active {
    transform: scale(0.97);
}

.producto-card .prod-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    transition: transform 0.15s;
}

.producto-card:hover .prod-img {
    transform: scale(1.08);
}

.producto-card .prod-nombre {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.producto-card .prod-marca {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.producto-card .prod-stock {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.producto-card .prod-stock.bajo {
    color: var(--orange);
    font-weight: 600;
}

.producto-card .prod-precio {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.producto-card.sin-stock {
    opacity: 0.4;
    cursor: not-allowed;
}

.producto-card.sin-stock:hover {
    transform: none;
    box-shadow: none;
}

/* Subtitulos de seccion en grilla */
.grilla-subtitulo {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 8px 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-card);
}

/* ============ CARRITO FLOTANTE ============ */
.carrito-flotante {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 200;
}

.carrito-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 24px var(--accent-glow);
    transition: all var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrito-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px var(--accent-glow);
}

.carrito-btn:active {
    transform: scale(0.94);
}

.carrito-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    padding: 0 5px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carrito-badge.pop {
    transform: scale(1.4);
}

/* ============ POPUP CANTIDAD ============ */
.popup-cantidad {
    position: fixed;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    width: 340px;
    animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}


.popup-cantidad .popup-titulo {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.popup-cantidad .popup-stock {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.popup-fondo {
    position: fixed;
    inset: 0;
    z-index: 999;
}

/* ============ TICKET PAGO LIMPIO ============ */
.ticket-pago-lista {
    list-style: none;
    padding: 0;
    margin: 4px 0;
}

.ticket-pago-lista li {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    font-size: 12px;
}

/* ============ MARKDOWN / AYUDA ============ */
.ayuda-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    max-width: 1100px;
}

.ayuda-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 16px;
    height: fit-content;
    backdrop-filter: blur(12px);
}

.ayuda-sidebar h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.ayuda-sidebar a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    margin-bottom: 2px;
}

.ayuda-sidebar a:hover,
.ayuda-sidebar a.activo {
    background: rgba(91, 141, 239, 0.1);
    color: var(--accent);
}

.ayuda-contenido {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 32px 36px;
    backdrop-filter: blur(12px);
    min-height: 400px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.ayuda-contenido h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-card);
}

.ayuda-contenido h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.ayuda-contenido h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.ayuda-contenido p {
    margin-bottom: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.ayuda-contenido strong {
    color: var(--text-primary);
}

.ayuda-contenido ul, .ayuda-contenido ol {
    margin-bottom: 14px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.ayuda-contenido li {
    margin-bottom: 6px;
}

.ayuda-contenido code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent);
}

.ayuda-contenido table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.ayuda-contenido th {
    text-align: left;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-card);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ayuda-contenido td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
    color: var(--text-secondary);
}

.ayuda-contenido hr {
    border: none;
    border-top: 1px solid var(--border-card);
    margin: 28px 0;
}

.ayuda-contenido a {
    color: var(--accent);
}

/* Badge de estado del servicio */
.badge-estado {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
    cursor: pointer;
    position: relative;
    line-height: 1.4;
}
.badge-activo {
    background: #22c55e20;
    color: #22c55e;
    border: 1px solid #22c55e30;
}
.badge-activo::before { background: #22c55e; }
.badge-suspendido {
    background: #ef444420;
    color: #ef4444;
    border: 1px solid #ef444430;
}
.badge-suspendido::before { background: #ef4444; }
.badge-pendiente {
    background: #f59e0b20;
    color: #f59e0b;
    border: 1px solid #f59e0b30;
}
.badge-pendiente::before { background: #f59e0b; }
.badge-activo .badge-dot { background: #22c55e; }
.badge-suspendido .badge-dot { background: #ef4444; }
.badge-pendiente .badge-dot { background: #f59e0b; }

.tooltip-estado {
    position: fixed;
    background: var(--bg-glass);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 400;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    line-height: 1.6;
    display: none;
    min-width: 160px;
    border: 1px solid var(--border-glass);
}
.tooltip-estado-linea {
    white-space: nowrap;
}
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 6px currentColor;
    flex-shrink: 0;
}
.badge-activo .badge-dot { background: #22c55e; }
.badge-suspendido .badge-dot { background: #ef4444; }
.badge-pendiente .badge-dot { background: #f59e0b; }

/* ============ PANTALLA DE ESCANEO ============ */
.scanner-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: scanner-pulse 2s ease-in-out infinite;
}

.scanner-icon {
    font-size: 40px;
    z-index: 1;
    position: relative;
}

.scanner-laser {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scanner-laser 1.5s ease-in-out infinite;
}



.scanner-ring-cargando {
    animation: scanner-spin 1s linear infinite !important;
}


/* Popup de escaneo (centrado, fondo blur) */
.popup-cantidad-escaneo {
    width: 360px;
    padding: 24px 20px 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

.popup-fondo-blur {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
}
