/* «Добавить в группу WhatsApp» (Ханзада 23.11.2026, Izi.CRM #5107) — окно wa-group-add.js, в стиле окон «Чата»
   (как «Выбрать группу WhatsApp» .gcp-*). Метки слева у плашек — ровной планкой внутри (::before), без border-left. */
.wga-ov {
    position: fixed; inset: 0; z-index: 10060; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(15, 23, 42, .45);
}
.wga {
    width: 100%; max-width: 540px; max-height: min(86vh, 780px); display: flex; flex-direction: column;
    background: var(--card-bg); color: var(--text-color); border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28), 0 2px 8px rgba(15, 23, 42, .12); overflow: hidden;
}
.wga-i { flex: none; vertical-align: middle; }
.wga-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.wga-head-ic {
    flex: none; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: #e8f8ee; color: #1f9d55;
}
.wga-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wga-head-t b { font-size: 15px; font-weight: 600; }
.wga-head-t span { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wga-x {
    flex: none; width: 32px; height: 32px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.wga-x:hover { background: var(--hover-bg); color: var(--text-color); }
.wga-body { flex: 1; min-height: 120px; overflow-y: auto; padding: 0 18px 12px; }
.wga-empty { padding: 16px 8px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* Плашки: кто добавляет, итог. Планка внутри слева, цвет — через --bar */
.wga-note {
    --bar: var(--primary-color); position: relative; display: flex; gap: 9px; align-items: flex-start;
    margin: 0 0 12px; padding: 10px 12px 10px 16px; border-radius: 10px; font-size: 13px; line-height: 1.45;
    background: var(--primary-light); color: var(--text-color);
}
.wga-note::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bar); pointer-events: none; }
.wga-note > svg { margin-top: 1px; color: var(--bar); }
.wga-note b { font-weight: 600; white-space: nowrap; }
.wga-note.is-info { --bar: #3b82f6; background: #eff6ff; }
.wga-note.is-ok { --bar: #16a34a; background: #ecfdf3; color: #14532d; }
.wga-note.is-warn { --bar: #f0a020; background: #fff8eb; color: #6b4300; }
.wga-note.is-error { --bar: #dc2626; background: #fef2f2; color: #7f1d1d; }

.wga-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.wga-lbl { font-size: 12.5px; font-weight: 600; color: var(--text-color); margin-top: 4px; }
.wga-lbl i { font-style: normal; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.wga-phone {
    display: flex; align-items: center; height: 42px; border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--card-bg); transition: border-color .15s ease, box-shadow .15s ease; overflow: hidden;
}
.wga-phone:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
.wga-phone.is-bad { border-color: var(--danger-color); }
.wga-cc {
    display: none; align-items: center; height: 100%; padding: 0 10px 0 12px; font-size: 15px; font-weight: 600;
    color: var(--text-muted); border-right: 1px solid var(--border-light); background: var(--hover-bg);
    font-variant-numeric: tabular-nums;
}
.wga-phone.is-kg .wga-cc { display: flex; }
.wga-phone input {
    flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent; color: var(--text-color);
    padding: 0 12px; font: inherit; font-size: 15px; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.wga-inp {
    width: 100%; box-sizing: border-box; height: 38px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--card-bg); color: var(--text-color); font: inherit; font-size: 13.5px; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.wga-inp:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
.wga-phone input:disabled, .wga-inp:disabled { opacity: .6; }
.wga-hint-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 18px; }
.wga-err { font-size: 12px; color: var(--danger-color); }
.wga-err.is-ok { color: #15803d; }
.wga-link {
    flex: none; border: none; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--primary-color); cursor: pointer;
}
.wga-link:hover { text-decoration: underline; }

.wga-sec {
    display: flex; align-items: center; gap: 6px; padding: 14px 2px 6px; font-size: 11.5px; font-weight: 600;
    letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted);
}
.wga-sec i { font-style: normal; font-weight: 500; padding: 0 6px; border-radius: 9px; background: var(--hover-bg); }
.wga-sync {
    margin-left: auto; display: inline-flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0;
    font-weight: 500; font-size: 11.5px; color: #15803d;
}
.wga-sync.is-busy { color: var(--text-muted); }
.wga-sync.is-busy svg { animation: wga-spin 1s linear infinite; }
.wga-sync.is-warn { color: #b45309; }
.wga-list { display: flex; flex-direction: column; gap: 1px; }
.wga-row {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 8px; border: none; border-radius: 10px;
    background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.wga-row:hover, .wga-row:focus-visible { background: var(--hover-bg); outline: none; }
.wga-row.is-static { cursor: default; }
.wga-row.is-static:hover { background: transparent; }
.wga-row.is-in { cursor: default; opacity: .72; }
.wga-row.is-in:hover { background: transparent; }
.wga-av {
    flex: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: #e8f8ee; color: #1f9d55; font-size: 12px; font-weight: 600;
}
.wga-row.is-us .wga-av { background: var(--hover-bg); color: var(--text-muted); }
.wga-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wga-txt b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wga-txt span { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wga-tag {
    flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px;
    font-size: 11.5px; font-weight: 500; background: var(--primary-light); color: var(--primary-color); white-space: nowrap;
}
.wga-tag.is-ok { background: #e8f8ee; color: #15803d; }
.wga-tag.is-admin { background: #fff4e0; color: #a15c00; }
.wga-small { margin: 6px 2px 0; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.wga-invite {
    margin: 0 0 12px; padding: 12px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg);
}
.wga-invite-h { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 8px; color: var(--text-color); }
.wga-invite-h b { font-weight: 600; }
.wga-invite-t {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px; padding: 9px 11px; border: 1px solid var(--border-light);
    border-radius: 9px; background: var(--hover-bg); color: var(--text-color); font: inherit; font-size: 13px; line-height: 1.45;
}
.wga-invite-a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.wga-foot {
    display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-light);
}
.wga-foot-sp { flex: 1; }
.wga-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
    border: 1px solid var(--border-color); border-radius: 9px; background: var(--card-bg); color: var(--text-color);
    font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.wga-btn:hover:not(:disabled) { background: var(--hover-bg); }
.wga-btn:disabled { opacity: .5; cursor: default; }
.wga-btn.is-primary { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.wga-btn.is-primary:hover:not(:disabled) { filter: brightness(1.06); background: var(--primary-color); }
.wga-btn.is-ghost { border-color: transparent; background: transparent; color: var(--primary-color); padding: 0 8px; }
.wga-btn.is-ghost:hover:not(:disabled) { background: var(--primary-light); }
.wga-btn.is-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.wga-spin { animation: wga-spin 1s linear infinite; }
@keyframes wga-spin { to { transform: rotate(360deg); } }

/* Кнопка в профиле клиента и в шаге онбординга */
.wga-pfl-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--card-bg); color: var(--primary-color); font: inherit; font-size: 12.5px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
}
.wga-pfl-btn:hover { background: var(--primary-light); border-color: var(--primary-color); }
.omni-chatid-hint .wga-pfl-btn { margin-left: 8px; }

body[data-theme="dark"] .wga-head-ic, body[data-theme="dark"] .wga-av { background: rgba(37, 211, 102, .14); color: #4ade80; }
body[data-theme="dark"] .wga-row.is-us .wga-av { background: var(--hover-bg); color: var(--text-muted); }
body[data-theme="dark"] .wga-note.is-info { background: rgba(59, 130, 246, .13); color: #dbeafe; --bar: #60a5fa; }
body[data-theme="dark"] .wga-note.is-ok { background: rgba(52, 211, 153, .13); color: #bbf7d0; --bar: #34d399; }
body[data-theme="dark"] .wga-note.is-warn { background: rgba(240, 160, 32, .13); color: #fde68a; --bar: #fbbf24; }
body[data-theme="dark"] .wga-note.is-error { background: rgba(248, 113, 113, .13); color: #fecaca; --bar: #f87171; }
body[data-theme="dark"] .wga-tag.is-ok { background: rgba(52, 211, 153, .14); color: #34d399; }
body[data-theme="dark"] .wga-tag.is-admin { background: rgba(251, 191, 36, .14); color: #fbbf24; }
body[data-theme="dark"] .wga-err.is-ok, body[data-theme="dark"] .wga-sync { color: #34d399; }
body[data-theme="dark"] .wga-sync.is-busy { color: var(--text-muted); }
body[data-theme="dark"] .wga-sync.is-warn { color: #fbbf24; }

@media (max-width: 600px) {
    .wga-ov { padding: 0; align-items: flex-end; }
    .wga { max-width: none; max-height: 92vh; border-radius: 14px 14px 0 0; }
    .wga-head { padding: 14px 14px 10px; }
    .wga-body { padding: 0 14px 10px; }
    .wga-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
    .wga-foot .wga-btn.is-ghost { order: 3; width: 100%; }
    .wga-foot-sp { display: none; }
    .wga-foot .wga-btn:not(.is-ghost) { flex: 1; }
}
