/**
 * ESTILOS ADMINISTRATIVOS - DISEÑO MODERNO
 * Panel administrativo mejorado
 */

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Mejora de rendimiento en móviles */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   LOGIN PAGE MEJORADO
   ============================================ */
.login-page {
    background: linear-gradient(135deg, #5B8A5B 0%, #4A7A4A 50%, #3A6A3A 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.login-box {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s ease;
}

.login-box h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    font-size: 0.95rem;
}

.login-form {
    margin-top: var(--spacing-lg);
}

.login-footer {
    text-align: center;
    margin-top: var(--spacing-md);
}

.login-footer a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-base);
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================
   ADMIN LAYOUT SIN SIDEBAR
   ============================================ */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    background: var(--color-cream);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: white;
    box-shadow: 0 4px 12px rgba(91, 138, 91, 0.2);
}

.sidebar-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: #212529;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    position: relative;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 0 3px 3px 0;
    transition: height 0.2s ease;
}

.nav-item:hover {
    background: #f8f9fa;
    color: var(--color-primary);
    transform: translateX(2px);
}

.nav-item:hover::before {
    height: 60%;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(91, 138, 91, 0.1) 0%, rgba(91, 138, 91, 0.05) 100%);
    color: var(--color-primary);
    font-weight: 600;
}

.nav-item.active::before {
    height: 70%;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
    color: currentColor;
    transition: all 0.2s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    transform: scale(1.1);
    color: var(--color-primary);
}

.nav-text {
    font-size: 0.9rem;
    letter-spacing: -0.1px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: white;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.user-info .user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .user-role {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 400;
}

.btn-logout {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #dc3545;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 10px;
    gap: 0.75rem;
    width: 100%;
    font-weight: 500;
    font-size: 0.9rem;
    background: transparent;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333;
    transform: translateX(2px);
}

.btn-logout .nav-icon {
    color: currentColor;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

/* Menú Horizontal Compacto */
.admin-menu-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin: 1.5rem auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    max-width: 1400px;
    position: relative; /* Cambiado de sticky a relative para que se mueva con el scroll */
    z-index: 98;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

.admin-menu-horizontal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #495057;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 90px;
    background: transparent;
    border: 2px solid transparent;
}

.menu-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.menu-item:hover {
    background: rgba(91, 138, 91, 0.05);
    color: var(--color-primary);
    transform: translateY(-2px);
    border-color: rgba(91, 138, 91, 0.2);
}

.menu-item:hover::before {
    width: 80%;
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(91, 138, 91, 0.1) 0%, rgba(91, 138, 91, 0.05) 100%);
    color: var(--color-primary);
    font-weight: 600;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(91, 138, 91, 0.15);
}

.menu-item.active::before {
    width: 100%;
    height: 3px;
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
    color: currentColor;
    transition: all 0.3s ease;
}

.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {
    transform: scale(1.15);
    color: var(--color-primary);
}

.menu-text {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.1px;
    text-align: center;
}

.admin-topbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 2rem;
    position: relative; /* Cambiado de sticky a relative para que se mueva con el scroll */
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 0;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.topbar-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    flex: 1;
}

.topbar-content .page-title {
    font-family: var(--font-display);
    font-size: 1.5rem; /* Reducido de 2.25rem */
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    font-weight: 600; /* Reducido de 700 */
    letter-spacing: -0.5px;
    text-align: center;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.875rem; /* Reducido de 1rem */
    color: #64748b;
    margin: 0;
    font-weight: 400; /* Reducido de 500 */
    text-align: center;
    letter-spacing: 0.1px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout-topbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem; /* Reducido */
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8125rem; /* Reducido de 0.875rem */
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.btn-logout-topbar:hover {
    background: linear-gradient(135deg, #D32F2F 0%, #C62828 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.btn-logout-topbar svg {
    width: 16px; /* Reducido de 18px */
    height: 16px; /* Reducido de 18px */
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    background: var(--color-soft-green);
    border-radius: 6px;
}

/* ============================================
   ADMIN CONTENT AREA
   ============================================ */
.admin-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    background: #f8f9fa;
    min-height: calc(100vh - 80px - 160px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    scroll-margin-top: 200px; /* Espacio para evitar que el contenido quede oculto */
}

/* Dashboard Container - Recuadro */
.dashboard-container {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin: 0 auto 2rem auto;
    width: 100%;
    max-width: 1200px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.dashboard-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.3px;
    text-align: center;
}

.admin-title {
    font-size: 1.25rem;
    color: #212529;
    margin: 0 0 1.5rem 0;
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* Tipografía más uniforme y lineal */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p, span, div, a, button {
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0.1px;
}

.admin-section {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.admin-section h2 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin: 0 0 var(--spacing-md) 0;
    font-weight: 500;
    font-size: 1.2rem;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

/* ============================================
   FILTROS MEJORADOS
   ============================================ */
.admin-filters {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.filter-form {
    margin: 0;
}

.filter-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-sm);
    align-items: end;
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
    margin-top: var(--spacing-sm);
}

.form-actions .btn {
    margin: 0;
}

/* ============================================
   TABLAS MODERNAS
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead {
    background: var(--color-primary);
    color: white;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: var(--color-soft-green);
}

.data-table tfoot {
    background: linear-gradient(135deg, var(--color-beige) 0%, var(--color-cream) 100%);
    font-weight: 600;
}

.data-table tfoot td {
    border-top: 2px solid var(--color-primary);
}

/* ============================================
   BADGES MEJORADOS
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-pendiente {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: white;
}

.badge-confirmado {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.badge-completado {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.badge-cancelado {
    background: linear-gradient(135deg, var(--color-error) 0%, #B71C1C 100%);
    color: white;
}

.badge-ausente {
    background: linear-gradient(135deg, #757575 0%, #424242 100%);
    color: white;
}

.badge-abierto {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.badge-cerrado {
    background: linear-gradient(135deg, var(--color-warning) 0%, #F57C00 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.badge-inactive {
    background: linear-gradient(135deg, #9E9E9E 0%, #616161 100%);
    color: white;
}

/* ============================================
   STATS HORIZONTALES MODERNOS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

/* Grid de Estadísticas Uniformes - Estilo Profesional */
.stats-grid-uniform {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 0;
    width: 100%;
}

.stat-card-uniform {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-card-uniform:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.stat-icon-uniform {
    background: #f5f3ff;
    color: var(--color-primary);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.stat-value-uniform {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.stat-label-uniform {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    margin-top: 4px;
}


.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid #e9ecef;
    min-height: 100px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.stat-card:hover::before {
    transform: scaleY(1);
}

.stat-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    opacity: 0.9;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(91, 138, 91, 0.1) 0%, rgba(91, 138, 91, 0.05) 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    transform: scale(1.1) rotate(5deg);
}

.stat-card:hover .stat-icon {
    color: white;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-info h3 {
    font-size: 2.25rem;
    color: #212529;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.stat-info p {
    color: #6c757d;
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ============================================
   ACCIONES MEJORADAS
   ============================================ */
.action-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.action-buttons .btn {
    margin: 0;
    white-space: nowrap;
}

.dashboard-section {
    margin: 2rem auto 0 auto;
    background: #f1f5f9;
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 1200px;
}

/* Recuadro de Pacientes Nuevos */
.nuevos-pacientes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.nuevos-pacientes-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-title svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.section-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    flex: 1;
}

.badge-count {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.pacientes-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.paciente-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.paciente-item:hover {
    background: #e9ecef;
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.paciente-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.paciente-info strong {
    font-size: 0.9375rem;
    color: #212529;
    font-weight: 600;
}

.paciente-fecha {
    font-size: 0.8125rem;
    color: #6c757d;
}

.empty-mini {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.empty-mini p {
    margin: 0;
    font-size: 0.875rem;
}

.ver-mas {
    margin-top: 0.75rem;
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h2 {
    text-align: left;
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-header .btn {
    flex-shrink: 0;
}

.dashboard-section h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.3px;
    text-align: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.3px;
    text-align: left;
}

/* Grid de Turnos */
.turnos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    justify-items: center;
    width: 100%;
}

.turno-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.turno-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.turno-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.turno-fecha {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.fecha-dia {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.fecha-mes {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.turno-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.turno-hora {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.turno-hora svg {
    color: #6c757d;
}

.turno-paciente {
    font-size: 1rem;
    color: #212529;
}

.turno-paciente strong {
    font-weight: 600;
}

.turno-modalidad {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.turno-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   PACIENTES MEJORADO
   ============================================ */
.paciente-secciones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.seccion {
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-beige) 100%);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.seccion:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.seccion h3 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
    font-weight: 500;
}

.anotaciones-preview {
    max-width: 300px;
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ============================================
   FORMULARIOS ADMIN MEJORADOS
   ============================================ */
.admin-form .form-group label {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-xs);
    display: block;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="tel"],
.admin-form input[type="date"],
.admin-form input[type="time"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    background: var(--color-cream);
    width: 100%;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 138, 91, 0.1);
    background: white;
}

/* ============================================
   MENSAJES MEJORADOS
   ============================================ */
.mensaje {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid;
    animation: slideInRight 0.4s ease;
    box-shadow: var(--shadow-sm);
    font-weight: 400;
    font-size: 0.85rem;
}

.mensaje.success {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
    border-color: var(--color-success);
}

.mensaje.error {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    color: #C62828;
    border-color: var(--color-error);
}

.mensaje.warning {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    color: #E65100;
    border-color: var(--color-warning);
}

/* ============================================
   BOTONES CON COLORES DIFERENTES
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #388E3C 0%, #2E7D32 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #D32F2F 0%, #C62828 100%);
}

.btn-info {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
    color: white;
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0097A7 0%, #00838F 100%);
}

.btn-purple {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
    border: none;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #7B1FA2 0%, #6A1B9A 100%);
}

/* ============================================
   CALENDARIO PREVIEW
   ============================================ */
.calendario-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.dia-preview {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm);
    transition: all var(--transition-base);
}

.dia-preview.hoy {
    border-color: var(--color-primary);
    background: var(--color-soft-green);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.dia-preview.sin-horarios {
    opacity: 0.5;
    background: #f5f5f5;
}

.dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

.dia-header strong {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.dia-header .fecha {
    color: var(--color-text-light);
    font-size: 0.75rem;
}

.dia-turnos {
    min-height: 50px;
    font-size: 0.8rem;
}

.turno-reservado {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-warning) 0%, #F57C00 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin: 2px 0;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.disponible {
    color: var(--color-success);
    font-weight: 600;
    display: block;
    text-align: center;
    padding: var(--spacing-sm);
}

.sin-disponibilidad {
    color: var(--color-text-light);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-sm);
    font-size: 0.85rem;
}

/* ============================================
   VACIO STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.4;
    color: #6c757d;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state h3 {
    color: #212529;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.empty-state p {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ============================================
   RESPONSIVE ADMIN
   ============================================ */

/* Tablets grandes y pantallas medianas (1024px y menos) */
@media (max-width: 1024px) {
    .admin-content {
        padding: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .admin-topbar {
        padding: 1.25rem 1.5rem;
    }
    
    .topbar-content .page-title {
        font-size: 1.875rem;
    }
    
    .page-subtitle {
        font-size: 0.9375rem;
    }
    
    .admin-menu-container {
        margin: 1rem;
        padding: 0.875rem 1.25rem;
        position: relative; /* Cambiado de sticky a relative para que se mueva con el scroll */
    }
    
    .admin-section {
        padding: 1.25rem;
    }
    
    .dashboard-container {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .dashboard-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .stats-grid-uniform {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .stat-card-uniform {
        padding: 20px;
    }
    
    .nuevos-pacientes-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .admin-nav {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .admin-nav-menu {
        order: 2;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.3rem;
    }
    
    .admin-nav-user {
        order: 3;
        justify-self: flex-end;
    }
}

@media (max-width: 1024px) {
    .admin-menu-container {
        margin: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    .admin-menu-horizontal {
        gap: 0.4rem;
    }
    
    .menu-item {
        min-width: 80px;
        padding: 0.625rem 0.875rem;
    }
    
    .menu-text {
        font-size: 0.75rem;
    }
}

/* Tablets (768px y menos) */
@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
        padding-top: 1rem;
    }
    
    .admin-topbar {
        padding: 0.875rem 1.25rem;
    }
    
    .topbar-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .topbar-title-section {
        text-align: center;
    }
    
    .topbar-content .page-title {
        font-size: 1.25rem; /* Reducido */
        margin-bottom: 0.25rem;
    }
    
    .page-subtitle {
        font-size: 0.8125rem; /* Reducido */
    }
    
    .btn-logout-topbar {
        width: 100%;
        justify-content: center;
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .btn-logout-topbar svg {
        width: 14px;
        height: 14px;
    }
    
    .admin-menu-container {
        margin: 0.75rem;
        padding: 0.75rem 1rem;
        position: relative; /* Cambiado de sticky a relative para que se mueva con el scroll */
        z-index: 98;
    }
    
    .admin-menu-horizontal {
        gap: 0.3rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        scrollbar-width: thin;
    }
    
    .admin-menu-horizontal::-webkit-scrollbar {
        height: 4px;
    }
    
    .admin-menu-horizontal::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }
    
    .menu-item {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
        flex-shrink: 0;
    }
    
    .menu-icon {
        width: 18px;
        height: 18px;
    }
    
    .menu-text {
        font-size: 0.7rem;
    }
    
    .dashboard-container {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.25rem;
    }
    
    .dashboard-section {
        padding: 1.25rem;
        margin-top: 1.25rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .section-header h2 {
        text-align: center;
        font-size: 1.25rem;
    }
    
    .section-header .btn {
        width: 100%;
    }
    
    .nuevos-pacientes-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .nuevos-pacientes-section {
        padding: 1.25rem;
    }
    
    .paciente-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .paciente-item .btn {
        width: 100%;
    }
    
    .stats-grid-uniform {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card-uniform {
        padding: 18px 14px;
    }
    
    .stat-value-uniform {
        font-size: 1.75rem;
    }
    
    .stat-icon-uniform {
        width: 40px;
        height: 40px;
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .stat-label-uniform {
        font-size: 0.8125rem;
    }
    
    .data-table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.6rem;
        white-space: nowrap;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .admin-title {
        font-size: 1.4rem;
    }
    
    .admin-section h2 {
        font-size: 1.1rem;
    }
    
    .admin-filters {
        padding: 1rem;
        flex-direction: column;
    }
    
    .paciente-secciones {
        grid-template-columns: 1fr;
    }
    
    .calendario-preview {
        grid-template-columns: 1fr;
    }
}

/* Móviles (480px y menos) */
@media (max-width: 480px) {
    .admin-content {
        padding: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .admin-topbar {
        padding: 0.75rem 1rem;
    }
    
    .topbar-content .page-title {
        font-size: 1.125rem; /* Reducido */
        margin-bottom: 0.25rem;
    }
    
    .page-subtitle {
        font-size: 0.75rem; /* Reducido */
    }
    
    .btn-logout-topbar {
        padding: 0.4rem 0.65rem;
        font-size: 0.7rem;
    }
    
    .btn-logout-topbar svg {
        width: 13px;
        height: 13px;
    }
    
    .admin-menu-container {
        margin: 0.5rem;
        padding: 0.625rem 0.75rem;
        border-radius: 8px;
        position: relative; /* Cambiado de sticky a relative para que se mueva con el scroll */
        z-index: 98;
    }
    
    .admin-menu-horizontal {
        gap: 0.25rem;
    }
    
    .menu-item {
        min-width: 60px;
        padding: 0.5rem 0.625rem;
    }
    
    .menu-icon {
        width: 16px;
        height: 16px;
    }
    
    .menu-text {
        font-size: 0.65rem;
    }
    
    .dashboard-container {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .dashboard-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.125rem;
    }
    
    .dashboard-section {
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 12px;
    }
    
    .section-header h2 {
        font-size: 1.125rem;
    }
    
    .stats-grid-uniform {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card-uniform {
        padding: 16px 12px;
    }
    
    .stat-value-uniform {
        font-size: 1.5rem;
    }
    
    .stat-icon-uniform {
        width: 36px;
        height: 36px;
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .stat-label-uniform {
        font-size: 0.75rem;
    }
    
    .nuevos-pacientes-section {
        padding: 1rem;
    }
    
    .section-title {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .section-title h3 {
        font-size: 1rem;
    }
    
    .admin-title {
        font-size: 1.2rem;
    }
    
    .admin-section h2 {
        font-size: 1rem;
    }
    
    .data-table {
        font-size: 0.7rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.4rem 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .turnos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .turno-card {
        padding: 1rem;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   MEJORAS ADICIONALES
   ============================================ */
.admin-section h3 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    font-weight: 500;
}

.info-text {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
    font-size: 0.8rem;
    line-height: 1.5;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-beige);
    border-radius: var(--border-radius-sm);
    border-left: 2px solid var(--color-primary);
}

/* Toggles de menú en configuración */
.menu-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.menu-toggle-item {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    margin: 0 !important;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(91, 138, 91, 0.25);
    background: #fff;
    cursor: pointer;
    font-weight: 500 !important;
}

.menu-toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #5B8A5B;
    cursor: pointer;
}

a.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
a.stat-card-link:hover {
    color: inherit;
}

/* Responsive admin extra */
@media (max-width: 768px) {
    .admin-section,
    .admin-content {
        overflow-x: visible;
        max-width: 100%;
    }

    .table-scroll {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .admin-section .data-table,
    .admin-content table.data-table {
        width: 100%;
    }

    .acciones {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        white-space: normal;
    }

    .acciones .btn,
    .acciones form {
        margin: 0;
    }

    .menu-toggles {
        grid-template-columns: 1fr;
    }

    .admin-form input[type="text"],
    .admin-form input[type="email"],
    .admin-form input[type="tel"],
    .admin-form input[type="date"],
    .admin-form input[type="time"],
    .admin-form input[type="number"],
    .admin-form select,
    .admin-form textarea,
    .admin-form input[type="file"] {
        max-width: 100%;
    }

    .stats-grid-uniform {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    .stats-grid-uniform {
        grid-template-columns: 1fr !important;
    }

    .nuevos-pacientes-grid {
        grid-template-columns: 1fr !important;
    }
}
