/* assets/css/styles.css - Diagnost.io Design System */

:root {
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --primary-dark: #115e59;
    
    --secondary: #0284c7;
    --secondary-light: #e0f2fe;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Navbar */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.2);
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.90rem;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* Navbar Actions (Right Side) */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.navbar-divider {
    width: 1px;
    height: 28px;
    background-color: var(--border);
    margin: 0 2px;
}

.btn-new-consultation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.88rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
    transition: all 0.2s ease;
}

.btn-new-consultation:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 10px 4px 5px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
}

.user-menu-btn:hover,
.user-menu-dropdown:hover .user-menu-btn,
.user-menu-dropdown.open .user-menu-btn {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.28);
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.user-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-license {
    font-size: 0.72rem;
    color: #0d9488;
    font-weight: 600;
    white-space: nowrap;
}

.user-arrow {
    font-size: 0.72rem;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: 2px;
}

.user-menu-dropdown:hover .user-arrow,
.user-menu-dropdown.open .user-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.user-menu-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
    min-width: 270px;
    padding: 8px 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-menu-dropdown:hover .user-menu-popover,
.user-menu-dropdown:focus-within .user-menu-popover,
.user-menu-dropdown.open .user-menu-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-popover-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    margin-top: -8px;
    border-radius: 14px 14px 0 0;
}

.popover-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.popover-info {
    flex: 1;
    min-width: 0;
}

.popover-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popover-email {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.popover-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.popover-badge {
    display: inline-block;
    font-size: 0.70rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f0fdfa;
    color: #0f766e;
    font-weight: 700;
    border: 1px solid #ccfbf1;
}

.popover-badge.clinic {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
    font-weight: 600;
}

.user-popover-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
}

.user-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.user-popover-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.user-popover-item.active {
    color: var(--primary);
    background: #f0fdfa;
}

.user-popover-item.logout {
    color: #dc2626;
}

.user-popover-item.logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Mobile Navigation Hamburger & Drawer */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

.hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: #334155;
    border-radius: 2px;
    transition: all 0.25s ease;
}

.mobile-nav-drawer {
    display: none;
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 14px 24px 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.94rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.mobile-nav-link.logout {
    color: #dc2626;
}

.mobile-nav-link.logout:hover {
    background: #fef2f2;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Responsive Breakpoints for Navbar */
@media (max-width: 1080px) {
    .navbar .nav-links {
        display: none;
    }
    .mobile-nav-toggle {
        display: flex;
    }
    .mobile-nav-drawer.open {
        display: block;
    }
    .user-name, .user-license, .user-arrow {
        display: none;
    }
    .user-menu-btn {
        padding: 2px;
    }
}

@media (max-width: 600px) {
    .navbar-container {
        padding: 0 16px;
        height: 64px;
    }
    .btn-new-consultation .btn-label {
        display: none;
    }
    .btn-new-consultation {
        padding: 8px 10px;
    }
    .brand span:last-child {
        display: inline;
    }
}

/* Layout */
.container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 48px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.stat-card:active {
    transform: translateY(-1px);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info .stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
    color: #ffffff;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1.05rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-8  { flex: 0 0 calc(66.666% - 10.6px); max-width: calc(66.666% - 10.6px); }
.col-7  { flex: 0 0 calc(58.333% - 9.3px); max-width: calc(58.333% - 9.3px); min-width: 0; }
.col-6  { flex: 0 0 calc(50% - 8px); max-width: calc(50% - 8px); }
.col-5  { flex: 0 0 calc(41.666% - 6.7px); max-width: calc(41.666% - 6.7px); min-width: 0; }
.col-4  { flex: 0 0 calc(33.333% - 10.6px); max-width: calc(33.333% - 10.6px); }
.col-3  { flex: 0 0 calc(25% - 12px); max-width: calc(25% - 12px); }

@media (max-width: 768px) {
    .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Profile Two-Column Layout Grid */
.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
}

.profile-col {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 820px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

.table th, .table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover td {
    background-color: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger  { background: var(--danger-light);  color: #991b1b; }
.badge-gray    { background: #f1f5f9; color: var(--text-secondary); }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--secondary-light); color: #075985; border: 1px solid #bae6fd; }

/* Clinical Diagnostic Assistant Component */
.diagnostic-container {
    background: #fdfefe;
    border: 2px dashed #99f6e4;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.diagnostic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.symptom-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.symptom-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1.5px solid var(--border);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.symptom-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdfa;
}

.symptom-tag.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.3);
}

.symptom-category-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin: 14px 0 8px;
    display: block;
    letter-spacing: 0.5px;
}

/* Diagnostic Suggestions Box */
.suggestions-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.suggestion-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    transition: all 0.2s ease;
}

.suggestion-card:last-child {
    margin-bottom: 0;
}

.suggestion-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.suggestion-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.suggestion-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.match-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin: 8px 0 12px;
}

.match-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #10b981, #0d9488);
    transition: width 0.4s ease;
}

.disclaimer-badge {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.82rem;
    color: #92400e;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Timeline Historial Médico */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 11px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.timeline-content {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-date {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Prescription Dynamic Rows */
.prescription-row {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
}

.btn-remove-row {
    color: #ef4444;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-row:hover {
    color: #dc2626;
}

/* Botón inferior punteado de ancho completo */
.btn-dashed-fullwidth {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border: 2px dashed #99f6e4;
    border-radius: var(--radius-md);
    background: #f0fdfa;
    color: #0f766e;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 14px;
}

.btn-dashed-fullwidth:hover {
    background: #ccfbf1;
    border-color: #0d9488;
    color: #115e59;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.btn-dashed-fullwidth:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MODAL DE CALENDARIO SEMANAL & SELECTOR DE DISPONIBILIDAD (TEAMS / GOOGLE CALENDAR)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-dialog-calendar {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    max-width: 1150px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-dialog-calendar {
    transform: translateY(0) scale(1);
}

.modal-header-calendar {
    padding: 18px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.modal-close-btn {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.calendar-toolbar {
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-legend-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: #475569;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.calendar-body {
    padding: 16px 24px;
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    background: #ffffff;
}

.calendar-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.calendar-table th {
    background: #f8fafc;
    padding: 10px 6px;
    text-align: center;
    border-bottom: 2px solid var(--border);
    border-right: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendar-table th.time-header {
    width: 75px;
    color: #64748b;
    font-size: 0.78rem;
    background: #f8fafc;
}

.calendar-table th.day-header {
    font-size: 0.82rem;
    color: #334155;
}

.calendar-table th.day-header.is-today {
    background: #f0fdfa;
    border-bottom-color: #0d9488;
    color: #0f766e;
}

.calendar-table td {
    padding: 3px;
    height: 52px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    vertical-align: stretch;
}

.calendar-table td.time-cell {
    width: 75px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    vertical-align: middle;
}

/* Slots estados */
.slot-box {
    width: 100%;
    height: 100%;
    min-height: 44px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 6px;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

/* Slot Disponible */
.slot-available {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    cursor: pointer;
    align-items: center;
    color: #64748b;
    font-size: 0.78rem;
}

.slot-available:hover {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    transform: scale(1.02);
}

.slot-available .slot-hover-text {
    display: none;
    font-size: 0.75rem;
    font-weight: 800;
    color: #059669;
}

.slot-available:hover .slot-hover-text {
    display: block;
}

.slot-available:hover .slot-idle-text {
    display: none;
}

/* Slot Seleccionado */
.slot-selected {
    background: #0d9488 !important;
    border: 2px solid #0f766e !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.45);
    transform: scale(1.03);
}

.slot-selected * {
    color: #ffffff !important;
}

/* Slot Ocupado (Cita existente) */
.calendar-table td.cell-occupied {
    padding: 3px;
    vertical-align: top;
    height: 100%;
}

.slot-occupied {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-left: 4px solid #ef4444;
    cursor: not-allowed;
    overflow: hidden;
    height: 100%;
    min-height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 6px 8px;
    box-sizing: border-box;
}

.slot-occupied:hover {
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.slot-occupied-tall {
    background: #fff5f5;
    border-left-width: 5px;
    padding: 8px 10px;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.slot-occupied .occ-status {
    font-size: 0.68rem;
    font-weight: 800;
    color: #b91c1c;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.slot-occupied .occ-patient {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.slot-occupied .occ-time {
    font-size: 0.7rem;
    color: #64748b;
}

/* Slot Pasado */
.slot-past {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    color: #cbd5e1;
    cursor: not-allowed;
    align-items: center;
    font-size: 0.72rem;
}

.modal-footer-calendar {
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Duración Selector y Pills */
.calendar-duration-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

.duration-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.duration-pills-full {
    display: flex;
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    gap: 6px;
}

.duration-pills-full .duration-pill {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
}

.duration-pill {
    border: none;
    background: #ffffff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
}

.duration-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.duration-pill.active {
    background: #0d9488 !important;
    color: #ffffff !important;
    border-color: #0f766e !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
}

/* Modal Central de Agendamiento Rápido */
.quick-booking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
}

.quick-booking-dialog {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    animation: quickPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes quickPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.quick-booking-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quick-booking-slot-banner {
    background: #f0fdfa;
    border-top: 1px solid #ccfbf1;
    border-bottom: 1px solid #ccfbf1;
    padding: 12px 24px;
}

/* Patient Search Input con Live Filter */
.patient-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.patient-search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.95rem;
}

.patient-search-input-wrapper input {
    padding-left: 36px !important;
    padding-right: 32px !important;
}

.patient-search-input-wrapper button#quick_patient_clear_search,
.patient-search-input-wrapper button.patient-search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 50%;
}

.patient-search-input-wrapper button#quick_patient_clear_search:hover,
.patient-search-input-wrapper button.patient-search-clear-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.patient-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #0d9488;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10060;
    animation: fadeIn 0.15s ease-out;
}

.patient-search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.12s ease;
    gap: 10px;
}

.patient-search-item:last-child {
    border-bottom: none;
}

.patient-search-item:hover, .patient-search-item.highlighted {
    background: #f0fdfa;
}

.patient-selected-card {
    background: #f0fdfa;
    border: 1.5px solid #99f6e4;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.patient-avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ccfbf1;
    color: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Modal de Cancelación de Citas */
.cancel-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
}

.cancel-modal-dialog {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    animation: quickPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cancel-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cancel-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.cancel-appointment-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}

.cancel-modal-footer {
    padding: 14px 24px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Modal de Vacunas e Inmunizaciones */
.vaccine-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
}

.vaccine-modal-dialog {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    animation: quickPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.vaccine-modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vaccine-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ccfbf1;
    color: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.vaccine-patient-banner {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.vaccine-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.vaccine-form-collapse {
    border-bottom: 1px solid #e2e8f0;
    background: #f0fdfa;
    padding: 16px 24px;
    animation: fadeIn 0.2s ease;
}

.vaccine-form-inner {
    background: #ffffff;
    border: 1px solid #99f6e4;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.08);
}

.vaccine-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    padding: 10px 12px;
    background: #f8fafc;
}

.vaccine-table td {
    padding: 12px;
    vertical-align: middle;
}

.vaccine-modal-footer {
    padding: 14px 24px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Pagination Component */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination-item:hover:not(.disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdfa;
}

.pagination-item.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

.pagination-item.disabled {
    color: #cbd5e1;
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==============================================================================
   Selector Discreto de Idiomas Multi-idioma (i18n)
   ============================================================================== */
.lang-selector-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.lang-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    font-family: inherit;
}

.lang-btn:hover,
.lang-selector-dropdown:hover .lang-btn {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdfa;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.lang-code {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lang-arrow {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.lang-selector-dropdown:hover .lang-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    list-style: none;
    padding: 6px;
    margin: 0;
    min-width: 155px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-selector-dropdown:hover .lang-menu,
.lang-selector-dropdown:focus-within .lang-menu,
.lang-selector-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-item {
    margin: 0;
    list-style: none;
}

.lang-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 11px;
    border-radius: 6px;
    text-decoration: none;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.lang-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.lang-item.active .lang-link {
    background: #f0fdfa;
    color: #0d9488;
    font-weight: 700;
}

.lang-check {
    margin-left: auto;
    color: #0d9488;
    font-weight: 800;
    font-size: 0.82rem;
}

/* Selector variante oscuro (para footer o barras oscuras) */
.lang-selector-dark .lang-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
}

.lang-selector-dark .lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #5eead4;
    color: #5eead4;
}



