.ev-ghost {
    opacity: 0.4;
    pointer-events: none;
    z-index: 10;
    border: 1px dashed rgba(255, 255, 255, 0.5);
}

.ev-status-dot {
    position: absolute;
    top: 3px;
    left: 5px;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    z-index: 21;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}


.mini-cal {
    padding: 8px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--gray-d)
}

.mc-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px
}

.mc-lbl {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink)
}

.mc-nav {
    display: flex;
    gap: 2px
}

.mc-nav button {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    color: var(--ink-m);
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center
}

.mc-nav button:hover {
    background: var(--gray-l)
}

.mc-g7 {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px
}

.mc-dn {
    font-size: 10px;
    color: var(--ink-l);
    text-align: center;
    padding: 2px 0;
    font-weight: 500
}

.mc-d {
    font-size: 11px;
    text-align: center;
    padding: 3px 1px;
    border-radius: 3px;
    line-height: 1.4;
    position: relative;
    cursor: default
}

.mc-d.works {
    background: #0e9488;
    color: #fff;
    cursor: pointer
}

.mc-d.works:hover {
    background: #0b7a70
}

.mc-d.nowork,
.mc-d.weekend {
    background: #1a2a3a;
    color: rgba(255, 255, 255, .22)
}

.mc-d.works.inweek {
    background: #0b7a70;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45)
}

.mc-d.works.today {
    background: #1565c0;
    font-weight: 700
}

.mc-d.nowork.today,
.mc-d.weekend.today {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3)
}

.mc-d.hap::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    opacity: .7
}

.mc-d.empty {
    cursor: default
}

.mp-notes {
    padding: 8px
}

.mp-lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--ink-l);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 5px
}

.mp-ta {
    width: 100%;
    height: 64px;
    padding: 5px 7px;
    border-radius: 3px;
    border: 1px solid var(--gray-d);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    resize: none;
    outline: none
}

.mp-ta:focus {
    border-color: var(--blue)
}

.mp-brow {
    display: flex;
    gap: 4px;
    margin-top: 5px
}

.mp-b {
    flex: 1;
    padding: 5px 0;
    border-radius: 3px;
    border: 1px solid var(--gray-d);
    background: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    cursor: pointer;
    color: var(--ink-m)
}

.mp-b:hover {
    background: var(--gray-l)
}

.mp-bfull {
    width: 100%;
    margin-top: 4px;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid var(--blue-l);
    background: var(--blue-l);
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    cursor: pointer;
    color: var(--blue)
}

.mp-bfull:hover {
    background: #cce0f5
}

/* ══ CALENDAR ══ */
.cal-area {
    flex: 1;
    overflow: auto
}

.cal-tbl {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%
}

.cal-tbl td,
.cal-tbl th {
    border: 1px solid #e0e4ea
}

.tc {
    position: sticky;
    left: 0;
    z-index: 22;
    background: #fff;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    font-size: 10px;
    color: var(--ink-l);
    text-align: right;
    padding: 0 4px 0 0;
    vertical-align: top;
    border-right: 2px solid #c8cdd5
}

.tc.hm {
    font-weight: 600;
    color: var(--ink-m);
    font-size: 10.5px
}

.tc-r {
    position: sticky;
    right: 0;
    z-index: 22;
    background: #fff;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    font-size: 10px;
    color: var(--ink-l);
    text-align: left;
    padding: 0 0 0 4px;
    vertical-align: top;
    border-left: 2px solid #c8cdd5
}

.tc-r.hm {
    font-weight: 600;
    color: var(--ink-m);
    font-size: 10.5px
}

/* Resaltado de hora al pasar el ratón por la fila */
.cal-tbl tr:hover .tc,
.cal-tbl tr:hover .tc-r {
    background-color: #e2e8f0 !important;
    color: var(--blue) !important;
    font-weight: 700 !important;
}

.th-corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 42;
    background: #fff;
    width: 46px;
    min-width: 46px
}

.th-corner-r {
    position: sticky;
    top: 0;
    right: 0;
    z-index: 42;
    background: #fff;
    width: 46px;
    min-width: 46px
}

.th-day {
    position: sticky;
    top: 0;
    z-index: 34;
    background: #fff;
    text-align: center;
    padding: 4px 2px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid #b0b8c4
}

.th-day.tod {
    background: var(--blue);
    color: #fff
}

.th-day-name {
    font-size: 10px;
    font-weight: 400;
    opacity: .8;
    text-transform: uppercase;
    letter-spacing: .04em
}

.th-day-num {
    font-size: 15px;
    font-weight: 700
}

.th-fisio-row th {
    position: sticky;
    top: 40px;
    z-index: 33
}

.th-fisio-cell {
    text-align: center;
    padding: 2px 3px;
    font-size: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .12)
}

.th-fisio-name {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    color: #fff;
    white-space: nowrap;
    display: inline-block
}

.th-room-row th {
    position: sticky;
    top: 68px;
    z-index: 32
}

.th-room-cell {
    text-align: center;
    padding: 2px 1px;
    font-size: 9px;
    font-weight: 700;
    border-bottom: 2px solid rgba(0, 0, 0, .15);
    white-space: nowrap
}

.slot {
    height: var(--cell-h);
    cursor: pointer;
    position: relative;
    vertical-align: top;
    overflow: visible;
    min-width: 0
}

.slot:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .06);
    pointer-events: none
}

.slot.ht {
    border-top: 1px solid #9aa0aa !important
}

.slot.hht {
    border-top: 1px dashed #c8cdd5
}

.ev {
    position: absolute;
    border-bottom: 1px solid rgba(0, 0, 0, .2);
    border-top: 1px solid rgba(0, 0, 0, .2);
    border-color: white;
    left: 1px;
    right: 1px;
    top: 1px;
    border-radius: 3px;
    overflow: hidden;
    cursor: default;
    z-index: 10;
    border-left: 3px solid rgba(0, 0, 0, .2);
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.ev:hover {
    filter: brightness(.91);
    z-index: 15
}

.ev-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 1px 3px;
    overflow: hidden;
    width: 100%;
}

.ev-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0
}

.ev-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .75);
    flex-shrink: 0;
    display: inline-block
}

.ev-pencil {
    font-size: 10px;
    opacity: .7;
    margin-left: auto;
    cursor: pointer;
    flex-shrink: 0
}

.ev-name {
    font-size: 10.5px;
    font-weight: 600;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    color: #000;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    flex: 1;
}

.ev-sub {
    font-size: 9.5px;
    padding: 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(0, 0, 0, .8);
    min-width: 0;
    width: 100%;
    text-align: center;
}

.ev-sala-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    color: #000;
    white-space: nowrap;
    opacity: .95;
    border: 1px solid rgba(0, 0, 0, .15);
    z-index: 20;
}

/* ── Context Menu (Appointment Options) ── */
.ev-opts-btn {
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 19px;
    height: 19px;
    background: rgba(0, 0, 0, .08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    z-index: 20;
    font-size: 14px;
    opacity: 0.82;
}

.ev-edit-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 19px;
    height: 19px;
    background: rgba(0, 0, 0, .08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    z-index: 20;
    font-size: 14px;
    opacity: 0.82;
}

.ev-note-btn {
    position: absolute;
    bottom: 2px;
    right: 21px;
    /* 2px gap + 17px pencil + 2px offset */
    width: 17px;
    height: 17px;
    background: rgba(0, 0, 0, .08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    z-index: 20;
    font-size: 12px;
    opacity: 0.82;
}

.ev-opts-btn:hover,
.ev-edit-btn:hover,
.ev-note-btn:hover {
    background: rgba(0, 0, 0, .3);
    opacity: 1;
}

.ev-paid-icon {
    position: absolute;
    top: 3px;
    left: 21px;
    font-size: 11px;
    color: #000;
    z-index: 20;
    font-weight: 700;
}

.ev-menu {
    position: fixed;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
    min-width: 170px;
    z-index: 2000;
    padding: 5px 0;
    display: none;
    flex-direction: column;
    animation: evMenuFade .12s ease-out;
    border: 1px solid rgba(0, 0, 0, .08);
}

.ev-menu.open {
    display: flex;
}

@keyframes evMenuFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.ev-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--ink-m);
    cursor: pointer;
    transition: background .1s, color .1s;
}

.ev-menu-item:hover {
    background: #f0f4ff;
    color: var(--blue);
}

.ev-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-l);
}

.ev-menu-item:hover i {
    color: var(--blue);
}

.ev-menu-item.danger:hover {
    background: #fff5f5;
    color: var(--red);
}

.ev-menu-item.danger:hover i {
    color: var(--red);
}

.ev-menu-sep {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

/* ── Appointment Info Modal (Summary) ── */
.ai-row {
    margin-bottom: 16px;
}

.ai-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-l);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

.ai-value {
    font-size: 14.5px;
    color: var(--ink);
    font-weight: 500;
}

.ai-badge-wrap {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.ai-price-box {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.ai-price-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

.ai-notes-box {
    background: #f9fafb;
    padding: 12px 14px;
    border-radius: 6px;
    border-left: 3px solid #e2e8f0;
    font-size: 13px;
    color: var(--ink-m);
    line-height: 1.5;
    font-style: italic;
}

.ai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}

.clickable:hover {
    opacity: 0.8;
}

.cal-print-btn {
    width: 100%;
    height: 100%;
    border: none;
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-print-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* -- Sidebar Mini Cal (Dark Theme Overrides) -- */
.sidebar .mini-cal {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 14px;
}

.sidebar .mc-lbl {
    color: #fff;
}

.sidebar .mc-nav button {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar .mc-nav button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .mc-dn {
    color: rgba(255, 255, 255, 0.9);
    /* Header de día mucho más visible */
    font-weight: 600;
}

.sidebar .mc-d.nowork,
.sidebar .mc-d.weekend {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    /* Fines de semana y no laborables más claros */
    font-weight: 400;
}

.sidebar .mc-d.works.today {
    background: var(--blue-m);
    color: #fff;
}

.sidebar .mc-d.works.today {
    background: var(--blue-m) !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.sidebar .mc-d.works {
    border-radius: 4px;
}

.sidebar .mc-d.nowork,
.sidebar .mc-d.weekend {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px;
}

.sidebar .mc-d.nowork,
.sidebar .mc-d.weekend {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ── Festivos en Agenda ── */
.th-day.festivo {
    background-color: #fff5f5 !important;
    color: #c53030 !important;
    border-bottom: 2px solid #feb2b2 !important;
}

.th-day.festivo .th-day-num {
    color: #c53030 !important;
}

.th-day.festivo .th-day-name {
    color: #e53e3e !important;
    font-weight: 700 !important;
    font-size: 9px !important;
}

.slot.festivo {
    background-color: #fffafa !important;
    cursor: default !important;
}

.slot.festivo:hover::after {
    display: none !important;
}