:root {
    --portal-sidebar-width: 250px;
    --portal-header-height: 74px;
    --portal-green: #059669;
    --portal-green-dark: #047857;
    --portal-green-soft: #ecfdf5;
    --portal-bg: #f3f7fa;
    --portal-card: #ffffff;
    --portal-text: #0f172a;
    --portal-muted: #64748b;
    --portal-border: #dbe5ec;
    --portal-danger: #dc2626;
    --portal-shadow: 0 12px 32px rgba(15, 23, 42, .07);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--portal-bg);
}

body.portal-v2-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

.portal-v2-shell {
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: var(--portal-sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

.portal-v2-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--portal-sidebar-width);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    background: #ffffff;
    border-right: 1px solid var(--portal-border);
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform .25s ease;
}

.portal-v2-brand {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 18px;
    border-bottom: 1px solid #edf2f7;
}

.portal-v2-brand a {
    display: flex;
    align-items: center;
}

.portal-v2-brand img {
    display: block;
    width: 128px;
    max-height: 42px;
    object-fit: contain;
}

.portal-v2-brand__divider {
    width: 1px;
    height: 28px;
    background: var(--portal-border);
}

.portal-v2-brand__name {
    font-size: 13px;
    line-height: 1.2;
    font-weight: 900;
    color: var(--portal-green-dark);
}

.portal-v2-sidebar-close {
    display: none;
    margin-left: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--portal-text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.portal-v2-nav {
    display: grid;
    gap: 5px;
    padding-top: 18px;
}

.portal-v2-nav__item {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition:
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}

.portal-v2-nav__item:hover {
    background: #f1fbf7;
    color: var(--portal-green-dark);
    transform: translateX(2px);
}

.portal-v2-nav__item.is-active {
    background: linear-gradient(90deg, #dff8ed, #edfdf6);
    color: var(--portal-green-dark);
}

.portal-v2-nav__icon {
    width: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.portal-v2-sidebar__bottom {
    margin-top: auto;
    padding-top: 22px;
}

.portal-v2-support {
    display: grid;
    gap: 9px;
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid #ccebdd;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f1fbf7);
    text-align: center;
}

.portal-v2-support strong {
    color: var(--portal-green-dark);
    font-size: 14px;
}

.portal-v2-support span {
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.45;
}

.portal-v2-support a {
    display: inline-flex;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--portal-green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.portal-v2-nav__logout {
    color: var(--portal-danger);
}

.portal-v2-overlay {
    position: fixed;
    inset: 0;
    z-index: 990;
    display: none;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
}

.portal-v2-header {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: var(--portal-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--portal-border);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .04);
    backdrop-filter: blur(12px);
}

.portal-v2-header__left,
.portal-v2-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-v2-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--portal-border);
    border-radius: 11px;
    background: #ffffff;
    cursor: pointer;
}

.portal-v2-menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    border-radius: 99px;
    background: #334155;
}

.portal-v2-home-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid #b9e7d3;
    border-radius: 11px;
    background: #ffffff;
    color: var(--portal-green-dark);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.portal-v2-home-button:hover {
    background: var(--portal-green-soft);
}

.portal-v2-user__text {
    text-align: right;
    line-height: 1.15;
}

.portal-v2-user__text strong {
    display: block;
    max-width: 210px;
    overflow: hidden;
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-v2-user__text small {
    color: var(--portal-muted);
    font-size: 11px;
}

.portal-v2-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--portal-green-dark), #10b981);
    color: white;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 7px 18px rgba(5, 150, 105, .2);
}

.portal-v2-logout {
    min-height: 40px;
    padding: 9px 14px;
    border: 0;
    border-radius: 11px;
    background: var(--portal-green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.portal-v2-content {
    width: 100%;
    max-width: 1500px;
    flex: 1;
    margin: 0 auto;
    padding: 26px;
}

.portal-v2-content > .ec-page {
    max-width: none;
    padding: 0;
}

.portal-v2-footer {
    padding: 24px;
    border-top: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-size: 12px;
    text-align: center;
}

.portal-v2-footer strong {
    color: var(--portal-green-dark);
}

.portal-v2-footer span {
    display: block;
    margin-top: 4px;
}

@media (max-width: 1100px) {
    :root {
        --portal-sidebar-width: 225px;
    }

    .portal-v2-content {
        padding: 22px;
    }

    .ec-grid--clinical {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
}

@media (max-width: 900px) {
    body.portal-sidebar-open {
        overflow: hidden;
    }

    .portal-v2-shell {
        margin-left: 0;
    }

    .portal-v2-sidebar {
        width: min(310px, calc(100vw - 52px));
        transform: translateX(-105%);
        box-shadow: 20px 0 50px rgba(15, 23, 42, .2);
    }

    .portal-v2-sidebar.is-open {
        transform: translateX(0);
    }

    .portal-v2-overlay.is-open {
        display: block;
    }

    .portal-v2-sidebar-close,
    .portal-v2-menu-button {
        display: block;
    }

    .portal-v2-header {
        padding: 10px 18px;
    }

    .portal-v2-content {
        padding: 18px;
    }

    .ec-grid--clinical {
        grid-template-columns: 1fr;
    }

    .ec-sticky {
        position: static;
    }
}

@media (max-width: 640px) {
    .portal-v2-header {
        min-height: 66px;
        gap: 8px;
        padding: 9px 12px;
    }

    .portal-v2-home-button {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .portal-v2-home-button span:last-child {
        display: none;
    }

    .portal-v2-user {
        gap: 8px;
    }

    .portal-v2-user__text {
        display: none;
    }

    .portal-v2-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .portal-v2-logout {
        display: none;
    }

    .portal-v2-content {
        padding: 12px;
    }

    .portal-v2-footer {
        padding: 20px 12px;
    }

    .ec-clinical-header__inner,
    .ec-card__header,
    .ec-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ec-info-grid,
    .ec-form-grid {
        grid-template-columns: 1fr;
    }

    .ec-card {
        padding: 16px;
        border-radius: 14px;
    }

    .ec-clinical-header {
        border-radius: 15px;
    }

    .ec-clinical-header h1 {
        font-size: clamp(22px, 7vw, 30px);
    }

    .ec-btn {
        width: 100%;
        min-height: 46px;
    }

    .ec-input,
    .ec-select,
    .ec-textarea {
        min-height: 48px;
        font-size: 16px;
    }

    #portal-chatbot-box {
        right: 8px !important;
        bottom: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: none !important;
    }
}

@media (max-width: 380px) {
    .portal-v2-header {
        padding-inline: 8px;
    }

    .portal-v2-menu-button {
        width: 40px;
        height: 40px;
    }

    .portal-v2-content {
        padding: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
   PORTAL V2 - UI KIT
   ========================================================= */

.pv2-card,
.pv2-table-card {
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: var(--portal-card);
    box-shadow: var(--portal-shadow);
}

.pv2-card__header,
.pv2-table-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 21px 24px;
    border-bottom: 1px solid #edf2f7;
}

.pv2-card__heading h2,
.pv2-table-card__header h2 {
    margin: 0;
    color: var(--portal-text);
    font-size: 18px;
    font-weight: 900;
}

.pv2-card__heading p,
.pv2-table-card__header p {
    margin: 5px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.pv2-card__actions,
.pv2-table-card__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pv2-card__body {
    padding: 24px;
}

.pv2-card--no-padding .pv2-card__body {
    padding: 0;
}

.pv2-card__footer,
.pv2-table-card__footer {
    padding: 16px 24px;
    border-top: 1px solid #edf2f7;
    background: #f8fafc;
}

.pv2-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

.pv2-button:hover {
    transform: translateY(-1px);
}

.pv2-button--primary {
    background: var(--portal-green);
    color: #fff;
    box-shadow: 0 8px 18px rgba(5, 150, 105, .18);
}

.pv2-button--primary:hover {
    background: var(--portal-green-dark);
}

.pv2-button--secondary {
    border-color: #b9e7d3;
    background: #fff;
    color: var(--portal-green-dark);
}

.pv2-button--secondary:hover {
    background: var(--portal-green-soft);
}

.pv2-button--danger {
    background: #dc2626;
    color: #fff;
}

.pv2-button--ghost {
    background: transparent;
    color: #475569;
}

.pv2-button--sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 12px;
}

.pv2-button--lg {
    min-height: 48px;
    padding: 12px 20px;
}

.pv2-button--block {
    width: 100%;
}

.pv2-button.is-disabled,
.pv2-button:disabled {
    opacity: .55;
    pointer-events: none;
}

.pv2-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.pv2-badge--success {
    background: #dcfce7;
    color: #166534;
}

.pv2-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.pv2-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.pv2-badge--info {
    background: #dbeafe;
    color: #1e40af;
}

.pv2-badge--neutral {
    background: #e2e8f0;
    color: #475569;
}

.pv2-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 17px;
    border: 1px solid;
    border-radius: 13px;
}

.pv2-alert__icon {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 18px;
}

.pv2-alert__content {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
}

.pv2-alert__content strong {
    display: block;
    margin-bottom: 2px;
}

.pv2-alert__close {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.pv2-alert--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.pv2-alert--warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.pv2-alert--danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.pv2-alert--info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.pv2-field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.pv2-field__label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.pv2-field__required {
    color: #dc2626;
}

.pv2-input,
.pv2-select,
.pv2-textarea {
    width: 100%;
    min-height: 45px;
    padding: 10px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--portal-text);
    transition:
        border-color .16s ease,
        box-shadow .16s ease;
}

.pv2-textarea {
    min-height: 110px;
    resize: vertical;
}

.pv2-input:focus,
.pv2-select:focus,
.pv2-textarea:focus {
    border-color: var(--portal-green);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, .12);
}

.pv2-input.is-invalid,
.pv2-select.is-invalid,
.pv2-textarea.is-invalid {
    border-color: #dc2626;
}

.pv2-field__help {
    color: var(--portal-muted);
    font-size: 11px;
}

.pv2-field__error {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
}

.pv2-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.pv2-form-grid__full {
    grid-column: 1 / -1;
}

.pv2-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.pv2-stat {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 19px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    box-shadow: var(--portal-shadow);
    text-decoration: none;
}

.pv2-stat__icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--portal-green-soft);
    color: var(--portal-green-dark);
    font-size: 22px;
}

.pv2-stat__content {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.pv2-stat__label {
    overflow: hidden;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv2-stat__value {
    color: var(--portal-text);
    font-size: 25px;
    line-height: 1;
    font-weight: 950;
}

.pv2-stat__content small {
    color: var(--portal-muted);
    font-size: 11px;
}

.pv2-stat__arrow {
    margin-left: auto;
    color: #94a3b8;
}

.pv2-stat--info .pv2-stat__icon {
    background: #eff6ff;
    color: #2563eb;
}

.pv2-stat--warning .pv2-stat__icon {
    background: #fffbeb;
    color: #d97706;
}

.pv2-stat--danger .pv2-stat__icon {
    background: #fef2f2;
    color: #dc2626;
}

.pv2-empty {
    display: grid;
    justify-items: center;
    padding: 48px 20px;
    text-align: center;
}

.pv2-empty__icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    border-radius: 22px;
    background: var(--portal-green-soft);
    color: var(--portal-green-dark);
    font-size: 30px;
}

.pv2-empty h3 {
    margin: 0;
    font-size: 18px;
}

.pv2-empty p {
    max-width: 480px;
    margin: 8px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.5;
}

.pv2-empty__actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.pv2-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pv2-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.pv2-table th,
.pv2-table td {
    padding: 14px 17px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
}

.pv2-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pv2-table td {
    color: #334155;
    font-size: 13px;
}

.pv2-table tbody tr:hover {
    background: #f8fffc;
}

.pv2-breadcrumb {
    margin-bottom: 14px;
}

.pv2-breadcrumb ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pv2-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--portal-muted);
    font-size: 12px;
}

.pv2-breadcrumb a {
    color: var(--portal-green-dark);
    font-weight: 750;
    text-decoration: none;
}

.pv2-breadcrumb i {
    font-size: 10px;
}

.pv2-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.pv2-page-header__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--portal-green-dark);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pv2-page-header h1 {
    margin: 0;
    color: var(--portal-text);
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.15;
    font-weight: 950;
}

.pv2-page-header p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.5;
}

.pv2-page-header__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pv2-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pv2-modal.is-open {
    display: flex;
}

.pv2-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
}

.pv2-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .28);
}

.pv2-modal__dialog--sm {
    max-width: 440px;
}

.pv2-modal__dialog--md {
    max-width: 650px;
}

.pv2-modal__dialog--lg {
    max-width: 920px;
}

.pv2-modal__header,
.pv2-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 21px;
}

.pv2-modal__header {
    border-bottom: 1px solid #edf2f7;
}

.pv2-modal__header h2 {
    margin: 0;
    font-size: 18px;
}

.pv2-modal__footer {
    justify-content: flex-end;
    border-top: 1px solid #edf2f7;
    background: #f8fafc;
}

.pv2-modal__body {
    padding: 21px;
}

.pv2-modal__close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .pv2-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .pv2-card__header,
    .pv2-table-card__header,
    .pv2-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pv2-card__body {
        padding: 17px;
    }

    .pv2-card__actions,
    .pv2-table-card__actions,
    .pv2-page-header__actions {
        width: 100%;
    }

    .pv2-page-header__actions .pv2-button {
        flex: 1;
    }

    .pv2-form-grid,
    .pv2-stats-grid {
        grid-template-columns: 1fr;
    }

    .pv2-stat {
        padding: 16px;
    }

    .pv2-table-card {
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .pv2-button {
        min-height: 46px;
    }

    .pv2-empty__actions {
        width: 100%;
        flex-direction: column;
    }

    .pv2-empty__actions .pv2-button {
        width: 100%;
    }

    .pv2-modal {
        align-items: flex-end;
        padding: 0;
    }

    .pv2-modal__dialog {
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
    }
}

/* =========================================================
   MÓDULO MÉDICO V2
   Dashboard + disponibilidad
   ========================================================= */

.pv2-error-list {
    margin: 8px 0 0;
    padding-left: 20px;
}

.doctor-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.doctor-stats-grid--schedule {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.doctor-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 126px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

.doctor-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 22px;
}

.doctor-stat-icon--green {
    color: #047857;
    background: #d1fae5;
}

.doctor-stat-icon--blue {
    color: #1d4ed8;
    background: #dbeafe;
}

.doctor-stat-icon--violet {
    color: #6d28d9;
    background: #ede9fe;
}

.doctor-stat-icon--amber {
    color: #b45309;
    background: #fef3c7;
}

.doctor-stat-label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.doctor-stat-value {
    margin-top: 5px;
    color: #0f172a;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.doctor-stat-value--small {
    font-size: 26px;
}

.doctor-stat-help {
    margin-top: 7px;
    color: #94a3b8;
    font-size: 12px;
}

.doctor-dashboard-grid,
.doctor-schedule-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.4fr);
    gap: 20px;
    margin-bottom: 20px;
}

.doctor-schedule-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

.doctor-panel {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

.doctor-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid #edf2f7;
}

.doctor-panel-heading--table {
    align-items: center;
}

.doctor-panel-heading h2 {
    margin: 3px 0 0;
    color: #0f172a;
    font-size: 21px;
    font-weight: 900;
}

.doctor-panel-heading p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.doctor-panel-eyebrow {
    display: block;
    color: #059669;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.doctor-panel-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    color: #047857;
    background: #ecfdf5;
    border-radius: 14px;
    font-size: 20px;
}

.doctor-next-panel {
    background:
        linear-gradient(145deg, rgba(6, 95, 70, 0.98), rgba(5, 150, 105, 0.95)),
        #065f46;
    border: 0;
    color: #ffffff;
}

.doctor-next-panel .doctor-panel-heading {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.doctor-next-panel .doctor-panel-eyebrow {
    color: #a7f3d0;
}

.doctor-next-panel .doctor-panel-heading h2 {
    color: #ffffff;
}

.doctor-next-panel .doctor-panel-heading-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
}

.doctor-next-time {
    padding: 25px 22px 0;
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
}

.doctor-next-time small {
    font-size: 17px;
}

.doctor-next-date {
    margin-top: 8px;
    padding: 0 22px;
    color: #d1fae5;
    font-size: 13px;
    text-transform: capitalize;
}

.doctor-next-patient {
    margin: 22px 22px 0;
    font-size: 24px;
    font-weight: 900;
}

.doctor-next-meta {
    display: grid;
    gap: 10px;
    margin-top: 17px;
    padding: 0 22px;
}

.doctor-next-meta > div {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #d1fae5;
    font-size: 13px;
}

.doctor-next-status {
    padding: 18px 22px 0;
}

.doctor-next-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 22px;
}

.doctor-text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #047857;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.doctor-today-list {
    padding: 4px 22px;
}

.doctor-today-item {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #edf2f7;
}

.doctor-today-item:last-child {
    border-bottom: 0;
}

.doctor-today-hour {
    color: #047857;
    font-size: 17px;
    font-weight: 900;
}

.doctor-today-content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.doctor-today-content strong {
    overflow: hidden;
    color: #0f172a;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-today-content span {
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-today-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doctor-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
}

.doctor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.doctor-badge--success {
    color: #166534;
    background: #dcfce7;
}

.doctor-badge--warning {
    color: #92400e;
    background: #fef3c7;
}

.doctor-badge--danger {
    color: #991b1b;
    background: #fee2e2;
}

.doctor-badge--neutral {
    color: #475569;
    background: #e2e8f0;
}

.doctor-table-wrap {
    overflow-x: auto;
}

.doctor-table {
    width: 100%;
    border-collapse: collapse;
}

.doctor-table th {
    padding: 14px 16px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.doctor-table td {
    padding: 15px 16px;
    color: #334155;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
    vertical-align: middle;
}

.doctor-table tbody tr:last-child td {
    border-bottom: 0;
}

.doctor-table tbody tr:hover {
    background: #fbfdfc;
}

.doctor-table td strong {
    display: block;
    color: #0f172a;
}

.doctor-table-secondary {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.doctor-table-actions-heading {
    text-align: right !important;
}

.doctor-table-actions-cell {
    text-align: right;
}

.doctor-coverage {
    display: inline-flex;
    padding: 6px 10px;
    color: #065f46;
    background: #ecfdf5;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.doctor-row-actions,
.doctor-schedule-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.doctor-row-actions form,
.doctor-schedule-actions form {
    margin: 0;
}

.doctor-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 11px;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.doctor-action--view {
    color: #334155;
    background: #f1f5f9;
}

.doctor-action--accept {
    color: #166534;
    background: #dcfce7;
}

.doctor-action--reject {
    color: #991b1b;
    background: #fee2e2;
}

.doctor-action--video {
    color: #1d4ed8;
    background: #dbeafe;
}

.doctor-action--history {
    color: #5b21b6;
    background: #ede9fe;
}

.doctor-action--toggle {
    color: #92400e;
    background: #fef3c7;
}

.doctor-empty-state {
    padding: 42px 24px;
    text-align: center;
}

.doctor-empty-state--compact {
    padding: 32px 20px;
}

.doctor-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 13px;
    color: #047857;
    background: #ecfdf5;
    border-radius: 17px;
    font-size: 23px;
}

.doctor-empty-state h3 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 900;
}

.doctor-empty-state p {
    margin: 7px auto 0;
    max-width: 420px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.doctor-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
    padding: 22px;
}

.doctor-field {
    min-width: 0;
}

.doctor-field label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
}

.doctor-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.doctor-control:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.doctor-field-error {
    display: block;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 12px;
}

.doctor-form-actions {
    grid-column: 1 / -1;
}

.doctor-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 11px 18px;
    color: #ffffff;
    background: #059669;
    border: 0;
    border-radius: 13px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.doctor-primary-button:hover {
    background: #047857;
}

.doctor-tips-list {
    display: grid;
    gap: 0;
    padding: 8px 22px 16px;
}

.doctor-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #edf2f7;
}

.doctor-tip:last-child {
    border-bottom: 0;
}

.doctor-tip > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: #047857;
    background: #ecfdf5;
    border-radius: 11px;
}

.doctor-tip strong {
    color: #0f172a;
    font-size: 13px;
}

.doctor-tip p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.doctor-schedule-list-panel {
    margin-bottom: 24px;
}

.doctor-total-badge {
    display: inline-flex;
    padding: 7px 12px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.doctor-schedule-list {
    display: grid;
}

.doctor-schedule-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid #edf2f7;
}

.doctor-schedule-card:last-child {
    border-bottom: 0;
}

.doctor-schedule-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.doctor-day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 17px;
    font-size: 16px;
    font-weight: 900;
}

.doctor-schedule-info {
    min-width: 0;
}

.doctor-schedule-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.doctor-schedule-title-row h3 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 900;
}

.doctor-schedule-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
}

.doctor-schedule-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1180px) {
    .doctor-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .doctor-dashboard-grid,
    .doctor-schedule-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .doctor-stats-grid,
    .doctor-stats-grid--schedule {
        grid-template-columns: 1fr;
    }

    .doctor-panel-heading,
    .doctor-panel-heading--table {
        align-items: flex-start;
        flex-direction: column;
    }

    .doctor-form-grid {
        grid-template-columns: 1fr;
    }

    .doctor-schedule-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .doctor-schedule-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .doctor-table,
    .doctor-table thead,
    .doctor-table tbody,
    .doctor-table tr,
    .doctor-table th,
    .doctor-table td {
        display: block;
        width: 100%;
    }

    .doctor-table thead {
        display: none;
    }

    .doctor-table tbody tr {
        padding: 13px 16px;
        border-bottom: 1px solid #e2e8f0;
    }

    .doctor-table td {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 12px;
        padding: 8px 0;
        border: 0;
        text-align: left;
    }

    .doctor-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .doctor-table-actions-cell {
        display: block !important;
    }

    .doctor-table-actions-cell::before {
        display: block;
        margin-bottom: 10px;
    }

    .doctor-row-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .doctor-stat-card {
        min-height: 110px;
        padding: 17px;
    }

    .doctor-today-item {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .doctor-today-side {
        grid-column: 2;
        justify-content: flex-start;
    }

    .doctor-next-actions {
        flex-direction: column;
    }

    .doctor-schedule-main {
        align-items: flex-start;
    }

    .doctor-schedule-meta {
        flex-direction: column;
        gap: 7px;
    }

    .doctor-action {
        flex: 1 1 auto;
    }
}
[?2004h[?1049h[22;0;0t[1;49r(B[m[4l[?7h[39;49m[?1h=[?1h=[?25l[39;49m(B[m[H[2J[47;90H(B[0;7m[ New File ](B[m[H(B[0;7m  GNU nano 8.4 [69bprescriptions-create-v2.css [78b [1;190H(B[m[48d(B[0;7m^G(B[m Help[48;18H(B[0;7m^O(B[m Write Out     (B[0;7m^F(B[m Where Is[52G(B[0;7m^K(B[m Cut[48;69H(B[0;7m^T(B[m Execute[86G(B[0;7m^C(B[m Location[103G(B[0;7mM-U(B[m Undo[48;120H(B[0;7mM-A(B[m Set Mark     (B[0;7mM-](B[m To Bracket   (B[0;7mM-B(B[m Previous     (B[0;7mLeft(B[m Back[49d(B[0;7m^X(B[m Exit[49;18H(B[0;7m^R(B[m Read File     (B[0;7m^\(B[m Replace[52G(B[0;7m^U(B[m Paste[49;69H(B[0;7m^J(B[m Justify[86G(B[0;7m^/(B[m Go To Line    (B[0;7mM-E(B[m Redo[49;120H(B[0;7mM-6(B[m Copy[49;137H(B[0;7m^B(B[m Where Was     (B[0;7mM-F(B[m Next[49;171H(B[0;7mRight(B[m Forward[2d[?12l[?25h[?25l[47;69H(B[0;7m[ line  1/1 (100%), col  1/ 1 (100%), char  0/0 ( 0%) ](B[m[?12l[?25h[2d[?25l[1;113H(B[0;7m*[190G(B[m[3d[?12l[?25h[?25l[4d[?12l[?25h[?25l[47;68H(B[0;7m[ line  3/3 (100%), col  1/ 1 (100%), char  2/2 (10[124G(B[m[?12l[?25h[4d[?25l[47;124H[?12l[?25h[4d[?25l[47;124H[?12l[?25h[4d[?25l[47d(B[0;7mSave modified buffer? [168b [48;1H Y(B[m Yes[K[49d(B[0;7m N(B[m No  [49;17H(B[0;7m^C(B[m Cancel[K[47;23H[?12l[?25h[?25l[47;89H[1K (B[0;7m[ Cancelled ](B[m[K[48d(B[0;7m^G(B[m Help[48;18H(B[0;7m^O(B[m Write Out     (B[0;7m^F(B[m Where Is[52G(B[0;7m^K(B[m Cut[48;69H(B[0;7m^T(B[m Execute[86G(B[0;7m^C(B[m Location[103G(B[0;7mM-U(B[m Undo[48;120H(B[0;7mM-A(B[m Set Mark     (B[0;7mM-](B[m To Bracket   (B[0;7mM-B(B[m Previous     (B[0;7mLeft(B[m Back[49d(B[0;7m^X(B[m Exit[49;17H (B[0;7m^R(B[m Read File     (B[0;7m^\(B[m Replace[52G(B[0;7m^U(B[m Paste[49;69H(B[0;7m^J(B[m Justify[86G(B[0;7m^/(B[m Go To Line    (B[0;7mM-E(B[m Redo[49;120H(B[0;7mM-6(B[m Copy[49;137H(B[0;7m^B(B[m Where Was     (B[0;7mM-F(B[m Next[49;171H(B[0;7mRight(B[m Forward[?12l[?25h[4d[?25l[47;68H(B[0;7m[ line  3/3 (100%), col  1/ 1 (100%), char  2/2 (100%) ](B[m[?12l[?25h[4d[?25l[47;124H[?12l[?25h[4d[?25l[47;124H[?12l[?25h[4d[?25l[5d[?12l[?25h[?25l[6d[?12l[?25h[?25l[7d[?12l[?25h

/* =========================================================
   RECETAS V2 - FORMULARIO DE CREACIÓN
   ========================================================= */

.prescription-patient-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 22px;
}

.prescription-patient-avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 25px;
}

.prescription-patient-data h2 {
    margin: 4px 0 8px;
    font-size: 22px;
    color: #0f172a;
}

.prescription-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #64748b;
    font-size: 14px;
}

.prescription-patient-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.prescription-form {
    display: grid;
    gap: 22px;
}

.prescription-form-section {
    padding: 24px;
}

.prescription-field {
    display: grid;
    gap: 8px;
}

.prescription-field label {
    color: #334155;
    font-size: 14px;
    font-weight: 800;
}

.prescription-control {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

textarea.prescription-control {
    resize: vertical;
}

.prescription-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.prescription-control--invalid {
    border-color: #dc2626;
}

.prescription-field-error {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.prescription-medications {
    display: grid;
    gap: 16px;
}

.prescription-medication-card {
    padding: 20px;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    background: #f8fafc;
}

.prescription-medication-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.prescription-medication-number {
    display: block;
    margin-bottom: 4px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.prescription-medication-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
}

.prescription-remove-medication {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
    cursor: pointer;
}

.prescription-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.prescription-submit-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
}

.prescription-submit-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.prescription-submit-info h2 {
    margin: 0 0 5px;
    color: #0f172a;
    font-size: 19px;
}

.prescription-submit-info p {
    margin: 0;
    color: #64748b;
}

.prescription-submit-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #dcfce7;
    color: #166534;
    font-size: 22px;
}

.prescription-submit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pv2-error-list {
    margin: 8px 0 0 20px;
}

@media (max-width: 768px) {
    .prescription-patient-panel,
    .prescription-submit-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .prescription-grid {
        grid-template-columns: 1fr;
    }

    .prescription-medication-header {
        align-items: stretch;
        flex-direction: column;
    }

    .prescription-submit-actions {
        width: 100%;
    }

    .prescription-submit-actions > * {
        flex: 1 1 auto;
    }
}
