:root {
  --bg: #fbfbfb;
  --surface: #ffffff;
  --surface-muted: #f4f4f4;
  --border: #e5e7eb;
  --border-soft: #d9d9d9;
  --text: #111827;
  --text-muted: #6b7280;
  --text-soft: #a1a1aa;

  --primary: #4f46e5;
  --primary-2: #7c3aed;

  --success-bg: #f0fdf4;
  --success-text: #15803d;
  --success-border: #bbf7d0;

  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  --danger-border: #fee2e2;

  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --container: 1360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-width: 320px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 15px;
  flex-wrap: wrap;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.btn,
button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  min-height: 40px;
  padding: 8px 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.btn:hover,
button:hover {
  opacity: 0.95;
}

.btn:active,
button:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-sm {
  min-width: 140px;
}

.logout-form {
  margin: 0;
}

.grid-top {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stack {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  flex: 0 0 auto;
  font-size: 16px;
}

.audience-wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: center;
}

.audience-total {
  font-size: 80px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}

.audience-subtitle {
  color: var(--text-soft);
  font-size: 16px;
  margin-bottom: 20px;
}

.audience-illustration {
  min-height: 140px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 35%, rgba(124, 58, 237, 0.7), rgba(124, 58, 237, 0) 34%),
    radial-gradient(circle at 28% 44%, rgba(124, 58, 237, 0.22), rgba(124, 58, 237, 0) 16%),
    radial-gradient(circle at 72% 44%, rgba(124, 58, 237, 0.22), rgba(124, 58, 237, 0) 16%),
    radial-gradient(ellipse at 50% 78%, rgba(124, 58, 237, 0.16), rgba(124, 58, 237, 0) 38%);
  position: relative;
}

.audience-illustration::before,
.audience-illustration::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.28), rgba(79, 70, 229, 0.05));
}

.audience-illustration::before {
  width: 94px;
  height: 94px;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
}

.audience-illustration::after {
  width: 180px;
  height: 34px;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
}

.audience-illustration {
  display: none;
}

.progress-group {
  display: grid;
  gap: 18px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 15px;
}

.progress-label-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.progress-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--primary);
}

.progress-dot.gray {
  background: #bdbdbd;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #ededed;
  border-radius: 999px;
  overflow: hidden;
}

.progress-value {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.progress-value.gray {
  background: #bdbdbd;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.input,
textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  outline: none;
}

textarea {
  min-height: 194px;
  resize: vertical;
}

.input:focus,
textarea:focus,
input:focus,
select:focus {
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.input-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.section-card {
  margin-bottom: 20px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
}

.table th,
.table td {
  text-align: left;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 15px;
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.table-stat {
  white-space: nowrap;
  font-weight: 400;
}

.stat-good {
  color: var(--success-text);
}

.stat-bad {
  color: var(--danger-text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.badge-neutral {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border);
}

.table-title {
  font-weight: 400;
  color: var(--text);
}

.table-sub {
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 6px;
}

.section-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.admin-users-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
}

.form-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface);
}

.empty {
  color: var(--text-muted);
  font-size: 15px;
}

.mobile-list {
  display: none;
}

.muted {
  color: var(--text-muted);
}

.page-title-mobile {
  display: none;
}

@media (max-width: 980px) {
  .grid-top,
  .admin-users-grid,
  .audience-wrap {
    grid-template-columns: 1fr;
  }

  .audience-illustration {
    min-height: 110px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    font-size: 28px;
    font-weight: 800;
  }

  .page-title-mobile {
    display: block;
  }

  .userbox {
    justify-content: flex-end;
    font-size: 13px;
  }

  .card {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .card-title {
    font-size: 15px;
    margin-bottom: 14px;
  }

  .audience-total {
    font-size: 64px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  textarea {
    min-height: 220px;
    font-size: 16px;
  }

  .form-actions .btn,
  .form-actions button {
    width: 100%;
  }

  .desktop-table {
    display: none;
  }

  .mobile-list {
    display: grid;
    gap: 12px;
  }

  .mobile-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: var(--surface);
  }

  .mobile-item-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    align-items: flex-start;
  }

  .mobile-item-row:last-child {
    margin-bottom: 0;
  }

  .mobile-item-label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    min-width: 92px;
    flex: 0 0 92px;
  }

  .mobile-item-value {
    flex: 1 1 auto;
    text-align: right;
    word-break: break-word;
  }

  .section-footer {
    font-size: 13px;
  }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.modal-text {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text);
}

button.text-preview-button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  min-height: auto;
  box-shadow: none;
  text-align: left;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

.text-preview-button:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 768px) {
 .admin-user-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

  .admin-user-actions form,
  .admin-user-actions button {
    width: 100%;
  }
}
