﻿@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;600;700&display=swap');

:root {
    --app-name: "eTiendas ERP";
    --primary: #0d6efd;
    --secondary: #6c757d;
    --dark: #2c3e50;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
    --global-font: 'Urbanist', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--global-font);
    margin: 0;
}

    body.module-page {
        background-color: #ffffff;
        padding: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

.module-content {
    flex-grow: 1;
    overflow: hidden;
}

/* ==========================================
   TOOLBAR DEL MOCKUP (Exacto a image_d9e802)
   ========================================== */
.page-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.5rem;
    color: #212529;
    margin: 0;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    outline: none;
    width: 200px;
    color: #495057;
}

/* Botón Azul Cuadrado [+] */
.btn-square-blue {
    background-color: #0d6efd;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

    .btn-square-blue:hover {
        background-color: #0b5ed7;
    }

/* Botón Gris [CSV Importar CSV] */
.btn-gray-import {
    background-color: #ced4da; /* Gris exacto del mockup */
    color: #ffffff; /* Letras blancas */
    border: none;
    height: 36px;
    padding: 0 15px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-gray-import:hover {
        background-color: #adb5bd;
    }

/* Botón Gris Cuadrado [Basurero] */
.btn-square-gray {
    background-color: #ced4da;
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

    .btn-square-gray:hover {
        background-color: #adb5bd;
    }

/* ==========================================
   TABULATOR - GRID
   ========================================== */
.tabulator {
    border: none !important;
    border-top: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    min-height: 32px;
}

.tabulator-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-weight: bold;
}

.tabulator-row {
    border-bottom: 1px solid #f1f3f5 !important;
    cursor: pointer; /* Comportamiento de Filas (Hover/Click) unificado */
    transition: background-color 0.2s;
    min-height: 26px !important;
}

    .tabulator-row:hover {
        background-color: #f8f9fa !important;
    }

.tabulator-cell {
    padding: 6px 10px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    height: auto !important;
}

/* ==========================================
   ESTILOS INTERNOS DEL GRID UNIFICADOS
   ========================================== */

/* Botones de Acción en el Grid */
.btn-grid-action, .btn-grid-edit {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

    .btn-grid-action:hover, .btn-grid-edit:hover {
        background-color: #2ecc71;
    }

/* Etiquetas (Badges) de Estado Globales */
.badge {
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 3px;
    font-weight: bold;
    display: inline-block;
}

.badge-blue {
    background: #3498db;
}

.badge-green {
    background: #2ecc71;
}

.badge-orange {
    background: #e67e22;
}

.badge-purple {
    background: #9b59b6;
}

.badge-yellow {
    background: #f1c40f;
    color: black;
}

.badge-dark {
    background: #34495e;
}

.badge-red {
    background: #e74c3c;
}

/* Estados de Compra / Globales en texto */
.status-borrador {
    color: #f39c12;
    font-weight: bold;
}

.status-recibida {
    color: #27ae60;
    font-weight: bold;
}

/* ==========================================
   MODALES
   ========================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fffde7; /* Fondo amarillo muy pálido */
    border-radius: 8px;
    width: 100%;
    max-width: 650px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background-color: var(--dark);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        margin: 0;
        font-size: 1.2rem;
        color: white !important;
    }

.modal-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 75vh;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: transparent; /* Hereda el fondo amarillo */
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================
   FORMULARIOS
   ========================================== */
.form-group {
    margin-bottom: 15px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        font-size: 0.9rem;
    }

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 10px;
}
