/* =========================================
   1. VARIABLES Y RESET GENERAL
   ========================================= */
:root {
    /* Paleta de Colores Corporativa */
    --primary: #0d6efd;       /* Azul Principal */
    --primary-hover: #0b5ed7; 
    --secondary: #6c757d;     /* Gris */
    --success: #198754;       /* Verde (Venta/Terminado) */
    --info: #0dcaf0;          /* Cyan (Información) */
    --warning: #ffc107;       /* Amarillo (Proceso/Alerta) */
    --danger: #dc3545;        /* Rojo (Error/Pendiente) */
    
    /* Colores Neutros */
    --dark: #212529;          /* Texto Oscuro */
    --light: #f8f9fa;         /* Fondos Claros */
    --bg-body: #f4f6f9;       /* Fondo de la página */
    --bg-sidebar: #343a40;    /* Fondo del Menú */
    
    /* Bordes y Sombras */
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--dark);
    line-height: 1.6;
    font-size: 15px; /* Un poco más compacto */
}

/* =========================================
   2. ESTRUCTURA (LAYOUT)
   ========================================= */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR (Menú Lateral) --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #131313;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: var(--light);
    border-bottom: 1px solid #4b545c;
    padding-bottom: 15px;
}

/* Títulos de sección en el menú */
.menu-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #adb5bd;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding-left: 10px;
}

/* Enlaces del menú */
.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #c2c7d0;
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.menu-link i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

.menu-link:hover, .menu-link.active {
    background-color: var(--primary);
    color: #fff;
    transform: translateX(3px); /* Pequeño movimiento */
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    flex: 1;
    margin-left: 260px; /* Igual al ancho del sidebar */
    padding: 30px;
    transition: all 0.3s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

header h1 {
    font-size: 1.8rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================================
   3. COMPONENTES UI
   ========================================= */

/* Tarjetas (Contenedores) */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Grillas (Layout Flexible) */
.grid-ventas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: start;
}

/* Formularios (Inputs) */
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 5px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* --- BOTONES GENERALES --- */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.2s ease;
}

.btn-guardar {
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-guardar:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-guardar:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

/* --- BOTÓN CERRAR SESIÓN (PREMIUM) --- */
.btn-logout {
    margin-top: auto; 
    background-color: rgba(220, 53, 69, 0.1); /* Fondo transparente */
    color: #ff8787;
    border: 1px solid #dc3545;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

/* --- TABLAS --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    overflow: hidden;
    border-radius: var(--radius);
}

th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 14px 12px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #444;
    vertical-align: middle;
}

tr:hover td {
    background-color: #f8f9fa;
}

/* Iconos de acción en tablas */
.btn-icon-edit, .btn-icon-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 4px;
    transition: 0.2s;
}
.btn-icon-edit { color: var(--warning); margin-right: 5px; }
.btn-icon-delete { color: var(--danger); }
.btn-icon-edit:hover, .btn-icon-delete:hover { background-color: #f1f1f1; transform: scale(1.1); }


/* =========================================
   4. KANBAN (PEDIDOS)
   ========================================= */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.kanban-column {
    background: #e9ecef; /* Gris claro */
    border-radius: 10px;
    padding: 15px;
    min-height: 400px;
    border-top: 4px solid transparent;
}
/* Colores de borde superior por columna */
.kanban-column:nth-child(1) { border-color: var(--danger); }
.kanban-column:nth-child(2) { border-color: var(--warning); }
.kanban-column:nth-child(3) { border-color: var(--success); }

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 800;
    text-transform: uppercase;
    color: #495057;
    font-size: 0.9rem;
}

.badge {
    background: #6c757d;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 5px solid #ccc;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Colores de Estado en Tarjetas */
.card-pendiente { border-left-color: var(--danger); }
.card-proceso { border-left-color: var(--warning); }
.card-terminado { border-left-color: var(--success); }

.card-title { font-weight: bold; color: #333; margin-bottom: 5px; font-size: 1.05rem; }
.card-desc { font-size: 0.9rem; color: #666; margin-bottom: 12px; line-height: 1.4; }
.card-meta { font-size: 0.8rem; color: #999; display: flex; justify-content: space-between; align-items: center; }

.card-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f1f1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Botones de acción del Kanban */
.btn-icon {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-icon:hover { background: #e2e6ea; }
.btn-next { color: var(--primary); font-weight: bold; }
.btn-prev { color: var(--secondary); }
.btn-del { color: var(--danger); }


/* =========================================
   5. MODALES
   ========================================= */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px); /* Efecto borroso elegante */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}


/* =========================================
   6. LOGIN (Página de Inicio)
   ========================================= */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    color: var(--dark);
    margin-bottom: 25px;
    font-size: 1.8rem;
}


/* =========================================
   7. IMPRESIÓN (TICKET TÉRMICO)
   ========================================= */
/* Ocultar en pantalla normal */
/* Ocultar cualquier ticket previo */
#area-ticket, .ticket-oculto {
    display: none !important;
}

/* Modal Simple */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-content { background: #fff; padding: 20px; border-radius: 10px; }

/* =========================================
   8. RESPONSIVIDAD (Móvil)
   ========================================= */
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; padding: 15px; }
    .sidebar h2 { margin-bottom: 15px; }
    .main-content { margin-left: 0; padding: 15px; }
    .grid-ventas { grid-template-columns: 1fr; } 
    .card { padding: 15px; }
    
    /* El botón logout en móvil se ve mejor como botón normal */
    .btn-logout { margin-top: 15px; }
}
