/* Modern Reset & Variables */
:root {
    /* Brand Palette - Elegant Gold/Bronze Theme */
    --brand-gold: #bc9862;
    /* Elegant Gold/Bronze Primary */
    --brand-dark: #6b5344;
    /* Deep Brown for hover states */
    --brand-accent: #4a5d6f;
    /* Sophisticated Blue-Gray for accents */

    /* Theme Mapping: Gold is Primary, Blue-Gray is Secondary/Accent */
    --primary: var(--brand-gold);
    --primary-dark: #a0845a;
    /* Darker shade of gold for hover */
    --primary-light: #faf7f2;
    /* Soft cream background */
    --primary-bg: #f5f0e8;
    /* Light beige for borders/accents */

    --secondary: var(--brand-accent);

    --text-main: #2d2d2d;
    /* Dark charcoal */
    --text-secondary: #6b7280;
    /* Medium gray */
    --bg-body: #fefdfb;
    /* Off-white cream */
    --bg-card: #ffffff;
    --border-color: #e8dfd3;
    /* Warm beige borders */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    padding: 2rem 1rem;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border-top: 5px solid var(--brand-gold);
    /* Gold Accent Top Border */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--brand-gold);
    /* Headings in Gold */
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

/* Branding */
.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.brand-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    text-align: left;
}

.brand-text h1 {
    margin-bottom: 0.25rem;
    text-align: left;
    font-size: 2.5rem;
    color: var(--brand-gold);
}

.brand-text .subtitle {
    text-align: left;
    margin-bottom: 0;
    margin-left: 0;
    font-size: 1.2rem;
    color: var(--brand-accent);
    font-weight: 600;
}

@media (max-width: 640px) {
    .header-brand {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .brand-text {
        text-align: center;
    }

    .brand-text h1,
    .brand-text .subtitle {
        text-align: center;
    }
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-gold);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Navigation */
.tabs-container {
    margin-bottom: 2rem;
}

.nav-buttons-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-body);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

.nav-button.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Grid System */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Cards */
.doctor-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.doctor-button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.doctor-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.doctor-button:hover::before {
    opacity: 1;
}

.doctor-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-align: center;
}

.doctor-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.suggested-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.suggested-slot-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-bg);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.suggested-slot-chip:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.suggested-slot-chip .slot-date {
    margin-right: 0.5rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

.form-group {
    margin-bottom: 0;
    /* Managed by grid gap */
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-section-title {
    grid-column: 1 / -1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--primary-bg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Enhanced Form Inputs & Selects */
.form-input,
.doctor-select,
select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    /* Increased size for better readability */
    font-weight: 500;
    /* Slightly bolder text */
    font-family: inherit;
    color: #0f172a;
    /* Darker color (Slate 900) for maximum contrast */
    background-color: white;
    transition: all 0.2s ease-in-out;
    height: 50px;
    /* Slightly taller to accommodate larger text */
    box-shadow: var(--shadow-sm);
}

textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

/* Custom Select Style */
select,
.doctor-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Hover States */
.form-input:hover,
.doctor-select:hover,
select:hover,
input:not(:disabled):not([readonly]):hover,
textarea:not(:disabled):not([readonly]):hover {
    border-color: #cbd5e1;
    background-color: #fcfcfc;
}

/* Focus States - Use Gold for Focus to bring back the primary color */
.form-input:focus,
.doctor-select:focus,
select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(188, 152, 98, 0.15);
    /* Light Gold Glow */
    background-color: white;
}

/* Disabled & Readonly States */
.form-input:disabled,
.form-input[readonly],
select:disabled,
input:disabled,
input[readonly] {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
}

/* Secondary Button (Buscar Horarios) - Use Gold for Action Highlights */
.secondary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: white;
    color: var(--primary);
    /* Gold Text */
    border: 1px solid var(--primary);
    /* Gold Border */
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-size: 0.95rem;
    height: 45px;
    box-shadow: var(--shadow-sm);
}

.secondary-button:hover {
    border-color: var(--primary);
    background-color: rgba(188, 152, 98, 0.05);
    /* Very light gold bg */
    transform: translateY(-1px);
}

.btn-icon {
    margin-right: 0.5rem;
    font-size: 1.1em;
    color: var(--primary);
    /* Teal Icons */
}

/* Make white buttons have teal icons too if needed, but usually icons inherit or are specific */
.save-button .btn-icon,
.filter-button .btn-icon,
.external-link-button .btn-icon {
    color: white;
    /* Keep white on primary buttons */
}

/* Buttons */
.save-button,
.filter-button,
.external-link-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    /* Deep Blue */
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    font-size: 1rem;
}

.save-button:hover,
.filter-button:hover,
.external-link-button:hover {
    background-color: var(--primary-dark);
}

/* Suggested Slots - Gold accents */
.suggested-slot-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: white;
    color: var(--primary);
    /* Gold text */
    border: 1px solid var(--primary-bg);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.suggested-slot-chip:hover {
    background-color: var(--primary);
    /* Gold background on hover */
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-gold);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background-color: var(--primary);
    /* Gold Accent Bar */
    margin-right: 0.75rem;
    border-radius: 4px;
}

/* Filter Section */
.filter-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
    background: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .filter-container {
        grid-template-columns: 1fr;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-outline-danger {
    background: white;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: #fef2f2;
}

.btn-outline-primary {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

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

/* Modern Form Inputs Override */
input[type="date"] {
    font-family: inherit;
    color: var(--text-main);
}

.appointment-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
    position: relative;
}

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

.appointment-card.cancelled {
    background-color: #f8f9fa;
    border-style: dashed;
    opacity: 0.8;
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.appointment-date-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.appointment-date {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appointment-date::before {
    content: '📅';
    font-size: 1rem;
}

.appointment-time {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    align-self: flex-start;
    display: inline-block;
}

.appointment-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.appointment-info-item {
    display: flex;
    flex-direction: column;
}

.appointment-info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.appointment-info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

/* Utilities */
.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

.no-appointments {
    text-align: center;
    padding: 3rem;
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
}

.error {
    background-color: #fef2f2;
    color: var(--danger);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #fee2e2;
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}

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

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-button {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-top: 2rem;
}

.cancel-button-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    width: 100%;
}

.cancel-button-modal:hover {
    background-color: var(--bg-body);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Patient Cards */
.patients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.patient-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

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

.patient-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.patient-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.patient-info-header {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.patient-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    background: var(--bg-body);
    padding: 2px 6px;
    border-radius: 4px;
}

.patient-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.patient-detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.patient-detail-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-body);
    border-radius: 6px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.patient-detail-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.patient-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Search Input Enhancement */
.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 4rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Date Picker Styles */
.date-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.scroll-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    transition: all 0.2s;
}

.scroll-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.date-picker-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 4px;
    /* Added horizontal padding to prevent cut-off shadows */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    margin: 0 8px;
    /* Space for buttons */
    scroll-behavior: smooth;
    width: 100%;
}

.date-picker-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.date-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 100px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    /* Circulitos/Capsule style */
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 5px 0;
}

.date-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.date-card.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.date-card .day-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.date-card .day-number {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2px 0;
}

.date-card .month-year {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: 2px;
    opacity: 0.9;
}

/* Available Date Style */
.date-card.has-slots {
    border-color: var(--primary);
    background-color: #faf5ed;
    /* Very light gold */
    color: var(--primary-dark);
    font-weight: 700;
}

.date-card.has-slots:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Ensure selected state overrides available state */
.date-card.selected,
.date-card.has-slots.selected {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

/* Time Slots Grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.time-slot-btn {
    padding: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.time-slot-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.time-slot-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.time-slot-btn span.end-time {
    font-size: 0.75rem;
    opacity: 0.8;
}



/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    h1 {
        font-size: 1.5rem;
    }

    .nav-buttons-container {
        flex-direction: column;
    }

    .nav-button {
        width: 100%;
        text-align: center;
    }

    .appointment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

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

.pagination-button {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #374151;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-button:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.pagination-button.active {
    background-color: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
    font-weight: 600;
}

.pagination-button:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.pagination-info {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 8px;
}

/* Appointments List in Patient Card */
.patient-appointments-list {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    display: none;
    /* Hidden by default */
    max-height: 250px;
    /* Limitar altura para evitar listas largas */
    overflow-y: auto;
    /* Scroll si hay muchos items */
}

.patient-appointment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

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

.appt-date {
    font-weight: 600;
    color: #0f172a;
}

.appt-details {
    color: #64748b;
    font-size: 0.85rem;
}

.appt-duration {
    background-color: #faf5ed;
    color: #a0845a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}