.messages-page {
  padding: 24px;
  min-height: 100%;
  background: var(--app-background);
}

.messages-page.mobile {
  padding: 16px 12px 80px;
}

.messages-card-title {
  margin: 0 !important;
}

.messages-toolbar-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.messages-toolbar-actions .ant-btn {
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(76, 111, 255, 0.08);
  transition: all 0.2s ease;
}

.messages-toolbar-actions .ant-btn:not(.ant-btn-primary) {
  color: var(--app-muted);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.72);
}

.messages-toolbar-actions .ant-btn:not(.ant-btn-primary):hover {
  color: var(--app-primary);
  background: rgba(76, 111, 255, 0.12);
  box-shadow: 0 6px 16px rgba(76, 111, 255, 0.12);
}

.messages-toolbar-actions .ant-btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
  box-shadow: 0 6px 16px rgba(76, 111, 255, 0.2);
}

.messages-toolbar-actions .ant-btn-primary:hover,
.messages-toolbar-actions .ant-btn-primary:focus {
  background: var(--app-primary-hover);
  border-color: var(--app-primary-hover);
}

.messages-group-select {
  width: 200px;
}

.messages-group-select.mobile {
  width: 120px;
}

.messages-clear-icon {
  color: var(--app-danger);
}

.messages-selection-bar {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--app-primary-soft);
  border-radius: 12px;
  border: 1px solid var(--app-border);
  box-shadow: 0 10px 24px rgba(76, 111, 255, 0.12);
  color: var(--app-muted);
}

.messages-selection-meta {
  color: inherit;
}

.messages-selection-count {
  font-weight: 600;
  color: var(--app-primary);
}

.messages-selection-link {
  padding: 0 4px !important;
  color: var(--app-primary-hover) !important;
}

.messages-selection-link:hover {
  background: transparent !important;
  color: var(--app-primary) !important;
  text-decoration: underline;
}

.messages-reply-card {
  margin-bottom: 16px;
  background: var(--app-accent-soft);
  border: 1px solid var(--app-border);
}

.messages-reply-text {
  margin: 8px 0 0 0 !important;
}

.messages-field-full {
  width: 100%;
}

.messages-progress-section {
  margin-bottom: 16px;
}

.messages-progress-loading {
  text-align: center;
  padding: 20px 0;
}

.messages-progress-loading-box {
  margin-bottom: 16px;
}

.messages-progress-icon {
  font-size: 24px;
  color: var(--app-primary);
  margin-bottom: 16px;
}

.messages-stat-grid {
  margin-bottom: 16px;
}

.messages-stat-grid .ant-card {
  border-radius: 14px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: 0 12px 28px rgba(76, 111, 255, 0.12);
}

.messages-stat-grid .ant-statistic-title {
  color: var(--app-muted-soft);
}

.messages-stat-grid .ant-statistic-content {
  color: var(--app-primary);
  font-weight: 600;
}

.messages-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--app-muted);
}

.messages-stat-icon {
  color: var(--app-primary);
  font-size: 14px;
}

.messages-stat-value {
  font-weight: 600;
}

.messages-reference-card {
  margin-bottom: 16px;
  background: var(--app-accent-soft);
  border: 1px solid var(--app-border);
}

.messages-reference-content {
  margin-top: 8px;
}

.messages-reference-text {
  margin: 4px 0 !important;
  color: var(--app-muted);
}

.messages-progress-panel {
  text-align: center;
  padding: 20px 0;
}

.messages-progress-panel > div:first-child {
  margin-bottom: 16px;
}

.messages-progress-icon-large {
  font-size: 48px;
  color: var(--app-danger);
  margin-bottom: 12px;
}

.messages-progress-text {
  color: var(--app-muted);
  font-size: 16px;
  margin-bottom: 8px;
}

.messages-progress-details {
  margin: 20px 0;
  color: var(--app-muted);
}

.messages-progress-alert {
  margin-top: 16px;
  padding: 12px;
  background: var(--app-danger-soft);
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--app-danger);
  font-size: 12px;
}

.messages-progress-alert strong {
  font-weight: 600;
}

.messages-progress-bar .ant-progress-bg {
  background: linear-gradient(90deg, #fda4af 0%, #f87171 100%) !important;
}

.messages-progress-bar .ant-progress-text {
  color: var(--app-danger) !important;
}

.messages-view-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--app-muted);
}

.messages-clear-caption {
  color: var(--app-muted);
  margin-bottom: 0;
}

.messages-progress-info {
  margin-top: 8px;
  color: var(--app-muted);
}

.messages-progress-info {
  color: var(--app-muted);
}

@media (max-width: 768px) {
  .messages-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .messages-toolbar-actions .ant-btn,
  .messages-toolbar-actions .ant-select {
    flex: 1;
  }

  .messages-group-select,
  .messages-group-select.mobile {
    width: 100%;
  }

  .messages-selection-bar {
    padding: 12px;
  }
}
