:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    line-height: 1.6;
}

/* Navbar */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    padding-top: 100px;
    padding-bottom: 80px;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), #2980b9) !important;
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.75rem 2rem;
    border-radius: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, var(--primary-color));
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Login & Register Cards */
.login-container,
.register-container {
    max-width: 500px;
    margin: 0 auto;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
    background-color: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding-top: 120px;
        padding-bottom: 60px;
        text-align: center;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem !important;
    }
}

/* Status indicators */
.status-pendiente {
    color: var(--warning-color);
}

.status-pagado {
    color: var(--success-color);
}

.status-vencido {
    color: var(--danger-color);
}

/* Dashboard Stats */
.stat-card {
    border-left: 4px solid;
}

.stat-card.bg-primary {
    border-left-color: var(--primary-color);
}

.stat-card.bg-success {
    border-left-color: var(--success-color);
}

.stat-card.bg-warning {
    border-left-color: var(--warning-color);
}

.stat-card.bg-danger {
    border-left-color: var(--danger-color);
}

/* ====================
   COLORES PERSONALIZADOS
   ==================== */
:root {
    --navy-blue: #001f3f;
    --navy-blue-light: #003366;
    --navy-blue-lighter: #004080;
    --gold-accent: #FFD700;
    --text-white: #ffffff;
    --text-light: #f8f9fa;
}

/* ====================
   NAVBAR PERSONALIZADO
   ==================== */
.custom-navbar {
    background: linear-gradient(135deg, var(--navy-blue), var(--navy-blue-light)) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 0.8rem 0;
}

.custom-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-white) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.custom-navbar .navbar-brand i {
    color: var(--gold-accent);
}

.custom-navbar .nav-link {
    color: var(--text-white) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-white) !important;
    transform: translateY(-2px);
}

.custom-navbar .nav-link.active {
    background-color: rgba(255, 215, 0, 0.2);
    color: var(--text-white) !important;
    border-bottom: 2px solid var(--gold-accent);
}

.custom-navbar .dropdown-menu {
    background: linear-gradient(135deg, var(--navy-blue-light), var(--navy-blue-lighter));
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.custom-navbar .dropdown-item {
    color: var(--text-white);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.custom-navbar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.custom-navbar .dropdown-item i {
    width: 20px;
    text-align: center;
}

.custom-navbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.custom-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.5);
}

/* ====================
   MEJORAS DE CONTRASTE Y LEGIBILIDAD
   ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333333; /* Texto oscuro para mejor contraste */
    line-height: 1.6;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #333333; /* Texto oscuro en tarjetas */
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #eaeaea;
    color: #333333; /* Texto oscuro en encabezados */
    font-weight: 600;
}

.table {
    color: #333333; /* Texto oscuro en tablas */
}

.table th {
    background-color: #f8f9fa;
    color: #333333; /* Texto oscuro en encabezados de tabla */
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.form-label {
    color: #333333; /* Texto oscuro en etiquetas */
    font-weight: 500;
}

.text-muted {
    color: #666666 !important; /* Un gris más oscuro para mejor legibilidad */
}

/* ====================
   BOTONES MEJORADOS
   ==================== */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0056b3, #004085);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #004085, #003366);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    border: none;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    color: white;
}

/* ====================
   HERO SECTION MEJORADO
   ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--navy-blue), var(--navy-blue-light)) !important;
    color: var(--text-white);
    padding-top: 100px;
    padding-bottom: 80px;
}

.hero-section .btn-light {
    background: rgba(255, 255, 255, 0.9);
    color: var(--navy-blue);
    font-weight: 600;
}

.hero-section .btn-light:hover {
    background: white;
    color: var(--navy-blue);
    transform: translateY(-2px);
}

/* ====================
   CARDS DE ESTADÍSTICAS
   ==================== */
.card.bg-primary {
    background: linear-gradient(135deg, #0056b3, #004085) !important;
    color: white;
}

.card.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
    color: white;
}

.card.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #333333; /* Texto oscuro sobre fondo amarillo */
}

.card.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white;
}

/* ====================
   RESPONSIVE
   ==================== */
@media (max-width: 768px) {
    .custom-navbar .navbar-nav {
        text-align: center;
        margin-top: 1rem;
    }
    
    .custom-navbar .nav-link {
        margin: 0.2rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding-top: 120px;
        padding-bottom: 60px;
        text-align: center;
    }
}

/* ====================
   BADGES MEJORADOS
   ==================== */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #0056b3, #004085) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #333333;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* ====================
   FORMULARIOS MEJORADOS
   ==================== */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    color: #333333; /* Texto oscuro en formularios */
    background-color: #ffffff;
}

.form-control:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
    color: #333333;
}

/* ====================
   FOOTER MEJORADO
   ==================== */
footer.bg-dark {
    background: linear-gradient(135deg, var(--navy-blue), var(--navy-blue-light)) !important;
    color: var(--text-white);
}

/* ====================
   ESTILOS PARA PAGOS
   ==================== */

/* Tablas responsive */
.table-responsive {
    border-radius: 8px;
}

/* Badges de estado */
.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #333;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* Botones de acción */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Cards de resumen */
.card.bg-primary,
.card.bg-warning,
.card.bg-success,
.card.bg-danger {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modal mejorado */
.modal-header {
    background: linear-gradient(135deg, var(--navy-blue), var(--navy-blue-light));
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Estados de saldo */
.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

.text-success {
    color: #28a745 !important;
    font-weight: 600;
}

/* Filtros */
.card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #333;
}

/* Hover en filas de tabla */
.table-hover tbody tr:hover {
    background-color: rgba(0, 31, 63, 0.05);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .btn-group-sm .btn {
        padding: 0.4rem 0.6rem;
        margin: 1px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card .card-body {
        padding: 1rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Tooltips mejorados */
.btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

/* ====================
   MEJORAS PARA MODALES
   ==================== */

.modal-backdrop {
    background-color: rgba(0, 31, 63, 0.8);
}

.modal-backdrop.show {
    opacity: 0.9;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Mejorar el z-index para evitar traslapes */
.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1050;
}

/* Estilos específicos para botones de acción */
.btn-outline-warning {
    color: #856404;
    border-color: #ffeaa7;
}

.btn-outline-warning:hover {
    background-color: #fff3cd;
    border-color: #ffc107;
}

/* Loading states */
.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.fa-spin {
    animation: fa-spin 1s infinite linear;
}

/* Alertas temporales */
.alert {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Mejorar tablas en modales */
.modal .table-sm td,
.modal .table-sm th {
    padding: 0.5rem;
}

/* Responsive para modales en móviles */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
}

/* Efectos de hover para botones de acción */
.btn-group-sm .btn {
    transition: all 0.2s ease;
}

.btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ====================
   ESTILOS DE VALIDACIÓN
   ==================== */

.is-valid {
    border-color: #28a745 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6.4.4.4-.4'/%3e%3cpath d='M6 7v1'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Mejorar la apariencia de los placeholders */
.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Estilos para alertas temporales */
.temp-alert {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mejorar el aspecto de los selects */
.form-select.is-valid, .form-select.is-invalid {
    background-position: right 1.5rem center;
}

/* ====================
   ANIMACIONES PARA ACTUALIZACIONES
   ==================== */

/* Resaltar filas actualizadas */
.table tbody tr.updated {
    animation: highlightRow 2s ease-in-out;
    background-color: #e8f5e8 !important;
}

@keyframes highlightRow {
    0% {
        background-color: #e8f5e8;
    }
    50% {
        background-color: #c8e6c9;
    }
    100% {
        background-color: #e8f5e8;
    }
}

/* Efecto de loading en botones */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: button-spinner 0.8s linear infinite;
}

@keyframes button-spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mejorar la visibilidad de los mensajes */
.alert {
    border-left: 4px solid;
    animation: slideInDown 0.5s ease-out;
}

.alert-success {
    border-left-color: #28a745;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #17a2b8;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Efecto de actualización en números */
.updated-value {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.ticket-container {
    background: white;
    border: 2px solid #333;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
}

.ticket-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
    color: #000;
}

/* Estilos para impresión */
@media print {
    body * {
        visibility: hidden;
    }
    .ticket-container, .ticket-container * {
        visibility: visible;
    }
    .ticket-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
    }
}