/* ============================================================
   CSM Pro — Supervision Panel
   ============================================================ */

/* ── Panel shell ── */
.csm-sup-panel {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

/* ── Header ── */
.csm-sup-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f0f0f1;
    gap: 12px;
    flex-wrap: wrap;
}

.csm-sup-panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

/* ── Ready badge (supervisor view) ── */
.csm-sup-ready-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #646970;
    background: #f6f7f7;
    border-radius: 20px;
    padding: 3px 10px;
    transition: background 0.2s, color 0.2s;
}

.csm-sup-ready-badge--on {
    background: #edfaef;
    color: #00a32a;
}

.csm-sup-ready-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c3c4c7;
    flex-shrink: 0;
    transition: background 0.2s;
}

.csm-sup-ready-badge--on .csm-sup-ready-dot {
    background: #00a32a;
    box-shadow: 0 0 0 3px #c5f2cc;
    animation: csm-sup-pulse 1.6s ease-in-out infinite;
}

@keyframes csm-sup-pulse {
    0%, 100% { box-shadow: 0 0 0 3px #c5f2cc; }
    50%       { box-shadow: 0 0 0 6px #c5f2cc; }
}

/* ── Active handoff bar (supervisor) ── */
.csm-sup-handoff-active {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #f0f6fc;
    border-bottom: 1px solid #c5d9f0;
    font-size: 13px;
    color: #1d2327;
}

.csm-sup-handoff-icon {
    color: #2271b1;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.csm-sup-handoff-msg {
    flex: 1;
}

.csm-sup-handoff-timer {
    color: #2271b1;
}

/* ── Template selector row ── */
.csm-sup-template-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid #f0f0f1;
}

.csm-sup-template-row label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    white-space: nowrap;
}

.csm-sup-template-select {
    min-width: 200px;
    font-size: 13px;
}

/* ── Editor ── */
.csm-sup-editor-wrap {
    display: flex;
    flex-direction: column;
}

.csm-sup-editor {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: none;
    border-top: 1px solid #f0f0f1;
    border-radius: 0;
    padding: 16px 18px;
    resize: vertical;
    min-height: 220px;
    color: #1d2327;
    background: #fdfdfd;
    outline: none;
}

.csm-sup-editor:focus {
    background: #fff;
    box-shadow: inset 0 0 0 2px #2271b1;
}

/* ── Actions row ── */
.csm-sup-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 14px;
    border-top: 1px solid #f0f0f1;
    flex-wrap: wrap;
}

.csm-sup-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.csm-sup-share-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Share status ── */
.csm-sup-share-status {
    font-size: 12px;
    font-weight: 500;
}

.csm-sup-status--saving { color: #8c8f94; }
.csm-sup-status--saved  { color: #00a32a; }
.csm-sup-status--error  { color: #d63638; }

/* ── Supervisee body ── */
.csm-sup-supervisee-body {
    padding: 18px;
}

.csm-sup-supervisee-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: #646970;
    line-height: 1.6;
}

.csm-sup-ready-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.csm-sup-btn-ready-on {
    color: #00a32a !important;
    border-color: #00a32a !important;
}

/* ── Supervisee ready status / pulse ── */
.csm-sup-ready-status {
    font-size: 13px;
    color: #646970;
    display: flex;
    align-items: center;
    gap: 6px;
}

.csm-sup-ready-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00a32a;
    animation: csm-sup-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

/* ── Blocking modal overlay ── */
.csm-sup-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.csm-sup-modal {
    background: #fff;
    border-radius: 6px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.csm-sup-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #dcdcde;
    background: #f6f7f7;
}

.csm-sup-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 6px;
}

.csm-sup-modal-title .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.csm-sup-modal-body {
    padding: 20px;
}

.csm-sup-modal-body p {
    margin: 0 0 14px;
    font-size: 13px;
    color: #1d2327;
    line-height: 1.6;
}

/* ── Countdown bar ── */
.csm-sup-countdown-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.csm-sup-countdown-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
}

.csm-sup-countdown-fill {
    height: 100%;
    width: 100%;
    background: #00a32a;
    border-radius: 4px;
    transition: width 1s linear, background 0.3s;
}

.csm-sup-countdown-fill--warn {
    background: #d63638;
}

.csm-sup-countdown-label {
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    white-space: nowrap;
    min-width: 72px;
    text-align: right;
}

.csm-sup-countdown-secs {
    font-variant-numeric: tabular-nums;
}

/* ── Modal warning line ── */
.csm-sup-modal-warning {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px !important;
    color: #614200 !important;
    background: #fcf9e8;
    border-left: 3px solid #dba617;
    padding: 8px 10px;
    border-radius: 0 3px 3px 0;
    margin-bottom: 0 !important;
}

.csm-sup-modal-warning .dashicons {
    color: #dba617;
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Modal footer ── */
.csm-sup-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #dcdcde;
    background: #f6f7f7;
}

.csm-sup-save-drive-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.csm-sup-modal-status {
    font-size: 12px;
    font-weight: 500;
}

/* ── Utility ── */
.csm-sup-hidden {
    display: none !important;
}
