:root {
  --bg: #121c22;
  --bg-soft: #18242b;
  --panel: rgba(23, 32, 38, 0.94);
  --panel-warm: rgba(50, 45, 45, 0.72);
  --line: rgba(209, 158, 69, 0.32);
  --line-soft: rgba(244, 228, 199, 0.11);
  --gold: #d8a84d;
  --gold-soft: #f1c972;
  --cream: #fff8ed;
  --muted: #9ca7aa;
  --wine: #7b2942;
  --danger: #dc746f;
  --ok: #76c39a;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 8%, rgba(216, 168, 77, 0.09), transparent 28%),
    radial-gradient(circle at 76% 62%, rgba(123, 41, 66, 0.13), transparent 34%),
    linear-gradient(135deg, #10191e 0%, #15242a 52%, #161a21 100%);
  color: var(--cream);
  font-family: "DM Sans", Arial, sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(430px, 100%);
  background: rgba(18, 28, 34, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-mark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 48px;
  line-height: 1;
  color: var(--gold-soft);
}

.brand-logo {
  display: block;
  width: 176px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.login-logo {
  width: min(260px, 100%);
  margin-bottom: 12px;
}

.eyebrow {
  margin: 10px 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: 28px;
}

.login-form,
.team-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.06);
  color: var(--cream);
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(216, 168, 77, 0.25);
  border-color: var(--gold);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

select option {
  color: #18242b;
}

.login-form button,
.team-form button,
.action-button {
  min-height: 42px;
  border-radius: 4px;
  background: var(--gold);
  color: #111a20;
  font-weight: 800;
  padding: 10px 14px;
}

.login-form button:disabled,
.team-form button:disabled,
.action-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.login-form.is-loading input {
  cursor: wait;
  opacity: 0.72;
}

.login-form.is-loading button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.login-form.is-loading button[type="submit"]::before,
.loading-status::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(17, 26, 32, 0.22);
  border-top-color: #111a20;
  border-radius: 999px;
  animation: spin 780ms linear infinite;
}

.action-button.secondary {
  background: rgba(255, 248, 237, 0.08);
  border: 1px solid var(--line);
  color: var(--cream);
}

.action-button.danger {
  background: #7d2d38;
  color: var(--cream);
}

.form-error,
.inline-message {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.inline-message.ok {
  color: var(--ok);
}

.inline-message.warn {
  color: var(--gold-soft);
}

.inline-message.error {
  color: var(--danger);
}

.dashboard {
  min-height: 100vh;
  padding: 44px 50px 58px;
}

.snapshot-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  max-width: 100%;
}

.snapshot-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-row .brand-mark {
  font-size: 48px;
}

.brand-row .brand-logo {
  flex: 0 0 auto;
}

.snapshot-title {
  color: var(--cream);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.period-label {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-align: right;
  text-transform: uppercase;
}

.period-value {
  margin: 0;
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
  text-align: right;
}

.loading-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 24px;
  margin: 4px 0 0;
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.loading-status::before {
  border-color: rgba(241, 201, 114, 0.24);
  border-top-color: var(--gold-soft);
}

.period-panel {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.period-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.period-control-wrap {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.period-segments {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.04);
}

.period-option,
.period-apply {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
  user-select: none;
}

.period-option {
  border-right: 1px solid var(--line-soft);
}

.period-option:last-child {
  border-right: 0;
}

.period-option.active,
.period-option:hover,
.period-apply:hover {
  background: rgba(216, 168, 77, 0.14);
  color: var(--cream);
}

.period-option:disabled,
.period-apply:disabled,
.period-input:disabled {
  cursor: wait;
  opacity: 0.72;
}

.period-custom {
  display: flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.04);
}

.period-input {
  width: 72px;
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  padding: 6px 8px;
  text-align: right;
}

.period-unit {
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.period-apply {
  border-left: 1px solid var(--line-soft);
}

.period-feedback {
  min-height: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.period-feedback.error {
  color: var(--danger);
}

.snapshot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.nav-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--line);
  background: rgba(216, 168, 77, 0.08);
  color: var(--cream);
}

.snapshot-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.section-block {
  margin-top: 30px;
}

.section-heading {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.section-index {
  color: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
}

.section-title {
  margin: 0;
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 18px;
}

.section-rule {
  height: 1px;
  background: var(--line);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(18, 28, 34, 0.66);
}

.metric-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.metric-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.metric-grid.four {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-grid.five {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.metric-card {
  min-height: 116px;
  min-width: 0;
  position: relative;
  padding: 18px 16px 16px;
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(135deg, rgba(255, 248, 237, 0.04), transparent 48%),
    var(--panel);
}

.metric-card.feature {
  min-height: 184px;
  border-left: 4px solid var(--gold);
  background:
    linear-gradient(120deg, rgba(123, 41, 66, 0.22), transparent 58%),
    linear-gradient(135deg, rgba(255, 248, 237, 0.05), transparent 42%),
    var(--panel);
}

.metric-card:last-child {
  border-right: 0;
}

.skeleton-card {
  overflow: hidden;
}

.skeleton-card::after,
.skeleton-pill::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 248, 237, 0.08), transparent);
  animation: shimmer 1400ms ease-in-out infinite;
}

.skeleton-dot,
.skeleton-line,
.skeleton-pill {
  position: relative;
  overflow: hidden;
  background: rgba(255, 248, 237, 0.08);
  border: 1px solid rgba(216, 168, 77, 0.08);
}

.skeleton-dot {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(216, 168, 77, 0.42);
  box-shadow: 0 0 16px rgba(241, 201, 114, 0.28);
}

.skeleton-line {
  width: 58%;
  height: 12px;
  border-radius: 999px;
}

.skeleton-line.label {
  width: 42%;
  height: 10px;
  margin-top: 8px;
}

.skeleton-line.number {
  width: 68%;
  height: 44px;
  margin-top: 20px;
  border-radius: 4px;
}

.skeleton-line.short {
  width: 50%;
  height: 11px;
  margin-top: 14px;
}

.skeleton-nav {
  pointer-events: none;
}

.skeleton-pill {
  display: inline-block;
  width: 96px;
  height: 36px;
  border-radius: 4px;
}

.skeleton-pill.wide {
  width: 156px;
  margin-left: auto;
}

.loading-grid {
  pointer-events: none;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.metric-card::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 12px var(--gold-soft);
  opacity: 0.9;
}

.metric-number {
  margin: 0 0 8px;
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.metric-card.feature .metric-number {
  font-size: clamp(62px, 8vw, 96px);
}

.metric-link-number {
  appearance: none;
  display: block;
  width: fit-content;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 0.98;
  padding: 0;
  text-align: left;
  text-decoration: none;
}

.metric-link-number:hover {
  color: var(--gold-soft);
}

.metric-link-number:focus-visible {
  outline: 2px solid rgba(216, 168, 77, 0.42);
  outline-offset: 4px;
}

.metric-link-number:disabled {
  color: var(--cream);
  cursor: default;
  text-decoration: none;
}

.metric-label {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.label-with-help,
.metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
}

.strip-label {
  max-width: none;
}

.help-trigger {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(241, 201, 114, 0.52);
  border-radius: 999px;
  background: rgba(216, 168, 77, 0.09);
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: help;
}

.help-trigger:hover,
.help-trigger:focus-visible {
  outline: 0;
  background: rgba(216, 168, 77, 0.22);
  border-color: var(--gold-soft);
  color: var(--cream);
}

.help-popover {
  position: fixed;
  z-index: 2000;
  width: min(340px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 12px 13px;
  border: 1px solid rgba(241, 201, 114, 0.48);
  border-radius: 4px;
  background: rgba(12, 20, 24, 0.98);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.4);
  color: var(--cream);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.help-popover.show {
  opacity: 1;
  transform: translateY(0);
}

.metric-note {
  margin: 0;
  color: rgba(255, 248, 237, 0.74);
  font-family: Georgia, serif;
  font-size: 14px;
  font-style: italic;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.metric-subnote {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.user-email {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.integration-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: rgba(18, 28, 34, 0.58);
}

.integration-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.integration-strip strong {
  color: var(--cream);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 12px;
  margin-top: 12px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(18, 28, 34, 0.64);
  padding: 18px;
}

.panel h2 {
  margin-bottom: 14px;
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 18px;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading-row h2 {
  margin-bottom: 0;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.action-button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.account-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.copy-box {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.06);
  color: var(--cream);
  padding: 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.copy-box:focus {
  outline: 2px solid rgba(216, 168, 77, 0.25);
  border-color: var(--gold);
}

.bars {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.bar-track {
  height: 9px;
  background: rgba(255, 248, 237, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  background: var(--gold);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.table th:first-child,
.table td:first-child {
  width: 46%;
}

.table th:nth-child(2),
.table td:nth-child(2),
.table th:nth-child(3),
.table td:nth-child(3) {
  width: 17%;
}

.table th:nth-child(4),
.table td:nth-child(4) {
  width: 20%;
}

.table th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.table th .label-with-help {
  gap: 5px;
  max-width: 100%;
}

.table th .help-trigger {
  width: 15px;
  height: 15px;
  font-size: 9px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 99px;
  padding: 3px 9px;
  background: rgba(255, 248, 237, 0.08);
  color: var(--cream);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.pill.ok {
  background: rgba(118, 195, 154, 0.13);
  color: var(--ok);
}

.pill.warn {
  background: rgba(216, 168, 77, 0.15);
  color: var(--gold-soft);
}

.pill.info {
  background: rgba(94, 177, 214, 0.13);
  color: #8fd0ee;
}

.pill.bad {
  background: rgba(220, 116, 111, 0.13);
  color: var(--danger);
}

.team-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.client-layout,
.support-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.operations-shell {
  display: grid;
  gap: 12px;
}

.operations-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.operation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.operation-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.04);
  color: var(--muted);
  padding: 8px 11px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.operation-tab.active,
.operation-tab:hover {
  background: rgba(216, 168, 77, 0.12);
  color: var(--cream);
}

.operation-count {
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(216, 168, 77, 0.14);
  color: var(--gold-soft);
  display: inline-grid;
  place-items: center;
  padding: 2px 7px;
  font-size: 10px;
  letter-spacing: 0;
}

.operation-add-button {
  flex: 0 0 auto;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-search-block {
  display: grid;
  gap: 14px;
}

.search-label {
  max-width: 360px;
}

.client-search-input {
  min-height: 38px;
}

.client-search-results {
  min-width: 0;
}

.phone-link {
  color: var(--cream);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.phone-link:hover {
  color: var(--gold-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--cream);
  letter-spacing: 0;
  text-transform: none;
}

.check-label input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--gold);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.management-table {
  min-width: 1160px;
  table-layout: auto;
}

.blocked-table {
  min-width: 860px;
}

.support-table {
  min-width: 820px;
  table-layout: auto;
}

.management-table th,
.management-table td,
.support-table th,
.support-table td {
  width: auto;
}

.management-table th:nth-child(2),
.management-table td:nth-child(2),
.management-table th:nth-child(3),
.management-table td:nth-child(3),
.management-table th:nth-child(4),
.management-table td:nth-child(4),
.support-table th:nth-child(2),
.support-table td:nth-child(2),
.support-table th:nth-child(3),
.support-table td:nth-child(3),
.support-table th:nth-child(4),
.support-table td:nth-child(4) {
  width: auto;
}

.management-table th:first-child,
.management-table td:first-child,
.support-table th:first-child,
.support-table td:first-child {
  width: 28%;
}

.support-table th:first-child,
.support-table td:first-child {
  width: 36%;
}

.groups-console {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.group-list-panel,
.group-thread-panel {
  min-width: 0;
}

.group-list {
  display: grid;
  gap: 8px;
}

.group-list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.04);
  color: var(--cream);
  padding: 11px;
  text-align: left;
}

.group-list-item:hover,
.group-list-item.active {
  border-color: var(--gold);
  background: rgba(216, 168, 77, 0.12);
}

.group-list-name {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.group-list-slug,
.group-thread-subtitle {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.group-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 248, 237, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.group-thread-content,
.group-thread-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.group-title-row {
  align-items: flex-start;
}

.group-thread-subtitle {
  margin: 4px 0 0;
}

.group-notice {
  margin-bottom: 0;
}

.group-composer {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.035);
  padding: 12px;
}

.group-composer.reply {
  margin-top: 8px;
  padding: 10px;
}

.group-composer-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.group-composer label {
  display: grid;
  gap: 6px;
  min-width: 160px;
  color: var(--ice);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.group-composer select {
  min-height: 34px;
  padding: 6px 8px;
}

.group-composer textarea {
  min-height: 86px;
  resize: vertical;
}

.group-composer.reply textarea {
  min-height: 64px;
}

.group-compose-message {
  min-height: 18px;
  margin: 0;
}

.group-post-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 17, 21, 0.42);
  padding: 13px;
}

.group-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.group-post-meta strong {
  color: var(--cream);
  font-size: 13px;
}

.group-post-body {
  margin: 0;
  color: rgba(255, 248, 237, 0.9);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.group-replies {
  display: grid;
  gap: 8px;
  border-left: 2px solid rgba(216, 168, 77, 0.32);
  margin-left: 4px;
  padding-left: 12px;
}

.group-reply {
  display: grid;
  gap: 5px;
  padding: 8px 0;
}

.ai-module-view {
  min-width: 0;
}

.ai-module-grid {
  display: grid;
  gap: 18px;
}

.ai-panel {
  min-width: 0;
}

.ai-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ai-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
}

.ai-form textarea {
  min-height: 132px;
}

.ai-toggle-grid,
.ai-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toggle-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.toggle-row input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--gold);
}

.ai-preview-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.ai-preview-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(10, 17, 21, 0.42);
  padding: 13px;
}

.ai-runs-table td:first-child {
  width: 34%;
}

.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.actions-menu-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  min-width: 44px;
}

.action-menu-trigger {
  width: 38px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.08);
  color: var(--cream);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.action-menu-trigger:hover,
.action-menu-trigger[aria-expanded="true"] {
  border-color: var(--gold);
  background: rgba(216, 168, 77, 0.18);
}

.action-menu-trigger:disabled {
  cursor: wait;
  opacity: 0.58;
}

.actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #111b21;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

.menu-action {
  display: flex;
  align-items: center;
  min-height: 36px;
  border-radius: 4px;
  background: transparent;
  color: var(--cream);
  font-size: 12px;
  font-weight: 800;
  justify-content: flex-start;
  padding: 8px 10px;
  text-align: left;
}

.menu-action:hover {
  background: rgba(255, 248, 237, 0.08);
}

.menu-action.danger {
  color: #ffd9df;
}

.menu-action.danger:hover {
  background: rgba(125, 45, 56, 0.35);
}

.menu-action:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.client-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 13, 17, 0.74);
}

.client-modal-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101a20;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
  padding: 22px;
}

.client-modal-panel.wide {
  width: min(860px, 100%);
}

.client-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.client-modal-heading h2 {
  margin: 2px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(24px, 4vw, 31px);
  letter-spacing: 0;
}

.client-modal-kicker {
  margin: 0;
  color: var(--ice);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.modal-close-button {
  width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 248, 237, 0.07);
  color: var(--cream);
  font-size: 18px;
  font-weight: 900;
}

.client-modal-form {
  display: grid;
  gap: 14px;
}

.client-modal-form label {
  display: grid;
  gap: 8px;
  color: var(--ice);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.cancellation-modal-body {
  display: grid;
  gap: 14px;
}

.cancellation-table-wrap {
  max-height: min(58vh, 520px);
  overflow: auto;
}

.cancellation-table td:first-child {
  min-width: 220px;
}

.cancellation-table td:last-child {
  min-width: 260px;
}

.cancellation-reason {
  max-width: 420px;
  color: rgba(255, 248, 237, 0.9);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.modal-message {
  min-height: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.action-button.small {
  min-height: 32px;
  padding: 7px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.inline-select {
  min-width: 118px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.item-title {
  display: block;
  margin-top: 8px;
}

.client-notice {
  margin-bottom: 12px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .metric-grid,
  .metric-grid.two,
  .metric-grid.three,
  .metric-grid.four,
  .metric-grid.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid,
  .team-layout,
  .client-layout,
  .support-layout,
  .groups-console {
    grid-template-columns: 1fr;
  }

  .ai-form-row,
  .ai-preview-form {
    grid-template-columns: 1fr;
  }

  .operations-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .operation-add-button,
  .search-label {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .dashboard {
    padding: 24px 16px 36px;
  }

  .snapshot-header {
    grid-template-columns: 1fr;
  }

  .period-label,
  .period-value {
    text-align: left;
  }

  .period-panel {
    justify-items: start;
  }

  .period-controls {
    justify-content: flex-start;
  }

  .period-control-wrap {
    justify-items: start;
  }

  .client-modal-backdrop {
    align-items: end;
    padding: 14px;
  }

  .client-modal-panel {
    padding: 18px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions .action-button {
    width: 100%;
  }

  .brand-row {
    display: grid;
    gap: 8px;
  }

  .snapshot-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .snapshot-actions {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .metric-grid,
  .metric-grid.two,
  .metric-grid.three,
  .metric-grid.four,
  .metric-grid.five,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
