/* estilos.css - Demo Sistema Tropicali */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

:root {
    --primary: #4e342e;
    --secondary: #8d6e63;
    --bg-light: #f4f6f8;
    --white: #ffffff;
}

/* === ESTRUCTURA WEB === */
body { 
    font-family: 'Montserrat', sans-serif; 
    background-color: var(--bg-light); 
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === BANNER SUPERIOR === */
header.app-header {
    background: linear-gradient(135deg, var(--primary), #2d1b18);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* === CONTENEDOR PRINCIPAL === */
.container-main { 
    max-width: 98%; 
    width: 98%;
    margin: 0 auto;
    padding: 5px 8px; 
    box-sizing: border-box;
    flex: 1; 
}

/* === TARJETAS === */
.card-box { 
    background: white; 
    border-radius: 15px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    padding: 25px; 
    overflow: hidden; 
    margin-bottom: 20px; 
}

/* === NAVEGACIÓN Y LOGO === */
.logo-area { display: flex; align-items: center; gap: 15px; }
.logo-img { height: 45px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); }

.nav-bar { background: white; padding: 10px; display: flex; justify-content: center; gap: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); flex-wrap: wrap; }
.nav-btn {
    text-decoration: none; color: #666; padding: 10px 20px; border-radius: 30px; font-weight: 600; transition: 0.3s;
}
.nav-btn:hover, .nav-btn.active { background: var(--secondary); color: white; }

/* === TABLAS Y BADGES === */
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom th { text-align: left; padding: 15px; background: #f8f9fa; color: #555; font-size: 0.9rem; }
.table-custom td { padding: 15px; border-bottom: 1px solid #eee; }
.badge { padding: 5px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; }
.bg-ok { background: #e8f5e9; color: #2e7d32; }
.bg-low { background: #fff3e0; color: #ef6c00; }
.bg-bad { background: #ffebee; color: #c62828; }

.table-custom-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* === FOOTER === */
.app-footer {
    margin-top: auto; 
    width: 100%;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* === GRID FINANCIERO === */
.grid-financiero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* TARJETAS PRINCIPALES */
.card-money {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-money:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-money::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color, #007bff), var(--card-color-dark, #0056b3));
}

.money-label { 
    font-size: 0.85rem; 
    color: #6c757d; 
    text-transform: uppercase; 
    font-weight: 600; 
    margin-bottom: 10px; 
    letter-spacing: 0.5px;
}
.money-value { 
    font-size: 2rem; 
    font-weight: 800; 
    color: #333; 
    line-height: 1.2;
}

/* Colores KPI con gradientes */
.borde-azul { --card-color: #1976D2; --card-color-dark: #1565c0; } 
.texto-azul { color: #1976D2; }
.borde-rojo { --card-color: #d32f2f; --card-color-dark: #c62828; } 
.texto-rojo { color: #d32f2f; }
.borde-verde { --card-color: #2e7d32; --card-color-dark: #1b5e20; } 
.texto-verde { color: #2e7d32; }
.borde-naranja { --card-color: #f57c00; --card-color-dark: #ef6c00; } 
.texto-naranja { color: #f57c00; }

/* === TICKET DE VENTA === */
.ny-receipt {
    background-color: #fffcf5;
    border: 1px solid #e0e0e0;
    padding: 25px;
    font-family: 'Inconsolata', monospace;
    color: #333;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.ny-receipt::before {
    content: ""; display: block; width: 100%; height: 5px;
    background: repeating-linear-gradient(45deg, #333, #333 10px, #fffcf5 10px, #fffcf5 20px);
    margin-bottom: 20px;
}

.receipt-header { text-align: center; border-bottom: 2px dashed #333; padding-bottom: 15px; margin-bottom: 15px; }
.receipt-header h4 { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin: 0; font-style: italic; color: var(--primary); }

#ticket-body { 
    flex: 1; 
    overflow-y: auto; 
    font-size: 1.1rem; 
    margin-bottom: 15px; 
}

.ticket-item {
    border-bottom: 1px dotted #ccc !important; 
    padding: 8px 0 !important; 
    display: flex !important; 
    justify-content: space-between !important;
    align-items: center !important;
}

.ticket-item-name {
    flex: 1;
    font-weight: 600;
}

.ticket-item-qty {
    margin: 0 10px;
    color: #666;
    font-size: 0.9rem;
}

.ticket-item-price {
    text-align: right;
    font-weight: bold;
    color: var(--primary);
}

.receipt-footer { border-top: 2px dashed #333; padding-top: 15px; }
.receipt-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; }

.btn-stamp {
    width: 100%; 
    padding: 15px; 
    background-color: var(--primary); 
    color: #fffcf5;
    border: 2px solid var(--primary); 
    font-family: 'Inconsolata', monospace;
    font-weight: bold; 
    font-size: 1.2rem; 
    text-transform: uppercase; 
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-stamp:hover {
    background-color: #fffcf5;
    color: var(--primary);
}

.payment-select {
    width: 100%; 
    padding: 8px; 
    margin-bottom: 15px; 
    border: 1px dashed #666;
    background: transparent; 
    font-family: 'Inconsolata', monospace; 
    color: #333;
}

/* === GRID DE VENTAS === */
.grid-ventas {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    height: calc(100vh - 200px);
}

/* === PRODUCTOS GRID === */
.producto-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.producto-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.producto-card.selected {
    border-color: var(--primary);
    background: linear-gradient(45deg, rgba(78, 52, 46, 0.05), rgba(78, 52, 46, 0.1));
}

.producto-nombre {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.producto-precio {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
}

.producto-stock {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.producto-stock.low {
    color: #f57c00;
    font-weight: bold;
}

/* === SECCIONES === */
.seccion {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .grid-ventas {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    
    .ny-receipt { 
        margin-top: 20px; 
        min-height: 400px;
    }
    
    .grid-financiero {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .card-money {
        padding: 20px 15px;
    }
    
    .money-value {
        font-size: 1.5rem;
    }
    
    .nav-bar {
        padding: 8px;
        gap: 5px;
    }
    
    .nav-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    header.app-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .logo-area {
        flex-direction: column;
        gap: 8px;
    }
    
    .table-custom {
        font-size: 0.9rem;
    }
    
    .table-custom th,
    .table-custom td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .container-main {
        padding: 5px;
    }
    
    .card-box {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .grid-financiero {
        grid-template-columns: 1fr;
    }
    
    .producto-card {
        padding: 10px;
    }
    
    .producto-nombre {
        font-size: 0.8rem;
    }
    
    .producto-precio {
        font-size: 1rem;
    }
}

/* === SCROLLBAR PERSONALIZADA === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* === ANIMACIONES === */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* === UTILIDADES === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none; }
.show { display: block; }