/* ============================================================
   STATUS GUARD (status-guard.js)
   The disqualify dialog, Kiwi's status helper and the "note but
   still New" hint. Dark first, body.light-mode overrides below.
   ============================================================ */

/* ── Kiwi's face ─────────────────────────────────────────────── */
.sg-kiwi {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; border-radius: 50%; overflow: hidden;
    background: #1f2a1c; border: 1px solid rgba(132, 204, 22, 0.35);
    color: #84cc16;
}
.sg-kiwi img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-kiwi-lg { width: 44px; height: 44px; font-size: 24px; }
.sg-kiwi-sm { width: 26px; height: 26px; font-size: 15px; }
.sg-kiwi-fallback i { line-height: 1; }

/* ── 1. Disqualify dialog ────────────────────────────────────── */
.sg-dq-overlay {
    position: fixed; inset: 0;
    z-index: 10000001;            /* above every other modal and popover */
    display: none; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sg-dq-overlay.active { display: flex; animation: sgFade .18s ease-out; }
@keyframes sgFade { from { opacity: 0; } to { opacity: 1; } }

.sg-dq-card {
    width: 420px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto;
    border-radius: 20px; padding: 24px;
    background: #1c1c1e; border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #fff; text-align: left; font-family: var(--font-ui);
}
.sg-dq-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sg-dq-head-text { min-width: 0; }
.sg-dq-kicker { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #84cc16; }
.sg-dq-card h3 { margin: 2px 0 0; font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: -0.3px; }
.sg-dq-lead { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.sg-dq-sub { margin: 4px 0 16px; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.6); }

.sg-dq-label { display: flex; gap: 6px; align-items: baseline; font-size: 12px; font-weight: 600; margin: 0 0 6px; color: rgba(255, 255, 255, 0.75); }
.sg-dq-req { font-weight: 500; color: #f59e0b; }
.sg-dq-req::before { content: "("; }
.sg-dq-req::after { content: ")"; }

.sg-dq-select-wrap { position: relative; margin-bottom: 14px; }
.sg-dq-select-wrap i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.sg-dq-select, .sg-dq-note {
    width: 100%; box-sizing: border-box;
    border-radius: 10px; padding: 11px 12px;
    font-family: var(--font-ui); font-size: 14px;
    background: rgba(255, 255, 255, 0.06); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.sg-dq-select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.sg-dq-select option { background: #1c1c1e; color: #fff; }
.sg-dq-note { resize: vertical; min-height: 78px; line-height: 1.45; }
.sg-dq-select:focus, .sg-dq-note:focus { border-color: #3369FF; box-shadow: 0 0 0 3px rgba(51, 105, 255, 0.2); }

.sg-dq-actions { display: flex; gap: 10px; margin-top: 18px; }
.sg-dq-cancel, .sg-dq-confirm {
    flex: 1; padding: 12px; border-radius: 10px; cursor: pointer;
    font-family: var(--font-ui); font-size: 13.5px; font-weight: 700;
    transition: background .15s, opacity .15s, border-color .15s;
}
.sg-dq-cancel { background: transparent; color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.18); font-weight: 600; }
.sg-dq-cancel:hover { border-color: rgba(255, 255, 255, 0.35); }
.sg-dq-confirm { flex: 1.4; background: #3369FF; color: #fff; border: 1px solid #3369FF; }
.sg-dq-confirm:hover:not(:disabled) { background: #2459EB; }
.sg-dq-confirm:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 600px) {
    .sg-dq-card { padding: 20px 18px; border-radius: 18px; }
    .sg-dq-card h3 { font-size: 17px; }
    .sg-dq-select, .sg-dq-note { font-size: 16px; }   /* 16px: no iOS zoom on focus */
}

/* ── 2. Status helper ────────────────────────────────────────── */
/* Floating, by a row's chip after a Call. Lets every click through. */
.sg-bubble {
    position: fixed; top: -9999px; left: -9999px;
    z-index: 999990;              /* under the status backdrop (999998) and popover */
    display: none; align-items: flex-start; gap: 10px;
    box-sizing: border-box; padding: 11px 13px; border-radius: 14px;
    background: #1f2937; color: #fff; border: 1px solid rgba(132, 204, 22, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    font-size: 12.5px; line-height: 1.45; font-weight: 500; text-align: left;
    pointer-events: none;
}
.sg-bubble.visible { display: flex; animation: sgFade .2s ease-out; }
.sg-bubble-arrow {
    position: absolute; left: calc(var(--sg-arrow-x, 24px) - 7px);
    width: 12px; height: 12px; background: inherit;
    border: inherit; transform: rotate(45deg);
}
.sg-bubble.below .sg-bubble-arrow { top: -7px; border-right: 0; border-bottom: 0; }
.sg-bubble.above .sg-bubble-arrow { bottom: -7px; border-left: 0; border-top: 0; }

/* In the profile: in the page, right under the status. */
.sg-helper-inline, .sg-note-hint {
    position: relative;
    display: flex; align-items: flex-start; gap: 10px;
    max-width: 440px; margin: 12px 0 0; padding: 11px 13px; border-radius: 12px;
    font-size: 12.5px; line-height: 1.45; font-weight: 500; text-align: left;
}
.sg-helper-inline { background: #18210f; border: 1px solid rgba(132, 204, 22, 0.4); color: rgba(255, 255, 255, 0.92); }
.sg-helper-inline::before {
    content: ""; position: absolute; top: -6px; left: 22px; width: 10px; height: 10px;
    background: #18210f; border-left: 1px solid rgba(132, 204, 22, 0.4); border-top: 1px solid rgba(132, 204, 22, 0.4);
    transform: rotate(45deg);
}
.sg-helper-text, .sg-note-hint-text { padding-top: 3px; }

/* ── 3. A note but still New ─────────────────────────────────── */
.sg-note-hint { background: #241a08; border: 1px solid rgba(245, 158, 11, 0.4); color: rgba(255, 255, 255, 0.92); }

.sg-note-mark.sg-kiwi {
    width: 18px; height: 18px; font-size: 11px; cursor: help;
    border: 1.5px solid #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

@media (max-width: 600px) {
    /* The profile hero is centred on a phone: the boxes follow it, full width. */
    .sg-helper-inline, .sg-note-hint { box-sizing: border-box; width: 100%; margin-left: auto; margin-right: auto; }
    .sg-helper-inline::before { left: calc(50% - 5px); }
}

/* ── light theme ─────────────────────────────────────────────── */
body.light-mode .sg-kiwi { background: #f0f7e6; border-color: rgba(101, 163, 13, 0.4); color: #4d7c0f; }
body.light-mode .sg-dq-overlay { background: rgba(15, 23, 42, 0.35); }
body.light-mode .sg-dq-card { background: #fff; color: #000; border-color: rgba(60, 60, 67, 0.1); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16); }
body.light-mode .sg-dq-kicker { color: #4d7c0f; }
body.light-mode .sg-dq-lead { color: #212531; }
body.light-mode .sg-dq-sub { color: rgba(60, 60, 67, 0.7); }
body.light-mode .sg-dq-label { color: rgba(60, 60, 67, 0.85); }
body.light-mode .sg-dq-req { color: #b45309; }
body.light-mode .sg-dq-select, body.light-mode .sg-dq-note { background: rgba(120, 120, 128, 0.08); color: #000; border-color: rgba(60, 60, 67, 0.14); }
body.light-mode .sg-dq-select option { background: #fff; color: #000; }
body.light-mode .sg-dq-select-wrap i { color: rgba(60, 60, 67, 0.6); }
body.light-mode .sg-dq-select:focus, body.light-mode .sg-dq-note:focus { border-color: #0043FB; box-shadow: 0 0 0 3px rgba(0, 67, 251, 0.12); background: rgba(0, 67, 251, 0.03); }
body.light-mode .sg-dq-cancel { color: rgba(60, 60, 67, 0.8); border-color: rgba(60, 60, 67, 0.18); }
body.light-mode .sg-dq-cancel:hover { border-color: rgba(60, 60, 67, 0.35); }
body.light-mode .sg-dq-confirm { background: #0043FB; border-color: #0043FB; }
body.light-mode .sg-dq-confirm:hover:not(:disabled) { background: #0036CC; }

body.light-mode .sg-bubble { background: #fff; color: #212531; border-color: rgba(101, 163, 13, 0.5); box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14); }
body.light-mode .sg-helper-inline { background: #f4f9ec; border-color: rgba(101, 163, 13, 0.4); color: #212531; }
body.light-mode .sg-helper-inline::before { background: #f4f9ec; border-color: rgba(101, 163, 13, 0.4); }
body.light-mode .sg-note-hint { background: #fff7e8; border-color: rgba(217, 119, 6, 0.35); color: #212531; }
body.light-mode .sg-note-mark.sg-kiwi { border-color: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.12); }

/* Kiwi's picture is transparent: no disc behind him. The bird icon shown when
   the picture cannot load keeps its disc; the note marker keeps its amber ring. */
.sg-kiwi:not(.sg-kiwi-fallback) { background: none; border-color: transparent; border-radius: 0; overflow: visible; }
body.light-mode .sg-kiwi:not(.sg-kiwi-fallback) { background: none; border-color: transparent; }
.sg-kiwi img { object-fit: contain; }
.sg-note-mark.sg-kiwi:not(.sg-kiwi-fallback) { border-radius: 50%; border-color: #f59e0b; }
body.light-mode .sg-note-mark.sg-kiwi:not(.sg-kiwi-fallback) { border-color: #d97706; }

/* The row marker's hover card: the notes column's card (styles.css
   .notes-popover) with Kiwi's name in its head and his words as the body. */
.sg-mark-pop { width: 280px; }
.sg-mark-pop-head { gap: 8px; }
/* the notes head styles every span as a count chip: not these two */
.sg-mark-pop-head span { font-size: inherit; padding: 0; border-radius: 0; background: none; color: inherit; }
.sg-mark-pop-head .sg-kiwi-sm { width: 22px; height: 22px; }
.sg-mark-pop-head .sg-mark-pop-who { color: #3F7A1A; font-weight: 700; font-size: 12px; }
.sg-mark-pop-body { font-size: 13px; line-height: 1.45; color: #1c1c1e; }
