:root {
  --page: #f5f7f6;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --ink: #151917;
  --ink-2: #33413b;
  --muted: #69756f;
  --line: #dfe7e3;
  --line-strong: #c5d2cc;
  --brand: #0d7c72;
  --brand-2: #e24d42;
  --blue: #245f91;
  --amber: #b87912;
  --green: #287a55;
  --danger: #b9443a;
  --rail: #121715;
  --rail-muted: #8ea098;
  --shadow: 0 18px 45px rgba(20, 28, 24, 0.1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(245, 247, 246, 0.94)),
    repeating-linear-gradient(90deg, rgba(21, 25, 23, 0.024) 0, rgba(21, 25, 23, 0.024) 1px, transparent 1px, transparent 72px),
    var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
textarea,
select,
input {
  font: inherit;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 72px 292px minmax(0, 1fr) 336px;
  height: 100vh;
  min-height: 760px;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  background: var(--rail);
  color: #fff;
}

.logo,
.auth-brand {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f7fbfa;
  color: var(--rail);
  font-weight: 900;
}

.rail-nav {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.rail-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 8px;
  background: transparent;
  color: var(--rail-muted);
}

.rail-button:hover,
.rail-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.rail-bottom {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
}

.panel-head,
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.title-block,
.conversation-title > div:last-child {
  min-width: 0;
}

.title-block strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.title-block span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.icon-button,
.primary-button,
.soft-button,
.template-button,
.assistant-button,
.thread-item {
  min-height: 36px;
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
}

.icon-button:hover,
.soft-button:hover,
.mini-action:hover {
  border-color: var(--line-strong);
  color: var(--brand);
}

.icon-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.panel-body,
.right-scroll {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.section {
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.assistant-list,
.template-list,
.thread-list {
  display: grid;
  gap: 8px;
}

.assistant-button,
.thread-item,
.template-button {
  display: flex;
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.assistant-button {
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.assistant-button:hover,
.assistant-button.active,
.thread-item:hover,
.thread-item.active,
.template-button:hover {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(20, 28, 24, 0.06);
}

.assistant-button.active {
  border-color: rgba(13, 124, 114, 0.34);
  background: #eff8f6;
}

.assistant-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff;
}

.assistant-mark.sales {
  background: var(--brand);
}

.assistant-mark.hr {
  background: var(--brand-2);
}

.assistant-mark.finance {
  background: var(--blue);
}

.assistant-mark.tech {
  background: var(--amber);
}

.assistant-mark.general {
  background: #2563eb;
}

.assistant-copy,
.thread-copy,
.template-copy {
  min-width: 0;
}

.assistant-copy strong,
.thread-copy strong,
.template-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.assistant-copy span,
.thread-copy span,
.template-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.thread-item {
  align-items: flex-start;
  gap: 9px;
  min-height: 58px;
  padding: 10px;
}

.thread-status {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: 0 0 auto;
}

.thread-status.hot {
  background: var(--brand);
}

.thread-status.warn {
  background: var(--amber);
}

.empty-note {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.quota,
.model-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(20, 28, 24, 0.06);
}

.quota-top,
.quota-line,
.model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quota-top strong {
  font-size: 19px;
}

.quota-top span,
.quota-line,
.model-row span {
  color: var(--muted);
  font-size: 12px;
}

.quota-line {
  margin-top: 6px;
}

.bar {
  overflow: hidden;
  height: 8px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: #e8eeeb;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--amber));
}

.chat {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.6);
}

.chat-head {
  padding: 0 22px;
  backdrop-filter: blur(18px);
}

.conversation-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.conversation-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e6f4f1;
  color: var(--brand);
}

.conversation-title h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.conversation-title p {
  margin: 5px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.model-select {
  min-height: 36px;
  width: 212px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  outline: 0;
}

.soft-button,
.primary-button,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.soft-button {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  white-space: nowrap;
}

.chat-stream {
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.day-pill {
  width: max-content;
  margin: 0 auto 18px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 12px;
}

.message {
  display: grid;
  grid-template-columns: 36px minmax(0, 760px);
  align-items: start;
  gap: 11px;
  margin-bottom: 18px;
}

.message.user {
  grid-template-columns: minmax(0, 760px) 36px;
  justify-content: end;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dfe8e4;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}

.avatar.ai {
  background: var(--ink);
  color: #fff;
}

.bubble {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(20, 28, 24, 0.07);
}

.message.user .bubble {
  grid-column: 1;
  background: #edf8f5;
  border-color: rgba(13, 124, 114, 0.26);
}

.message.user .avatar {
  grid-column: 2;
  grid-row: 1;
}

.bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bubble-meta strong {
  color: var(--ink-2);
}

.bubble p {
  margin: 0;
  line-height: 1.56;
}

.chips,
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.chip.warn {
  border-color: #ecd5a3;
  background: #fff8e8;
  color: #755016;
}

.mini-action {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.composer-wrap {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.composer {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.composer-top,
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.composer-top {
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.context-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 94px;
  max-height: 190px;
  padding: 14px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: #fff;
  color: var(--ink);
}

.composer-bottom {
  border-top: 1px solid var(--line);
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.primary-button {
  min-width: 116px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: #26302b;
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.model-row {
  margin-bottom: 10px;
}

.model-row:last-child {
  margin-bottom: 0;
}

.meter {
  overflow: hidden;
  width: 96px;
  height: 7px;
  border-radius: 999px;
  background: #e8eeeb;
}

.meter-fill {
  height: 100%;
  background: var(--brand);
}

.meter-fill.blue {
  background: var(--blue);
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 112px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfb;
  text-align: center;
}

.file-icon {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.file-drop strong {
  display: block;
  margin-top: 10px;
  font-size: 13px;
}

.file-drop span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.template-button {
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
}

.template-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand);
}

.risk-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.risk-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.risk-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.risk-dot.warn {
  background: var(--amber);
}

.risk-dot.danger {
  background: var(--danger);
}

.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.person {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.person-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.person-copy {
  min-width: 0;
}

.person-copy strong,
.person-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #efc3bd;
  border-radius: 8px;
  background: #fff5f3;
  color: #7c2d25;
  box-shadow: var(--shadow);
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 18px 0 6px;
  font-size: 24px;
}

.auth-note {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
}

.auth-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 124, 114, 0.12);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: 100%;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.primary-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-link {
  margin-top: 2px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
}

.alert {
  padding: 11px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.alert.danger {
  border: 1px solid #efc3bd;
  background: #fff5f3;
  color: #7c2d25;
}

.alert.success {
  border: 1px solid #bfe3d2;
  background: #f1fbf6;
  color: #1d6647;
}

.admin-page {
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.admin-topbar strong,
.admin-topbar span {
  display: block;
}

.admin-topbar strong {
  font-size: 17px;
}

.admin-topbar span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  padding: 16px;
}

.admin-main,
.admin-side {
  min-width: 0;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(20, 28, 24, 0.08);
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-card-head.compact {
  padding: 0 0 14px;
  border-bottom: 0;
}

.admin-card h1,
.admin-card h2 {
  margin: 0;
  font-size: 18px;
}

.admin-card h2 {
  font-size: 17px;
}

.admin-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
}

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

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--ink-2);
  font-size: 13px;
}

.admin-table td strong,
.admin-table td span {
  display: block;
}

.admin-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-badge {
  display: inline-flex !important;
  width: max-content;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px !important;
  font-weight: 800;
}

.status-badge.active {
  background: #edf8f5;
  color: var(--brand);
}

.status-badge.passive {
  background: #f2f3f2;
  color: var(--muted);
}

.table-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}

.table-action:hover {
  border-color: var(--line-strong);
  color: var(--brand);
}

.admin-form {
  display: grid;
  gap: 13px;
  padding: 16px;
  position: sticky;
  top: 16px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
}

.admin-form input,
.admin-form select {
  min-height: 40px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 124, 114, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 1320px) {
  .app {
    grid-template-columns: 72px 268px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 920px) {
  .app {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .left-panel {
    display: none;
  }

  .chat-head {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    min-height: 72px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .head-actions {
    justify-content: flex-start;
  }

  .model-select {
    width: min(100%, 280px);
  }
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .admin-form {
    position: static;
  }
}

@media (max-width: 680px) {
  .app {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .rail {
    display: none;
  }

  .chat {
    min-height: 100vh;
  }

  .chat-stream {
    padding: 16px 12px;
  }

  .message,
  .message.user {
    grid-template-columns: 32px minmax(0, 1fr);
    justify-content: stretch;
  }

  .message.user .bubble {
    grid-column: 2;
  }

  .message.user .avatar {
    grid-column: 1;
  }

  .composer-wrap,
  .chat-head {
    padding-left: 12px;
    padding-right: 12px;
  }

  .composer-top,
  .composer-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-metrics {
    flex-wrap: wrap;
    white-space: normal;
  }

  .primary-button {
    width: 100%;
  }

  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .admin-topbar nav {
    justify-content: flex-start;
  }

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

body.hub-page {
  overflow: hidden;
  background:
    linear-gradient(180deg, #eef4f7 0%, #f8fafc 48%, #edf2f7 100%);
  color: #111827;
}

.hub-page .hub-shell {
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
}

.hub-page .hub-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, auto);
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid #1f2a37;
  background: #0d1420;
  color: #f8fafc;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
  z-index: 3;
}

.hub-page .hub-brand,
.hub-page .hub-user,
.hub-page .hub-status,
.hub-page .security-card-top,
.hub-page .model-title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hub-page .hub-brand {
  gap: 12px;
  color: #fff;
}

.hub-page a.hub-brand:hover .hub-brand-copy strong {
  color: #bfdbfe;
}

.hub-page .hub-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 8px;
  background: #111d2d;
  color: #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hub-page .hub-brand-copy {
  min-width: 0;
}

.hub-page .hub-brand-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.hub-page .hub-brand-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  color: #9ca3af;
  font-size: 12px;
}

.hub-page .hub-status {
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-page .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #2c3a4d;
  border-radius: 999px;
  background: #111d2d;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.hub-page .status-pill.compact {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.hub-page .status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.hub-page .status-pill.good {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.hub-page .status-pill.blue {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
}

.hub-page .status-pill.warn {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.11);
  color: #fbbf24;
}

.hub-page .hub-user {
  justify-content: flex-end;
  gap: 9px;
}

.hub-page .hub-user .person-copy {
  max-width: 176px;
}

.hub-page .hub-user .person-copy strong {
  color: #f8fafc;
}

.hub-page .hub-user .person-copy span {
  color: #9ca3af;
}

.hub-page .hub-user .person-avatar {
  background: #2563eb;
  color: #fff;
}

.hub-page .hub-user .icon-button,
.hub-page .hub-user .soft-button {
  border-color: #2c3a4d;
  background: #111d2d;
  color: #cbd5e1;
}

.hub-page .hub-user .icon-button:hover,
.hub-page .hub-user .soft-button:hover {
  color: #fff;
  border-color: #3b82f6;
}

.hub-page .hub-body {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr) 340px;
  height: calc(100vh - 66px);
  min-height: 0;
  overflow: hidden;
}

.hub-page.staff-hub-page .hub-body {
  grid-template-columns: 292px minmax(0, 1fr);
}

.hub-page .hub-body > * {
  min-height: 0;
}

.hub-page .left-panel.hub-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
  padding: 14px;
  border-right: 1px solid #1f2937;
  background: #111827;
  color: #e5e7eb;
  backdrop-filter: none;
}

.hub-page .security-card {
  padding: 12px;
  border: 1px solid #263244;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.hub-page .security-card-top {
  gap: 10px;
}

.hub-page .security-card-top > div {
  min-width: 0;
  flex: 1;
}

.hub-page .security-card-top strong,
.hub-page .security-card-top span {
  display: block;
}

.hub-page .security-card-top strong {
  color: #f8fafc;
  font-size: 14px;
}

.hub-page .security-card-top span {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.hub-page .security-card-top b {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  font-size: 10px;
  letter-spacing: 0;
}

.hub-page .security-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
}

.hub-page .security-card p {
  margin: 10px 0 0;
  color: #a9b4c3;
  font-size: 12px;
  line-height: 1.45;
}

.hub-page .hub-nav {
  display: grid;
  gap: 7px;
  margin: 14px 0 18px;
}

.hub-page .hub-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

.hub-page .hub-nav-item span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.hub-page .hub-nav-item small {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #1f2937;
  color: #94a3b8;
  font-size: 10px;
  text-align: center;
}

.hub-page .hub-nav-item:hover {
  border-color: #263244;
  background: #172033;
  color: #fff;
}

.hub-page .hub-nav-item.active {
  border-color: rgba(59, 130, 246, 0.45);
  background: #2563eb;
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.hub-page .hub-nav-item.active small {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.hub-page .hub-sidebar .section-title {
  color: #94a3b8;
}

.hub-page .security-card + .section {
  margin-top: 14px;
}

.hub-page .hub-sidebar .assistant-button,
.hub-page .hub-sidebar .thread-item {
  border-color: transparent;
  background: transparent;
  color: #e5e7eb;
}

.hub-page .hub-sidebar .assistant-button:hover,
.hub-page .hub-sidebar .assistant-button.active,
.hub-page .hub-sidebar .thread-item:hover,
.hub-page .hub-sidebar .thread-item.active {
  border-color: #263244;
  background: #172033;
  box-shadow: none;
}

.hub-page .hub-sidebar .assistant-button.active {
  border-color: rgba(20, 184, 166, 0.34);
  background: rgba(20, 184, 166, 0.11);
}

.hub-page .hub-sidebar .thread-item.active {
  border-color: rgba(59, 130, 246, 0.38);
  background: rgba(37, 99, 235, 0.14);
}

.hub-page .hub-sidebar .thread-item.loading {
  cursor: wait;
  opacity: 0.7;
}

.hub-page .hub-sidebar .assistant-copy span,
.hub-page .hub-sidebar .thread-copy span {
  color: #94a3b8;
}

.hub-page .hub-sidebar .empty-note {
  border-color: #334155;
  color: #94a3b8;
}

.hub-page .chat.hub-chat {
  display: grid;
  grid-template-rows: 66px 50px minmax(0, 1fr) auto;
  height: calc(100vh - 66px);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: #f8fafc;
}

.hub-page .hub-chat-head {
  min-height: 66px;
  padding: 0 18px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.hub-page .conversation-icon {
  background: #dbeafe;
  color: #2563eb;
}

.hub-page .conversation-title h1 {
  color: #0f172a;
}

.hub-page .conversation-title p {
  color: #64748b;
}

.hub-page .chat-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 7px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.hub-page .control-group,
.hub-page .control-button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.hub-page .control-group {
  flex: 1;
  max-width: 420px;
  padding: 0 8px 0 10px;
}

.hub-page .control-button {
  padding: 0 11px;
}

.hub-page .control-button b {
  padding: 2px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
}

.hub-page .control-icon {
  color: #2563eb;
}

.hub-page .model-select {
  width: 210px;
  min-height: 30px;
  margin-left: auto;
  border-color: #d8e0ea;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
}

.hub-page .chat-stream {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(248, 250, 252, 0.94)),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.026) 0, rgba(15, 23, 42, 0.026) 1px, transparent 1px, transparent 88px);
}

.hub-page .day-pill {
  border-color: #d8e0ea;
  background: #fff;
  color: #64748b;
}

.hub-page .message {
  grid-template-columns: 38px minmax(0, 800px);
  gap: 12px;
}

.hub-page .message.user {
  grid-template-columns: minmax(0, 800px) 38px;
}

.hub-page .avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #dbeafe;
  color: #2563eb;
}

.hub-page .avatar.ai {
  background: #111827;
  color: #93c5fd;
}

.hub-page .bubble {
  padding: 14px;
  border-color: #d8e0ea;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
}

.hub-page .message.user .bubble {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.hub-page .message.user .bubble-meta,
.hub-page .message.user .bubble-meta strong {
  color: rgba(255, 255, 255, 0.82);
}

.hub-page .bubble-meta {
  color: #64748b;
}

.hub-page .bubble-meta strong {
  color: #111827;
}

.hub-page .message-text {
  line-height: 1.58;
}

.hub-page .message-text p {
  margin: 0 0 9px;
}

.hub-page .message-text p:last-child {
  margin-bottom: 0;
}

.hub-page .chip {
  border-color: #d8e0ea;
  background: #f8fafc;
  color: #475569;
}

.hub-page .chip.warn {
  border-color: #f5d18b;
  background: #fffbeb;
  color: #92400e;
}

.hub-page .message.user .chip,
.hub-page .message.user .mini-action {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hub-page .message-actions {
  gap: 6px;
}

.hub-page .mini-action {
  border-color: #d8e0ea;
  background: #fff;
  color: #64748b;
}

.hub-page .mini-action:hover {
  border-color: #93c5fd;
  color: #2563eb;
}

.hub-page .composer-wrap {
  position: relative;
  z-index: 2;
  padding: 10px 18px 12px;
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
}

.hub-page .composer {
  border-color: #cbd5e1;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.hub-page .composer-top {
  border-bottom-color: #e2e8f0;
  background: #f8fafc;
}

.hub-page .context-pill {
  color: #334155;
}

.hub-page .context-pill .nav-icon {
  color: #10b981;
}

.hub-page .composer-metrics {
  color: #64748b;
}

.hub-page .composer textarea {
  min-height: 54px;
  max-height: 110px;
  background: #fff;
  color: #111827;
}

.hub-page .composer-top,
.hub-page .composer-bottom {
  padding-top: 8px;
  padding-bottom: 8px;
}

.hub-page .composer-bottom {
  border-top-color: #e2e8f0;
  background: #fff;
}

.hub-page .file-input {
  display: none;
}

.hub-page .file-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 220px;
  padding: 0 9px;
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-page #fileButton.loading {
  cursor: wait;
  opacity: 0.7;
}

.hub-page .staff-tool-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.hub-page .staff-tool-note .nav-icon {
  color: #10b981;
}

.hub-page .primary-button {
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.18);
}

.hub-page .primary-button:hover {
  background: #2563eb;
}

.hub-page .primary-button:disabled {
  opacity: 0.65;
  transform: none;
}

.hub-page .soft-button,
.hub-page .icon-button {
  border-color: #d8e0ea;
  background: #fff;
  color: #334155;
}

.hub-page .soft-button:hover,
.hub-page .icon-button:hover {
  border-color: #93c5fd;
  color: #2563eb;
}

.hub-page .right-panel.hub-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid #e2e8f0;
  background: #fff;
  backdrop-filter: none;
  overflow: hidden;
}

.hub-page .hub-detail .panel-head {
  background: #fff;
}

.hub-page .hub-detail .right-scroll {
  padding: 14px;
}

.hub-page .hub-quota,
.hub-page .gateway-card {
  border-color: #d8e0ea;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.hub-page .quota-top strong {
  color: #111827;
}

.hub-page .bar {
  background: #e2e8f0;
}

.hub-page .bar.slim {
  height: 6px;
  margin-bottom: 0;
}

.hub-page .bar-fill {
  background: #10b981;
}

.hub-page .bar-fill.daily {
  background: #2563eb;
}

.hub-page .model-title {
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.hub-page .model-title > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #dbeafe;
  color: #2563eb;
}

.hub-page .model-title strong,
.hub-page .model-title small {
  display: block;
}

.hub-page .model-title strong {
  color: #111827;
  font-size: 13px;
}

.hub-page .model-title small {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.hub-page .meter {
  background: #e2e8f0;
}

.hub-page .meter-fill {
  background: #10b981;
}

.hub-page .meter-fill.blue {
  background: #2563eb;
}

.hub-page .file-drop {
  border-color: #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
}

.hub-page .file-drop:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.hub-page .file-drop.dragging,
.hub-page .file-drop.loading {
  border-color: #2563eb;
  background: #eff6ff;
}

.hub-page .file-drop.loading {
  cursor: wait;
  opacity: 0.72;
}

.hub-page .file-icon,
.hub-page .template-icon {
  color: #2563eb;
}

.hub-page .template-button:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.hub-page .toast {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}

@media (max-width: 1420px) {
  .hub-page .hub-body {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .hub-page .right-panel.hub-detail {
    display: none;
  }
}

@media (max-width: 1120px) {
  .hub-page .hub-header {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .hub-page .hub-status {
    display: none;
  }

  .hub-page .hub-body {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .hub-page .chat-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-page .control-group,
  .hub-page .control-button {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 820px) {
  body.hub-page {
    overflow: auto;
  }

  .hub-page .hub-shell {
    height: auto;
    min-height: 100vh;
  }

  .hub-page .hub-header {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px;
  }

  .hub-page .hub-user {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hub-page .hub-body {
    display: block;
  }

  .hub-page .left-panel.hub-sidebar {
    display: none;
  }

  .hub-page .chat.hub-chat {
    min-height: calc(100vh - 132px);
  }

  .hub-page .hub-chat-head {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .hub-page .head-actions {
    justify-content: flex-start;
  }

  .hub-page .chat-stream {
    padding: 16px 12px;
  }

  .hub-page .message,
  .hub-page .message.user {
    grid-template-columns: 34px minmax(0, 1fr);
    justify-content: stretch;
  }

  .hub-page .message.user .bubble {
    grid-column: 2;
  }

  .hub-page .message.user .avatar {
    grid-column: 1;
  }

  .hub-page .composer-wrap {
    padding: 12px;
  }

  .hub-page .composer-top,
  .hub-page .composer-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-page .composer-metrics,
  .hub-page .tool-row {
    flex-wrap: wrap;
  }

  .hub-page .model-select {
    width: 100%;
  }
}

.admin-hub-page .admin-shell {
  min-height: 100vh;
  overflow: hidden;
}

.admin-hub-page .admin-hub-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  height: calc(100vh - 66px);
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(241, 245, 249, 0.96)),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.024) 0, rgba(15, 23, 42, 0.024) 1px, transparent 1px, transparent 88px);
}

.admin-hub-page .admin-console,
.admin-hub-page .admin-editor {
  min-width: 0;
}

.admin-hub-page .admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.admin-hub-page .admin-hero .section-title {
  margin-bottom: 7px;
  color: #2563eb;
}

.admin-hub-page .admin-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: 26px;
  line-height: 1.15;
}

.admin-hub-page .admin-hero p {
  max-width: 680px;
  margin: 7px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.admin-hub-page .primary-inline {
  gap: 8px;
  flex: 0 0 auto;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.14);
}

.admin-hub-page .primary-inline:hover {
  background: #2563eb;
}

.admin-hub-page .admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-hub-page .stat-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.admin-hub-page .stat-card span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.admin-hub-page .stat-card span .nav-icon {
  color: #2563eb;
}

.admin-hub-page .stat-card strong {
  display: block;
  margin-top: 10px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.admin-hub-page .stat-card small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.admin-hub-page .admin-card {
  border-color: #d8e0ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.admin-hub-page .admin-table-card {
  overflow: hidden;
}

.admin-hub-page .admin-card-head {
  padding: 14px 16px;
  border-bottom-color: #e2e8f0;
}

.admin-hub-page .admin-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}

.admin-hub-page .admin-card p {
  margin: 5px 0 0;
  color: #64748b;
}

.admin-hub-page .table-wrap {
  max-height: calc(100vh - 294px);
  overflow: auto;
}

.admin-hub-page .admin-table {
  min-width: 980px;
}

.admin-hub-page .admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: #d8e0ea;
  background: #f8fafc;
  color: #64748b;
}

.admin-hub-page .admin-table td {
  border-bottom-color: #edf2f7;
  color: #334155;
}

.admin-hub-page .admin-table tr:hover td {
  background: #f8fafc;
}

.admin-hub-page .conversation-table-card {
  margin-bottom: 14px;
}

.admin-hub-page .admin-conversation-wrap {
  max-height: 280px;
}

.admin-hub-page .admin-conversation-table {
  min-width: 920px;
}

.admin-hub-page .status-badge.active {
  background: #ecfdf5;
  color: #047857;
}

.admin-hub-page .status-badge.passive {
  background: #f1f5f9;
  color: #64748b;
}

.admin-hub-page .table-action {
  border-color: #d8e0ea;
  background: #fff;
}

.admin-hub-page .table-action:hover {
  border-color: #93c5fd;
  color: #2563eb;
}

.admin-hub-page button.table-action {
  background: #fff;
  cursor: pointer;
}

.admin-hub-page .table-action.loading {
  cursor: wait;
  opacity: 0.7;
}

.admin-hub-page .admin-chat-modal[hidden] {
  display: none;
}

.admin-hub-page .admin-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-hub-page .admin-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
}

.admin-hub-page .admin-chat-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(940px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
}

.admin-hub-page .admin-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.admin-hub-page .admin-chat-head strong,
.admin-hub-page .admin-chat-head span {
  display: block;
}

.admin-hub-page .admin-chat-head strong {
  color: #0f172a;
  font-size: 17px;
}

.admin-hub-page .admin-chat-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.admin-hub-page .admin-chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}

.admin-hub-page .admin-chat-loading {
  padding: 14px;
  color: #64748b;
}

.admin-hub-page .admin-chat-message {
  max-width: 82%;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
}

.admin-hub-page .admin-chat-message.user {
  margin-left: auto;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-hub-page .admin-chat-message-meta,
.admin-hub-page .admin-chat-message-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

.admin-hub-page .admin-chat-message-meta strong {
  color: #0f172a;
}

.admin-hub-page .admin-chat-message-text {
  margin-top: 8px;
  color: #111827;
  line-height: 1.55;
}

.admin-hub-page .admin-chat-message-detail {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
}

.modal-open {
  overflow: hidden;
}

.admin-hub-page .admin-editor {
  align-self: start;
}

.admin-hub-page .admin-form {
  position: sticky;
  top: 0;
  gap: 12px;
  padding: 14px;
}

.admin-hub-page .admin-form-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-hub-page .form-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #dbeafe;
  color: #2563eb;
}

.admin-hub-page .admin-form-title h2 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}

.admin-hub-page .admin-form-title p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.admin-hub-page .admin-form label {
  color: #334155;
}

.admin-hub-page .admin-form input,
.admin-hub-page .admin-form select {
  border-color: #d8e0ea;
  background: #fff;
}

.admin-hub-page .admin-form input:focus,
.admin-hub-page .admin-form select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-hub-page .primary-link {
  background: #111827;
}

.admin-hub-page .primary-link:hover {
  background: #2563eb;
}

.admin-hub-page .alert {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .admin-hub-page .admin-hub-body {
    grid-template-columns: 1fr;
  }

  .admin-hub-page .admin-form {
    position: static;
  }

  .admin-hub-page .table-wrap {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .admin-hub-page .admin-shell {
    height: auto;
    overflow: visible;
  }

  .admin-hub-page .admin-hub-body {
    height: auto;
    min-height: calc(100vh - 132px);
    overflow: visible;
    padding: 12px;
  }

  .admin-hub-page .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .admin-hub-page .admin-stats {
    grid-template-columns: 1fr;
  }
}
