/**
 * AJT MSP Hub — Premium Team Calendar Styles.
 *
 * Custom in-house calendar engine CSS. Fully themed via CSS
 * custom properties for white-label compliance.
 *
 * Colour sources (fallback chain):
 *   --msphub-primary → --cm-plum → #7B4C75
 *   --cm-teal        → #14B8A6
 *   --cm-amber       → #F59E0B
 *   --cm-red         → #EF4444
 *   --cm-green       → #059669
 *
 * @package AJT_MSP_Hub
 * @since   1.21.0
 */

/* ══════════════════════════════════════════════════════════════
 * CSS CUSTOM PROPERTIES (CALENDAR LAYER)
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal {
    --cal-primary:        var(--msphub-primary, var(--cm-plum, #7B4C75));
    --cal-primary-light:  var(--msphub-primary-light, rgba(123, 76, 117, 0.08));
    --cal-primary-hover:  var(--msphub-primary-hover, #6A3F63);
    --cal-teal:           var(--cm-teal, #14B8A6);
    --cal-amber:          var(--cm-amber, #F59E0B);
    --cal-red:            var(--cm-red, #EF4444);
    --cal-green:          var(--cm-green, #059669);
    --cal-indigo:         #818cf8;
    --cal-gray-50:        var(--cm-gray-50, #F5F4F6);
    --cal-gray-100:       var(--cm-gray-100, #E8E6EB);
    --cal-gray-200:       var(--cm-gray-200, #D1CDD6);
    --cal-gray-300:       var(--cm-gray-300, #B0AAB8);
    --cal-gray-400:       var(--cm-gray-400, #8E8799);
    --cal-gray-500:       var(--cm-gray-500, #6D657A);
    --cal-gray-900:       var(--cm-gray-900, #2D2836);
    --cal-surface:        #fff;
    --cal-border:         var(--cal-gray-200);
    --cal-font:           var(--msphub-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);

    /* Layout tokens */
    --cal-resource-width: 200px;
    --cal-row-height:     60px;
    --cal-slot-height:    48px;
    --cal-header-height:  44px;
    --cal-radius:         10px;
    --cal-radius-sm:      6px;
    --cal-radius-xs:      4px;
    --cal-shadow:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --cal-shadow-md:      0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --cal-shadow-lg:      0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.03);
    --cal-transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════════
 * CONTAINER & TOOLBAR
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal {
    font-family: var(--cal-font);
    color: var(--cal-gray-900);
    background: var(--cal-surface);
    border: 1px solid var(--cal-border);
    border-radius: var(--cal-radius);
    box-shadow: var(--cal-shadow);
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
}

.ajt-cal-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #1E1A28;
    color: #fff;
    flex-wrap: wrap;
}

.ajt-cal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ajt-cal-title svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.ajt-cal-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.ajt-cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--cal-radius-sm);
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: var(--cal-transition);
    padding: 0;
    line-height: 1;
}

.ajt-cal-nav-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
}

.ajt-cal-today-btn {
    width: auto;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ajt-cal-views {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: var(--cal-radius-sm);
    overflow: hidden;
}

.ajt-cal-view-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cal-transition);
    letter-spacing: 0.02em;
}

.ajt-cal-view-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.ajt-cal-view-btn.active {
    background: var(--cal-primary);
    color: #fff;
}

.ajt-cal-find-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--cal-teal);
    border-radius: var(--cal-radius-sm);
    background: transparent;
    color: var(--cal-teal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cal-transition);
    white-space: nowrap;
}

.ajt-cal-find-btn:hover {
    background: var(--cal-teal);
    color: #fff;
}

.ajt-cal-find-btn svg {
    width: 14px;
    height: 14px;
}

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

.ajt-cal-filters {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--cal-gray-100);
    background: var(--cal-gray-50);
    font-size: 12px;
}

.ajt-cal-filters select {
    font-size: 12px;
    padding: 4px 28px 4px 10px;
    border: 1px solid var(--cal-gray-200);
    border-radius: var(--cal-radius-xs);
    background: var(--cal-surface);
    color: var(--cal-gray-900);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236D657A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.ajt-cal-filter-cb {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--cal-gray-500);
    cursor: pointer;
    user-select: none;
}

.ajt-cal-filter-cb input[type="checkbox"] {
    accent-color: var(--cal-primary);
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
 * WEEK VIEW — RESOURCE TIMELINE (HORIZONTAL)
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-week {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Header (Day columns) ──────────────── */

.ajt-cal-week-header {
    display: flex;
    border-bottom: 2px solid var(--cal-gray-200);
    background: var(--cal-gray-50);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ajt-cal-week-header-resource {
    flex: 0 0 var(--cal-resource-width);
    min-width: var(--cal-resource-width);
    padding: 10px 16px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cal-gray-400);
    border-right: 1px solid var(--cal-gray-200);
}

.ajt-cal-week-header-days {
    flex: 1;
    display: grid;
    min-width: 0;
}

.ajt-cal-week-day-col {
    padding: 8px 4px;
    text-align: center;
    border-right: 1px solid var(--cal-gray-100);
    transition: background 0.15s ease;
    position: relative;
}

.ajt-cal-week-day-col:last-child {
    border-right: none;
}

.ajt-cal-week-day-col.is-today {
    background: var(--cal-primary-light);
}

.ajt-cal-week-day-col.is-weekend {
    background: var(--cal-gray-50);
    opacity: 0.7;
}

.ajt-cal-day-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cal-gray-400);
    line-height: 1;
    margin-bottom: 2px;
}

.ajt-cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--cal-gray-900);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    line-height: 1;
}

.ajt-cal-week-day-col.is-today .ajt-cal-day-num {
    background: var(--cal-primary);
    color: #fff;
}

/* ── Body (staff rows) ─────────────────── */

.ajt-cal-week-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 520px;
}

.ajt-cal-week-row {
    display: flex;
    border-bottom: 1px solid var(--cal-gray-100);
    min-height: var(--cal-row-height);
    transition: background 0.1s ease;
}

.ajt-cal-week-row:last-child {
    border-bottom: none;
}

.ajt-cal-week-row:hover {
    background: rgba(123, 76, 117, 0.015);
}

/* ── Resource cell (staff name) ────────── */

.ajt-cal-resource {
    flex: 0 0 var(--cal-resource-width);
    min-width: var(--cal-resource-width);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-right: 1px solid var(--cal-gray-200);
    background: var(--cal-surface);
    position: sticky;
    left: 0;
    z-index: 5;
}

.ajt-cal-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cal-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ajt-cal-resource-info {
    min-width: 0;
    overflow: hidden;
}

.ajt-cal-resource-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cal-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ajt-cal-resource-role {
    font-size: 10px;
    color: var(--cal-gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ── Day cells in week view ────────────── */

.ajt-cal-week-cells {
    flex: 1;
    display: grid;
    min-width: 0;
}

.ajt-cal-week-cell {
    position: relative;
    border-right: 1px solid var(--cal-gray-100);
    padding: 4px 3px;
    min-height: var(--cal-row-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ajt-cal-week-cell:last-child {
    border-right: none;
}

.ajt-cal-week-cell.is-today {
    background: var(--cal-primary-light);
}

.ajt-cal-week-cell.is-weekend {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        var(--cal-gray-50) 4px,
        var(--cal-gray-50) 8px
    );
    opacity: 0.6;
}

.ajt-cal-week-cell.is-oof {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, rgba(239, 68, 68, 0.08) 100%);
}

/* ── Event chips (week view) ───────────── */

.ajt-cal-event-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: var(--cal-radius-xs);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: var(--cal-transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-height: 22px;
    border-left: 3px solid transparent;
}

.ajt-cal-event-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--cal-shadow);
    z-index: 2;
}

.ajt-cal-event-chip .chip-time {
    font-size: 9px;
    font-weight: 700;
    opacity: 0.8;
    flex-shrink: 0;
}

.ajt-cal-event-chip .chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ajt-cal-event-chip .chip-teams {
    flex-shrink: 0;
    font-size: 10px;
    opacity: 0.7;
}

/* Chip colour variants */
.ajt-cal-chip-busy {
    background: rgba(123, 76, 117, 0.12);
    border-left-color: var(--cal-primary);
    color: var(--cal-primary-hover);
}

.ajt-cal-chip-at {
    background: rgba(20, 184, 166, 0.12);
    border-left-color: var(--cal-teal);
    color: #0D9488;
}

.ajt-cal-chip-tentative {
    background: rgba(245, 158, 11, 0.12);
    border-left-color: var(--cal-amber);
    color: #B45309;
}

.ajt-cal-chip-oof {
    background: rgba(239, 68, 68, 0.12);
    border-left-color: var(--cal-red);
    color: #DC2626;
}

.ajt-cal-chip-brighthr {
    background: rgba(129, 140, 248, 0.12);
    border-left-color: var(--cal-indigo);
    color: #6366F1;
}

.ajt-cal-chip-private {
    background: var(--cal-gray-100);
    border-left-color: var(--cal-gray-300);
    color: var(--cal-gray-500);
}

.ajt-cal-chip-wfh {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--cal-amber);
    color: #92400E;
}

/* All-day banner chip */
.ajt-cal-chip-allday {
    font-size: 9px;
    padding: 2px 6px;
    min-height: 18px;
    border-left-width: 2px;
}

/* More events indicator */
.ajt-cal-more {
    font-size: 9px;
    font-weight: 700;
    color: var(--cal-gray-400);
    padding: 1px 6px;
    cursor: pointer;
    text-align: center;
}

.ajt-cal-more:hover {
    color: var(--cal-primary);
}

/* Free label */
.ajt-cal-free {
    font-size: 10px;
    color: var(--cal-gray-300);
    padding: 4px 6px;
    font-style: italic;
}

/* OOF badge */
.ajt-cal-oof-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--cal-radius-xs);
    background: rgba(239, 68, 68, 0.1);
    color: var(--cal-red);
    font-size: 10px;
    font-weight: 700;
}

/* ── Now indicator (week view) ─────────── */
/* v1.21.1: Original vertical red line disabled — replaced by horizontal teal line in day view. */
/*
.ajt-cal-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--cal-red);
    z-index: 4;
    pointer-events: none;
}

.ajt-cal-now-line::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cal-red);
}
*/

/* ══════════════════════════════════════════════════════════════
 * DAY VIEW — VERTICAL TIMEGRID
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-day {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Column headers (staff) ────────────── */

.ajt-cal-day-header {
    display: flex;
    border-bottom: 2px solid var(--cal-gray-200);
    background: var(--cal-gray-50);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ajt-cal-day-time-header {
    flex: 0 0 60px;
    min-width: 60px;
    border-right: 1px solid var(--cal-gray-200);
}

.ajt-cal-day-staff-headers {
    flex: 1;
    display: flex;
}

.ajt-cal-day-staff-col-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-right: 1px solid var(--cal-gray-100);
    min-width: 120px;
    gap: 4px;
}

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

/* ── Grid body ─────────────────────────── */

.ajt-cal-day-body {
    display: flex;
    overflow-y: auto;
    overflow-x: auto;
    max-height: 600px;
    position: relative;
}

.ajt-cal-day-time-col {
    flex: 0 0 60px;
    min-width: 60px;
    border-right: 1px solid var(--cal-gray-200);
    background: var(--cal-surface);
    position: sticky;
    left: 0;
    z-index: 5;
}

.ajt-cal-day-time-label {
    height: var(--cal-slot-height);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--cal-gray-400);
    border-bottom: 1px solid var(--cal-gray-100);
    transform: translateY(-6px);
}

.ajt-cal-day-time-label:first-child {
    transform: none;
    padding-top: 4px;
}

.ajt-cal-day-columns {
    flex: 1;
    display: flex;
    position: relative;
}

.ajt-cal-day-column {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--cal-gray-100);
    min-width: 120px;
}

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

/* Gridlines */
.ajt-cal-day-gridline {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--cal-gray-100);
    pointer-events: none;
}

.ajt-cal-day-gridline.is-hour {
    background: var(--cal-gray-200);
}

/* ── Event blocks (day view) ───────────── */

.ajt-cal-day-event {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: var(--cal-radius-xs);
    padding: 4px 6px;
    font-size: 11px;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    z-index: 2;
    border-left: 3px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ajt-cal-day-event:hover {
    box-shadow: var(--cal-shadow-md);
    transform: scale(1.01);
    z-index: 6;
}

.ajt-cal-day-event .event-title {
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.ajt-cal-day-event .event-teams {
    font-size: 10px;
    opacity: 0.6;
}

/* Day event colour variants (reuse chip colours) */
.ajt-cal-day-event.ev-busy {
    background: rgba(123, 76, 117, 0.14);
    border-left-color: var(--cal-primary);
    color: var(--cal-primary-hover);
}

.ajt-cal-day-event.ev-at {
    background: rgba(20, 184, 166, 0.14);
    border-left-color: var(--cal-teal);
    color: #0D9488;
}

.ajt-cal-day-event.ev-tentative {
    background: rgba(245, 158, 11, 0.14);
    border-left-color: var(--cal-amber);
    color: #B45309;
}

.ajt-cal-day-event.ev-oof {
    background: rgba(239, 68, 68, 0.14);
    border-left-color: var(--cal-red);
    color: #DC2626;
}

.ajt-cal-day-event.ev-brighthr {
    background: rgba(129, 140, 248, 0.14);
    border-left-color: var(--cal-indigo);
    color: #6366F1;
}

.ajt-cal-day-event.ev-private {
    background: var(--cal-gray-100);
    border-left-color: var(--cal-gray-300);
    color: var(--cal-gray-500);
}

.ajt-cal-day-event.ev-wfh {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--cal-amber);
    color: #92400E;
}

/* ── Resize handle ─────────────────────── */

.ajt-cal-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: s-resize;
    border-radius: 0 0 var(--cal-radius-xs) var(--cal-radius-xs);
    transition: background 0.15s ease;
}

.ajt-cal-resize-handle:hover,
.ajt-cal-resize-handle.active {
    background: rgba(0, 0, 0, 0.12);
}

/* ── Drag ghost ────────────────────────── */

.ajt-cal-drag-ghost {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: var(--cal-radius-xs);
    background: var(--cal-primary);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    transition: top 0.08s ease, height 0.08s ease;
}

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

.ajt-cal-day-now {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--cal-red);
    z-index: 8;
    pointer-events: none;
}

.ajt-cal-day-now::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cal-red);
}

/* ══════════════════════════════════════════════════════════════
 * EVENT DETAIL POPOVER
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-popover {
    position: fixed;
    z-index: 10000;
    width: 300px;
    background: #fff;
    border: 1px solid #D8D3DD;
    border-radius: 10px;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.18), 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    animation: ajtCalPopIn 0.15s ease;
    overflow: visible;
}

@keyframes ajtCalPopIn {
    from { opacity: 0; transform: translateY(4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ajt-cal-popover-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--cal-gray-100);
}

.ajt-cal-popover-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--cal-gray-900);
    line-height: 1.3;
    margin: 0 0 6px;
}

.ajt-cal-popover-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--cal-gray-500);
}

.ajt-cal-popover-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ajt-cal-popover-body {
    padding: 10px 16px 14px;
}

.ajt-cal-popover-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ajt-cal-popover-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ajt-cal-popover-badge.badge-busy     { background: rgba(123,76,117,0.1); color: var(--cal-primary); }
.ajt-cal-popover-badge.badge-at       { background: rgba(20,184,166,0.1); color: var(--cal-teal); }
.ajt-cal-popover-badge.badge-tentative{ background: rgba(245,158,11,0.1); color: var(--cal-amber); }
.ajt-cal-popover-badge.badge-oof      { background: rgba(239,68,68,0.1); color: var(--cal-red); }
.ajt-cal-popover-badge.badge-brighthr { background: rgba(129,140,248,0.1); color: var(--cal-indigo); }
.ajt-cal-popover-badge.badge-private  { background: var(--cal-gray-100); color: var(--cal-gray-500); }
.ajt-cal-popover-badge.badge-source   { background: var(--cal-gray-50); color: var(--cal-gray-500); }
.ajt-cal-popover-badge.badge-recurring{ background: var(--cal-gray-50); color: var(--cal-gray-500); }
.ajt-cal-popover-badge.badge-ticket   { background: rgba(20,184,166,0.1); color: var(--cal-teal); }

.ajt-cal-popover-join {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: var(--cal-radius-sm);
    background: #5B5FC7;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--cal-transition);
}

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

.ajt-cal-popover-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--cal-gray-400);
    cursor: pointer;
    border-radius: var(--cal-radius-xs);
    font-size: 16px;
    line-height: 1;
    transition: var(--cal-transition);
}

.ajt-cal-popover-close:hover {
    background: var(--cal-gray-100);
    color: var(--cal-gray-900);
}

/* ── Loading detail inside popover ─────── */

.ajt-cal-popover-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 11px;
    color: var(--cal-gray-400);
}

.ajt-cal-popover-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--cal-gray-200);
    border-top-color: var(--cal-primary);
    border-radius: 50%;
    animation: ajtCalSpin 0.6s linear infinite;
}

@keyframes ajtCalSpin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════
 * LEGEND
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 20px;
    border-top: 1px solid var(--cal-gray-100);
    background: var(--cal-gray-50);
    font-size: 11px;
    color: var(--cal-gray-500);
}

.ajt-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ajt-cal-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
 * LOADING / EMPTY STATES
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--cal-gray-400);
    font-size: 13px;
}

.ajt-cal-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--cal-gray-200);
    border-top-color: var(--cal-primary);
    border-radius: 50%;
    animation: ajtCalSpin 0.7s linear infinite;
}

.ajt-cal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--cal-gray-400);
}

.ajt-cal-empty svg {
    opacity: 0.4;
    margin-bottom: 12px;
}

.ajt-cal-empty p {
    margin: 4px 0;
    font-size: 12px;
    max-width: 300px;
}

/* ══════════════════════════════════════════════════════════════
 * UNDO TOAST
 * ══════════════════════════════════════════════════════════════ */


/* Toast is also appended to document.body — redeclare vars. */
.ajt-cal-toast {
    --cal-gray-900: #1E1A28;
    --cal-radius-sm: 6px;
}

.ajt-cal-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--cal-gray-900);
    color: #fff;
    border-radius: var(--cal-radius);
    box-shadow: var(--cal-shadow-lg);
    font-size: 13px;
    animation: ajtCalToastIn 0.25s ease;
}

@keyframes ajtCalToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.ajt-cal-toast-undo {
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--cal-radius-xs);
    background: transparent;
    color: var(--cal-teal);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--cal-transition);
}

.ajt-cal-toast-undo:hover {
    background: rgba(255,255,255,0.1);
}

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

/* Tablet (641–900px) */
@media (max-width: 900px) {
    .ajt-cal {
        --cal-resource-width: 140px;
        --cal-row-height: 52px;
    }

    .ajt-cal-toolbar {
        padding: 10px 14px;
        gap: 8px;
    }

    .ajt-cal-find-btn span.btn-label {
        display: none;
    }

    .ajt-cal-filters {
        padding: 8px 14px;
    }

    .ajt-cal-resource-role {
        display: none;
    }

    .ajt-cal-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .ajt-cal-day-staff-col-header .ajt-cal-resource-role {
        display: none;
    }
}

/* Mobile (≤640px) */
@media (max-width: 640px) {
    .ajt-cal {
        --cal-resource-width: 100px;
        --cal-row-height: 44px;
        border-radius: var(--cal-radius-sm);
    }

    .ajt-cal-toolbar {
        padding: 8px 12px;
        gap: 6px;
    }

    .ajt-cal-title {
        font-size: 12px;
    }

    .ajt-cal-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .ajt-cal-today-btn {
        padding: 0 10px;
        font-size: 10px;
    }

    .ajt-cal-view-btn {
        padding: 4px 10px;
        font-size: 10px;
    }

    .ajt-cal-find-btn {
        padding: 4px 10px;
        font-size: 10px;
    }

    .ajt-cal-filters {
        padding: 6px 12px;
        gap: 8px;
    }

    .ajt-cal-resource-name {
        font-size: 11px;
    }

    .ajt-cal-avatar {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    .ajt-cal-event-chip {
        font-size: 9px;
        padding: 2px 4px;
        min-height: 18px;
    }

    .ajt-cal-event-chip .chip-time {
        display: none;
    }

    .ajt-cal-legend {
        gap: 10px;
        padding: 8px 12px;
        font-size: 10px;
    }

    .ajt-cal-day-time-col {
        flex: 0 0 44px;
        min-width: 44px;
    }

    .ajt-cal-day-time-label {
        font-size: 9px;
        padding: 0 4px;
    }

    .ajt-cal-day-column {
        min-width: 80px;
    }

    .ajt-cal-popover {
        width: calc(100vw - 24px);
        max-width: 340px;
    }
}


/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — STAGGERED ANIMATIONS
 * ══════════════════════════════════════════════════════════════ */

/* Subtle fade-in for week rows */
.ajt-cal-week-row {
    animation: ajtCalRowFadeIn 0.3s ease both;
}

.ajt-cal-week-row:nth-child(1) { animation-delay: 0s; }
.ajt-cal-week-row:nth-child(2) { animation-delay: 0.03s; }
.ajt-cal-week-row:nth-child(3) { animation-delay: 0.06s; }
.ajt-cal-week-row:nth-child(4) { animation-delay: 0.09s; }
.ajt-cal-week-row:nth-child(5) { animation-delay: 0.12s; }
.ajt-cal-week-row:nth-child(6) { animation-delay: 0.15s; }
.ajt-cal-week-row:nth-child(7) { animation-delay: 0.18s; }
.ajt-cal-week-row:nth-child(8) { animation-delay: 0.21s; }
.ajt-cal-week-row:nth-child(9) { animation-delay: 0.24s; }
.ajt-cal-week-row:nth-child(10) { animation-delay: 0.27s; }

@keyframes ajtCalRowFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Day columns stagger */
.ajt-cal-day-column {
    animation: ajtCalColFadeIn 0.35s ease both;
}

.ajt-cal-day-column:nth-child(1) { animation-delay: 0.05s; }
.ajt-cal-day-column:nth-child(2) { animation-delay: 0.1s; }
.ajt-cal-day-column:nth-child(3) { animation-delay: 0.15s; }
.ajt-cal-day-column:nth-child(4) { animation-delay: 0.2s; }
.ajt-cal-day-column:nth-child(5) { animation-delay: 0.25s; }
.ajt-cal-day-column:nth-child(6) { animation-delay: 0.3s; }

@keyframes ajtCalColFadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — ENHANCED HOVER STATES
 * ══════════════════════════════════════════════════════════════ */

/* Week cell hover crosshair effect */
.ajt-cal-week-cell:not(.is-weekend):hover {
    background: rgba(123, 76, 117, 0.03);
}

/* Resource hover glow */
.ajt-cal-resource:hover .ajt-cal-avatar {
    box-shadow: 0 0 0 3px rgba(123, 76, 117, 0.15);
    transition: box-shadow 0.2s ease;
}

/* Day column header hover */
.ajt-cal-day-staff-col-header:hover .ajt-cal-avatar {
    box-shadow: 0 0 0 3px rgba(123, 76, 117, 0.15);
    transition: box-shadow 0.2s ease;
}

/* Day event interaction refinements */
.ajt-cal-day-event:active {
    transform: scale(0.99);
    box-shadow: var(--cal-shadow);
}

.ajt-cal-day-event.ev-at:hover {
    box-shadow: 0 4px 12px -2px rgba(20, 184, 166, 0.25);
}

.ajt-cal-day-event.ev-busy:hover {
    box-shadow: 0 4px 12px -2px rgba(123, 76, 117, 0.25);
}

.ajt-cal-day-event.ev-oof:hover {
    box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.2);
}

.ajt-cal-day-event.ev-brighthr:hover {
    box-shadow: 0 4px 12px -2px rgba(129, 140, 248, 0.25);
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — TOOLBAR GLASS EFFECT
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-toolbar {
    background: linear-gradient(135deg, var(--cal-gray-900) 0%, #1a1525 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — SCROLLBAR STYLING
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-week-body::-webkit-scrollbar,
.ajt-cal-day-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.ajt-cal-week-body::-webkit-scrollbar-track,
.ajt-cal-day-body::-webkit-scrollbar-track {
    background: var(--cal-gray-50);
    border-radius: 3px;
}

.ajt-cal-week-body::-webkit-scrollbar-thumb,
.ajt-cal-day-body::-webkit-scrollbar-thumb {
    background: var(--cal-gray-300);
    border-radius: 3px;
}

.ajt-cal-week-body::-webkit-scrollbar-thumb:hover,
.ajt-cal-day-body::-webkit-scrollbar-thumb:hover {
    background: var(--cal-gray-400);
}

/* Firefox */
.ajt-cal-week-body,
.ajt-cal-day-body {
    scrollbar-width: thin;
    scrollbar-color: var(--cal-gray-300) var(--cal-gray-50);
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — POPOVER COLOUR BAR
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-popover {
    overflow: visible;
}

.ajt-cal-popover-header {
    position: relative;
}

/* Colour accent bar at top of popover */
.ajt-cal-popover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--cal-radius) var(--cal-radius) 0 0;
    background: var(--cal-primary);
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — DAY VIEW BUSINESS HOURS SHADING
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-day-column {
    background: linear-gradient(180deg, 
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 100%
    );
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — FOCUS / ACCESSIBILITY
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-nav-btn:focus-visible,
.ajt-cal-view-btn:focus-visible,
.ajt-cal-find-btn:focus-visible,
.ajt-cal-event-chip:focus-visible,
.ajt-cal-day-event:focus-visible {
    outline: 2px solid var(--cal-teal);
    outline-offset: 2px;
}

.ajt-cal-event-chip {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ajt-cal-day-event {
    -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — NOW INDICATOR PULSE
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-now-line::before,
.ajt-cal-day-now::before {
    animation: ajtCalNowPulse 2s ease-in-out infinite;
}

@keyframes ajtCalNowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%      { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — LOADING SKELETON SHIMMER
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-loading::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; right: 100%; bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(123, 76, 117, 0.03) 50%,
        transparent 100%
    );
    animation: ajtCalShimmer 1.8s ease-in-out infinite;
}

.ajt-cal-loading {
    position: relative;
    overflow: hidden;
}

@keyframes ajtCalShimmer {
    0%   { left: -100%; right: 100%; }
    100% { left: 100%; right: -100%; }
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — ENHANCED EVENT CHIPS
 * ══════════════════════════════════════════════════════════════ */

/* Subtle inner glow for active/today chips */
.ajt-cal-week-cell.is-today .ajt-cal-event-chip {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* Chip hover: slight background brighten */
.ajt-cal-chip-at:hover       { background: rgba(20, 184, 166, 0.18); }
.ajt-cal-chip-busy:hover     { background: rgba(123, 76, 117, 0.18); }
.ajt-cal-chip-oof:hover      { background: rgba(239, 68, 68, 0.18); }
.ajt-cal-chip-tentative:hover{ background: rgba(245, 158, 11, 0.18); }
.ajt-cal-chip-brighthr:hover { background: rgba(129, 140, 248, 0.18); }
.ajt-cal-chip-private:hover  { background: var(--cal-gray-200); }

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — FILTER BAR REFINEMENT
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-filters select:focus {
    border-color: var(--cal-primary);
    box-shadow: 0 0 0 2px rgba(123, 76, 117, 0.12);
    outline: none;
}

.ajt-cal-filter-cb:hover {
    color: var(--cal-gray-900);
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — RESIZE VISUAL CUES
 * ══════════════════════════════════════════════════════════════ */

/* Show grab dots on resize handle */
.ajt-cal-resize-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: transparent;
    transition: background 0.15s ease;
}

.ajt-cal-day-event:hover .ajt-cal-resize-handle::after {
    background: rgba(0, 0, 0, 0.2);
}

.ajt-cal-resize-handle.active::after {
    background: rgba(0, 0, 0, 0.35);
}

/* During resize: add a subtle blue tint to the event */
.ajt-cal-day-event:has(.ajt-cal-resize-handle.active) {
    outline: 2px solid var(--cal-teal);
    outline-offset: -1px;
}

/* ══════════════════════════════════════════════════════════════
 * PREMIUM POLISH — WEEK VIEW MINIMUM WIDTH
 * ══════════════════════════════════════════════════════════════ */

.ajt-cal-week {
    min-width: 0;
}

.ajt-cal-week-header-days,
.ajt-cal-week-cells {
    min-width: 490px; /* 70px per day column minimum */
}


/* ══════════════════════════════════════════════════════════════
 * PRINT
 * ══════════════════════════════════════════════════════════════ */

@media print {
    .ajt-cal-toolbar,
    .ajt-cal-filters,
    .ajt-cal-find-btn,
    .ajt-cal-popover,
    .ajt-cal-toast,
    .ajt-cal-resize-handle {
        display: none !important;
    }

    .ajt-cal {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .ajt-cal-week-body {
        max-height: none;
        overflow: visible;
    }

    .ajt-cal-day-body {
        max-height: none;
        overflow: visible;
    }
}


/* ========================================================================
 * v1.21.1 BUG FIXES & UX IMPROVEMENTS
 * ======================================================================== */

/* ---- Viewport stretch ---- */
.ajt-cal-week-body { max-height: calc(100vh - 280px); min-height: 300px; }
.ajt-cal-day-body  { max-height: calc(100vh - 280px); min-height: 300px; }

/* ---- Event name truncation fix: allow wrapping ---- */
.ajt-cal-event-chip { white-space: normal; word-break: break-word; }
.ajt-cal-event-chip .chip-label { white-space: normal; overflow: visible; text-overflow: unset; }
.ajt-cal-day-event .event-title { white-space: normal; word-break: break-word; overflow: visible; text-overflow: unset; }
.ajt-cal-day-event .event-time { white-space: nowrap; }

/* ---- Utilisation Strip ---- */
.ajt-cal-util-strip { border-bottom: 1px solid var(--cal-gray-100); background: var(--cal-gray-50); font-size: 12px; }
.ajt-cal-util-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 20px; border: none; background: transparent; color: var(--cal-gray-500); font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--cal-transition); text-align: left; }
.ajt-cal-util-toggle:hover { color: var(--cal-gray-900); background: rgba(123, 76, 117, 0.03); }
.ajt-cal-util-toggle svg { flex-shrink: 0; opacity: 0.6; }
.ajt-cal-util-label { flex: 1; }
.ajt-cal-util-chevron { transition: transform 0.2s ease; }
.ajt-cal-util-body { padding: 0 20px 12px; }
.ajt-cal-util-metric { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.ajt-cal-util-pct { font-size: 22px; font-weight: 800; line-height: 1; }
.ajt-cal-util-hours { font-size: 11px; color: var(--cal-gray-400); font-weight: 500; }
.ajt-cal-util-bar { height: 4px; background: var(--cal-gray-100); border-radius: 2px; overflow: hidden; }
.ajt-cal-util-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---- Now Indicator (Soft Teal) ---- */
.ajt-cal-now-line { position: absolute !important; left: 0 !important; right: 0 !important; bottom: auto !important; width: auto !important; height: 2px !important; background: var(--cal-teal, #14B8A6) !important; opacity: 0.75 !important; z-index: 8; pointer-events: none; box-shadow: 0 0 4px rgba(20, 184, 166, 0.3); }
.ajt-cal-now-dot { position: absolute; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--cal-teal, #14B8A6); z-index: 9; pointer-events: none; transform: translateY(-3px); animation: ajtNowDotPulse 3s ease-in-out infinite; }
@keyframes ajtNowDotPulse { 0%,100%{box-shadow:0 0 0 2px rgba(20,184,166,0.2)} 50%{box-shadow:0 0 0 5px rgba(20,184,166,0)} }
.ajt-cal-day-now { display: none !important; }
.ajt-cal-now-line::before, .ajt-cal-day-now::before { display: none; }

/* ---- Availability Badge Pills ---- */
.ajt-cal-avail-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.ajt-cal-avail-free {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}
.ajt-cal-avail-free::before { content: '\1F7E2 '; font-size: 8px; }

.ajt-cal-avail-busy {
    background: rgba(220, 38, 38, 0.08);
    color: #DC2626;
}
.ajt-cal-avail-busy::before { content: '\1F534 '; font-size: 8px; }

.ajt-cal-avail-tentative {
    background: rgba(245, 158, 11, 0.1);
    color: #B45309;
}
.ajt-cal-avail-tentative::before { content: '\1F7E1 '; font-size: 8px; }

.ajt-cal-avail-oof {
    background: rgba(239, 68, 68, 0.08);
    color: #B91C1C;
}
.ajt-cal-avail-oof::before { content: '\1F3D6\FE0F '; font-size: 8px; }

.ajt-cal-avail-wfh {
    background: rgba(245, 158, 11, 0.08);
    color: #92400E;
}
.ajt-cal-avail-wfh::before { content: '\1F7E0 '; font-size: 8px; }

.ajt-cal-avail-offline {
    background: var(--cal-gray-100);
    color: var(--cal-gray-400);
}
.ajt-cal-avail-offline::before { content: '\26AA '; font-size: 8px; }

/* ---- Resource Email Link ---- */
.ajt-cal-resource-email { display: block; font-size: 10px; color: var(--cal-gray-400); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; line-height: 1.3; transition: color 0.15s ease; }
.ajt-cal-resource-email:hover { color: var(--cal-primary); }

/* ---- Popover: Solid Background ---- */
.ajt-cal-popover { background: #fff !important; opacity: 1 !important; border: 1px solid var(--cal-gray-200, #D1CDD6); box-shadow: 0 12px 32px -4px rgba(0,0,0,0.18), 0 4px 12px -2px rgba(0,0,0,0.08); }
.ajt-cal-popover-close { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: none; background: var(--cal-gray-50); border-radius: 50%; color: var(--cal-gray-400); font-size: 16px; cursor: pointer; transition: var(--cal-transition); line-height: 1; }
.ajt-cal-popover-close:hover { background: var(--cal-gray-100); color: var(--cal-gray-900); }

/* ---- +N more interactive ---- */
.ajt-cal-more { cursor: pointer; transition: color 0.15s ease, background 0.15s ease; border-radius: var(--cal-radius-xs); padding: 2px 6px; }
.ajt-cal-more:hover { color: var(--cal-primary); background: var(--cal-primary-light); }

/* ---- Wider resource column for badge + email ---- */
.ajt-cal { --cal-resource-width: 220px; }
.ajt-cal-week-row { min-height: 80px; }


/* ---- Ghost Event (click-to-create placeholder) ---- */
.ajt-cal-ghost-event {
    background: rgba(20, 184, 166, 0.15);
    border: 2px dashed var(--cal-teal, #14B8A6);
    border-radius: var(--cal-radius-sm, 6px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    cursor: ns-resize;
    transition: background 0.15s ease;
    user-select: none;
}
.ajt-cal-ghost-event:hover { background: rgba(20, 184, 166, 0.22); }
.ajt-cal-ghost-event .ghost-label { font-size: 11px; font-weight: 600; color: var(--cal-teal, #14B8A6); }
.ajt-cal-ghost-event .ghost-time { font-size: 10px; color: var(--cal-teal, #14B8A6); opacity: 0.7; }

/* ---- Quick Event Form ---- */
.ajt-cal-quick-form {
    width: 300px;
    border-radius: var(--cal-radius-md, 10px);
    border: 1px solid var(--cal-gray-200, #D1CDD6);
    box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.2), 0 4px 16px -2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: var(--cal-font);
}
.ajt-cal-quick-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cal-gray-100);
    background: var(--cal-gray-50);
}
.ajt-cal-quick-form-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--cal-gray-900);
}
.ajt-cal-quick-form-body { padding: 16px; }
.ajt-cal-quick-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--cal-gray-200, #D1CDD6);
    border-radius: var(--cal-radius-sm, 6px);
    font-size: 13px;
    font-family: var(--cal-font);
    color: var(--cal-gray-900);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.ajt-cal-quick-input:focus {
    border-color: var(--cal-teal, #14B8A6);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.ajt-cal-quick-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--cal-gray-500);
    margin-bottom: 16px;
}
.ajt-cal-quick-meta span { display: flex; align-items: center; gap: 4px; }
.ajt-cal-quick-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.ajt-cal-quick-cancel-btn {
    padding: 7px 14px;
    border: 1px solid var(--cal-gray-200, #D1CDD6);
    border-radius: var(--cal-radius-sm, 6px);
    background: #fff;
    color: var(--cal-gray-600);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ajt-cal-quick-cancel-btn:hover { background: var(--cal-gray-50); color: var(--cal-gray-900); }
.ajt-cal-quick-save-btn {
    padding: 7px 16px;
    border: none;
    border-radius: var(--cal-radius-sm, 6px);
    background: var(--cal-teal, #14B8A6);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ajt-cal-quick-save-btn:hover { background: #0D9488; }
.ajt-cal-quick-save-btn:disabled { opacity: 0.6; cursor: wait; }

/* ---- Day column pointer for click-to-create ---- */
.ajt-cal-day-column { cursor: crosshair; }
.ajt-cal-day-event { cursor: pointer; }


/* ---- Recurring indicators on chips/blocks ---- */
.chip-recurring, .event-recurring {
    font-size: 10px;
    opacity: 0.6;
    margin-left: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}
.event-recurring { margin-left: 6px; }

/* ---- Popover delete button ---- */
.ajt-cal-popover-actions {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--cal-gray-100);
}
.ajt-cal-popover-delete {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--cal-radius-sm, 6px);
    background: rgba(220, 38, 38, 0.04);
    color: #DC2626;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    justify-content: center;
}
.ajt-cal-popover-delete:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.35);
}
.ajt-cal-popover-delete:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ---- Recurring badge in popover ---- */
.badge-recurring {
    background: rgba(99, 102, 241, 0.08) !important;
    color: #6366F1 !important;
}
