/**
 * AJT MSP Hub — Microsoft Graph Calendar Styles.
 *
 * Uses the existing Contracts Manager design system variables:
 *   --cm-plum, --cm-teal, --cm-amber, --cm-red, --cm-green,
 *   --cm-gray-100..500, --cm-slate, --cm-radius, --cm-shadow.
 *
 * New variable added: --cm-indigo for BrightHR absences.
 *
 * @since 1.20.0
 */

:root {
    --cm-indigo: #818cf8;
}

/* ══════════════════════════════════════════════════════════
 * AVAILABILITY DOTS (on staff contact cards)
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-avail {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.2;
}

.ajt-msgraph-avail-dot { font-size: 10px; line-height: 1; }

.ajt-msgraph-avail-label {
    color: var(--cm-gray-500, #716B7E);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.avail-free .ajt-msgraph-avail-label   { color: var(--cm-green, #059669); }
.avail-busy .ajt-msgraph-avail-label   { color: var(--cm-red, #DC2626); }
.avail-oof .ajt-msgraph-avail-label    { color: var(--cm-amber, #D97706); }

/* ══════════════════════════════════════════════════════════
 * CALENDAR WRAPPER
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-calendar-wrap {
    margin-top: 24px;
    background: #fff;
    border: 1px solid var(--cm-gray-200, #EDEAEF);
    border-radius: var(--cm-radius, 10px);
    overflow: hidden;
    box-shadow: var(--cm-shadow, 0 1px 3px rgba(45,40,54,0.06));
}

.ajt-msgraph-calendar-empty {
    background: var(--cm-gray-100, #F8F7F9);
}

/* ── Toolbar ──────────────────────────────────────── */

.ajt-msgraph-cal-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--cm-slate, #2D2836);
    color: #fff;
    flex-wrap: wrap;
}

.ajt-msgraph-cal-title {
    font-weight: 700;
    font-size: 14px;
    flex: 1;
    min-width: 180px;
}

.ajt-msgraph-cal-title span { font-weight: 600; }

.ajt-msgraph-cal-nav {
    display: flex;
    gap: 4px;
}

.ajt-msgraph-cal-nav-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--cm-radius-sm, 6px);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
}

.ajt-msgraph-cal-nav-btn:hover { background: rgba(255,255,255,0.22); }

.ajt-msgraph-cal-today { background: var(--cm-plum, #7B4C75); }
.ajt-msgraph-cal-today:hover { background: var(--cm-plum-dark, #5E3A5A); }

.ajt-msgraph-cal-views {
    display: flex;
    gap: 0;
    border-radius: var(--cm-radius-sm, 6px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.ajt-msgraph-view-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 6px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.ajt-msgraph-view-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.ajt-msgraph-view-btn.active { background: var(--cm-plum, #7B4C75); color: #fff; }

.ajt-msgraph-cal-find-btn {
    background: var(--cm-teal, #0D9488);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--cm-radius-sm, 6px);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
}

.ajt-msgraph-cal-find-btn:hover { background: #0f766e; }

/* ── Filters ──────────────────────────────────────── */

.ajt-msgraph-cal-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--cm-gray-100, #F8F7F9);
    border-bottom: 1px solid var(--cm-gray-200, #EDEAEF);
    font-size: 12px;
}

.ajt-msgraph-cal-filters select {
    padding: 4px 8px;
    border: 1px solid var(--cm-gray-300, #DBD8DE);
    border-radius: var(--cm-radius-sm, 6px);
    font-size: 12px;
    background: #fff;
}

.ajt-msgraph-cal-filter-cb {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--cm-gray-500);
}

/* ── Calendar Grid Container ──────────────────────── */

.ajt-msgraph-cal-grid {
    min-height: 200px;
    overflow-x: auto;
}

/* ── Calendar Grid Container ──────────────────────── */

.ajt-msgraph-cal-grid {
    min-height: 200px;
    overflow-x: auto;
}

/* ── Loading ──────────────────────────────────────── */

.ajt-msgraph-cal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 20px;
    color: var(--cm-gray-400, #9B95A6);
    font-size: 13px;
}

/* ── Legend ────────────────────────────────────────── */

.ajt-msgraph-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 16px;
    border-top: 1px solid var(--cm-gray-200, #EDEAEF);
    background: var(--cm-gray-100, #F8F7F9);
    font-size: 11px;
    color: var(--cm-gray-500, #716B7E);
}

.ajt-msgraph-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ajt-msgraph-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* ══════════════════════════════════════════════════════════
 * WEEK VIEW TABLE
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-week-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ajt-msgraph-week-table th {
    padding: 8px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cm-gray-400, #9B95A6);
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid var(--cm-gray-200, #EDEAEF);
    background: var(--cm-gray-100, #F8F7F9);
}

.ajt-msgraph-wt-name { text-align: left; padding-left: 12px; width: 140px; min-width: 120px; }

.ajt-msgraph-wt-day-label { display: block; }
.ajt-msgraph-wt-day-num { display: block; font-size: 9px; color: var(--cm-gray-300); font-weight: 500; }

.ajt-msgraph-wt-today {
    background: rgba(123,76,117,0.04) !important;
}

.ajt-msgraph-wt-today.ajt-msgraph-wt-day::after,
th.ajt-msgraph-wt-today {
    border-bottom-color: var(--cm-plum, #7B4C75);
}

.ajt-msgraph-wt-row {
    border-bottom: 1px solid var(--cm-gray-200, #EDEAEF);
    transition: background 0.1s;
}

.ajt-msgraph-wt-row:hover { background: var(--cm-gray-100, #F8F7F9); }

.ajt-msgraph-wt-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--cm-slate, #2D2836);
    font-size: 12px;
    white-space: nowrap;
}

.ajt-msgraph-wt-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: var(--cm-teal, #0D9488);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.ajt-msgraph-wt-cell {
    padding: 4px 2px;
    text-align: left;
    vertical-align: bottom;
    min-height: 42px;
    position: relative;
}

.ajt-msgraph-wt-oof {
    background: rgba(217,119,6,0.06);
}

.ajt-msgraph-wt-weekend {
    background: var(--cm-gray-100, #F8F7F9);
}

.ajt-msgraph-wt-oof-badge {
    font-size: 11px;
    color: var(--cm-amber, #d97706);
    text-align: center;
    padding: 4px 0;
}


/* ── All-day event banner (sits above the timeline) ── */

.ajt-msgraph-wt-allday {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.ajt-msgraph-wt-allday-time {
    font-size: 8px;
    opacity: 0.6;
    font-weight: 500;
}

.ajt-msgraph-wt-allday.ajt-msgraph-ev-busy      { background: rgba(123,76,117,0.15); color: #5a2d53; border-left: 3px solid var(--cm-plum, #7B4C75); }
.ajt-msgraph-wt-allday.ajt-msgraph-ev-at         { background: rgba(13,148,136,0.15); color: #065f56; border-left: 3px solid var(--cm-teal, #0D9488); }
.ajt-msgraph-wt-allday.ajt-msgraph-ev-tentative  { background: rgba(217,119,6,0.15); color: #92400e; border-left: 3px solid var(--cm-amber, #D97706); }
.ajt-msgraph-wt-allday.ajt-msgraph-ev-oof        { background: rgba(220,38,38,0.15); color: #991b1b; border-left: 3px solid var(--cm-red, #DC2626); }
.ajt-msgraph-wt-allday.ajt-msgraph-ev-brighthr   { background: rgba(129,140,248,0.15); color: #3730a3; border-left: 3px solid var(--cm-indigo, #818cf8); }
.ajt-msgraph-wt-allday.ajt-msgraph-ev-private    { background: rgba(219,216,222,0.25); color: #6b7280; border-left: 3px solid var(--cm-gray-300, #DBD8DE); }

/* ── Timeline container inside each week cell ──── */

.ajt-msgraph-wt-timeline {
    position: relative;
    height: 44px;
    background: var(--cm-gray-100, #F8F7F9);
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}

.ajt-msgraph-wt-gridline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--cm-gray-200, #EDEAEF);
    pointer-events: none;
    z-index: 0;
}

/* ── Event bars positioned within the timeline ── */

.ajt-msgraph-wt-event {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 3px;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 4px;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.15s, filter 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.ajt-msgraph-wt-event:hover {
    filter: brightness(0.9);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.ajt-msgraph-wt-event-time {
    font-size: 10px;
    font-weight: 700;
    opacity: 1;
    flex-shrink: 0;
}

.ajt-msgraph-wt-event-label {
    font-size: 10px;
    font-weight: 500;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ajt-msgraph-wt-free-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--cm-gray-300, #C5C0CA);
    letter-spacing: 0.03em;
}


/* ── Current time indicator ("now" line) ─────────── */

.ajt-msgraph-wt-now {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--cm-red, #ef4444);
    z-index: 3;
    pointer-events: none;
    border-radius: 1px;
}

.ajt-msgraph-wt-now::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: var(--cm-red, #ef4444);
    border-radius: 50%;
}

/* ── Old dot blocks (kept for backwards compat) ── */

.ajt-msgraph-wt-block {
    display: inline-block;
    width: 8px;
    height: 20px;
    border-radius: 2px;
    margin: 0 1px;
    cursor: pointer;
    transition: transform 0.1s;
}

.ajt-msgraph-wt-block:hover { transform: scaleY(1.3); }

.ajt-msgraph-wt-free {
    display: inline-block;
    width: 8px;
    height: 20px;
    border-radius: 2px;
    margin: 0 1px;
    background: var(--cm-gray-100, #F8F7F9);
}

/* ══════════════════════════════════════════════════════════
 * DAY VIEW GRID (v1.20.0 — continuous event blocks)
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-day-grid {
    width: 100%;
    overflow-x: auto;
}

.ajt-msgraph-day-header {
    display: flex;
    border-bottom: 2px solid var(--cm-gray-200, #EDEAEF);
    background: var(--cm-gray-100, #F8F7F9);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ajt-msgraph-day-time-col {
    width: 60px;
    min-width: 60px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--cm-gray-400, #9B95A6);
    text-align: right;
    border-right: 1px solid var(--cm-gray-200, #EDEAEF);
}

.ajt-msgraph-day-staff-col {
    flex: 1;
    min-width: 120px;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-right: 1px solid var(--cm-gray-200, #EDEAEF);
}

.ajt-msgraph-day-staff-col:last-child { border-right: none; }

/* ── Day view body: time labels + columns side by side ── */

.ajt-msgraph-day-body {
    overflow-y: auto;
    max-height: 70vh;
}

.ajt-msgraph-day-rows {
    display: flex;
    position: relative;
}

.ajt-msgraph-day-time-labels {
    width: 60px;
    min-width: 60px;
    position: relative;
    border-right: 1px solid var(--cm-gray-200, #EDEAEF);
}

.ajt-msgraph-day-time-label {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2px 8px 0 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--cm-gray-400, #9B95A6);
    border-top: 1px solid var(--cm-gray-200, #EDEAEF);
    box-sizing: border-box;
}

.ajt-msgraph-day-columns {
    display: flex;
    flex: 1;
}

.ajt-msgraph-day-column {
    flex: 1;
    min-width: 120px;
    position: relative;
    border-right: 1px solid var(--cm-gray-200, #EDEAEF);
}

.ajt-msgraph-day-column:last-child { border-right: none; }

.ajt-msgraph-day-gridline {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px solid var(--cm-gray-200, #EDEAEF);
}

/* ── Now indicator (day view) ── */

.ajt-msgraph-day-now {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--cm-red, #ef4444);
    z-index: 5;
    pointer-events: none;
}

.ajt-msgraph-day-now::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -5px;
    width: 10px;
    height: 10px;
    background: var(--cm-red, #ef4444);
    border-radius: 50%;
}

/* ── Event blocks (absolutely positioned in columns) ── */

.ajt-msgraph-day-event {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: 4px;
    padding: 4px 6px;
    overflow: hidden;
    cursor: pointer;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: filter 0.15s;
    border-left: 3px solid transparent;
}

.ajt-msgraph-day-event:hover {
    filter: brightness(0.95);
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.ajt-msgraph-day-event-name {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ajt-msgraph-day-event-time {
    font-size: 9px;
    font-weight: 500;
    opacity: 0.7;
}

/* Day event colour variants */
.ajt-msgraph-day-event.ajt-msgraph-ev-busy      { background: rgba(123,76,117,0.15); color: #5a2d53; border-left-color: var(--cm-plum, #7B4C75); }
.ajt-msgraph-day-event.ajt-msgraph-ev-at         { background: rgba(13,148,136,0.15); color: #065f56; border-left-color: var(--cm-teal, #0D9488); }
.ajt-msgraph-day-event.ajt-msgraph-ev-tentative  { background: rgba(217,119,6,0.15); color: #92400e; border-left-color: var(--cm-amber, #D97706); }
.ajt-msgraph-day-event.ajt-msgraph-ev-oof        { background: rgba(220,38,38,0.15); color: #991b1b; border-left-color: var(--cm-red, #DC2626); }
.ajt-msgraph-day-event.ajt-msgraph-ev-brighthr   { background: rgba(129,140,248,0.15); color: #3730a3; border-left-color: var(--cm-indigo, #818cf8); }
.ajt-msgraph-day-event.ajt-msgraph-ev-private    { background: rgba(219,216,222,0.30); color: #6b7280; border-left-color: var(--cm-gray-300, #DBD8DE); }

/* ══════════════════════════════════════════════════════════
 * EVENT COLOUR CLASSES
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-ev-busy        { background: var(--cm-plum, #7B4C75); }
.ajt-msgraph-ev-at          { background: var(--cm-teal, #0D9488); }
.ajt-msgraph-ev-tentative   { background: var(--cm-amber, #D97706); }
.ajt-msgraph-ev-oof         { background: var(--cm-red, #DC2626); }
.ajt-msgraph-ev-brighthr    { background: var(--cm-indigo, #818cf8); }
.ajt-msgraph-ev-private     { background: var(--cm-gray-300, #DBD8DE); }

/* Week timeline event bars — lighter backgrounds with readable text. */
.ajt-msgraph-wt-event.ajt-msgraph-ev-busy      { background: rgba(123,76,117,0.18); color: #5a2d53; }
.ajt-msgraph-wt-event.ajt-msgraph-ev-at         { background: rgba(13,148,136,0.18); color: #065f56; }
.ajt-msgraph-wt-event.ajt-msgraph-ev-tentative  { background: rgba(217,119,6,0.20); color: #92400e; }
.ajt-msgraph-wt-event.ajt-msgraph-ev-oof        { background: rgba(220,38,38,0.18); color: #991b1b; }
.ajt-msgraph-wt-event.ajt-msgraph-ev-brighthr   { background: rgba(129,140,248,0.22); color: #3730a3; }
.ajt-msgraph-wt-event.ajt-msgraph-ev-private    { background: rgba(219,216,222,0.35); color: #6b7280; }

.ajt-msgraph-wt-event.ajt-msgraph-ev-busy      { border-left: 3px solid var(--cm-plum, #7B4C75); }
.ajt-msgraph-wt-event.ajt-msgraph-ev-at         { border-left: 3px solid var(--cm-teal, #0D9488); }
.ajt-msgraph-wt-event.ajt-msgraph-ev-tentative  { border-left: 3px solid var(--cm-amber, #D97706); }
.ajt-msgraph-wt-event.ajt-msgraph-ev-oof        { border-left: 3px solid var(--cm-red, #DC2626); }
.ajt-msgraph-wt-event.ajt-msgraph-ev-brighthr   { border-left: 3px solid var(--cm-indigo, #818cf8); }
.ajt-msgraph-wt-event.ajt-msgraph-ev-private    { border-left: 3px solid var(--cm-gray-300, #DBD8DE); }



/* ══════════════════════════════════════════════════════════
 * EVENT DETAIL PANEL (JS popup)
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-event-panel-popup {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    width: 320px;
    max-width: 90vw;
    background: #fff;
    border-radius: var(--cm-radius, 10px);
    box-shadow: 0 12px 40px rgba(45,40,54,0.2);
    border: 1px solid var(--cm-gray-200, #EDEAEF);
    z-index: 100050;
    overflow: hidden;
    display: none;
}

.ajt-msgraph-event-panel-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--cm-gray-400);
    cursor: pointer;
    line-height: 1;
}

.ajt-msgraph-event-panel-close:hover { color: var(--cm-slate); }

.ajt-msgraph-event-panel-body {
    padding: 16px;
}

/* ── Calendar heading ─────────────────────────────── */

.ajt-msgraph-cal-heading {
    font-weight: 600;
}

/* ── Schedule button (in ticket detail) ───────────── */

.ajt-msgraph-schedule-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    transition: background 0.15s, border-color 0.15s;
}

.ajt-msgraph-schedule-btn:hover {
    background: rgba(13,148,136,0.18) !important;
    border-color: rgba(13,148,136,0.35) !important;
}

/* ══════════════════════════════════════════════════════════
 * EVENT DETAIL PANEL
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-event-detail h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-slate);
}

.ajt-msgraph-event-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--cm-gray-500);
    margin-bottom: 10px;
}

.ajt-msgraph-event-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ajt-msgraph-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: var(--cm-gray-100);
    color: var(--cm-gray-500);
    border: 1px solid var(--cm-gray-200);
}

.ajt-msgraph-event-badge--busy      { background: rgba(123,76,117,0.08); color: var(--cm-plum); border-color: rgba(123,76,117,0.2); }
.ajt-msgraph-event-badge--oof       { background: rgba(220,38,38,0.08); color: var(--cm-red); border-color: rgba(220,38,38,0.2); }
.ajt-msgraph-event-badge--tentative { background: rgba(217,119,6,0.08); color: var(--cm-amber); border-color: rgba(217,119,6,0.2); }
.ajt-msgraph-event-badge--source    { background: rgba(13,148,136,0.08); color: var(--cm-teal); border-color: rgba(13,148,136,0.2); }
.ajt-msgraph-event-badge--at        { background: rgba(13,148,136,0.08); color: var(--cm-teal); border-color: rgba(13,148,136,0.2); }


/* ══════════════════════════════════════════════════════════
 * EVENT CLICK POPOVER
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-popover {
    position: absolute;
    z-index: 9999;
    display: none;
    filter: drop-shadow(0 4px 16px rgba(45,40,54,0.18));
}

.ajt-msgraph-popover-body {
    background: #fff;
    border: 1px solid var(--cm-gray-200, #EDEAEF);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cm-slate, #2D2836);
    max-width: 320px;
}

.ajt-msgraph-popover-arrow {
    position: absolute;
    top: -6px;
    left: 50%;
    margin-left: -6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1px solid var(--cm-gray-200, #EDEAEF);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
    z-index: 1;
}

.ajt-msgraph-popover-above .ajt-msgraph-popover-arrow {
    top: auto;
    bottom: -6px;
    transform: rotate(225deg);
}

.ajt-msgraph-popover-above .ajt-msgraph-popover-body {
    transform: translateY(-100%);
    margin-top: -8px;
}

.ajt-msgraph-popover-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
    word-break: break-word;
}

.ajt-msgraph-popover-loading {
    font-size: 11px;
    color: var(--cm-gray-400, #9B95A6);
    font-style: italic;
    margin-top: 6px;
}


/* ── Teams meeting icon + join button ─────────────── */

.ajt-msgraph-wt-teams-icon {
    font-size: 9px;
    flex-shrink: 0;
    line-height: 1;
}

.ajt-msgraph-popover-join {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 4px;
    padding: 6px 14px;
    background: #5b5fc7;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.ajt-msgraph-popover-join:hover {
    background: #4b4fb5;
    color: #fff;
    text-decoration: none;
}

.ajt-msgraph-popover-detail {
    margin-top: 8px;
    font-size: 12px;
    color: var(--cm-gray-500, #6B6575);
}

.ajt-msgraph-popover-detail p {
    margin: 4px 0;
}

.ajt-msgraph-popover-detail strong {
    color: var(--cm-slate, #2D2836);
}

/* ══════════════════════════════════════════════════════════
 * SCHEDULE MODAL
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-schedule-modal {
    position: fixed;
    inset: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ajt-msgraph-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45,40,54,0.5);
    backdrop-filter: blur(2px);
}

.ajt-msgraph-modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--cm-radius, 10px);
    width: 560px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(45,40,54,0.25);
    overflow: hidden;
}

.ajt-msgraph-modal-header {
    padding: 16px 20px;
    background: var(--cm-slate, #2D2836);
    color: #fff;
    position: relative;
}

.ajt-msgraph-modal-header h3 { margin: 0 0 4px; font-size: 16px; }
.ajt-msgraph-modal-subtitle { font-size: 12px; opacity: 0.7; }

.ajt-msgraph-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
    line-height: 1;
}

.ajt-msgraph-modal-close:hover { opacity: 1; }

.ajt-msgraph-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ajt-msgraph-modal-form {
    margin-bottom: 14px;
}

.ajt-msgraph-modal-form {
    margin-bottom: 4px;
}

.ajt-msgraph-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--cm-gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    background: var(--cm-gray-100);
}

.ajt-msgraph-form-row {
    margin-bottom: 14px;
}

.ajt-msgraph-form-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-slate);
    margin-bottom: 4px;
}

.ajt-msgraph-form-row select,
.ajt-msgraph-form-row input[type="date"],
.ajt-msgraph-form-row input[type="text"],
.ajt-msgraph-form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--cm-gray-300);
    border-radius: var(--cm-radius-sm, 6px);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.ajt-msgraph-form-row textarea { resize: vertical; }

/* ── Slot picker in schedule modal ────────────────── */

.ajt-msgraph-slots-wrap {
    margin: 14px 0;
    border: 1px solid var(--cm-gray-200);
    border-radius: var(--cm-radius-sm, 6px);
    max-height: 260px;
    overflow-y: auto;
    background: var(--cm-gray-100);
}

.ajt-msgraph-slots-placeholder {
    padding: 30px 16px;
    text-align: center;
    color: var(--cm-gray-400);
    font-size: 12px;
}

.ajt-msgraph-slot {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--cm-gray-200);
    cursor: pointer;
    transition: background 0.1s;
    gap: 10px;
    font-size: 12px;
}

.ajt-msgraph-slot:last-child { border-bottom: none; }
.ajt-msgraph-slot:hover { background: rgba(123,76,117,0.04); }
.ajt-msgraph-slot.selected { background: rgba(123,76,117,0.10); border-left: 3px solid var(--cm-plum); }

.ajt-msgraph-slot-time {
    font-weight: 700;
    min-width: 50px;
    color: var(--cm-slate);
}

.ajt-msgraph-slot-status {
    flex: 1;
}

.ajt-msgraph-slot--free .ajt-msgraph-slot-status { color: var(--cm-green); }
.ajt-msgraph-slot--busy .ajt-msgraph-slot-status { color: var(--cm-red); }
.ajt-msgraph-slot--tentative .ajt-msgraph-slot-status { color: var(--cm-amber); }
.ajt-msgraph-slot--oof .ajt-msgraph-slot-status { color: var(--cm-red); }

.ajt-msgraph-slot--busy,
.ajt-msgraph-slot--oof {
    opacity: 0.5;
    cursor: not-allowed;
}

.ajt-msgraph-slot-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--cm-gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ajt-msgraph-slot.selected .ajt-msgraph-slot-check {
    background: var(--cm-plum);
    border-color: var(--cm-plum);
    color: #fff;
}

.ajt-msgraph-slot.selected .ajt-msgraph-slot-check::after { content: '✓'; font-size: 10px; }

/* ══════════════════════════════════════════════════════════
 * FIND A TIME PANEL
 * ══════════════════════════════════════════════════════════ */

.ajt-msgraph-find-panel {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--cm-gray-200);
    border-radius: var(--cm-radius);
    overflow: hidden;
    box-shadow: var(--cm-shadow);
}

.ajt-msgraph-find-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--cm-slate);
    color: #fff;
}

.ajt-msgraph-find-header h4 { margin: 0; font-size: 14px; }

.ajt-msgraph-find-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
}

.ajt-msgraph-find-close:hover { opacity: 1; }

.ajt-msgraph-find-body { padding: 16px; }

.ajt-msgraph-find-staff-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 14px;
}

.ajt-msgraph-find-staff-cb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--cm-gray-100);
    border: 1px solid var(--cm-gray-200);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.ajt-msgraph-find-staff-cb:has(input:checked) {
    background: rgba(123,76,117,0.1);
    border-color: var(--cm-plum);
    color: var(--cm-plum);
}

.ajt-msgraph-find-staff-cb input { display: none; }

.ajt-msgraph-find-options {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ajt-msgraph-find-options .ajt-msgraph-form-row {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ajt-msgraph-find-options .ajt-msgraph-form-row label { margin-bottom: 0; white-space: nowrap; }
.ajt-msgraph-find-options .ajt-msgraph-form-row input,
.ajt-msgraph-find-options .ajt-msgraph-form-row select { width: auto; min-width: 100px; }

.ajt-msgraph-find-results {
    margin-top: 14px;
    max-height: 300px;
    overflow-y: auto;
}

.ajt-msgraph-find-result-day {
    margin-bottom: 12px;
}

.ajt-msgraph-find-result-day h5 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--cm-slate);
}

.ajt-msgraph-find-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--cm-gray-200);
    border-radius: var(--cm-radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
}

.ajt-msgraph-find-slot:hover {
    border-color: var(--cm-plum);
    background: rgba(123,76,117,0.04);
}

.ajt-msgraph-find-slot-time { font-weight: 700; color: var(--cm-slate); min-width: 110px; }
.ajt-msgraph-find-slot-staff { color: var(--cm-green); font-size: 11px; }

/* ══════════════════════════════════════════════════════════
 * RESPONSIVE
 * ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .ajt-msgraph-cal-toolbar { flex-direction: column; align-items: flex-start; }
    .ajt-msgraph-wt-name { width: 90px; min-width: 90px; }
    .ajt-msgraph-wt-name-text { display: none; }
    .ajt-msgraph-modal-content { width: 95vw; }
    .ajt-msgraph-find-options { flex-direction: column; }
}
test123

/* Calendar row-height fix (v1.20.0.23) */
.ajt-msgraph-wt-cell{height:58px !important;max-height:58px !important;overflow:hidden}
.ajt-msgraph-wt-allday-wrap{position:absolute;top:2px;left:2px;right:2px;z-index:2;display:flex;gap:2px;align-items:flex-start}
.ajt-msgraph-wt-allday-wrap .ajt-msgraph-wt-allday{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ajt-msgraph-wt-allday-more{flex:0 0 auto;font-size:8px;font-weight:700;background:rgba(219,216,222,.5);color:var(--cm-slate,#2D2836);border-radius:3px;padding:1px 4px;line-height:1.3;cursor:default}
.ajt-msgraph-wt-timeline{position:absolute !important;bottom:2px;left:2px;right:2px;height:34px !important}
