body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding-left: 250px; /* Alineado con el content */
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.container {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    height: 100vh;
    position: fixed;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

.logo-ppal {
    width: auto;  /* Mantiene proporción */
    height: auto;  /* Mantiene proporción */
    display: block;  /* Asegura comportamiento correcto */
    transform: scale(0.35); /* Escala al 35% del tamaño original */
    margin: 0 auto;  /* Centrado adicional (redundante con flex) */
}

.menu ul {
    list-style: none;
    padding: 0;
}

.menu-item {
    margin-bottom: 10px;
}

.menu-title {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.menu-title:hover {
    background-color: #34495e;
}

.submenu {
    display: none;
    margin-left: 15px;
}

.submenu li a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    padding: 8px 5px;
    border-radius: 3px;
}

.submenu li a:hover {
    background-color: #34495e;
    color: white;
}

.content {
    margin-left: 280px;
    padding: 15px;
    width: calc(100% - 280px);
}

/* Estilos para el login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Estilos para el dashboard */
.dashboard-header {
    /* padding: 20px; */

    display: flex;
    align-items: center;  /* Alinea verticalmente logo y texto */
    justify-content: center;  /* Centra horizontalmente el contenido */
    gap: 5px;  /* Espacio entre logo y texto */
    background-color: #3498db;
    color: white;
    width: 100%;
    padding: 2px 0;
    border-radius: 5px;
    margin-bottom: 2px;
    margin-right: 10px;
    border: solid 1px #2c3e50;
}

.dashboard-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.dashboard-content {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 30%;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Estilos para formularios */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-cancel {
    background-color: #95a5a6;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8em;
}

.header-actions {
    margin-top: 10px;
}

/* Estilos para formularios de edición */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
}

.btn-edit:hover {
    background-color: #e67e22;
}

.mt-4 {
    flex-direction: column;
    align-items: center;
}

.mb-3 {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 7px;
    margin-top: 7px;
    background-color: #3498db;
}

.paciente-container {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow-x: auto;
}

.patient-form {
    display: grid;
    width: 80%;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px; /* Espacio reducido */
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
}

.agenda-container {
    margin-top: 20px;
    overflow-x: auto;
}
.agenda-table {
    width: 80%;
    border-collapse: collapse;
    font-size: 12px; /* 0.8em;  Fuente más pequeña para la tabla */
}
.agenda-table th, .agenda-table td {
    border: 1px solid #ddd;
    padding: 3px 5px; /* Padding reducido */
    text-align: center;
    height: 18px; /* Altura fija reducida */
}
.agenda-table th {
    background-color: #3498db;
    color: white;
    position: sticky;
    top: 0;
    padding: 5px;
}
.agenda-table tr:nth-child(even) {
    background-color: #f2f2f2;
}
.agenda-select {
    width: 100%;
    padding: 3px; /* Padding reducido */
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.8em; /* Fuente más pequeña */
    height: 18px; /* Altura reducida */
}
.correlativo {
    font-weight: bold;
    background-color: #f8f9fa;
    width: 30px; /* Ancho reducido */
    font-size: 0.8em; /* Fuente más pequeña */
}
.prestacion-col {
    min-width: 100px; /* Ancho reducido */
}
.modalidad-col {
    min-width: 80px; /* Ancho reducido */
}
/* Columnas adicionales más estrechas */
.agenda-table td:not(.correlativo):not(.prestacion-col):not(.modalidad-col) {
    width: 15px; /* Ancho reducido a la mitad */
    min-width: 15px;
    max-width: 15px;
}

.agenda-th-col {
    /* Alineación y disposición */
    vertical-align: bottom;
    text-align: center;
    font-size: 0.8em; /* Fuente más pequeña */
    /* display: flex;
    flex-direction: column;
    justify-content: flex-end; */
}

.agenda-input {
    width: 100%;
    padding: 3px; /* Padding reducido */
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.8em; /* Fuente más pequeña */
    height: 18px; /* Altura reducida */
}

.font-medium {
    font-size: 12px;
}

.font-small {
    font-size: 12px;
}

.compact-line p {
    line-height: 1.0;
    margin-bottom: 0.15rem; /* 4px */
}

/* Espaciado compacto para la ficha */
.ficha-paciente p {
    margin-bottom: 0.25rem;  /* Reduce el espacio vertical entre párrafos */
    line-height: 1.0;        /* Interlineado más ajustado (1.3 es ~20% más compacto que el estándar) */
}

.form-header {
    margin-bottom: 20px;
    border: solid 1px #3498db;
    border-radius: 5px;
    padding: 10px;
}

/* Para las observaciones (texto multilínea) */
.observaciones {
    line-height: 1.2;
    margin-top: 0.5rem;
}

.ul-menu-horizontal{
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.ul-menu-horizontal li{
    display: inline-block;
    margin-right: 10px;
}

.bloque-menu {
    display: inline-block;
    margin-right: 10px;
}

/* Estructura básica del modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    /* max-height: 90vh; */
    overflow-y: auto;
}

/* Pestañas */
.tabs {
    display: flex;
    overflow-x: auto;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #228be6;
}

.tab-button.active {
    color: #228be6;
    border-bottom-color: #228be6;
    font-weight: 500;
}

.badge {
    margin-left: 8px;
    padding: 2px 6px;
    background: #228be6;
    color: white;
    border-radius: 10px;
    font-size: 12px;
}

/* Contenido de las pestañas */
.tab-content {
    display: none;
    padding: 15px 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Estilos para la información del profesional */
.profesional-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.profesional-info h3 {
    margin: 0 0 5px 0;
    color: #333;
}

.current-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #ebfbee;
    color: #2b8a3e;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 5px;
}

/* Estilos para carga y errores */
.loading-tab, .loading-content {
    text-align: center;
    padding: 15px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #228be6;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    padding: 20px;
    background: #fff3f3;
    border-left: 4px solid #ff6b6b;
    color: #ff6b6b;
}

.error-message button {
    margin-top: 10px;
    padding: 8px 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Botón de selección */
.btn-select {
    display: block;
    width: 100%;
    padding: 12px;
    background: #228be6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background 0.2s;
}

.btn-select:hover {
    background: #1971c2;
}

/* Estilos para el calendario */
.month-calendar {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    table-layout: fixed; /* Importante para el ancho fijo */
}

.month-calendar th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #dee2e6;
    font-size: 14px;
}

.month-calendar td {
    padding: 20px 10px; /* Más alto y ancho */
    text-align: center;
    border: 1px solid #dee2e6;
    height: 40px; /* Altura fija */
    vertical-align: middle;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Asegurar que las columnas tengan ancho uniforme */
.month-calendar th, 
.month-calendar td {
    width: calc(100% / 8); /* 7 días + columna de semana */
    min-width: 50px;
}

/* Estilos para días del mes actual */
.month-calendar .available {
    background-color: #ebfbee;
}

.month-calendar .available:hover {
    background-color: #d3f9d8;
    transform: scale(1.05);
}

/* Estilo para el día seleccionado */
.month-calendar .selected {
    background-color: #228be6;
    color: white;
    font-weight: bold;
}

/* Estilo para días de otros meses */
.month-calendar .unavailable {
    color: #adb5bd;
    background-color: #f8f9fa;
}

/* Número de semana */
.month-calendar .week-number {
    background: #f1f3f5;
    font-weight: bold;
    color: #495057;
}

/* Día actual */
.month-calendar .today {
    position: relative;
    background-color: #e7f5ff;
    font-weight: bold;
}

.month-calendar .today::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #228be6;
    border-radius: 50%;
}

/* Estilo para el marcador de agenda */
.agenda-marker {
    color: #e03131; /* Rojo para mayor visibilidad */
    font-weight: bold;
    margin-left: 2px;
    cursor: help;
	font-size: 24px;
}

/* Estilo para días con agenda */
.day-with-agenda {
    font-weight: bold;
    color: #2b8a3e; /* Verde oscuro */
}

/* Resaltar al pasar el mouse */
td.available:hover .agenda-marker {
    transform: scale(1.3);
    transition: transform 0.2s;
}

table-responsive {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
}

table-listado {
    width: 100%;
}

.celda-verde {
    background-color: #61fd85; /* verde claro, #d4edda */
    text-align: center;
    font-weight: bold;
}

.celda-roja {
    background-color: #fc4454; /* rojo claro, #f8d7da */
    text-align: center;
    font-weight: bold;
}

.celda-info {
    text-align: center;
}

/* static/style.css */
.login-container {
    max-width: 400px;
    margin: 5% auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-container div {
    margin-bottom: 1rem;
}

.login-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 600;
}

.login-container input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.login-container input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.login-container button {
    width: 100%;
    padding: 0.75rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-container button:hover {
    background-color: #2980b9;
}

/* Estilo para mensajes de error */
.error-message {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 1rem;
}

/* Estilo para el mensaje de error CSRF */
.csrf-error {
    color: #dc3545;
    background: #f8d7da;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
}

/* Alinea la primera columna de la tabla de reportes a la izquierda */
.agenda-table td.nombre-profesional,
.agenda-table th.nombre-profesional {
    text-align: left;
    padding-left: 10px;
}

.linea-espaciado {
    display: block;
    height: 20px;  /* o el valor que estimes */
}

.titulo-seccion {
    text-align: center;
    font-weight: bold;
    padding: 10px 0;
    background-color: #f5f5f5;  /* opcional: fondo claro */
    font-size: 1.1em;           /* opcional: tamaño de letra */
}

.subtitulo-seccion {
    text-align: left;
    font-weight: bold;
    padding: 6px 0 4px 4px;
    font-size: 1em;
    border-bottom: 1px solid #ccc; /* línea divisoria opcional */
    background-color: #fafafa;     /* fondo suave opcional */
}

/* Estilos para el modal adicional */
.form-container {
  padding: 20px 0;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
}

.readonly-field {
  background-color: #f8f9fa;
  color: #6c757d;
}

.form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-cancelar {
  padding: 10px 20px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-grabar {
  padding: 10px 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-cancelar:hover {
  background-color: #5a6268;
}

.btn-grabar:hover {
  background-color: #218838;
}

.btn-grabar:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.loading {
  color: #007bff;
  font-style: italic;
  margin-top: 5px;
}

.error-message {
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
}

/* Estilos para el modal de equipo */
.equipo-container {
  padding: 20px 0;
}

.equipo-header {
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.equipo-header h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
}

.equipo-subtitle {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.equipo-table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
}

.equipo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.equipo-table thead tr {
  background-color: #f7fafc;
}

.equipo-table th {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  color: #4a5568;
}

.equipo-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.equipo-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.equipo-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
}

.equipo-table td.rut-profesional {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.equipo-footer {
  margin-top: 1rem;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 6px;
}

.equipo-footer p {
  margin: 0;
  color: #718096;
  font-size: 0.8rem;
  font-style: italic;
}

.no-data {
  text-align: center;
  padding: 2rem;
  color: #666;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 1rem 0;
}

.no-data h4 {
  margin: 0 0 1rem 0;
  color: #333;
}

.no-data p {
  margin: 0;
}
