/* Panel de Control de Citas - Estilos */

.panel-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Tarjetas de estadísticas */
.panel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-pending .stat-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-confirmed .stat-icon {
    background: #d1fae5;
    color: #10b981;
}

.stat-today .stat-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-cancelled .stat-icon {
    background: #fee2e2;
    color: #ef4444;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* Contenedor de tabla */
.appointments-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 25px;
}

.appointments-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.appointments-table-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Filtros */
.appointments-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-refresh {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Tabla */
.table-responsive {
    overflow-x: auto;
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-table thead {
    background: #f9fafb;
}

.appointments-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    border-bottom: 2px solid #e5e7eb;
}

.appointments-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.appointments-table tbody tr:hover {
    background: #f9fafb;
}

.appointments-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-dark {
    background: #f3f4f6;
    color: #374151;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Botones de acción */
.btn-group {
    display: flex;
    gap: 4px;
}

.btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

/* Estados de filas */
.appointment-row-pending {
    border-left: 4px solid #f59e0b;
}

.appointment-row-confirmed {
    border-left: 4px solid #10b981;
}

.appointment-row-cancelled {
    border-left: 4px solid #ef4444;
    opacity: 0.7;
}

.appointment-row-no_show {
    border-left: 4px solid #6b7280;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .panel-container {
        padding: 10px;
    }
    
    .panel-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .appointments-table-container {
        padding: 15px;
    }
    
    .appointments-table {
        font-size: 13px;
    }
    
    .appointments-table th,
    .appointments-table td {
        padding: 8px;
    }
    
    /* Ocultar columnas en móvil */
    .appointments-table th:nth-child(5),
    .appointments-table td:nth-child(5),
    .appointments-table th:nth-child(7),
    .appointments-table td:nth-child(7) {
        display: none;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate__fadeIn {
    animation: fadeIn 0.5s ease-out;
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-primary {
    color: #3b82f6;
}

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.text-muted {
    color: #6b7280;
}

/* Estilos adicionales para el Panel Mejorado */

/* Contenedor principal */
.appointments-main-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0;
    overflow: hidden;
}

/* Header del panel */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-wrap: wrap;
    gap: 20px;
}

.panel-title h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.75rem;
}

.week-range {
    margin: 5px 0 0 0;
    color: #6b7280;
    font-size: 14px;
}

.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Pestañas de días */
.day-tabs {
    display: flex;
    padding: 0;
    background: #19416952;
    border-bottom: 2px solid #0f55e1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.day-tab {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

.day-tab:hover {
    background: #f3f4f6;
}

.day-tab.active {
    background: white;
    border-bottom-color: #3b82f6;
}

.day-name {
    display: block;
    font-weight: 600;
    color: #4b5563;
    font-size: 14px;
}

.day-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 5px 0;
}

.day-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.day-count:empty,
.day-count:contains('0') {
    display: none;
}

/* Barra de filtros */
.filters-bar {
    display: flex;
    gap: 20px;
    padding: 20px 25px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
}

/* Toggle de vista */
.view-toggle {
    display: flex;
    gap: 5px;
    padding: 20px 25px 10px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.view-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.view-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.view-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.view-btn:hover:not(.active) {
    background: #f9fafb;
}

/* Contenedor de vistas */
#appointments-content {
    padding: 0 25px 25px;
}

.view-container {
    margin-top: 20px;
}

/* Vista Timeline */
.timeline {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.timeline-hour {
    display: flex;
    border-bottom: 1px solid #f3f4f6;
    min-height: 60px;
}

.timeline-hour.has-appointments {
    min-height: auto;
}

.hour-label {
    width: 100px;
    padding: 15px;
    background: #f9fafb;
    font-weight: 600;
    color: #4b5563;
    font-size: 14px;
    border-right: 1px solid #e5e7eb;
}

.hour-appointments {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-appointment {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 12px;
    flex: 0 0 calc(33.333% - 10px);
    min-width: 250px;
    border-left: 4px solid #6b7280;
    transition: all 0.2s ease;
}

.timeline-appointment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.timeline-appointment.status-pending {
    border-left-color: #f59e0b;
    background: #fef3c7;
}

.timeline-appointment.status-confirmed {
    border-left-color: #10b981;
    background: #d1fae5;
}

.timeline-appointment.status-cancelled {
    border-left-color: #ef4444;
    background: #fee2e2;
    opacity: 0.7;
}

.appointment-time {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
}

.appointment-patient {
    font-weight: 600;
    color: #374151;
    margin: 5px 0;
}

.appointment-service {
    font-size: 13px;
    color: #6b7280;
}

.appointment-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.timeline-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.8);
    color: #4b5563;
    transition: all 0.2s ease;
    text-decoration: none;
}

.timeline-action:hover {
    background: white;
    color: #1f2937;
    transform: scale(1.1);
}

/* Modal de recordatorio */
.reminder-info {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.reminder-info p {
    margin: 5px 0;
    font-size: 14px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .panel-header {
        padding: 15px;
    }
    
    .panel-title h2 {
        font-size: 1.25rem;
    }
    
    .day-tabs {
        padding: 0 15px;
    }
    
    .day-tab {
        min-width: 80px;
        padding: 10px;
    }
    
    .day-name {
        font-size: 12px;
    }
    
    .day-number {
        font-size: 16px;
    }
    
    .filters-bar {
        padding: 15px;
        gap: 10px;
    }
    
    .filter-group {
        flex: 1 1 100%;
    }
    
    .filter-group input,
    .filter-group select {
        flex: 1;
    }
    
    #appointments-content {
        padding: 0 15px 15px;
    }
    
    .timeline-appointment {
        flex: 1 1 100%;
        min-width: auto;
    }
    
    .hour-label {
        width: 70px;
        font-size: 12px;
        padding: 10px;
    }
}

/* Animación para notificaciones */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
    z-index: 9999;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

.notification.info {
    background: #3b82f6;
}

/* Estilos para paginación */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 15px;
}

.pagination-info {
  font-size: 14px;
  color: #6b7280;
}

.pagination-info .text-warning {
  color: #f59e0b;
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pagination-controls .btn {
  min-width: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    text-align: center;
  }
  
  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
}