/* NMACB Vendedores - Estilos Frontend */

.nmacb-dashboard {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Sidebar */
.nmacb-sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.nmacb-user-info {
    padding: 20px;
    background: #34495e;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.nmacb-user-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: white;
}

.nmacb-user-info p {
    margin: 5px 0;
    color: #bdc3c7;
    font-size: 14px;
}

.nmacb-user-info .codigo {
    color: #3498db;
    font-weight: bold;
}

/* Menú */
.nmacb-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nmacb-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nmacb-menu-item:hover {
    background: #34495e;
    color: white;
}

.nmacb-menu-item.active {
    background: #3498db;
    color: white;
    border-left: 4px solid #fff;
}

.nmacb-menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Contenido Principal */
.nmacb-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.nmacb-seccion-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nmacb-seccion-header h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

/* Estadísticas (Cards) */
.nmacb-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.nmacb-stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.nmacb-stat-card .label {
    display: block;
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
}

.nmacb-stat-card .value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Tablas */
.nmacb-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.nmacb-table {
    width: 100%;
    border-collapse: collapse;
}

.nmacb-table th,
.nmacb-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.nmacb-table th {
    background: #f8f9fa;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

/* Formulario Pedido */
.pedido-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.pedido-buscador {
    margin-bottom: 20px;
}

.pedido-buscador input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
}

.resultados-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
}

.producto-resultado {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.producto-resultado:hover {
    transform: translateY(-5px);
}

.producto-resultado img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.producto-resultado:hover img {
    transform: scale(1.05);
}

.producto-resultado h4 {
    margin: 10px 0;
    font-size: 14px;
    min-height: 40px;
}

/* Items del pedido seleccionado */
.pedido-resumen {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.pedido-items {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.pedido-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
    margin-bottom: 10px;
}

.pedido-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.pedido-item .item-nombre {
    flex: 1;
    font-weight: 600;
}

.pedido-item .item-precio {
    color: #3498db;
    font-weight: 700;
}

.pedido-item .item-cantidad {
    width: 80px;
    padding: 8px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
}

.pedido-item .remover-producto-pedido {
    width: 30px;
    height: 30px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.pedido-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
    text-align: right;
    font-size: 20px;
    color: #2c3e50;
}

.pedido-total span {
    color: #3498db;
    font-weight: bold;
}

/* Formulario Login Vendedor */
.nmacb-login-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.nmacb-login-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.nmacb-login-container input[type="text"],
.nmacb-login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Badges de Estado */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Notificaciones y Cargando */
#nmacb-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nmacb-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nmacb-notice-success { background: #46b450; color: white; }
.nmacb-notice-error { background: #dc3232; color: white; }

/* Responsivo */
@media (max-width: 992px) {
    .nmacb-dashboard { flex-direction: column; }
    .nmacb-sidebar { width: 100%; }
    .pedido-grid { grid-template-columns: 1fr; }
}