/* Раздел «Группы» (тёмное золото). Классы с приставкой gr- */
#tab-groups { max-width: 1080px; margin: 0 auto; padding-bottom: 84px; animation: none; color: #f1f1f2; font-family: Inter, Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#tab-groups [hidden], .modal.modal-gr [hidden] { display: none !important; }

/* Гасим общие стили кнопок и полей из style.css */
#tab-groups button, .modal.modal-gr .gr-link { min-height: 0; padding: 0; margin: 0; gap: 0; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; color: inherit; font: inherit; cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s, filter 0.15s; }
#tab-groups button:disabled { cursor: default; }
#tab-groups button:focus-visible, #tab-groups a:focus-visible, #tab-groups input:focus-visible { outline: 2px solid #ffd785; outline-offset: -2px; }

.gr-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.gr-top h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.gr-sum { min-height: 21px; margin-top: 6px; color: #a1a6af; }

#tab-groups .gr-btn { height: 40px; padding: 0 16px; flex: none; border-radius: 11px; border: 1px solid rgba(229, 172, 69, 0.22); background: rgba(255, 255, 255, 0.045); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
#tab-groups .gr-btn:hover:not(:disabled) { border-color: rgba(244, 191, 92, 0.55); color: #ffd785; }
#tab-groups .gr-btn:disabled { opacity: 0.45; }
#tab-groups .gr-btn-sm { height: 36px; font-size: 13px; }
#tab-groups .gr-btn-gold, #tab-groups .gr-btn-gold:hover:not(:disabled) { height: 42px; border: 0; color: #17130d; font-weight: 700; background: linear-gradient(180deg, #ffd785 0%, #f4bf5c 35%, #e5ac45 70%, #a8722e 100%); box-shadow: 0 8px 22px rgba(229, 172, 69, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
#tab-groups .gr-btn-gold:hover:not(:disabled) { filter: brightness(1.07); }
#tab-groups .gr-btn-danger { border-color: rgba(245, 87, 108, 0.45); background: rgba(245, 87, 108, 0.14); color: #ffb3bd; font-weight: 700; }
#tab-groups .gr-btn-danger:hover:not(:disabled) { border-color: rgba(245, 87, 108, 0.7); background: rgba(245, 87, 108, 0.24); color: #ffd0d6; }
#tab-groups .gr-link, .modal.modal-gr .gr-link { color: #f4bf5c; font-weight: 600; }
#tab-groups .gr-link:hover, .modal.modal-gr .gr-link:hover:not(:disabled) { color: #ffd785; text-decoration: underline; text-underline-offset: 3px; }
.modal.modal-gr .gr-link:disabled { opacity: 0.45; cursor: default; }

/* Поиск и переключатели */
.gr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
#tab-groups .gr-search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; height: 44px; margin: 0; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.09); background: #0b0c0e; }
#tab-groups .gr-search:focus-within { border-color: #f4bf5c; box-shadow: 0 0 0 3px rgba(229, 172, 69, 0.14); }
.gr-search svg { width: 17px; height: 17px; flex: none; color: #8a909b; }
#tab-groups .gr-search input { flex: 1; width: auto; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; background: none; box-shadow: none; color: #f1f1f2; font: inherit; color-scheme: dark; }
.gr-seg { display: flex; gap: 4px; max-width: 100%; padding: 4px; border-radius: 13px; border: 1px solid rgba(255, 255, 255, 0.07); background: #0b0c0e; }
.gr-seg:empty { display: none; }
#tab-groups .gr-seg button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 9px; color: #a1a6af; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.gr-seg b { color: #8a909b; font-size: 12px; font-weight: 600; }
#tab-groups .gr-seg button:hover { color: #f1f1f2; }
#tab-groups .gr-seg button.on { background: rgba(229, 172, 69, 0.14); box-shadow: inset 0 0 0 1px rgba(229, 172, 69, 0.22); color: #ffd785; }
.gr-seg button.on b { color: #f4bf5c; }
.gr-seg button.bad b { color: #ff8c9b; }
#tab-groups .gr-sort[hidden] { display: none; }
#tab-groups .gr-sort.on { border-color: rgba(229, 172, 69, 0.55); background: rgba(229, 172, 69, 0.14); color: #ffd785; }
.gr-risk { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; font-size: 12px; line-height: 1.4; }
.gr-risk::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 2px; transform: translateY(-1px); background: currentColor; }
.gr-risk.green { color: #6f9f8b; }
.gr-risk.yellow { color: #ffd27a; }
.gr-risk.red { color: #ff9aa7; }
.gr-only { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 14px; color: #a1a6af; }
.gr-only:empty { display: none; }
.gr-only b { color: #f1f1f2; font-weight: 600; }

/* Блоки аккаунтов и строки */
.gr-box { border-radius: 18px; border: 1px solid rgba(229, 172, 69, 0.22); background: linear-gradient(180deg, #121316, #0b0c0e); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); overflow: hidden; }
.gr-box + .gr-box { margin-top: 16px; }
.gr-acc-h { display: flex; align-items: center; gap: 10px; padding: 0 14px 0 0; border-bottom: 1px solid rgba(229, 172, 69, 0.22); background: radial-gradient(70% 160% at 0 0, rgba(229, 172, 69, 0.09), transparent 60%); }
.gr-acc.closed .gr-acc-h { border-bottom: 0; }
#tab-groups .gr-acc-t { display: flex; align-items: center; justify-content: flex-start; gap: 13px; flex: 1; min-width: 0; padding: 13px 8px 13px 18px; text-align: left; }
.gr-face { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid rgba(244, 191, 92, 0.6); background: #0a0b0d; color: #ffd785; font-size: 17px; font-weight: 700; }
.gr-face::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid #121316; background: #34d399; }
.gr-face.warn::after { background: #ffb938; }
.gr-face.err::after { background: #f5576c; }
.gr-face.err { border-color: rgba(245, 87, 108, 0.55); color: #ffb3bd; }
.gr-face.off::after { background: #5b5f67; }
.gr-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gr-acc-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; font-weight: 600; }
.gr-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14.5px; font-weight: 600; }
.gr-sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #8a909b; font-size: 12.5px; font-weight: 400; }
.gr-sub .shared-chip { margin-left: 8px; padding: 0 8px; border: 1px solid rgba(229, 172, 69, 0.4); border-radius: 999px; background: none; color: #f1f1f2; font-size: 11.5px; }

.gr-row { display: grid; grid-template-columns: 20px 40px minmax(0, 1fr) 110px minmax(0, 260px) 76px; align-items: center; gap: 14px; min-height: 66px; padding: 10px 14px 10px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); cursor: pointer; }
.gr-ro .gr-row { grid-template-columns: 40px minmax(0, 1fr) 110px minmax(0, 260px) 76px; cursor: default; }
.gr-row:last-child { border-bottom: 0; }
.gr-row:hover { background: rgba(255, 255, 255, 0.025); }
.gr-row.on { background: rgba(229, 172, 69, 0.07); }
#tab-groups .gr-cb, .modal.modal-gold.modal-gr .modal-body input.gr-cb { appearance: none; -webkit-appearance: none; width: 19px; height: 19px; min-height: 0; flex: none; display: grid; place-items: center; margin: 0; padding: 0; border-radius: 6px; border: 1.5px solid #4a4c54; background: #08090b; box-shadow: none; cursor: pointer; }
#tab-groups .gr-cb:hover, .modal.modal-gold.modal-gr .modal-body input.gr-cb:hover { border-color: #f4bf5c; }
#tab-groups .gr-cb:checked, .modal.modal-gold.modal-gr .modal-body input.gr-cb:checked { border-color: #f4bf5c; background: #f4bf5c; }
#tab-groups .gr-cb:checked::after, .modal.modal-gold.modal-gr .modal-body input.gr-cb:checked::after { content: ""; width: 5px; height: 9px; border: solid #17130d; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.modal.modal-gold.modal-gr .modal-body input.gr-cb:disabled { opacity: 0.4; cursor: default; }
.gr-ava { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(229, 172, 69, 0.22); background: #0a0b0d; color: #ffd785; font-weight: 700; }
.gr-cnt { text-align: right; color: #a1a6af; font-size: 13px; white-space: nowrap; }
.gr-st { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13px; font-weight: 500; }
.gr-st i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #34d399; }
.gr-st span { min-width: 0; overflow-wrap: anywhere; }
.gr-st small { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #8a909b; font-size: 12px; font-weight: 400; line-height: 1.4; }
.gr-st.idle { color: #8a909b; }
.gr-st.idle i { background: transparent; border: 1.5px solid #5b5f67; }
.gr-st.err { color: #ff9aa7; }
.gr-st.err i { background: #f5576c; }
.gr-st.warn { color: #ffd27a; }
.gr-st.warn i { background: #ffb938; }
.gr-acts { display: flex; justify-content: flex-end; gap: 4px; }
#tab-groups .gr-ib { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #8a909b; }
.gr-ib svg { width: 17px; height: 17px; }
#tab-groups .gr-ib:hover { background: rgba(229, 172, 69, 0.1); color: #ffd785; }
#tab-groups .gr-del:hover { background: rgba(245, 87, 108, 0.13); color: #ff9aa7; }
.gr-fold svg { transition: transform 0.2s; }
.gr-acc.closed .gr-fold svg { transform: rotate(-90deg); }

.gr-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 44px 20px; border-radius: 18px; border: 1px dashed rgba(229, 172, 69, 0.3); color: #a1a6af; text-align: center; }
.gr-skel div { position: relative; height: 66px; overflow: hidden; }
.gr-skel div + div { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.gr-skel div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(229, 172, 69, 0.07), transparent); animation: bp-shimmer 1.3s infinite; }

/* Панель выбранного */
.gr-bar { position: fixed; left: 50%; bottom: 22px; z-index: 150; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px; border-radius: 16px; border: 1px solid rgba(244, 191, 92, 0.55); background: #141519; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.75); transform: translateX(-50%); white-space: nowrap; }
.gr-bar b { margin-right: 8px; font-weight: 600; }

/* Окно «Добавить группы» */
.modal.modal-gold.modal-gr { max-width: 560px; }
.modal.modal-gold.modal-gr .modal-body select, .modal.modal-gold.modal-gr .modal-body input[type="search"] { width: 100%; margin: 0 0 10px; color: #f1f1f2; color-scheme: dark; }
.modal.modal-gold.modal-gr .modal-body select { appearance: none; -webkit-appearance: none; padding: 0 40px 0 13px; background: #08090b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5ac45' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center / 16px; cursor: pointer; }
.modal.modal-gold.modal-gr .btn-primary:disabled { opacity: 0.4; filter: none; box-shadow: none; cursor: default; }
.gr-pick-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; padding: 0 12px 6px; color: #8a909b; font-size: 13px; }
.gr-pick { height: min(340px, 40vh); overflow-y: auto; border-radius: 13px; border: 1px solid rgba(255, 255, 255, 0.07); background: #08090b; }
.modal.modal-gold.modal-gr .modal-body label.gr-opt { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); color: #f1f1f2; font-size: 14px; font-weight: 400; line-height: 1.4; text-transform: none; letter-spacing: 0; cursor: pointer; }
.modal.modal-gold.modal-gr .modal-body label.gr-opt[hidden] { display: none; }
.modal.modal-gold.modal-gr .modal-body label.gr-opt:last-child { border-bottom: 0; }
.modal.modal-gold.modal-gr .modal-body label.gr-opt:hover { background: rgba(255, 255, 255, 0.03); }
.modal.modal-gold.modal-gr .modal-body label.gr-opt.have { opacity: 0.6; cursor: default; }
.gr-tag { flex: none; color: #8a909b; font-size: 12px; }
.gr-pick-note { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; padding: 20px; color: #a1a6af; text-align: center; }
.gr-wait { animation: gr-blink 1.4s ease-in-out infinite; }
@keyframes gr-blink { 50% { opacity: 0.45; } }

@media (max-width: 900px) {
  .gr-top h1 { font-size: 24px; }
  #tab-groups .gr-top .gr-btn-gold { width: 100%; height: 44px; }
  #tab-groups .gr-search { flex: 1 1 100%; }
  .gr-seg { display: grid; grid-template-columns: 1fr 1fr; flex: 1 1 100%; }
  .gr-row { grid-template-columns: 20px 40px minmax(0, 1fr) auto; grid-template-areas: "check ava who acts" "check ava state acts"; gap: 2px 12px; padding: 11px 8px 11px 14px; }
  .gr-ro .gr-row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ava who acts" "ava state acts"; }
  .gr-row .gr-cb { grid-area: check; }
  .gr-row .gr-ava { grid-area: ava; }
  .gr-row .gr-who { grid-area: who; }
  .gr-row .gr-st { grid-area: state; font-size: 12.5px; }
  .gr-row .gr-acts { grid-area: acts; }
  .gr-row .gr-cnt, .gr-st small { display: none; }
  #tab-groups .gr-open { display: none; }
  #tab-groups .gr-ib { width: 44px; height: 44px; }
  .gr-acc-h { padding-right: 8px; }
  #tab-groups .gr-acc-t { padding-left: 12px; gap: 11px; }
  .gr-face { width: 38px; height: 38px; font-size: 15px; }
  .gr-bar { left: 10px; right: 10px; bottom: 12px; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; transform: none; }
  .gr-bar b { margin-right: auto; }
  #tab-groups .gr-bar [data-gr="clear"] { display: none; }
  #tab-groups .gr-bar .gr-btn { padding: 0 12px; }
}
@media (max-width: 560px) {
  #tab-groups .gr-acc-h .gr-btn-sm { width: 40px; padding: 0; overflow: hidden; font-size: 0; }
  #tab-groups .gr-acc-h .gr-btn-sm::before { content: "+"; font-size: 20px; line-height: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gr-skel div::after, .gr-wait { animation: none; }
  .gr-fold svg { transition: none; }
}
