@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

/* Forum Stylesheet - Clean Dark Theme */

:root {
  --bg: #0f1115;
  --bg-elevated: #111828;
  --surface: #171a21;
  --surface-soft: #1f2430;
  --surface-strong: #23344d;
  --surface-glass: rgba(15, 17, 21, 0.84);
  --text: #e7ebf2;
  --muted: #a4adbd;
  --line: #2e3544;
  --line-soft: #394255;
  --primary: #18478f;
  --primary-strong: #1f53a3;
  --primary-soft: #1b2a43;
  --primary-hover: #1f53a3;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.18);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.2);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.2);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.24);
  --transition: 0.22s ease;
}

body.theme-light {
  --bg: #eef3fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f4f7fc;
  --surface-strong: #eef2f8;
  --surface-glass: rgba(255, 255, 255, 0.8);
  --text: #0f172a;
  --muted: #46556f;
  --line: #d6e0ed;
  --line-soft: #c8d4e5;
  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --primary-soft: #dbeafe;
  --primary-hover: #1e40af;
  --shadow: 0 20px 35px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 8px 18px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Sora", "Segoe UI", sans-serif;
  line-height: 1.62;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 110% -20%, rgba(24, 71, 143, 0.22), transparent 60%),
    radial-gradient(900px 500px at -20% -30%, rgba(24, 71, 143, 0.16), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, #0f1420 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), transparent 45%);
  z-index: -1;
}

a {
  color: #a8c5ff;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

a:hover {
  color: #d3e2ff;
}

.container {
  width: min(1220px, 93vw);
  margin: 0 auto;
}

main {
  min-height: calc(100vh - 206px);
  padding: 30px 0 62px;
}

main > * {
  animation: fade-in-up 0.5s ease backwards;
}

main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }

.forum-header {
  position: sticky;
  top: 0;
  z-index: 120;
  border-bottom: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.forum-logo {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.logo-subtitle {
  font-size: 0.77rem;
  color: var(--muted);
}

.forum-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.forum-nav a,
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 8px 13px;
}

.forum-nav a:hover,
.forum-nav a:focus-visible,
.nav-dropdown summary:hover,
.nav-dropdown summary:focus-visible,
.forum-nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-soft);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 188px;
  display: none;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 9px;
}

.nav-dropdown[open] .nav-dropdown-menu {
  display: flex;
  animation: fade-in-up 0.2s ease;
}

.nav-dropdown-menu a {
  border-radius: var(--radius-xs);
}

.profile-corner {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 6px 9px;
}

.profile-corner:hover {
  border-color: #5270a4;
  box-shadow: 0 0 0 3px rgba(24, 71, 143, 0.18);
  transform: translateY(-1px);
}

.profile-corner-avatar,
.profile-avatar,
.member-card-avatar,
.author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, #315fa9, var(--primary));
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.profile-corner-meta {
  display: grid;
  line-height: 1.2;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.section-title {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.page-hero,
.workflow-hero,
.profile-header,
.profile-hero,
.profile-cover,
.workflow-panel,
.profile-section,
.reply-form,
.topic-form,
.auth-form,
.admin-form,
.chat-shell,
.application-item,
.notification-item,
.member-card,
.conversation-item,
.pm-item,
.ticket-reply,
.post-item,
.admin-tag-card,
.tab-nav,
.admin-table,
.category-list,
.topic-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0)), var(--surface);
  box-shadow: var(--shadow-soft);
}

.page-hero,
.workflow-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px 18px;
}

.page-hero h1,
.workflow-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  letter-spacing: -0.02em;
}

.hero-kpis,
.profile-hero-actions,
.workflow-hero-meta,


.admin-table .actions,
.member-card-role,
.admin-tag-actions,
.topic-tags,
.profile-head-meta,
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-kpis {
  justify-content: flex-end;
}

.kpi-chip,
.badge,
.rank-badge,
.ticket-status,
.topic-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
}

.kpi-chip {
  background: var(--surface-soft);
  color: var(--text);
}

.quick-links-grid,
.forum-stats,
.profile-stats,
.profile-layout-clean,
.messages-layout,
.workflow-grid,
.members-grid,
.settings-grid,
.admin-tag-grid,
.profile-highlights {
  display: grid;
  gap: 12px;
}

.quick-links-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.quick-link-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)), var(--surface);
  color: var(--text);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.quick-link-card:hover {
  transform: translateY(-2px);
  border-color: #4f6896;
  background: linear-gradient(180deg, rgba(24, 71, 143, 0.12), rgba(24, 71, 143, 0.04)), var(--surface-soft);
}

.forum-stats,
.profile-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stat-box,
.profile-stat-box {
  padding: 14px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.stat-box:hover,
.profile-stat-box:hover {
  transform: translateY(-2px);
  border-color: #4b638f;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.workflow-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.workflow-grid-ticket-detail {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.workflow-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--surface);
  padding: 14px;
}

.workflow-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 9px;
}

.workflow-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.workflow-form {
  display: grid;
  gap: 10px;
}

.workflow-review-form,
.workflow-reply-form {
  margin-top: 8px;
}

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

.workflow-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  padding: 11px;
  display: grid;
  gap: 6px;
}

.workflow-item p {
  margin: 0;
}

.workflow-item-head,
.workflow-item-foot,
.post-header,
.pm-head,
.chat-header,
.application-head,
.ticket-reply-head,
.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.workflow-item-foot .btn {
  flex-shrink: 0;
}

.workflow-item strong {
  line-height: 1.35;
}

.workflow-panel-divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.breadcrumb {
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--text);
}

.text-muted,
.page-info,
.post-date,
.post-permalink,
.post-edited,
.last-time,
.auth-link,
.reply-prompt,
.workflow-hero p,
.workflow-item p,
.ticket-reply-body,
.profile-info p,
.category-info p,
.topic-meta,
.category-last,
.topic-last,
.category-stats,
.topic-stats,
.last-user {
  color: var(--muted);
}

.empty-state,
.reply-prompt {
  text-align: center;
  padding: 42px 16px;
}

.category-list,
.topic-list,
.admin-table,
.chat-shell {
  overflow: hidden;
}

.category-item,
.topic-item {
  display: grid;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)), var(--surface);
  padding: 16px;
  transition: background var(--transition);
}

.category-item {
  grid-template-columns: 1fr 150px 225px;
}

.category-item:last-child,
.topic-item:last-child,
.profile-list li:last-child {
  border-bottom: none;
}

.category-item:hover,
.topic-item:hover,
.member-card:hover,
.conversation-item-active,
.pm-item-self,
.ticket-reply-staff {
  background: linear-gradient(180deg, rgba(24, 71, 143, 0.12), rgba(24, 71, 143, 0.04)), var(--surface-soft);
}

.category-main,
.topic-main,
.profile-identity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.category-icon,
.topic-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--muted);
}

.category-info h3,
.topic-info h3 {
  margin-bottom: 4px;
  font-size: 1.04rem;
}

.category-stats,
.topic-stats {
  text-align: center;
}

.category-stats span,
.topic-stats span {
  display: block;
}

.last-topic {
  color: var(--text);
  display: block;
}

.no-posts {
  font-style: italic;
}

.topic-list-header,
.topic-item {
  display: grid;
  grid-template-columns: 1fr 95px 200px;
  gap: 14px;
  align-items: center;
}

.topic-list-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 16px;
}

.topic-item {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)), var(--surface);
  padding: 14px 16px;
}

.topic-item.pinned {
  background: linear-gradient(90deg, rgba(24, 71, 143, 0.22), transparent 70%);
}

.topic-title-col,
.topic-stats-col,
.topic-last-col {
  min-width: 0;
}

.topic-tag {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
}

.badge {
  color: #fff;
}

.badge-owner { background: #ef4444; }
.badge-admin { background: #f97316; }
.badge-support-staff { background: #2563eb; }
.badge-pinned { background: #1d4ed8; }
.badge-locked { background: #d97706; }

.rank-badge {
  border: 1px solid currentColor;
  color: #dbe8ff;
  background: rgba(24, 71, 143, 0.14);
}

.ticket-status-open {
  background: #2e8b03c0;
  color: #ffffff;
}

.ticket-status-in_progress {
  background: #04a3d3a2;
  color: #ffffff;
}

.ticket-status-closed {
  background: #9b0303;
  color: #ffffff;
}

.post-list {
  margin-bottom: 22px;
}

.post-item {
  display: flex;
  margin-bottom: 14px;
  overflow: hidden;
}

.post-sidebar {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 71, 143, 0.08), rgba(24, 71, 143, 0.02)), var(--surface-strong);
  padding: 18px;
}

.post-author {
  text-align: center;
}

.author-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
}

.author-name {
  display: block;
  font-weight: 700;
}

.author-posts {
  color: var(--muted);
  font-size: 0.82rem;
}

.post-content {
  flex: 1;
  min-width: 0;
  padding: 18px;
}

.post-body,
.pm-content,
.ticket-reply-body {
  line-height: 1.74;
  word-break: break-word;
}

.post-edited {
  margin-top: 12px;
  font-style: italic;
}

.post-image-wrap {
  margin-top: 10px;
}

.post-image,
.profile-banner-preview {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-image {
  max-height: 420px;
}

.profile-banner-preview {
  max-height: 220px;
}

.profile-cover {
  position: relative;
  overflow: hidden;
  border: 1px solid #314b73;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(24, 71, 143, 0.18), rgba(24, 71, 143, 0.05) 45%, rgba(23, 26, 33, 0.95));
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 14px;
}

.profile-cover-grid {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
}

.profile-avatar-xl {
  width: 68px;
  height: 68px;
  border: 2px solid #486591;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.profile-info h1 {
  font-size: 1.35rem;
  margin-bottom: 2px;
  letter-spacing: -0.03em;
}

.profile-info p {
  margin-top: 3px;
  color: var(--muted);
}

.profile-kv {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-kv span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(110, 134, 173, 0.35);
  background: rgba(16, 24, 39, 0.52);
  color: #d7e3fa;
  font-size: 0.74rem;
  padding: 4px 9px;
}

.profile-hero-actions {
  min-width: 170px;
  justify-content: flex-end;
}

.profile-highlights {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-highlight-card {
  border: 1px solid rgba(110, 134, 173, 0.45);
  border-radius: 12px;
  background: rgba(11, 17, 30, 0.58);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.highlight-label {
  color: #9eb2d3;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.highlight-value {
  color: #f4f8ff;
  font-size: 1rem;
  font-weight: 700;
}

.profile-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(115, 136, 172, 0.25);
}

.profile-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3a77dd, #7da8ee);
}

.profile-layout-clean {
  grid-template-columns: minmax(0, 1fr) 260px;
}

.profile-section {
  padding: 14px;
}

.profile-section h2 {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-size: 1.08rem;
}

.profile-section-head h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-list {
  list-style: none;
}

.profile-list li {
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}

.profile-list li:last-child {
  border-bottom: none;
}

.profile-list-rich li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-list-main {
  display: grid;
  gap: 2px;
}

.profile-list-time {
  white-space: nowrap;
}

.edit-profile-shell {
  max-width: 880px;
  margin: 0 auto;
}

.edit-profile-avatar-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-edit-banner {
  margin-bottom: 14px;
}

.profile-banner-placeholder {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
}

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

.settings-copy {
  margin-bottom: 10px;
}

.settings-logout-wrap {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-tabs {
  margin-top: 16px;
}

.tab-nav {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  padding: 11px 14px;
}

.tab-btn.active {
  color: #fff;
  background: var(--primary);
}

.tab-btn:hover:not(.active) {
  color: var(--text);
  background: var(--surface-soft);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fade-in-up 0.3s ease;
}

.admin-form {
  margin-bottom: 16px;
  padding: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem;
  padding: 10px 12px;
}

.admin-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-table .actions {
  justify-content: flex-start;
}

.admin-tag-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.admin-tag-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-tag-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.messages-layout {
  grid-template-columns: 350px 1fr;
}

.conversation-list,
.notification-list,
.application-list,
.ticket-replies,
.quick-actions,
.profile-content,
.profile-sidebar-clean,
.members-search {
  display: grid;
  gap: 12px;
}

.conversation-item,
.pm-item,
.notification-item,
.application-item,
.ticket-reply,
.member-card {
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.conversation-item:hover,
.pm-item:hover,
.notification-item:hover,
.application-item:hover,
.ticket-reply:hover,
.member-card:hover {
  transform: translateY(-1px);
}

.notification-unread,
.conversation-item-active,
.ticket-reply-staff,
.pm-item-self {
  border-color: #4e77be;
  background: rgba(24, 71, 143, 0.17);
}

.pm-thread,
.chat-messages {
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-shell {
  max-width: 880px;
  margin: 10px auto 0;
}

.chat-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 12px 14px;
}

.chat-messages {
  height: 430px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.chat-row {
  display: flex;
}

.chat-row-user {
  justify-content: flex-end;
}

.chat-row-bot {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 76%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.chat-row-user .chat-bubble {
  border-color: #4f73b4;
  background: #22395f;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.members-search {
  margin-bottom: 0;
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.members-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.members-empty {
  grid-column: 1 / -1;
  text-align: center;
}

.members-search input {
  min-width: 0;
}

.members-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  text-decoration: none;
}

.member-card strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.member-card-avatar {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.member-card-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.member-card-body .text-muted {
  font-size: 0.8rem;
}

.profile {
  max-width: 860px;
  margin: 0 auto;
}

.profile-header,
.profile-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0)), var(--surface);
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
  padding: 22px;
}

.profile-cover {
  position: relative;
  overflow: hidden;
  border: 1px solid #314b73;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(24, 71, 143, 0.18), rgba(24, 71, 143, 0.05) 45%, rgba(23, 26, 33, 0.95));
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 14px;
}

.profile-cover-grid {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
}

.profile-avatar-xl {
  width: 68px;
  height: 68px;
  border: 2px solid #486591;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.profile-info h1 {
  font-size: 1.35rem;
  margin-bottom: 2px;
  letter-spacing: -0.03em;
}

.profile-info p {
  margin-top: 3px;
  color: var(--muted);
}

.profile-highlights {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-highlight-card {
  border: 1px solid rgba(110, 134, 173, 0.45);
  border-radius: 12px;
  background: rgba(11, 17, 30, 0.58);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.highlight-label {
  color: #9eb2d3;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.highlight-value {
  color: #f4f8ff;
  font-size: 1rem;
  font-weight: 700;
}

.profile-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(115, 136, 172, 0.25);
}

.profile-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3a77dd, #7da8ee);
}

.profile-layout-clean {
  grid-template-columns: minmax(0, 1fr) 260px;
}

.profile-section h2 {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-size: 1.08rem;
}

.profile-list {
  list-style: none;
}

.profile-list li {
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}

.profile-list li:last-child {
  border-bottom: none;
}

.profile-list-rich li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-list-main {
  display: grid;
  gap: 2px;
}

.profile-list-time {
  white-space: nowrap;
}

.edit-profile-shell {
  max-width: 880px;
  margin: 0 auto;
}

.edit-profile-avatar-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-edit-banner {
  margin-bottom: 14px;
}

.profile-banner-placeholder {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select,
.members-search input,
.chat-form input,
.inline-user-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 10px 12px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.chat-form input:focus,
.members-search input:focus {
  outline: none;
  border-color: #4e77be;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  padding: 9px 14px;
  transition: transform var(--transition), border-color var(--transition), filter var(--transition), background var(--transition), box-shadow var(--transition);
}

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

.btn-primary {
  color: #fff;
  border-color: #375f9f;
  background: linear-gradient(180deg, #2259af, var(--primary));
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-secondary {
  color: var(--text);
  border-color: #44536f;
  background: var(--surface-soft);
}

.btn-secondary:hover {
  border-color: #637797;
  background: #28364e;
}

.btn-danger {
  color: #fff;
  border-color: #b91c1c;
  background: #dc2626;
}

.btn-danger:hover {
  filter: brightness(1.06);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 6px 10px;
}

.alert {
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
}

.alert-error {
  border: 1px solid #dc2626;
  background: var(--danger-soft);
  color: #fecaca;
}

.alert-success {
  border: 1px solid #16a34a;
  background: var(--success-soft);
  color: #bbf7d0;
}

.auth-form {
  max-width: 540px;
  margin: 24px auto;
  padding: 24px;
}

.auth-form h1 {
  margin-bottom: 14px;
}

.auth-link {
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
}

.otp-inputs {
  max-width: 360px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.otp-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.otp-input:focus {
  outline: none;
  border-color: #4e77be;
  box-shadow: 0 0 0 3px var(--primary-glow);
  transform: translateY(-1px);
}

.pagination {
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-action {
  display: inline;
}

.topic-header,
.category-header {
  margin-bottom: 14px;
}

.topic-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title actions"
    "tags actions";
  align-items: center;
  gap: 10px 12px;
}

.topic-header h1 {
  grid-area: title;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}

.topic-header .topic-tags {
  grid-area: tags;
  margin: 0;
}

.topic-header .topic-actions {
  grid-area: actions;
  justify-self: end;
}

.forum-stats .stat-box:last-child {
  display: grid;
  place-content: center;
}

.forum-stats .stat-box:last-child .stat-label {
  font-size: 0.88rem;
  line-height: 1.4;
}

.category-desc {
  color: var(--muted);
}

.staff-channel-note {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.staff-channel-badge {
  display: inline-flex;
}

.settings-logout-wrap {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.forum-footer {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
  padding: 22px 0 28px;
}

.forum-footer p {
  margin-bottom: 4px;
}

.forum-footer a {
  color: #aac8ff;
}

.forum-footer a:hover {
  color: #d6e5ff;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1120px) {
  .quick-links-grid {
    grid-template-columns: 1fr 1fr;
  }

  .workflow-grid,
  .workflow-grid-ticket-detail {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .messages-layout,
  .profile-layout-clean,
  .profile-cover-grid {
    grid-template-columns: 1fr;
  }

  .profile-cover-grid {
    display: grid;
  }

  .profile-highlights {
    grid-template-columns: 1fr;
  }

  .profile-header,
  .profile-hero {
    flex-direction: column;
  }

  .members-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-hero,
  .workflow-hero,
  .category-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-kpis,
  .workflow-hero-meta {
    justify-content: flex-start;
  }

  .profile-sidebar-clean {
    order: -1;
  }

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

  .category-item {
    grid-template-columns: 1fr;
  }

  .category-stats,
  .category-last {
    text-align: left;
    padding-left: 44px;
  }

  .topic-list-header {
    display: none;
  }

  .topic-item {
    grid-template-columns: 1fr;
  }

  .topic-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "tags"
      "actions";
  }

  .topic-header .topic-actions {
    justify-self: start;
  }

  .topic-stats,
  .topic-last,
  .topic-stats-col,
  .topic-last-col {
    display: none;
  }

  .post-item {
    flex-direction: column;
  }

  .post-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 768px) {
  .header-inner,
  .header-right {
    flex-direction: column;
    align-items: stretch;
  }

  .forum-nav {
    justify-content: center;
  }

  .profile-corner {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .tab-nav {
    flex-direction: column;
  }

  .chat-bubble {
    max-width: 90%;
  }

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

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .members-search {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .profile-avatar-xl {
    width: 88px;
    height: 88px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(1220px, 95vw);
  }

  .forum-nav a,
  .nav-dropdown summary {
    font-size: 0.84rem;
    padding: 7px 10px;
  }

  .forum-stats,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .auth-form,
  .admin-form,
  .profile-section,
  .post-content,
  .post-sidebar {
    padding: 14px;
  }

  .otp-inputs {
    gap: 6px;
  }

  .otp-input {
    min-height: 44px;
    font-size: 0.98rem;
  }
}
