/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Layout principal */
.container {
    display: flex;
    min-height: calc(100vh - 66px); /* Restamos la altura del header */
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 0;
}

.sidebar-header {
    padding: 20px 20px 20px 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-menu {
    list-style: none;
    margin-top: 20px;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 10px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #34495e;
    color: white;
    border-left: 4px solid #3498db;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

/* Tarjetas */
.card {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Formularios */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* Botones */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Tablas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* Alertas */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-form {
    background: white;
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
}

.login-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px 30px 30px;
    text-align: center;
    position: relative;
}

.logo-container {
    margin-bottom: 20px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
    object-fit: cover;
    background: white;
    padding: 10px;
}

.login-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: white;
}

.login-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

.login-form-content {
    padding: 40px 30px 30px;
}

.login-form-content .form-group {
    margin-bottom: 25px;
}

.login-form-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.login-form-content label i {
    margin-right: 8px;
    color: #3498db;
    width: 16px;
}

.login-form-content .form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.login-form-content .form-control:focus {
    outline: none;
    border-color: #3498db;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.btn-login i {
    margin-right: 8px;
}

.alert-error {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 30px;
    display: flex;
    align-items: center;
}

.alert-error i {
    margin-right: 10px;
    font-size: 18px;
}

.login-footer {
    background-color: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.login-footer p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

/* Responsive para login */
@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
        padding: 10px;
    }
    
    .login-header {
        padding: 30px 20px 20px;
    }
    
    .login-form-content {
        padding: 30px 20px 20px;
    }
    
    .login-footer {
        padding: 15px 20px;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .sidebar-menu li {
        margin-bottom: 0;
    }
    
    .sidebar-menu a {
        padding: 8px 15px;
        border-radius: 4px;
    }
}

/* Ventas */
.venta-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .venta-container {
        grid-template-columns: 1fr;
    }
}

.items-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.item-card {
    padding: 10px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.item-card:hover {
    background-color: #f8f9fa;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.totales {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.totales div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 18px;
}

.totales .grand-total {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Header específico */
.hdr-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    margin-bottom: 0;
}

.hdr-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hdr-left h1 {
    margin: 0;
    font-size: 24px;
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (max-width: 768px) {
    .hdr-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Dashboard específico */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dash-stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.dash-stat-card:hover {
    transform: translateY(-5px);
}

.dash-stat-icon {
    font-size: 40px;
    margin-right: 15px;
}

.dash-stat-info h3 {
    margin: 0;
    font-size: 28px;
    color: #2c3e50;
}

.dash-stat-info p {
    margin: 5px 0 0;
    color: #7f8c8d;
}

.dash-quick-actions {
    margin-bottom: 30px;
}

.dash-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.dash-action-buttons .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.dash-action-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.dash-charts {
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .dash-stats {
        grid-template-columns: 1fr;
    }
    
    .dash-action-buttons {
        grid-template-columns: 1fr;
    }
}

/* Consultas específico */
.cons-filter-form .cons-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.cons-filter-actions {
    display: flex;
    gap: 10px;
}

.cons-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.cons-table-responsive {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .cons-filter-form .cons-filter-row {
        grid-template-columns: 1fr;
    }
    
    .cons-filter-actions {
        flex-direction: column;
    }
    
    .cons-pagination {
        flex-wrap: wrap;
    }
}

/* Admin específico */
.admin-badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.admin-badge-success {
    background-color: #d4edda;
    color: #155724;
}

.admin-badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Formularios dinámicos */
.form-hidden {
    display: none;
}

.form-visible {
    display: block;
}

.form-image-preview {
    margin-top: 10px;
}

.form-image-preview img {
    max-width: 200px;
    max-height: 200px;
}

/* Botones específicos */
.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
    margin: 2px;
}

/* Separadores de sección en el sidebar para administrador */
.sidebar-section-separator {
    height: 1px;
    background-color: #34495e;
    margin: 10px 20px;
    opacity: 0.5;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

.modal-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #bdc3c7;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/*  Layout de dos columnas  */
.row-layout  {  display:  flex;  gap: 20px;  margin-bottom: 20px;  }
.col-left, .col-right  {  flex:  1;  }

.ticket-item { padding: 15px; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; transition: all 0.3s; }
.ticket-item:hover { background-color: #f8f9fa; border-color: #3498db; }
.ticket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ticket-code { margin: 5px 0; font-size: 14px; }
.ticket-desc { margin: 5px 0; font-size: 14px; color: #666; }
.ticket-stats { display: flex; gap: 5px; margin-top: 8px; }

/* Preview de tickets */
.tickets-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ticket-preview-item { padding: 15px; border: 1px solid #ddd; border-radius: 5px; text-align: center; background: #f8f9fa; }
.ticket-preview-item strong { display: block; margin: 8px 0; }
.ticket-preview-item small { display: block; color: #666; font-size: 12px; font-family: monospace; }

/* Responsive */
@media (max-width: 768px) { .row-layout { flex-direction: column; } .tickets-preview { grid-template-columns: 1fr; } }

/* Table wrapper */
.table-wrapper { padding: 20px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
.data-table th { background-color: #f8f9fa; font-weight: 600; }
.data-table tr:hover { background-color: #f8f9fa; }

/* Botón Excel */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

