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

:root {
  --bg-dark: #07111f;
  --bg-surface: #0d1b2d;
  --bg-card: rgba(15, 26, 43, 0.88);
  --bg-card-hover: rgba(23, 39, 63, 0.96);
  --bg-soft: rgba(110, 231, 183, 0.08);
  --text-main: #e8f1ff;
  --text-muted: #8ea1bc;
  --text-soft: #b9c6da;
  --accent-primary: #2dd4bf;
  --accent-primary-deep: #14b8a6;
  --accent-secondary: #f97316;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-danger: #fb7185;
  --accent-info: #38bdf8;
  --border-color: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(96, 165, 250, 0.22);
  --shadow-main: 0 24px 70px rgba(2, 8, 23, 0.42);
  --shadow-soft: 0 16px 36px rgba(8, 15, 31, 0.24);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --font-display: 'Space Grotesk', 'Instrument Sans', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --sidebar-width: 254px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.13), transparent 26%),
    linear-gradient(180deg, #07111f 0%, #091728 44%, #06111d 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

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

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: rgba(8, 16, 30, 0.94);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  backdrop-filter: blur(18px);
  padding: 1.35rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 120;
  overflow-y: auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.25rem 0.55rem 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.24), rgba(56, 189, 248, 0.18));
  color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.18);
  flex-shrink: 0;
}

.brand-logo-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.brand-logo-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.brand-logo-subtitle {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.78rem 0.88rem;
  border-radius: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(23, 39, 63, 0.78);
  border-color: rgba(148, 163, 184, 0.12);
  transform: translateX(2px);
}

.nav-link.active {
  color: #f8fffe;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(20, 184, 166, 0.14));
  border-color: rgba(45, 212, 191, 0.28);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.08);
}

.nav-link i {
  width: 1rem;
  text-align: center;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(18px);
}

.header-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(34, 197, 94, 0.1);
  color: #9cf7c0;
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  background: rgba(15, 26, 43, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.workspace-switcher i {
  color: var(--accent-primary);
}

.workspace-switcher select {
  min-width: 220px;
  border: none;
  background: transparent;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.profile-panel {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.45rem 0.5rem 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(15, 26, 43, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.profile-copy {
  text-align: right;
}

.profile-name {
  font-weight: 700;
  color: var(--text-main);
}

.profile-role {
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #08131f;
  background: linear-gradient(135deg, #2dd4bf 0%, #38bdf8 100%);
  box-shadow: 0 12px 24px rgba(45, 212, 191, 0.25);
}

.content-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
  gap: 1rem;
}

.hero-panel,
.hero-sidecard,
.table-card,
.stat-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
}

.hero-panel {
  overflow: hidden;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.15), transparent 28%),
    linear-gradient(135deg, rgba(15, 26, 43, 0.96), rgba(10, 19, 34, 0.92));
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: auto 1.25rem 0.75rem auto;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 68%);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(45, 212, 191, 0.18);
  background: rgba(45, 212, 191, 0.08);
  color: #8ef2e5;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1.08;
  margin-bottom: 0.6rem;
}

.hero-description {
  max-width: 58ch;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.15rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: rgba(23, 39, 63, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--text-soft);
  font-size: 0.84rem;
}

.hero-sidecard {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background:
    linear-gradient(180deg, rgba(13, 27, 45, 0.92), rgba(10, 18, 34, 0.94));
}

.hero-sidecard-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.hero-sidecard-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
}

.progress-bar-shell {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-info), var(--accent-primary));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.15rem 1.2rem;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: auto -16px -18px auto;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(56, 189, 248, 0));
  transform: rotate(18deg);
}

.stat-card-title {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card-caption {
  position: relative;
  z-index: 1;
  margin-top: 0.7rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.stat-tone-info .stat-card-value { color: var(--accent-info); }
.stat-tone-success .stat-card-value { color: var(--accent-success); }
.stat-tone-warning .stat-card-value { color: var(--accent-warning); }
.stat-tone-primary .stat-card-value { color: var(--accent-primary); }

.table-card {
  overflow: hidden;
}

.table-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.table-title {
  font-size: 1.02rem;
  font-weight: 700;
}

.table-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: rgba(17, 29, 47, 0.92);
  padding: 0.78rem 1.15rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.9rem;
  vertical-align: middle;
}

.custom-table tr:hover {
  background: rgba(23, 39, 63, 0.45);
}

.search-input {
  min-height: 42px;
  background: rgba(15, 26, 43, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  outline: none;
  font-size: 0.88rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-input:focus {
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
  background: rgba(18, 31, 51, 0.98);
}

.search-input::placeholder {
  color: #6f86a4;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success { background: rgba(34, 197, 94, 0.14); color: #9ce7b3; border: 1px solid rgba(34, 197, 94, 0.24); }
.badge-warning { background: rgba(245, 158, 11, 0.14); color: #ffd48a; border: 1px solid rgba(245, 158, 11, 0.24); }
.badge-danger { background: rgba(251, 113, 133, 0.14); color: #ffb0bf; border: 1px solid rgba(251, 113, 133, 0.24); }
.badge-info { background: rgba(56, 189, 248, 0.14); color: #a8e6ff; border: 1px solid rgba(56, 189, 248, 0.24); }

.btn-primary,
.btn-action {
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-deep) 100%);
  color: #04131d;
  border: none;
  padding: 0.72rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(20, 184, 166, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(20, 184, 166, 0.26);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.5rem 0.72rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 12px;
  text-decoration: none;
}

.btn-action:hover {
  color: var(--text-main);
  background: rgba(23, 39, 63, 0.7);
  border-color: rgba(148, 163, 184, 0.12);
}

.btn-action.delete:hover {
  color: #ffd0da;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.18);
}

.data-empty {
  padding: 2.6rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.data-empty-icon {
  display: inline-flex;
  width: 60px;
  height: 60px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin-bottom: 0.8rem;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-info);
  font-size: 1.2rem;
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.customer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(23, 39, 63, 0.8);
}

.metric-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.soft-panel {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.12);
}

.split-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 190px);
  overflow: hidden;
}

.surface-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
}

.stack-list {
  display: flex;
  flex-direction: column;
}

.chat-sidebar-panel {
  overflow: hidden;
}

.chat-sidebar-scroll,
.chat-thread-scroll {
  overflow-y: auto;
}

.chat-sidebar-scroll {
  max-height: calc(100vh - 305px);
}

.chat-thread-scroll {
  flex: 1;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.05), transparent 22%),
    linear-gradient(180deg, rgba(10, 18, 34, 0.98), rgba(8, 15, 28, 0.96));
}

.list-item-card {
  display: block;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.list-item-card:hover {
  background: rgba(23, 39, 63, 0.55);
}

.list-item-card.active {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.14), rgba(56, 189, 248, 0.08));
  border-color: rgba(45, 212, 191, 0.18);
}

.list-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.55rem;
}

.list-item-title {
  font-weight: 700;
}

.list-item-copy {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.chat-thread-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thread-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(13, 27, 45, 0.86);
}

.thread-customer {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.thread-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(23, 39, 63, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.thread-title {
  font-size: 1.02rem;
  font-weight: 700;
}

.thread-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.message-bubble {
  max-width: min(76%, 760px);
  padding: 0.9rem 1rem;
  border-radius: 20px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
}

.message-bubble.message-customer {
  align-self: flex-start;
  background: rgba(31, 48, 73, 0.92);
  border-bottom-left-radius: 6px;
}

.message-bubble.message-ai {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.94), rgba(20, 184, 166, 0.9));
  color: #04131d;
  border-bottom-right-radius: 6px;
}

.message-bubble.message-agent {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.94), rgba(16, 185, 129, 0.88));
  color: #04131d;
  border-bottom-right-radius: 6px;
}

.message-meta {
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  opacity: 0.84;
  font-weight: 700;
}

.message-body {
  white-space: pre-wrap;
}

.message-media-link,
.message-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.message-media-preview {
  display: block;
  width: min(280px, 100%);
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-soft);
}

.message-attachment-link {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  font-weight: 600;
}

.message-attachment-chip,
.moderation-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.composer-bar {
  padding: 1rem 1.15rem;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  display: flex;
  gap: 0.8rem;
  background: rgba(10, 18, 34, 0.96);
  align-items: flex-end;
}

.composer-bar .search-input {
  flex: 1;
}

.composer-fields {
  flex: 1;
  display: grid;
  gap: 0.65rem;
}

.moderation-grid {
  display: grid;
  gap: 1rem;
}

.moderation-card {
  padding: 1rem 1.15rem;
}

.moderation-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.95rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.moderation-bubble {
  max-width: 88%;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.moderation-bubble.customer {
  background: rgba(31, 48, 73, 0.92);
  border-bottom-left-radius: 6px;
}

.moderation-bubble.ai {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.94), rgba(20, 184, 166, 0.9));
  color: #04131d;
  border-bottom-right-radius: 6px;
}

.moderation-attachment-chip {
  margin-bottom: 0.6rem;
}

.moderation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.modal-shell {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 19, 0.72);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2000;
}

.modal-card {
  width: min(720px, 100%);
  background: rgba(10, 18, 34, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(2, 8, 23, 0.5);
  padding: 1.35rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.modal-subtitle {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-textarea {
  min-height: 180px;
  width: 100%;
  resize: vertical;
}

.content-grid {
  display: grid;
  gap: 1rem;
}

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

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.summary-card {
  padding: 1rem 1.05rem;
}

.summary-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.summary-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
}

.summary-note {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.entity-code {
  font-weight: 700;
  color: var(--accent-info);
}

.money-value {
  font-weight: 700;
  color: var(--accent-success);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

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

.diagnostic-list {
  display: grid;
  gap: 0.9rem;
}

.diagnostic-item {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(10, 18, 34, 0.72);
  display: grid;
  gap: 0.8rem;
}

.diagnostic-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.diagnostic-title {
  font-weight: 700;
  color: var(--text-main);
}

.diagnostic-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.diagnostic-error {
  font-size: 0.82rem;
}

.diagnostic-raw {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  padding-top: 0.75rem;
}

.diagnostic-raw summary {
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 600;
}

.diagnostic-raw pre {
  margin-top: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(4, 9, 19, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.55;
}

.field-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-soft);
  font-weight: 600;
}

.surface-muted {
  background: rgba(15, 26, 43, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.standalone-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #091626 100%);
}

.standalone-card {
  width: min(560px, 100%);
  text-align: center;
  background: rgba(10, 18, 34, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(2, 8, 23, 0.5);
  padding: 2.5rem 2rem;
}

.standalone-icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1.35rem;
  background: rgba(15, 26, 43, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.standalone-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  margin-bottom: 0.5rem;
}

.standalone-copy {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 auto 1.6rem;
  max-width: 44ch;
}

.standalone-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.auth-shell,
.legal-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 24%),
    linear-gradient(180deg, #07111f 0%, #091626 100%);
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
  overflow: hidden;
  background: rgba(10, 18, 34, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(2, 8, 23, 0.5);
}

.auth-showcase {
  padding: 2rem;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(8, 20, 36, 0.98), rgba(9, 22, 38, 0.92));
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
}

.auth-form-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.15rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.08);
  color: #8ef2e5;
  border: 1px solid rgba(45, 212, 191, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.76rem;
  font-weight: 700;
}

.auth-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.8vw, 2.8rem);
  line-height: 1.08;
}

.auth-copy {
  color: var(--text-soft);
  max-width: 44ch;
  line-height: 1.75;
}

.auth-feature-list {
  display: grid;
  gap: 0.85rem;
}

.auth-feature {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(15, 26, 43, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.auth-feature i {
  color: var(--accent-info);
  margin-top: 0.2rem;
}

.auth-form-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin-bottom: 0.35rem;
}

.status-banner {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 26, 43, 0.7);
}

.status-banner.error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(127, 29, 29, 0.25);
}

.status-banner.success {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(20, 83, 45, 0.26);
}

.status-banner.info {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(30, 58, 138, 0.22);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-links a,
.legal-shell a,
.public-nav a,
.public-footer a {
  color: var(--accent-info);
  text-decoration: none;
}

.legal-shell {
  padding: clamp(1.2rem, 4vw, 3rem);
}

.legal-wrap {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
}

.legal-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-card {
  background: rgba(10, 18, 34, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(2, 8, 23, 0.42);
  padding: clamp(1.2rem, 4vw, 2rem);
  line-height: 1.8;
}

.legal-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.4rem 0 0.55rem;
}

.public-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #091626 100%);
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1.2rem, 5vw, 4rem);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(7, 17, 31, 0.86);
  backdrop-filter: blur(16px);
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.public-hero {
  padding: clamp(4rem, 8vw, 6.5rem) clamp(1.2rem, 5vw, 4rem) 4rem;
}

.public-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
}

.public-hero-panel,
.public-card {
  background: rgba(10, 18, 34, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(2, 8, 23, 0.42);
}

.public-hero-panel {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(8, 20, 36, 0.98), rgba(9, 22, 38, 0.92));
}

.public-sidecard {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.public-section {
  padding: 0 clamp(1.2rem, 5vw, 4rem) 4rem;
}

.public-section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.public-card {
  padding: 1.3rem;
}

.public-footer {
  padding: 2rem clamp(1.2rem, 5vw, 4rem) 3rem;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .page-hero {
    grid-template-columns: 1fr;
  }

  .workspace-switcher select {
    min-width: 160px;
  }

  .split-shell {
    grid-template-columns: 1fr;
  }

  .auth-card,
  .public-hero-grid {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 100%;
  }

  .app-container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .main-wrapper {
    margin-left: 0;
  }

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

  .public-nav,
  .public-nav-links,
  .auth-links {
    align-items: stretch;
  }

  .public-nav,
  .public-nav-links {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .header {
    padding: 1rem;
  }

  .content-body {
    padding: 1rem;
  }

  .header,
  .header-cluster,
  .profile-panel,
  .table-header {
    align-items: stretch;
  }

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

  .profile-copy {
    text-align: left;
  }

  .workspace-switcher {
    width: 100%;
  }

  .workspace-switcher select {
    width: 100%;
    min-width: 0;
  }

  .nav-menu {
    grid-template-columns: 1fr;
  }

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

  .content-grid.columns-2,
  .form-grid.columns-2 {
    grid-template-columns: 1fr;
  }

  .chat-sidebar-scroll {
    max-height: 280px;
  }

  .thread-header,
  .moderation-card-top,
  .composer-bar,
  .moderation-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .message-bubble,
  .moderation-bubble {
    max-width: 100%;
  }

  .custom-table thead {
    display: none;
  }

  .custom-table,
  .custom-table tbody,
  .custom-table tr,
  .custom-table td {
    display: block;
    width: 100%;
  }

  .custom-table tr {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  }

  .custom-table td {
    border-bottom: none;
    padding: 0.35rem 0;
  }
}
