/* ── Engage360 Calendar ────────────────────────────────────────────────────── */

.engage360-calendar-wrap {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a2332;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.e360-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.e360-cal-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #1a2332;
}

.e360-cal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* View switcher */
.e360-view-group {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.e360-view-btn {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}

.e360-view-btn:hover  { color: #1a2332; }
.e360-view-btn.active {
    background: #fff;
    color: #00466d;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* Nav buttons */
.e360-cal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.e360-cal-nav-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    border-radius: 7px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #475569;
    transition: all .15s;
    line-height: 1;
}

.e360-cal-nav-btn:hover { border-color: #00466d; color: #00466d; }

.e360-cal-today-btn {
    padding: 7px 14px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .15s;
}

.e360-cal-today-btn:hover { border-color: #00466d; color: #00466d; }

#e360-cal-date-label {
    font-size: 15px;
    font-weight: 700;
    color: #1a2332;
    min-width: 180px;
    text-align: center;
}

/* ── Toolbar (filter + schedule button) ───────────────────────────────────── */

.e360-cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.e360-cal-filter {
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.e360-cal-filter:focus { border-color: #00466d; }

.e360-cal-sched-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: #00466d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.e360-cal-sched-btn:hover { background: #003554; }
.e360-cal-sched-btn svg { width: 15px; height: 15px; }

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

.e360-cal-legend {
    display: flex;
    gap: 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.e360-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.e360-legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Calendar container ──────────────────────────────────────────────────── */

.e360-cal-container {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

/* ── MONTH VIEW ──────────────────────────────────────────────────────────── */

#e360-cal-grid.e360-cal-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.e360-cal-head {
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
}

.e360-cal-cell {
    min-height: 110px;
    padding: 6px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
    position: relative;
}

.e360-cal-cell:hover          { background: #f8fafc; }
.e360-cal-other               { background: #fcfcfd; }
.e360-cal-other .e360-cal-num { color: #d1d5db; }
.e360-cal-today               { background: #f0f9ff; }

.e360-cal-num {
    font-size: 13px;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 4px;
    line-height: 1;
}

.e360-cal-today .e360-cal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    background: #00466d;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
}

/* Event pills — month view */
.e360-cal-pills {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.e360-cal-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    font-size: 11px;
    cursor: pointer;
    transition: filter .12s;
    overflow: hidden;
}

.e360-cal-pill:hover { filter: brightness(.94); }

.e360-pill-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.e360-pill-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a2332;
    font-weight: 500;
}

.e360-pill-time {
    font-size: 10px;
    color: #94a3b8;
    flex-shrink: 0;
    margin-right: 2px;
}

.e360-cal-more {
    font-size: 11px;
    color: #00466d;
    font-weight: 600;
    padding: 2px 6px;
    cursor: pointer;
}

.e360-cal-more:hover { text-decoration: underline; }

/* Status opacity */
.e360-cal-pill--published  { opacity: .7; }
.e360-cal-pill--cancelled  { opacity: .4; text-decoration: line-through; }
.e360-cal-pill--failed     { background: #fee2e2 !important; }

/* ── WEEK VIEW ───────────────────────────────────────────────────────────── */

#e360-cal-grid.e360-cal-week {
    display: grid;
    grid-template-columns: 56px repeat(7, 1fr);
    overflow-y: auto;
    max-height: 640px;
}

.e360-cal-time-corner {
    background: #f8fafc;
    border-right: 1.5px solid #e2e8f0;
    border-bottom: 1.5px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.e360-cal-week-head {
    padding: 10px 6px;
    text-align: center;
    background: #f8fafc;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1.5px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.e360-cal-wday {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.e360-cal-wdate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    font-size: 14px;
    font-weight: 700;
    color: #1a2332;
    border-radius: 50%;
    margin-top: 3px;
}

.e360-cal-today-head .e360-cal-wday  { color: #00466d; }
.e360-cal-today-head .e360-cal-today-num {
    background: #00466d;
    color: #fff;
}

.e360-cal-time-label {
    padding: 6px 8px 6px 4px;
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
    background: #f8fafc;
    border-right: 1.5px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1;
    position: relative;
    top: -6px;
}

.e360-cal-week-slot {
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    min-height: 52px;
    padding: 3px;
    position: relative;
}

.e360-cal-slot-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── DAY VIEW ────────────────────────────────────────────────────────────── */

#e360-cal-grid.e360-cal-day {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 640px;
}

.e360-cal-day-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.e360-cal-day-wday {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #94a3b8;
}

.e360-cal-day-date {
    font-size: 18px;
    font-weight: 800;
    color: #1a2332;
}

.e360-cal-today-num {
    color: #00466d;
}

.e360-cal-day-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    border-bottom: 1px solid #f1f5f9;
    min-height: 60px;
}

.e360-cal-day-row .e360-cal-time-label {
    border-right: 1.5px solid #e2e8f0;
    border-bottom: none;
    display: flex;
    align-items: flex-start;
    padding-top: 8px;
    justify-content: flex-end;
}

.e360-cal-day-slot {
    padding: 4px 8px;
}

/* ── Modals ──────────────────────────────────────────────────────────────── */

.e360-cal-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.e360-cal-modal[style*="block"] { display: flex !important; }

.e360-cal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
}

.e360-cal-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.e360-cal-modal-box--wide { max-width: 640px; }

.e360-cal-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1.5px solid #e2e8f0;
    flex-shrink: 0;
}

.e360-cal-modal-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #1a2332;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.e360-cal-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .12s;
}

.e360-cal-close:hover { background: #e2e8f0; color: #1a2332; }

.e360-cal-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

/* Event detail */
.e360-event-dl dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #94a3b8;
    margin: 0 0 3px;
}

.e360-event-dl dd {
    font-size: 14px;
    color: #1a2332;
    margin: 0 0 14px;
}

.e360-status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.e360-status-scheduled { background: #dbeafe; color: #1e40af; }
.e360-status-published  { background: #d1fae5; color: #065f46; }
.e360-status-failed     { background: #fee2e2; color: #991b1b; }
.e360-status-cancelled  { background: #f1f5f9; color: #64748b; }

.e360-event-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1.5px solid #e2e8f0;
    margin-top: 4px;
}

.e360-act-btn {
    padding: 8px 16px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .12s;
}

.e360-act-btn:hover     { border-color: #00466d; color: #00466d; }
.e360-act-primary       { background: #00466d; color: #fff; border-color: #00466d; }
.e360-act-primary:hover { background: #003554; color: #fff; border-color: #003554; }
.e360-act-danger        { color: #ef4444; border-color: #fca5a5; }
.e360-act-danger:hover  { background: #fef2f2; border-color: #ef4444; }

/* Day popover list */
.e360-popover-date  { font-size: 13px; font-weight: 700; color: #1a2332; margin-bottom: 12px; }

.e360-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .12s;
    margin-bottom: 4px;
}

.e360-popover-item:hover     { background: #f8fafc; }
.e360-popover-time           { font-size: 12px; color: #94a3b8; flex-shrink: 0; width: 60px; }
.e360-popover-title          { flex: 1; font-size: 14px; color: #1a2332; font-weight: 500; }
.e360-popover-type           { font-size: 11px; color: #64748b; background: #f1f5f9; padding: 2px 7px; border-radius: 10px; }

/* Schedule form */
.e360-sched-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.e360-sched-field > label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
}

.e360-sched-field select,
.e360-sched-field input[type=date],
.e360-sched-field input[type=time] {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 14px;
    color: #1a2332;
    box-sizing: border-box;
    outline: none;
}

.e360-sched-field select:focus,
.e360-sched-field input:focus { border-color: #00466d; }

.e360-sched-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.e360-sched-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.e360-sched-checks label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    font-weight: normal !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.e360-cal-submit-btn {
    padding: 11px;
    background: #00466d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s;
}

.e360-cal-submit-btn:hover { background: #003554; }
.e360-cal-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.e360-cal-notice { padding: 10px 14px; border-radius: 7px; font-size: 13px; }
.e360-notice-error { background: #fee2e2; color: #991b1b; }

.e360-cal-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}
