html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-mark-lg {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 1.4rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.65);
}

.auth-body {
    background: radial-gradient(circle at top left, #e7f1ff 0, #f8f9fa 45%, #eef2f7 100%);
    min-height: 100vh;
}

.auth-box {
    padding: 1.5rem 0;
}

.auth-shell {
    width: 100%;
    max-width: 560px;
}

.auth-brand {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand img {
    max-height: 42px;
    width: auto;
}

.auth-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.14);
}

@media (max-width: 767.98px) {
    .auth-box {
        align-items: flex-start !important;
        padding-top: 1rem;
    }
}

.card-soft {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.card {
    background-color: #fff;
}

.page-title-head {
    margin-top: 0 !important;
    margin-bottom: 1.5rem;
}

.content-page {
    padding-top: 1.25rem;
}

.page-title-head h4 {
    letter-spacing: -0.02em;
}

.card-header {
    padding: 1rem 1.25rem;
}

.card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
}

.table-custom thead th {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: #6c757d;
    font-weight: 600;
}

.table-custom td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.dashboard-hero {
    background: linear-gradient(120deg, #e0f7ff 0%, #bae6fd 48%, #7dd3fc 100%);
}

.dashboard-hero .card-body {
    background: transparent;
}

.dashboard-hero h1 {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    letter-spacing: -0.03em;
    color: #0f172a;
}

.dashboard-hero-icon {
    width: 140px;
    height: 140px;
    color: #0284c7;
    opacity: 0.22;
    stroke-width: 1.1;
}

body.dashboard-page {
    background: #f0f9ff;
}

.doctor-picker {
    position: relative;
}

.doctor-picker .dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
}

.doctor-picker-avatar {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

.doctor-picker-toggle {
    min-height: 44px;
    border-color: #dee2e6;
    background-color: #fff;
}

.doctor-picker-option {
    border-radius: 0.5rem;
}

.profile-cover {
    height: 150px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 35%),
        linear-gradient(120deg, #0f172a 0%, #1e40af 60%, #2563eb 100%);
}

.profile-avatar {
    width: 96px;
    height: 96px;
    margin-top: -58px;
    margin-left: 0.25rem;
    background: #fff;
    border: 4px solid #fff;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agenda-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.65rem;
}

.agenda-day-col {
    min-width: 0;
    min-height: 240px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 0.6rem;
}

.agenda-day-col.is-today {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.08);
}

.agenda-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eef1f4;
    color: #6c757d;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.agenda-day-head strong {
    color: #212529;
    font-size: 1rem;
}

.agenda-event,
.agenda-mobile-event,
.agenda-day-event {
    display: block;
    color: inherit;
    text-decoration: none;
    border-left: 4px solid var(--agenda-color, #2563eb);
    border-radius: 0.5rem;
    background: #f8fafc;
    padding: 0.5rem 0.6rem;
    transition: background-color 0.15s ease;
}

.agenda-event {
    margin-bottom: 0.45rem;
}

.agenda-event:hover,
.agenda-mobile-event:hover,
.agenda-day-event:hover {
    background: #eef4ff;
    color: inherit;
}

.agenda-event .agenda-time {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--agenda-color, #2563eb);
}

.agenda-event .agenda-patient {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
}

.agenda-event .agenda-doctor {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.agenda-empty {
    color: #adb5bd;
    font-size: 0.75rem;
    padding: 0.75rem 0;
    text-align: center;
}

.agenda-mobile-event {
    margin-bottom: 0.5rem;
}

.agenda-day-event {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agenda-day-event .agenda-time {
    min-width: 110px;
    font-weight: 600;
    color: var(--agenda-color, #2563eb);
}

@media (max-width: 575.98px) {
    .agenda-day-event {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .agenda-day-event .agenda-time {
        min-width: auto;
    }
}

#agenda-calendar {
    min-height: 650px;
}

#agenda-calendar .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 600;
}

#agenda-calendar .fc-button {
    border-radius: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
}

#agenda-calendar .fc-button-primary {
    background-color: var(--ins-secondary-bg-subtle) !important;
    border-color: transparent !important;
    color: var(--ins-secondary) !important;
}

#agenda-calendar .fc-button-primary:hover,
#agenda-calendar .fc-button-primary:focus,
#agenda-calendar .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--ins-secondary) !important;
    border-color: var(--ins-secondary) !important;
    color: #fff !important;
}

#agenda-calendar .fc-event {
    border-radius: 0.4rem;
    border-width: 0 0 0 4px;
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.agenda-fc-event {
    min-width: 0;
    line-height: 1.15;
}

.agenda-fc-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-fc-doctor {
    font-size: 0.67rem;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-doctor-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Choices.js con la misma altura y radios que los controles de Homer. */
.choices {
    margin-bottom: 0;
    font-size: 0.8125rem;
}

.choices__inner {
    min-height: calc(1.5em + 0.9064rem + 2px);
    padding: 0.4532rem 0.77rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background-color: var(--ins-secondary-bg);
    color: var(--ins-body-color);
}

.choices[data-type*="select-one"] .choices__inner {
    padding-bottom: 0.4532rem;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 0.15rem var(--ins-primary-bg-subtle);
}

.choices__list--single {
    padding: 0;
}

.choices__list--single .choices__item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.choices__input {
    margin-bottom: 0;
    background: transparent;
    color: var(--ins-body-color);
    font-size: 0.8125rem;
}

.choices__list--dropdown {
    z-index: 1050;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background-color: var(--ins-secondary-bg);
    color: var(--ins-body-color);
    box-shadow: var(--ins-box-shadow);
}

.choices__list--dropdown .choices__item--selectable {
    padding: 0.5rem 0.75rem;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--ins-primary-bg-subtle);
    color: var(--ins-body-color);
}

.choices__placeholder {
    opacity: 0.65;
}

#agenda-calendar .fc-daygrid-event {
    white-space: normal;
}

#agenda-calendar .fc-timegrid-event {
    min-height: 1.4rem;
}

#agenda-calendar .fc-col-header-cell-cushion,
#agenda-calendar .fc-daygrid-day-number {
    color: #475569;
    text-decoration: none;
}

#agenda-calendar .fc-day-today {
    background-color: #f0f9ff;
}

#agenda-calendar .fc-list-event,
#agenda-calendar .fc-list-event td,
#agenda-calendar .fc-list-event .fc-list-event-title,
#agenda-calendar .fc-list-event .agenda-fc-title,
#agenda-calendar .fc-list-event .agenda-fc-doctor {
    color: #1f2937 !important;
}

#agenda-calendar .fc-list-event .fc-list-event-dot {
    border-width: 5px;
}

@media (max-width: 767.98px) {
    #agenda-calendar {
        min-height: 0;
    }

    #agenda-calendar .fc-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #agenda-calendar .fc-toolbar-chunk {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    #agenda-calendar .fc-toolbar-title {
        font-size: 1rem;
    }
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

@media (max-width: 575.98px) {
    .auth-body {
        padding: 0;
    }

    .auth-box {
        padding: 1rem 0;
    }

    .auth-card .card-body {
        padding: 1.5rem !important;
    }

    .display-6 {
        font-size: 2rem;
    }
}
