:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef2f7;
  --text: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --primary: #5b45e0;
  --primary-hover: #4834c4;
  --primary-soft: #efedff;
  --success: #16825d;
  --success-soft: #eaf8f2;
  --warning: #b54708;
  --warning-soft: #fff4e5;
  --danger: #c4320a;
  --danger-soft: #fff0eb;
  --info: #175cd3;
  --info-soft: #eff6ff;
  --sidebar: #101828;
  --sidebar-muted: #98a2b3;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.10);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(91, 69, 224, 0.2);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.muted-text {
  color: var(--text-muted);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 16px;
  background: var(--sidebar);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 8px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #7f6cf2, #5b45e0);
  box-shadow: 0 8px 18px rgba(91, 69, 224, 0.32);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 34px;
}

.tab-btn {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d0d5dd;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.tab-btn.active {
  background: rgba(127, 108, 242, 0.18);
  color: #fff;
}

.tab-btn:active {
  transform: translateY(1px);
}

.nav-icon {
  display: inline-flex;
  width: 24px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f04438;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note strong,
.sidebar-note small {
  display: block;
}

.sidebar-note strong {
  font-size: 12px;
}

.sidebar-note small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 11px;
  line-height: 1.35;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #32d583;
  box-shadow: 0 0 0 4px rgba(50, 213, 131, 0.12);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions,
.auth-info {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 12px;
}

.topbar h1 {
  font-size: 21px;
  letter-spacing: -0.02em;
}

.topbar p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 10px;
}

.last-updated {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.auth-info {
  gap: 8px;
  padding-left: 4px;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.auth-avatar {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-email {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-btn {
  display: none !important;
}

.content {
  padding: 28px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: paneIn 180ms ease;
}

@keyframes paneIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.section-heading p {
  max-width: 680px;
  margin-top: 6px;
  color: var(--text-muted);
}

.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn,
.icon-btn,
.link-btn {
  border: 0;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 12px rgba(91, 69, 224, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-soft);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-info {
  background: var(--info);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
}

.btn-danger.btn-ghost {
  border-color: #fecdca;
  color: var(--danger);
}

.btn-sm {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-icon span {
  display: inline;
}

.icon-btn {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-secondary);
}

.link-btn {
  padding: 4px;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

.link-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--surface-muted);
  content: "";
  opacity: 0.6;
}

.metric-card-accent {
  border-color: transparent;
  background: linear-gradient(145deg, #5b45e0, #745ee8);
  color: #fff;
}

.metric-card-accent::after {
  background: rgba(255, 255, 255, 0.13);
}

.metric-label,
.metric-card strong,
.metric-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.metric-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card-accent .metric-label,
.metric-card-accent small {
  color: rgba(255, 255, 255, 0.78);
}

.metric-card strong {
  margin-top: 13px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.metric-card small {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 16px;
}

.panel-header p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.panel-table {
  overflow: hidden;
}

.attention-list,
.format-summary {
  min-height: 210px;
  padding: 14px 20px 20px;
}

.attention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 900;
}

.attention-main {
  min-width: 0;
  flex: 1;
}

.attention-main strong,
.attention-main span {
  display: block;
}

.attention-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-main span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.format-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.format-row:last-child {
  border-bottom: 0;
}

.format-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.format-row-head span {
  color: var(--text-muted);
  font-size: 12px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.progress.success > span {
  background: var(--success);
}

.skeleton-block {
  color: var(--text-muted);
}

.empty-state {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text-secondary);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-toolbar {
  flex-wrap: wrap;
}

.filter-toolbar select,
.support-list-header select {
  min-height: 40px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-secondary);
}

.search-field {
  display: flex;
  min-width: 250px;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-muted);
}

.search-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 69, 224, 0.1);
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field-wide {
  min-width: min(440px, 100%);
}

.filter-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fcfcfd;
}

.compact-table th,
.compact-table td {
  padding-top: 11px;
  padding-bottom: 11px;
}

.table-primary {
  color: var(--text);
  font-weight: 700;
}

.table-secondary {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.75;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-muted); color: var(--text-secondary); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.type-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.type-badge.competitive {
  background: var(--info-soft);
  color: var(--info);
}

.row-actions {
  display: flex;
  min-width: 180px;
  flex-wrap: wrap;
  gap: 6px;
}

.action-menu {
  position: relative;
}

.operation-complete {
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 12px;
}

.notice-warning {
  border-color: #fedf89;
  background: var(--warning-soft);
  color: #7a2e0e;
}

.notice-neutral {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.finance-metrics {
  margin-top: 18px;
}

.support-container {
  display: grid;
  min-height: 650px;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
}

.support-tickets-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
}

.support-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.support-list-header h3 {
  font-size: 16px;
}

.support-search {
  min-width: 0;
  margin: 12px;
  background: var(--surface);
}

.tickets-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.ticket-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 140ms ease;
}

.ticket-item:hover {
  background: var(--surface);
}

.ticket-item.active {
  box-shadow: inset 3px 0 0 var(--primary);
  background: var(--primary-soft);
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ticket-user-link {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-user-link:hover {
  color: var(--primary);
}

.ticket-preview {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ticket-meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.support-chat {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.chat-header {
  min-height: 66px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 800;
}

.chat-header small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.chat-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fcfcfd;
}

.chat-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 13px;
}

.chat-message.user { align-items: flex-start; }
.chat-message.admin { align-items: flex-end; }

.message-bubble {
  max-width: min(74%, 620px);
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 13px 13px 13px 4px;
  background: var(--surface);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message.admin .message-bubble {
  border-color: transparent;
  border-radius: 13px 13px 4px 13px;
  background: var(--primary);
  color: #fff;
}

.message-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.chat-composer textarea {
  min-height: 76px;
  flex: 1;
  resize: vertical;
}

.chat-actions {
  padding: 0 18px 14px;
  text-align: right;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(16, 24, 40, 0.62);
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  animation: modalFade 160ms ease;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.28);
}

.modal-small { max-width: 500px; }
.modal-medium { max-width: 680px; }
.modal-wide { max-width: 1180px; }
.modal-login { max-width: 430px; }

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.close-btn:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.modal-heading {
  margin-bottom: 20px;
  padding-right: 30px;
}

.modal-heading h2 {
  margin-top: 4px;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.modal-heading p {
  margin-top: 5px;
  color: var(--text-muted);
}

.centered {
  padding-right: 0;
  text-align: center;
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(91, 69, 224, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-muted);
  cursor: not-allowed;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.challenge-preview {
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 12px;
}

.challenge-preview strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.modal-actions-centered {
  justify-content: center;
}

.confirm-symbol {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 22px;
  font-weight: 900;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mini-metric {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.mini-metric span,
.mini-metric strong {
  display: block;
}

.mini-metric span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-metric strong {
  margin-top: 4px;
  font-size: 18px;
}

.participant-highlight td {
  background: #fffaeb !important;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.step-row.success {
  border-color: #abefc6;
  background: var(--success-soft);
}

.step-row.fail {
  border-color: #fecdca;
  background: var(--danger-soft);
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.profile-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.profile-card span,
.profile-card strong {
  display: block;
}

.profile-card span {
  color: var(--text-muted);
  font-size: 11px;
}

.profile-card strong {
  overflow: hidden;
  margin-top: 5px;
  text-overflow: ellipsis;
}

.profile-section {
  margin-top: 20px;
}

.profile-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.details-list {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.details-list dt {
  color: var(--text-muted);
}

.details-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.audit-details {
  display: block;
  max-width: 540px;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-secondary);
  pointer-events: auto;
  animation: toastIn 180ms ease;
}

.toast::before {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  content: "i";
  font-size: 11px;
  font-weight: 900;
}

.toast-success { border-color: #abefc6; }
.toast-success::before { background: var(--success-soft); color: var(--success); content: "✓"; }
.toast-error { border-color: #fecdca; }
.toast-error::before { background: var(--danger-soft); color: var(--danger); content: "!"; }
.toast-warning { border-color: #fedf89; }
.toast-warning::before { background: var(--warning-soft); color: var(--warning); content: "!"; }
.toast-info { border-color: #b2ddff; }
.toast-info::before { background: var(--info-soft); color: var(--info); }
.toast.hide { opacity: 0; transform: translateX(20px); transition: 180ms ease; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.access-denied {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
}

.access-denied h1 {
  color: var(--danger);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(16, 24, 40, 0.48);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .support-container {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .topbar p,
  .last-updated,
  .auth-email,
  .btn-icon span {
    display: none;
  }

  .auth-user {
    padding: 5px;
  }

  .content {
    padding: 18px 14px 28px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .section-heading > .btn {
    width: 100%;
  }

  .metric-grid,
  .mini-metrics,
  .profile-summary {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 126px;
  }

  .support-container {
    min-height: 760px;
    grid-template-columns: 1fr;
  }

  .support-tickets-list {
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .filter-toolbar > *,
  .search-field,
  .search-field-wide {
    width: 100%;
    min-width: 0;
  }

  .filter-count {
    margin-left: 0;
  }

  .form-grid,
  .steps-grid,
  .details-list {
    grid-template-columns: 1fr;
  }

  .details-list {
    gap: 3px;
  }

  .details-list dd {
    margin-bottom: 8px;
  }

  .modal {
    padding: 8px;
  }

  .modal-content {
    max-height: calc(100vh - 16px);
    padding: 22px 16px;
    border-radius: 14px;
  }

  .message-bubble {
    max-width: 88%;
  }
}

@media (max-width: 480px) {
  .metric-grid,
  .mini-metrics,
  .profile-summary {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .btn {
    padding-right: 11px;
    padding-left: 11px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

/* ===== Marafon Admin v3 additions ===== */
.small-code {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface-soft, #f2f4f7);
  font-size: 11px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 18px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #475467);
}

.check-row input,
.check-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #6941c6);
}

.check-card {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 12px;
  cursor: pointer;
  background: var(--surface, #fff);
}

.check-card span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.check-card small {
  color: var(--text-muted, #667085);
}

.system-grid {
  align-items: start;
}

.inline-admin-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 12px;
  background: var(--surface-soft, #f9fafb);
}

.admin-item > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.admin-item > div:first-child span {
  overflow: hidden;
  color: var(--text-muted, #667085);
  font-size: 11px;
  text-overflow: ellipsis;
}

.admin-item > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

#closeChallengePreview .mini-metrics {
  margin-bottom: 14px;
}

#closeChallengePreview .mini-metrics > div {
  min-width: 120px;
}

.permission-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .inline-admin-form {
    grid-template-columns: 1fr 1fr;
  }

  .check-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .inline-admin-form {
    grid-template-columns: 1fr;
  }

  .admin-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-item > div:last-child {
    justify-content: flex-start;
  }
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.analytics-item {
  padding: 16px;
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 14px;
  background: var(--surface-soft, #f9fafb);
}

.analytics-item span,
.analytics-item small {
  display: block;
  color: var(--text-muted, #667085);
}

.analytics-item strong {
  display: block;
  margin: 7px 0 3px;
  font-size: 24px;
}

@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .analytics-grid { grid-template-columns: 1fr; }
}


/* Marafon Admin v3 Lite */
.lite-hidden { display: none !important; }
.lite-mode-banner { margin-bottom: 20px; border-left: 4px solid currentColor; }

/* v3.2 — совместимость Android и история марафона */
.compatibility-repair-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.compatibility-repair-box > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.compatibility-repair-box span {
  color: var(--text-muted);
  font-size: 12px;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.history-summary-grid > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}

.history-summary-grid span,
.history-summary-grid strong {
  display: block;
}

.history-summary-grid span {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.history-summary-grid strong {
  overflow-wrap: anywhere;
}

.history-table-wrapper {
  max-height: 430px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.history-table-wrapper table {
  min-width: 920px;
}

@media (max-width: 820px) {
  .compatibility-repair-box {
    align-items: stretch;
    flex-direction: column;
  }

  .history-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .history-summary-grid {
    grid-template-columns: 1fr;
  }
}


/* v3.3: copyable challenge IDs and administrator identity */
.copy-id-btn {
  display: inline-flex;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.copy-id-btn:hover {
  color: var(--primary-hover);
  text-decoration-style: solid;
}

.history-identity-meta {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* v3.4: поддержка — имя открывает тикет, профиль вынесен в отдельную кнопку */
.ticket-user-name {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.ticket-meta-row .ticket-meta {
  min-width: 0;
  margin-top: 0;
}

.ticket-profile-link {
  flex: 0 0 auto;
  font-size: 11px;
}

.ticket-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.ticket-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.ticket-open-link {
  font-size: 11px;
  font-weight: 800;
}

/* v3.5 — расширенная работа с пользователями */
.filter-toolbar {
  position: sticky;
  top: 76px;
  z-index: 12;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  backdrop-filter: blur(10px);
}

.table-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.column-hidden { display: none !important; }

.view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 10px;
  background: var(--surface-soft, #f5f7fa);
}

.view-switch-btn {
  border: 0;
  background: transparent;
  color: var(--muted, #667085);
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.view-switch-btn.active {
  background: var(--surface, #fff);
  color: var(--text, #101828);
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}

.column-picker { position: relative; }
.column-picker > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  user-select: none;
}
.column-picker > summary::-webkit-details-marker { display: none; }
.column-picker-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 210px;
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 45px rgba(16, 24, 40, .16);
}
.column-picker-menu label {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.column-picker-menu label:hover { background: var(--surface-soft, #f5f7fa); }

.user-row { cursor: pointer; transition: background .15s ease, transform .15s ease; }
.user-row:hover { background: rgba(99, 91, 255, .045); }
.user-row-blocked { background: rgba(217, 45, 32, .035); }
.user-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.users-detailed tbody td { padding-top: 16px; padding-bottom: 16px; }

.challenge-reference { min-width: 170px; display: grid; gap: 3px; align-content: start; }
.challenge-reference .full-id { overflow-wrap: anywhere; }
.challenge-reference-missing { color: var(--danger, #d92d20); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 3px; }

.action-menu { position: relative; }
.action-menu > summary {
  list-style: none;
  width: 34px;
  height: 32px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 235px;
  display: grid;
  padding: 7px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 45px rgba(16, 24, 40, .18);
}
.action-menu-list button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #101828);
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.action-menu-list button:hover { background: var(--surface-soft, #f5f7fa); }
.user-row-actions { flex-wrap: nowrap; }

.modal-right { align-items: stretch; justify-content: flex-end; padding: 0; }
.modal-right .modal-drawer {
  width: min(1120px, 88vw);
  max-width: none;
  min-height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 22px 0 0 22px;
  animation: drawerIn .22s ease-out;
}
@keyframes drawerIn { from { transform: translateX(36px); opacity: .65; } to { transform: translateX(0); opacity: 1; } }

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 91, 255, .08), rgba(14, 165, 233, .05));
}
.profile-hero > div:first-child { display: flex; align-items: center; gap: 14px; }
.profile-hero h3 { margin: 0 0 4px; font-size: 22px; }
.profile-hero span:not(.badge):not(.profile-avatar) { color: var(--muted, #667085); font-size: 13px; }
.profile-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #625bf6;
  color: #fff;
  font-size: 23px;
  font-weight: 800;
}
.profile-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.profile-tabs {
  position: sticky;
  top: -24px;
  z-index: 7;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 0 10px;
  margin: 8px 0 16px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #d8dee9);
}
.profile-tab-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted, #667085);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.profile-tab-btn span { margin-left: 4px; font-size: 11px; opacity: .7; }
.profile-tab-btn.active { background: rgba(99, 91, 255, .1); color: #5148d8; }
.profile-tab-pane { display: none; }
.profile-tab-pane.active { display: block; }
.profile-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-active-challenge { margin-bottom: 14px; }
.section-inline-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 14px; }
.section-inline-heading h3, .section-inline-heading p { margin: 0; }
.section-inline-heading p { margin-top: 4px; color: var(--muted, #667085); font-size: 13px; }

.change-history-list { display: grid; gap: 10px; }
.change-history-list.compact { margin-bottom: 12px; }
.change-history-item {
  display: grid;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 13px;
  background: var(--surface, #fff);
}
.change-history-item.expanded { padding: 16px; }
.change-history-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.change-history-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.change-history-head span, .change-history-head time, .change-meta { color: var(--muted, #667085); font-size: 12px; }
.change-history-item p { margin: 0; color: var(--muted, #667085); font-size: 13px; }
.value-diff { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.value-diff del, .value-diff ins { padding: 5px 8px; border-radius: 8px; text-decoration: none; overflow-wrap: anywhere; }
.value-diff del { background: rgba(217, 45, 32, .08); color: #b42318; }
.value-diff ins { background: rgba(3, 152, 85, .09); color: #027a48; }
.change-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.history-toolbar { top: 0; }

.change-preview { display: grid; gap: 7px; margin-top: 12px; }
.change-preview > div { display: grid; grid-template-columns: minmax(100px, .8fr) 1fr auto 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-soft, #f5f7fa); font-size: 13px; }
.change-preview del { color: #b42318; }
.change-preview ins { color: #027a48; text-decoration: none; font-weight: 700; }

.notes-list { display: grid; gap: 10px; }
.note-card { padding: 14px; border: 1px solid var(--border, #d8dee9); border-left: 4px solid #98a2b3; border-radius: 12px; background: var(--surface, #fff); }
.note-card > div { display: flex; justify-content: space-between; gap: 10px; }
.note-card p { white-space: pre-wrap; margin: 10px 0; }
.note-card time, .note-card small { color: var(--muted, #667085); font-size: 12px; }
.note-important { border-left-color: #f79009; }
.note-risk { border-left-color: #d92d20; }
.note-resolved { border-left-color: #039855; }

.timeline-list { position: relative; display: grid; gap: 0; margin-top: 12px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; min-height: 76px; }
.timeline-item::before { content: ''; position: absolute; left: 7px; width: 2px; height: 100%; background: var(--border, #d8dee9); }
.timeline-dot { position: relative; z-index: 1; width: 16px; height: 16px; margin-top: 4px; border: 4px solid var(--surface, #fff); border-radius: 50%; background: #625bf6; box-shadow: 0 0 0 1px #625bf6; }
.timeline-item > div { padding-bottom: 20px; }
.timeline-item > div > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.timeline-item p { margin: 6px 0; color: var(--muted, #667085); }
.timeline-item time { color: var(--muted, #667085); font-size: 12px; }

.empty-state.compact { padding: 20px; min-height: auto; }
.full-id { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .profile-two-columns { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; }
  .profile-quick-actions { justify-content: flex-start; }
  .modal-right .modal-drawer { width: 100vw; border-radius: 0; }
  .change-preview > div { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .filter-toolbar { top: 64px; }
  .view-switch, .column-picker { width: 100%; }
  .view-switch-btn { flex: 1; }
  .column-picker > summary { text-align: center; }
  .column-picker-menu { left: 0; right: auto; width: 100%; }
  .profile-summary { grid-template-columns: 1fr 1fr; }
  .profile-tabs { top: -16px; }
}
.action-grid { display: grid; grid-template-columns: auto repeat(4, 32px); align-items: center; gap: 6px; }
.icon-action-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-secondary); cursor: pointer; font-weight: 800; }
.icon-action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }


/* v3.5.1: диагностическое предупреждение о Firestore Rules */
.permission-warning {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #f0c36a;
  border-radius: 14px;
  background: #fff8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.permission-warning strong { display: block; margin-bottom: 4px; }
.permission-warning p { margin: 0 0 5px; color: #5f4a1f; }
.permission-warning small { color: #78633a; }
.permission-warning code { user-select: all; }
@media (max-width: 760px) {
  .permission-warning { align-items: stretch; flex-direction: column; }
}
