/* Lugh Dental — Agenda Clínica / Tanda 2 (2026-10-12)
   Capa exclusivamente visual: no altera estados, reservas ni permisos.
   Se carga DESPUÉS de reserva-interina.css y lugh-mobile-polish.css. */

.agenda-shell-v2 {
    --agenda-tinta: #102d52;
    --agenda-acento: #147ac6;
    --agenda-borde: #d6e6f5;
}

.agenda-shell-v2 .agenda-hero-clean {
    position: relative;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px;
    align-items: start;
    overflow: visible !important;
    padding: 25px 28px;
    text-align: left;
    border: 1px solid #cfe3f5;
    border-radius: 24px;
    background: linear-gradient(130deg, #ffffff 0%, #f2f9ff 75%, #e7f4ff 100%);
    box-shadow: 0 12px 36px rgba(17, 65, 108, .09);
}

.agenda-shell-v2 .agenda-hero-clean::after {
    pointer-events: none;
    z-index: 0;
}

.agenda-hero-main,
.agenda-hero-aside,
.agenda-hero-clean > .current-card {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.agenda-shell-v2 .agenda-hero-clean .agenda-today {
    margin: 0 0 14px !important;
    color: #617b96;
    font-size: 13px !important;
    font-weight: 750;
    line-height: 1.45;
    text-transform: capitalize;
    letter-spacing: .01em;
}

.agenda-shell-v2 .agenda-box-toolbar-featured {
    display: flex !important;
    align-items: flex-end !important;
    flex-wrap: wrap;
    gap: 8px 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-toolbar__text {
    display: grid;
    gap: 3px;
    min-width: 0 !important;
    width: auto !important;
}

.agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-toolbar__text span {
    font-size: 11px !important;
    color: #57718e;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 850;
}

.agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-toolbar__text strong {
    max-width: 100%;
    color: var(--agenda-tinta);
    font-size: clamp(32px, 3vw, 46px) !important;
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
    white-space: normal !important;
    text-overflow: clip !important;
}

.agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-mode {
    display: inline-flex;
    align-self: flex-end;
    justify-self: auto;
    margin: 0 0 4px !important;
    width: auto;
    min-height: 28px;
    padding: 5px 10px !important;
    font-size: 11px !important;
    font-weight: 800;
    background: #e5f8f1;
    color: #08765c;
}

.agenda-hero-aside {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.agenda-shell-v2 .agenda-hero-aside .agenda-box-toolbar__select {
    display: grid;
    width: min(240px, 100%);
    min-width: 180px;
    gap: 5px;
    margin: 0;
}

.agenda-shell-v2 .agenda-hero-aside .agenda-box-toolbar__select.hidden {
    display: none !important;
}

.agenda-shell-v2 .agenda-hero-aside .agenda-box-toolbar__select > span {
    font-size: 11px !important;
    font-weight: 800;
    color: #516d87;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.agenda-shell-v2 .agenda-hero-aside .control-select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 9px 28px 9px 11px;
    border: 1px solid #c9dcef;
    border-radius: 12px;
    background: #fff;
    color: var(--agenda-tinta);
    font-size: 15px;
    font-weight: 700;
}

.agenda-actions-menu {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    min-width: 172px;
}

.agenda-actions-trigger {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    cursor: pointer;
    border: 1px solid #007ec3;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(120deg, #066daf, #0a9ac2);
    box-shadow: 0 7px 17px rgba(8, 111, 168, .19);
    font-weight: 850;
    font-size: 14px;
    list-style: none;
    user-select: none;
}

.agenda-actions-trigger::-webkit-details-marker { display: none; }
.agenda-actions-trigger::marker { content: ''; }
.agenda-actions-trigger:hover { filter: brightness(1.04); }
.agenda-actions-trigger:focus-visible { outline: 3px solid #85c9f8; outline-offset: 3px; }
.agenda-actions-chevron { margin-left: auto; transition: transform .2s; }
.agenda-actions-menu[open] .agenda-actions-chevron { transform: rotate(180deg); }

.agenda-actions-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 100;
    display: grid;
    width: max-content;
    min-width: 270px;
    max-width: min(94vw, 360px);
    gap: 4px;
    padding: 8px;
    border: 1px solid #d5e7f8;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 20px 42px rgba(15, 53, 98, .24);
}

.agenda-actions-panel .agenda-action-item {
    appearance: none;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #163957;
    text-decoration: none !important;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.agenda-actions-panel .agenda-action-item > i:first-child {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 10px;
    color: #007aa8;
    background: #e9f7fd;
    font-size: 17px;
}
.agenda-actions-panel .agenda-action-item > span { flex: 1; }
.agenda-actions-panel .agenda-action-item > i:last-child { color: #8aa3b9; }
.agenda-actions-panel .agenda-action-item:hover,
.agenda-actions-panel .agenda-action-item:focus-visible {
    background: #e9f6fc;
    outline: 0;
}

.agenda-shell-v2 .agenda-hero-clean > .current-card {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100% !important;
    max-width: none;
    margin: 0;
    padding: 12px 17px;
    border: 1px solid #d5e9f7;
    border-radius: 15px;
    box-shadow: none;
    text-align: left;
}
.agenda-shell-v2 .agenda-hero-clean > .current-card strong { font-size: clamp(16px, 1.7vw, 20px); }

.agenda-shell-v2 .agenda-toolbar-clean {
    position: relative;
    z-index: 1;
    margin-top: 13px;
    padding: 15px 18px;
    gap: 12px;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(18, 63, 179, .07);
}

.agenda-shell-v2 .agenda-toolbar-clean .view-switch {
    border-radius: 13px;
}

.agenda-shell-v2 .agenda-controls-simple {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-shell-v2 .agenda-toolbar-clean .control-btn,
.agenda-shell-v2 .agenda-toolbar-clean .control-date {
    width: auto;
    min-height: 42px;
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 800;
}

.agenda-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 760px) {
    .agenda-shell-v2 .agenda-hero-clean {
        grid-template-columns: minmax(0,1fr);
        gap: 13px;
        padding: 18px 15px 15px !important;
        border-radius: 19px;
    }
    .agenda-shell-v2 .agenda-hero-clean .agenda-today {
        margin-bottom: 10px !important;
        font-size: 12px !important;
    }
    .agenda-shell-v2 .agenda-box-toolbar-featured {
        display: flex !important;
        align-items: center !important;
        gap: 5px 9px !important;
    }
    .agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-toolbar__text {
        width: auto !important;
    }
    .agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-toolbar__text strong {
        font-size: clamp(27px, 7vw, 37px) !important;
        line-height: 1.1;
    }
    .agenda-shell-v2 .agenda-hero-aside {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 9px;
    }
    .agenda-shell-v2 .agenda-hero-aside .agenda-box-toolbar__select {
        width: 100%;
        min-width: 0;
    }
    .agenda-actions-menu { width: 100%; }
    .agenda-actions-trigger { min-height: 45px; }
    .agenda-actions-panel { right: 0; left: 0; min-width: 0; width: 100%; max-width: 100%; }
    .agenda-shell-v2 .agenda-hero-clean > .current-card {
        padding: 11px 12px !important;
        border-radius: 13px !important;
    }
    .agenda-shell-v2 .agenda-hero-clean > .current-card strong {
        font-size: 15px !important;
    }
    .agenda-shell-v2 .agenda-toolbar-clean {
        padding: 11px !important;
    }
    .agenda-shell-v2 .agenda-controls-simple {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-areas: 'fecha hoy' 'prev next';
        gap: 8px !important;
    }
    .agenda-shell-v2 .agenda-controls-simple #inputSemana { grid-area: fecha; }
    .agenda-shell-v2 .agenda-controls-simple #btnHoy { grid-area: hoy; }
    .agenda-shell-v2 .agenda-controls-simple #btnPrev { grid-area: prev; }
    .agenda-shell-v2 .agenda-controls-simple #btnNext { grid-area: next; }
    .agenda-shell-v2 .agenda-toolbar-clean .control-btn,
    .agenda-shell-v2 .agenda-toolbar-clean .control-date {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 8px 7px !important;
        font-size: 12px !important;
        border-radius: 12px !important;
    }
}

@media (max-width: 350px) {
    .agenda-shell-v2 .agenda-box-toolbar-featured .agenda-box-toolbar__text strong {
        font-size: 26px !important;
    }
    .agenda-shell-v2 .agenda-toolbar-clean .control-btn { font-size: 11px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-actions-chevron { transition: none; }
}


/* Lugh Dental — Tanda 3 / configuración asistida de disponibilidad */
#modalGenerar .modal-content-wide { width: min(860px, 100%); max-height: min(93dvh, 960px); overflow-y: auto; overscroll-behavior: contain; }
.agenda-wizard { margin: 20px 0 12px; color: #173854; }
.agenda-wizard * { box-sizing: border-box; }
.agenda-wizard-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-bottom: 20px; }
.agenda-wizard-step { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 8px; border: 1px solid #e0eaf4; border-radius: 13px; background: #f6f9fc; color: #72869b; font-weight: 750; font-size: 13px; }
.agenda-wizard-step b { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: #e1ebf3; color: #58738b; font-size: 12px; }
.agenda-wizard-step.is-current { color: #056b9b; border-color: #7fd6eb; background: #e9f8fe; }
.agenda-wizard-step.is-current b { background: #00a2ce; color: white; }
.agenda-wizard-step.is-done { color: #0a7464; border-color: #c2eee3; background: #effcf7; }
.agenda-wizard-step.is-done b { color: #fff; background: #12a988; }
.agenda-wizard-panel { background: #ffffff; border: 1px solid #ddeaf4; border-radius: 20px; padding: clamp(17px,2.5vw,26px); min-width: 0; }
.agenda-wizard-panel.hidden { display: none !important; }
.agenda-wizard-panel h4 { margin: 0 0 8px; color: #102d4c; font-size: clamp(20px,2.4vw,25px); font-weight: 850; }
.agenda-wizard-subtitle { margin: 0 0 18px; color: #627a8e; font-size: 13px; line-height: 1.6; }
.agenda-wizard-boxes { display: grid; grid-template-columns: repeat(auto-fit,minmax(225px,1fr)); gap: 12px; }
.agenda-wizard-box { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid #ccdfef; border-radius: 16px; background: #f9fcff; cursor: pointer; }
.agenda-wizard-box:has(input:checked) { background: #e7f8fc; border-color: #09a3cc; box-shadow: inset 0 0 0 1px rgba(0,160,207,.15); }
.agenda-wizard-box input { width: 20px; height: 20px; flex-shrink: 0; accent-color: #068eb7; }
.agenda-wizard-box span { display: grid; gap: 4px; min-width: 0; }
.agenda-wizard-box strong { font-size: 16px; color: #153650; overflow-wrap: anywhere; }
.agenda-wizard-box small { color: #637c90; font-size: 12px; }
.agenda-wizard-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.agenda-wizard-dates label,.agenda-wizard-tramo label { display: grid; gap: 7px; margin: 0; color: #23465e; font-size: 12px; font-weight: 800; min-width: 0; }
.agenda-wizard .form-control { min-width: 0; width: 100%; height: 46px; border: 1px solid #d0e1ee; border-radius: 12px; padding: 9px 11px; background: #fff; color: #16364d; font-size: 15px; }
.agenda-wizard-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; }
.agenda-wizard-weekdays label { min-width: 0; display: grid; place-items: center; gap: 7px; padding: 11px 3px; border: 1px solid #d7e4f0; border-radius: 12px; background: #f8fbfd; font-size: 12px; color: #365870; font-weight: 750; cursor: pointer; }
.agenda-wizard-weekdays label:has(input:checked) { border-color: #5dcbe5; color: #047eaa; background: #e9f9ff; }
.agenda-wizard-weekdays input { accent-color: #079ec5; width: 17px; height: 17px; }
.agenda-wizard-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.agenda-wizard-link,.agenda-wizard-add { cursor: pointer; border: 1px solid #a9d9ec; border-radius: 11px; padding: 10px 13px; background: #f3fbff; color: #087eac; font-size: 12px; font-weight: 850; }
.agenda-wizard-tramos { display: grid; gap: 11px; }
.agenda-wizard-tramo { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 42px; align-items: end; gap: 12px; padding: 13px; border: 1px solid #dcebf5; border-radius: 14px; background: #f9fcff; }
.agenda-wizard-remove { display: grid; place-items: center; width: 42px; height: 46px; border: 1px solid #f1c7cd; border-radius: 10px; background: #fff5f6; color: #b64a54; cursor: pointer; }
.agenda-wizard-add { margin-top: 13px; }
.agenda-wizard-summary { display: grid; gap: 8px; margin-top: 20px; padding: 18px; background: linear-gradient(120deg,#e7f8ff,#f0fcfa); border: 1px solid #c3e9eb; border-radius: 16px; }
.agenda-wizard-summary strong { font-size: 16px; color: #11435f; }
.agenda-wizard-summary div { line-height: 1.6; color: #145375; font-weight: 750; }
.agenda-wizard-summary small { color: #59778a; line-height: 1.55; }
.agenda-wizard-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 19px; }
.agenda-wizard-footer button { min-height: 46px; border-radius: 12px; padding: 11px 20px; font-weight: 850; font-size: 13px; cursor: pointer; }
.agenda-wizard-footer button.hidden { display: none !important; }
.agenda-wizard-back { border: 1px solid #c4dce9; background: #fff; color: #416075; }
.agenda-wizard-next,.agenda-wizard-save { border: 1px solid #058db6; background: linear-gradient(110deg,#047bad,#00a6cf); color: #fff; }
.agenda-wizard-footer button:disabled { opacity: .58; cursor: progress; }
.agenda-wizard-error { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid #fdcbd1; background: #fff2f4; color: #a8233c; font-size: 13px; font-weight: 700; }
.agenda-wizard-advanced { margin: 26px 0 0; border-top: 1px solid #e5ecf2; padding: 18px 0 0; }
.agenda-wizard-advanced summary { color: #6b7f8f; font-size: 12px; cursor: pointer; font-weight: 800; }
.agenda-wizard-advanced-warning { padding: 12px; color: #744614; background: #fff7e7; border-radius: 12px; font-size: 12px; }
@media(max-width:600px) {
 #modalGenerar { padding: 9px !important; align-items: center; }
 #modalGenerar .modal-content-wide { width: 100%; max-height: calc(100dvh - 18px); padding: 16px 13px 18px; border-radius: 18px; }
 #modalGenerar .modal-head h3 { font-size: 21px; }
 #modalGenerar .modal-help { font-size: 12px; }
 .agenda-wizard { margin-top: 16px; }
 .agenda-wizard-steps { gap: 5px; margin-bottom: 13px; }
 .agenda-wizard-step { gap: 5px; flex-direction: column; font-size: 11px; padding: 9px 3px; }
 .agenda-wizard-step b { width: 23px; height: 23px; }
 .agenda-wizard-panel { padding: 15px 12px; border-radius: 15px; }
 .agenda-wizard-boxes { grid-template-columns: 1fr; }
 .agenda-wizard-weekdays { grid-template-columns: repeat(4,minmax(0,1fr)); }
 .agenda-wizard-dates { grid-template-columns: 1fr; }
 .agenda-wizard-tramo { gap: 7px; padding: 10px; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 36px; }
 .agenda-wizard-remove { width: 36px; }
 .agenda-wizard-tramo .form-control { padding: 8px 5px; font-size: 13px; }
 .agenda-wizard-footer { position: sticky; bottom: -18px; z-index: 2; margin: 14px -13px -18px; padding: 12px 13px 15px; background: #fff; border-top: 1px solid #e2ecf4; }
 .agenda-wizard-footer button { flex: 1; padding: 11px 7px; }
 .agenda-wizard-advanced .generator-toolbar { display: flex; }
}
