/* Executive calendar — month matrix + agenda + day drawer (RTL-first). */

.exec-month {
    direction: rtl;
    border: 1px solid #e6eaf0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    width: 100%;
}

.exec-month__head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-bottom: 1px solid #e6eaf0;
}

.exec-month__head-cell {
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 0.78rem;
    color: #334155;
    border-left: 1px solid #eef2f7;
}

.exec-month__head-cell:first-child {
    border-left: none;
}

.exec-month__body {
    display: flex;
    flex-direction: column;
}

.exec-month__week {
    border-bottom: 1px solid #e6eaf0;
}

.exec-month__week:last-child {
    border-bottom: none;
}

.exec-month__span-row {
    display: grid;
    min-height: 28px;
    background: #fafcff;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    align-items: center;
}

.exec-month__span-col {
    position: relative;
    min-height: 28px;
    min-width: 0;
    border-left: 1px solid #eef2f7;
}

.exec-month__span-col:first-child {
    border-left: none;
}

/* Grid host for continuous multi-day bars (matches weekly scheduler-span approach). */
.exec-month__span-host {
    z-index: 3;
    min-width: 0;
    align-self: center;
    height: 22px;
    margin-block: 3px;
    margin-inline: 2px;
    display: block;
    max-width: none;
}

.exec-month__span-bar {
    height: 22px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 22px;
    padding: 0 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

/* RTL: event start is inline-start; flat edges when the span continues across week rows. */
.exec-month__span-bar--continues-before {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
}

.exec-month__span-bar--continues-after {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.exec-month__span-host:has(.exec-month__span-bar--continues-before) {
    margin-inline-start: 0;
}

.exec-month__span-host:has(.exec-month__span-bar--continues-after) {
    margin-inline-end: 0;
}

.exec-month__span-ctx-continuous {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: block !important;
    max-width: none !important;
}

.exec-month__span-ctx-continuous .exec-month__span-activator,
.exec-month__span-ctx-continuous .mud-menu-activator {
    width: 100%;
    height: 100%;
    display: block;
}

.exec-month__span-ctx-continuous .exec-month__span-bar {
    height: 100%;
}

.exec-month__head--week {
    border-bottom: 1px solid #eef2f7;
}

.exec-month__week-days {
    display: grid;
    grid-auto-rows: minmax(96px, auto);
}

.exec-month__cell {
    position: relative;
    min-height: 96px;
    padding: 6px;
    border-left: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
}

.exec-month__week-days .exec-month__cell:first-child,
.exec-month__week-days .exec-month__cell:nth-child(7n + 1) {
    border-left: none;
}

.exec-month__cell:hover {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.exec-month__cell--muted {
    background: #f8fafc;
    color: #94a3b8;
}

/* Today / holiday accents use inset bars so heat backgrounds remain visible. */
.exec-month__cell--today {
    box-shadow: inset 0 -3px 0 #fb923c;
}

.exec-month__cell--holiday {
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.35);
}

.exec-month__cell--today.exec-month__cell--holiday {
    box-shadow: inset 0 -3px 0 #fb923c, inset 0 0 0 2px rgba(239, 68, 68, 0.35);
}

.exec-month__cell--selected {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* Heat must win over muted/today/holiday backgrounds (same specificity + later order). */
.exec-month__cell.exec-month__cell--heat-1 {
    background: #bae6fd !important;
}

.exec-month__cell.exec-month__cell--heat-2 {
    background: #7dd3fc !important;
}

.exec-month__cell.exec-month__cell--heat-3 {
    background: #fcd34d !important;
}

.exec-month__cell.exec-month__cell--heat-4 {
    background: #f87171 !important;
}

.exec-month__cell--muted.exec-month__cell--heat-1 {
    background: #e0f2fe !important;
}

.exec-month__cell--muted.exec-month__cell--heat-2 {
    background: #bae6fd !important;
}

.exec-month__cell--muted.exec-month__cell--heat-3 {
    background: #fde68a !important;
}

.exec-month__cell--muted.exec-month__cell--heat-4 {
    background: #fecaca !important;
}

.exec-month__cell--today.exec-month__cell--heat-1,
.exec-month__cell--today.exec-month__cell--heat-2,
.exec-month__cell--today.exec-month__cell--heat-3,
.exec-month__cell--today.exec-month__cell--heat-4 {
    box-shadow: inset 0 -3px 0 #fb923c;
}

.exec-month__daynum {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
}

.exec-month__cell--today .exec-month__daynum {
    background: #ea580c;
    color: #fff;
}

.exec-month__heat-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1rem;
    text-align: center;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.exec-month__dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.exec-month__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.exec-month__dot--task { background: #475569; }
.exec-month__dot--meeting { background: #0284c7; }
.exec-month__dot--training { background: #16a34a; }
.exec-month__dot--reminder { background: #7c3aed; }
.exec-month__dot--exam { background: #f59e0b; }
.exec-month__dot--holiday { background: #ef4444; }

.exec-month__events {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exec-month__pill {
    font-size: 0.65rem;
    line-height: 1.25;
    padding: 2px 5px;
    border-radius: 6px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.exec-month__pill--meeting { background: #0369a1; }
.exec-month__pill--reminder { background: #6d28d9; }
.exec-month__pill--task { background: #334155; }
.exec-month__pill-ribbon {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0 4px;
    margin-inline-start: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}
.exec-month__more {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
}

.exec-agenda {
    border-radius: 14px;
    border: 1px solid #dcfce7;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 70%);
}

.exec-focus-bar {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.exec-day-drawer {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    max-height: 70vh;
    overflow: auto;
}

.exec-event-block {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.exec-event-block:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.exec-event-block--training {
    border-color: #86efac;
    background: linear-gradient(90deg, #f0fdf4, #fff);
}

.exec-event-block--meeting {
    border-color: #7dd3fc;
    background: linear-gradient(90deg, #f0f9ff, #fff);
}

.exec-event-block__ribbon {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    color: #fff;
}

.scheduler-event .exec-event-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .exec-month__week-days {
        grid-auto-rows: minmax(80px, auto);
    }
    .exec-month__cell {
        min-height: 80px;
        padding: 4px;
    }
}
