:root {
    --senda-green: #6ba132;
    --senda-green-dark: #4f7d22;
    --senda-orange: #ee9830;
    --senda-slate: #0f172a;
}

html,
body {
    min-height: 100%;
}

body {
    overflow-x: hidden;
}

.senda-sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.senda-nav-section {
    margin: 1.25rem 1rem .4rem;
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.nav-link i {
    width: 1.35rem;
    display: inline-block;
}

.cms-card {
    border: 1px solid rgba(148, 163, 184, .18);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: rgba(107, 161, 50, .08);
}

.stat-card-orange::after {
    background: rgba(238, 152, 48, .10);
}

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

.blog-modal-dialog {
    max-width: 1580px;
}


/*
 * Bootstrap aplica el scroll al .modal-body cuando este es hijo directo
 * del .modal-content. En nuestros formularios hay un <form> intermedio,
 * así que lo convertimos también en contenedor flex y limitamos su altura.
 */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.blog-modal-dialog {
    height: calc(100dvh - 1.5rem);
    margin-top: .75rem;
    margin-bottom: .75rem;
}

.blog-modal-dialog .modal-content {
    max-height: 100%;
}

.team-photo-uploader {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.team-photo-preview {
    min-height: 170px;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.team-photo-preview img {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
}

.team-photo-placeholder {
    padding: 1rem;
    color: #94a3b8;
    text-align: center;
}

.team-photo-path {
    overflow-wrap: anywhere;
}

.team-description-toolbar {
    position: sticky;
    top: -1px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    padding: .55rem;
    border: 1px solid #dbe3ec;
    border-bottom: 0;
    border-radius: .8rem .8rem 0 0;
    background: #f8fafc;
}

#teamDescripcionEditor {
    min-height: 220px;
    max-height: 430px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #dbe3ec;
    border-radius: 0 0 .8rem .8rem;
    background: #fff;
    font-size: 15px;
    line-height: 1.7;
}

#teamDescripcionEditor:focus {
    outline: 0;
    border-color: rgba(107, 161, 50, .65);
    box-shadow: 0 0 0 .22rem rgba(107, 161, 50, .13);
}

#teamDescripcionEditor p:last-child,
#teamDescripcionEditor ul:last-child,
#teamDescripcionEditor ol:last-child {
    margin-bottom: 0;
}

/*
 * Tailwind/preflight elimina las viñetas de ul/ol. El contenido HTML del CMS
 * debe representarse dentro del editor igual que en la web pública.
 */
#teamDescripcionEditor ul {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 1.6rem;
    margin: 0 0 1rem 0;
}

#teamDescripcionEditor ol {
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 1.6rem;
    margin: 0 0 1rem 0;
}

#teamDescripcionEditor li {
    display: list-item;
    margin-bottom: .3rem;
}

#teamDescripcionEditor ul ul {
    list-style-type: circle;
    margin-top: .3rem;
}

#teamDescripcionEditor ul ul ul {
    list-style-type: square;
}

#teamDescripcionEditor ol ol {
    list-style-type: lower-alpha;
    margin-top: .3rem;
}

.team-list-thumb {
    width: 52px;
    height: 52px;
    border-radius: .75rem;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.blog-settings-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
}

.blog-settings-card > .card-header {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: transparent;
    padding: 1rem 1.1rem;
    font-weight: 700;
}

.blog-settings-card > .card-body {
    padding: 1.1rem;
}

.blog-editor-toolbar {
    position: sticky;
    top: -1px;
    z-index: 4;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-bottom: 0;
    border-radius: .85rem .85rem 0 0;
    padding: .65rem;
}

#blogContenido,
#blogContenidoSource {
    min-height: 520px;
    border-radius: 0 0 .85rem .85rem;
    border-color: #dbe3ec;
    padding: 1.25rem;
    font-size: 15px;
    line-height: 1.75;
    background: #fff;
}

#blogContenido:focus,
#blogContenidoSource:focus {
    outline: 0;
    box-shadow: 0 0 0 .22rem rgba(107, 161, 50, .13);
    border-color: rgba(107, 161, 50, .65);
}

#blogContenido h2,
#blogPreview h2 {
    margin-top: 1.75rem;
    margin-bottom: .85rem;
    font-size: 1.55rem;
    font-weight: 700;
}

#blogContenido h3,
#blogPreview h3 {
    margin-top: 1.4rem;
    margin-bottom: .75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

#blogContenido p,
#blogPreview p {
    margin-bottom: 1rem;
}

#blogContenido ul,
#blogPreview ul {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 1.6rem;
    margin-bottom: 1rem;
}

#blogContenido ol,
#blogPreview ol {
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 1.6rem;
    margin-bottom: 1rem;
}

#blogContenido li,
#blogPreview li {
    display: list-item;
    margin-bottom: .3rem;
}

#blogContenido ul ul,
#blogPreview ul ul {
    list-style-type: circle;
    margin-top: .3rem;
}

#blogContenido ul ul ul,
#blogPreview ul ul ul {
    list-style-type: square;
}

#blogContenido ol ol,
#blogPreview ol ol {
    list-style-type: lower-alpha;
    margin-top: .3rem;
}

#blogContenido blockquote,
#blogPreview blockquote {
    border-left: 4px solid var(--senda-orange);
    background: #fff8ef;
    padding: .85rem 1rem;
    margin: 1rem 0;
}

#blogContenido img,
#blogPreview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: .85rem;
    margin: 1.25rem auto;
}

#blogContenido img {
    cursor: pointer;
    transition: outline-color .12s ease, box-shadow .12s ease, opacity .12s ease;
}

#blogContenido img.senda-editor-image-selected {
    outline: 3px solid var(--senda-orange);
    outline-offset: 4px;
    box-shadow:
        0 0 0 7px rgba(238, 152, 48, .16),
        0 .5rem 1.4rem rgba(15, 23, 42, .12);
}

#blogContenido img.senda-editor-image-selected::selection {
    background: transparent;
}

#blogContenido figure,
#blogPreview figure {
    margin: 1.5rem 0;
}

#blogContenido figcaption,
#blogPreview figcaption {
    margin-top: .5rem;
    color: #64748b;
    font-size: .875rem;
    text-align: center;
}

#blogContenido iframe,
#blogPreview iframe {
    display: block;
    width: 100%;
    max-width: 860px;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 1.5rem auto;
    border: 0;
    border-radius: .85rem;
    background: #0f172a;
}

.blog-preview-box {
    min-height: 360px;
    max-height: 620px;
    overflow: auto;
}

.blog-image-preview {
    min-height: 130px;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blog-image-preview img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.blog-category-list {
    max-height: 260px;
    overflow: auto;
}

.blog-category-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .75rem;
    align-items: center;
    padding: .55rem .7rem;
    border-radius: .7rem;
}

.blog-category-row:hover {
    background: #f8fafc;
}

.blog-ai-card {
    border: 1px solid rgba(107, 161, 50, .28);
    background: linear-gradient(145deg, rgba(107, 161, 50, .08), rgba(238, 152, 48, .08));
}

.blog-ai-badge {
    background: rgba(107, 161, 50, .14);
    color: var(--senda-green-dark);
}

.blog-ai-result {
    border: 1px solid rgba(107, 161, 50, .25);
    background: rgba(255, 255, 255, .8);
    border-radius: .9rem;
    padding: .9rem;
}

.media-offcanvas {
    width: min(92vw, 980px) !important;
    z-index: 1095;
}

.offcanvas-backdrop.show.media-backdrop,
.offcanvas-backdrop.show {
    z-index: 1090;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.media-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.media-card:hover {
    transform: translateY(-2px);
    border-color: rgba(107, 161, 50, .5);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
}

.media-card-image {
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    background: #f1f5f9;
}

.media-card-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-message-box {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    min-height: 160px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--senda-orange);
    border-radius: .85rem;
    padding: 1rem;
    line-height: 1.7;
}

.delivery-error {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .78rem;
}

.status-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    display: inline-block;
}

.pagination .page-link {
    border-radius: .65rem !important;
}

@media (max-width: 991.98px) {
    .senda-admin-layout {
        display: block !important;
    }

    .senda-sidebar {
        width: 100% !important;
        min-height: auto;
        position: static;
    }

    .senda-sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .senda-sidebar .senda-nav-section {
        grid-column: 1 / -1;
    }

    .senda-sidebar-footer {
        display: none;
    }

    #blogContenido,
    #blogContenidoSource {
        min-height: 380px;
    }
}

.grid-column-full {
    grid-column: 1 / -1;
}


@media (max-width: 575.98px) {
    .team-photo-uploader {
        grid-template-columns: 1fr;
    }

    .team-photo-preview {
        min-height: 220px;
    }

    .blog-modal-dialog {
        height: calc(100dvh - .5rem);
        margin: .25rem;
    }
}

/* =========================================================
 * Identidad corporativa Clínica Senda
 * ========================================================= */
:root {
    --senda-green: #6aa22f;
    --senda-green-dark: #426f1f;
    --senda-green-deep: #274517;
    --senda-green-soft: #f2f8ec;
    --senda-orange: #f39a24;
    --senda-orange-dark: #d9780c;
    --senda-orange-soft: #fff7ea;
}

body {
    background: #f6f8f5 !important;
}

.senda-sidebar {
    background: linear-gradient(180deg, #233d19 0%, #182d11 100%) !important;
}

.senda-sidebar .border-slate-800,
.senda-sidebar-footer {
    border-color: rgba(255, 255, 255, .10) !important;
}

.senda-brand {
    background: rgba(255, 255, 255, .035);
}

.senda-brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    padding: .65rem .8rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.senda-brand-logo {
    display: block;
    width: 100%;
    max-width: 205px;
    height: auto;
}

.senda-brand-copy {
    margin-top: .9rem;
    text-align: center;
}

.senda-brand-copy h1 {
    color: #fff;
}

.senda-brand-copy p {
    color: rgba(255, 255, 255, .62);
}

.senda-nav-section {
    color: rgba(255, 255, 255, .48);
}

.senda-sidebar .nav-link {
    color: rgba(255, 255, 255, .86);
    border: 1px solid transparent;
}

.senda-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .08) !important;
    color: #fff;
}

.senda-sidebar .nav-link.bg-slate-800 {
    background: var(--senda-green) !important;
    border-color: rgba(255, 255, 255, .12);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.senda-sidebar .nav-link.bg-slate-800 i {
    color: #fff;
}

.senda-sidebar-footer .bg-slate-800 {
    background: rgba(255, 255, 255, .08) !important;
}

.senda-sidebar-footer #logoutButton {
    color: var(--senda-green-deep) !important;
}

.cms-card {
    border-color: #e3eadf;
}

.cms-card:hover {
    border-color: rgba(106, 162, 47, .28);
}

.table thead > tr > th {
    background: var(--senda-green-soft) !important;
    color: #385327;
    border-bottom-color: #dce8d5;
    font-weight: 700;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: #fafcf8;
}

.btn-primary {
    --bs-btn-bg: var(--senda-green);
    --bs-btn-border-color: var(--senda-green);
    --bs-btn-hover-bg: var(--senda-green-dark);
    --bs-btn-hover-border-color: var(--senda-green-dark);
    --bs-btn-active-bg: var(--senda-green-dark);
    --bs-btn-active-border-color: var(--senda-green-dark);
    --bs-btn-disabled-bg: var(--senda-green);
    --bs-btn-disabled-border-color: var(--senda-green);
}

.btn-outline-primary {
    --bs-btn-color: var(--senda-green-dark);
    --bs-btn-border-color: var(--senda-green);
    --bs-btn-hover-bg: var(--senda-green);
    --bs-btn-hover-border-color: var(--senda-green);
    --bs-btn-active-bg: var(--senda-green-dark);
    --bs-btn-active-border-color: var(--senda-green-dark);
}

.btn-warning,
.btn-outline-warning {
    --bs-btn-color: #5d3908;
    --bs-btn-border-color: var(--senda-orange);
    --bs-btn-bg: var(--senda-orange);
    --bs-btn-hover-bg: var(--senda-orange-dark);
    --bs-btn-hover-border-color: var(--senda-orange-dark);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(106, 162, 47, .68);
    box-shadow: 0 0 0 .22rem rgba(106, 162, 47, .14);
}

.form-check-input:checked {
    background-color: var(--senda-green);
    border-color: var(--senda-green);
}

a:not(.btn):not(.nav-link) {
    color: var(--senda-green-dark);
}

a:not(.btn):not(.nav-link):hover {
    color: var(--senda-orange-dark);
}

.pagination {
    --bs-pagination-active-bg: var(--senda-green);
    --bs-pagination-active-border-color: var(--senda-green);
    --bs-pagination-color: var(--senda-green-dark);
    --bs-pagination-hover-color: var(--senda-green-deep);
}

.badge.bg-primary,
.bg-primary {
    background-color: var(--senda-green) !important;
}

.text-primary {
    color: var(--senda-green-dark) !important;
}

.senda-login-logo {
    display: block;
    width: min(100%, 300px);
    height: auto;
}

.senda-login-button {
    background: var(--senda-green-dark);
    box-shadow: 0 8px 18px rgba(66, 111, 31, .18);
}

.senda-login-button:hover,
.senda-login-button:focus {
    background: var(--senda-green-deep);
}

@media (max-width: 991.98px) {
    .senda-brand {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .senda-brand-logo-wrap {
        width: 190px;
        min-height: auto;
    }

    .senda-brand-copy {
        margin-top: 0;
        text-align: left;
    }
}

@media (max-width: 575.98px) {
    .senda-brand {
        display: block;
    }

    .senda-brand-logo-wrap {
        width: 100%;
    }

    .senda-brand-copy {
        margin-top: .75rem;
        text-align: center;
    }
}
