/* Settings → Escalations — personal critical-event watches.
   Scoped under .esc-watch-section (list) and .esc-watch-modal-overlay (modal). */

.esc-watch-section .settings-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* ---- buttons ---- */
.esc-watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    background: var(--surface-color, #fff);
    color: var(--text-color, #1f2937);
    font-size: 13.5px;
    cursor: pointer;
    white-space: nowrap;
}
.esc-watch-btn:hover { background: var(--hover-bg, #f3f4f6); }
.esc-watch-btn--primary {
    background: var(--primary-color, #2d78b7);
    border-color: var(--primary-color, #2d78b7);
    color: #fff;
}
.esc-watch-btn--primary:hover { filter: brightness(1.05); }

.esc-watch-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    background: var(--surface-color, #fff);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
}
.esc-watch-icon:hover { background: var(--hover-bg, #f3f4f6); color: var(--text-color, #1f2937); }
.esc-watch-icon--danger:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* ---- list ---- */
.esc-watch-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.esc-watch-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6b7280);
    margin: 10px 2px 2px;
}
.esc-watch-group-label:first-child { margin-top: 0; }

.esc-watch-card--locked { background: var(--muted-bg, #f8fafc); }
.esc-watch-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--text-muted, #9ca3af);
}
.esc-watch-tag--org { background: #fee2e2; color: #991b1b; }

.esc-watch-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted, #6b7280);
}
.esc-watch-empty i { font-size: 26px; opacity: 0.5; display: block; margin-bottom: 8px; }

.esc-watch-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--surface-color, #fff);
}
.esc-watch-card--off { opacity: 0.62; }
.esc-watch-card__main { min-width: 0; flex: 1; }
.esc-watch-card__title { font-weight: 600; color: var(--text-color, #111827); }
.esc-watch-card__desc {
    color: var(--text-muted, #4b5563);
    font-size: 13px;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.esc-watch-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.esc-watch-card__actions { display: flex; gap: 6px; flex: 0 0 auto; }

.esc-watch-tag {
    font-size: 11.5px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
}
.esc-watch-tag--armed { background: #dcfce7; color: #166534; }
.esc-watch-tag--unarmed { background: #fef3c7; color: #92400e; }
.esc-watch-tag--scope { background: #e0f2fe; color: #075985; }
.esc-watch-tag--off { background: #e5e7eb; color: #374151; }

/* ---- modal ---- */
.esc-watch-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
}
.esc-watch-modal {
    background: var(--surface-color, #fff);
    color: var(--text-color, #1f2937);
    border-radius: 14px;
    width: min(720px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.esc-watch-modal__head,
.esc-watch-modal__foot {
    display: flex;
    align-items: center;
    padding: 16px 20px;
}
.esc-watch-modal__head { justify-content: space-between; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.esc-watch-modal__head h3 { margin: 0; font-size: 17px; }
.esc-watch-modal__foot { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border-color, #e5e7eb); }
.esc-watch-modal__body {
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.esc-watch-modal__body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted, #374151);
}
.esc-watch-modal__body input[type="text"],
.esc-watch-modal__body input[type="number"],
.esc-watch-modal__body select,
.esc-watch-modal__body textarea {
    padding: 9px 10px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: var(--input-bg, #fff);
    color: var(--text-color, #1f2937);
}
.esc-watch-modal__body textarea { resize: vertical; min-height: 72px; }
.esc-watch-modal__row { display: flex; gap: 14px; }
.esc-watch-modal__row label { flex: 1; min-width: 0; }
.esc-watch-checkbox { flex-direction: row !important; align-items: center; gap: 8px !important; }
.esc-watch-checkbox input { width: auto; }

/* ---- keyword picker (aligned Keyword / Speaker / Type columns) ---- */
.esc-watch-kw-picker {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 8px;
    background: var(--muted-bg, #f8fafc);
}
.esc-watch-kw-search { width: 100%; margin-bottom: 8px; }
/* `.esc-watch-modal__body label` sets flex-column with higher specificity, so the
   grid needs !important to win for the label rows (same pattern as the admin picker). */
.esc-watch-kw-head,
.esc-watch-kw-item {
    display: grid !important;
    grid-template-columns: 1fr 68px 92px;
    align-items: center;
    column-gap: 8px;
    padding: 5px 8px;
    margin: 0;
}
.esc-watch-kw-head {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #6b7280);
    border-bottom: 1px solid var(--border-color, #d7dbe6);
    margin-bottom: 4px;
    padding-bottom: 6px;
}
.esc-watch-kw-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.esc-watch-kw-item { border-radius: 8px; cursor: pointer; font-weight: 400; }
.esc-watch-kw-item:hover { background: var(--hover-bg, #f1f5f9); }
.esc-watch-kw-item[hidden] { display: none !important; }
.esc-watch-kw-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.esc-watch-kw-item input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }
.esc-watch-kw-text {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 13.5px;
    color: var(--text-color, #1f2937);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.esc-watch-kw-muted { color: var(--text-muted, #9ca3af); }
.esc-watch-kw-tag {
    flex: 0 0 auto;
    display: inline-block;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 999px;
    text-transform: lowercase;
    background: #e5e7eb;
    color: #374151;
}
.esc-watch-kw-tag--critical { background: #fee2e2; color: #991b1b; }
.esc-watch-kw-tag--negative { background: #ffedd5; color: #9a3412; }
.esc-watch-kw-tag--positive { background: #dcfce7; color: #166534; }
.esc-watch-kw-tag--neutral  { background: #e5e7eb; color: #374151; }
.esc-watch-kw-tag--regex    { background: #ede9fe; color: #5b21b6; }
.esc-watch-kw-tag--spk-agent  { background: #dbeafe; color: #1e40af; text-transform: none; }
.esc-watch-kw-tag--spk-client { background: #cffafe; color: #155e75; text-transform: none; }
.esc-watch-kw-tag--spk-any    { background: #e0e7ff; color: #3730a3; text-transform: none; }
.esc-watch-kw-warn {
    margin-top: 8px;
    font-size: 12.5px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 10px;
}
.esc-watch-kw-empty { font-size: 13px; color: var(--text-muted, #6b7280); padding: 10px; }
