:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f1f1f3;
  --surface-3: #ececf1;
  --text: #202123;
  --muted: #6b6c70;
  --line: #e5e5e7;
  --primary: #10a37f;
  --primary-2: #0d7f66;
  --accent: #8a5a35;
  --warning: #b88918;
  --danger: #b42318;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button,
a {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:hover,
a:hover {
  transform: translateY(-1px);
}

.hidden {
  display: none !important;
}

.chat-body {
  background: #ffffff;
}

.app-frame {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background: #ffffff;
}

.chat-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f4f4f5;
  border-right: 1px solid var(--line);
}

.side-logo,
.side-nav-item,
.side-action {
  border-radius: 8px;
  text-decoration: none;
}

.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px;
  color: var(--text);
}

.side-logo img {
  width: 62px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.side-logo strong {
  font-size: 0.95rem;
}

.side-action {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  padding: 0 13px;
  font-weight: 700;
}

.side-action::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--primary);
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: #343541;
  font-weight: 650;
}

.side-nav-item.active,
.side-nav-item:hover {
  background: #e9e9eb;
}

.chat-history-panel {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.chat-history-list {
  min-height: 0;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding-right: 2px;
}

.history-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #343541;
  cursor: pointer;
  padding: 8px 10px;
}

.history-item:hover,
.history-item.active {
  background: #e9e9eb;
}

.history-item span,
.history-item small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-item span {
  font-weight: 650;
}

.history-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.side-note {
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.side-note p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.conversation-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.conversation-topbar {
  height: 62px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 8;
}

.conversation-topbar > div {
  display: grid;
  gap: 2px;
}

.conversation-topbar strong {
  font-size: 0.95rem;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(32, 33, 35, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 33, 35, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, #ffffff 0%, #f4f4f5 54%, #edf7f4 100%);
  background-size: 42px 42px, 42px 42px, 100% 100%;
  animation: gridMove 18s linear infinite;
}

@keyframes gridMove {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 42px 42px, 42px 42px, 0 0; }
}

.login-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.login-brand,
.login-card,
.chat-hero,
.info-panel,
.admin-content,
.admin-sidebar,
.modal {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(220, 228, 234, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-brand {
  min-height: 560px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.login-brand,
.login-card {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.09);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(32, 33, 35, 0.12);
  border-radius: 8px;
  pointer-events: none;
}

.brand-mark,
.app-logo span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: #202123;
  font-weight: 800;
}

.brand-logo {
  width: 180px;
  height: 76px;
  padding: 10px;
  background: #ffffff;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand h1 {
  margin: 80px 0 12px;
  max-width: 520px;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.login-brand p,
.login-card p,
.info-card p,
.data-row p,
.data-row small {
  color: var(--muted);
}

.login-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.login-metrics span,
.eyebrow,
.info-card span,
.data-row span {
  color: var(--primary-2);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.login-metrics span {
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
}

.login-card {
  border-radius: 8px;
  padding: 42px;
  align-self: center;
}

.login-card h2,
.modal h2,
.admin-heading h1,
.chat-heading h1,
.info-panel h2 {
  margin: 6px 0 0;
  letter-spacing: 0;
}

.login-card h2 {
  font-size: 2rem;
}

.form-stack,
.form-grid,
.admin-form {
  display: grid;
  gap: 16px;
}

.form-stack {
  margin-top: 32px;
}

label {
  display: grid;
  gap: 8px;
  color: #2b3845;
  font-weight: 700;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 115, 0.13);
}

.primary-button,
.danger-button,
.ghost-link,
.tab-button,
.mini-danger,
.file-loader {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-2);
}

.danger-button,
.mini-danger {
  background: #fff0ee;
  color: var(--danger);
  border: 1px solid #ffd7d2;
}

.ghost-link,
.tab-button,
.file-loader {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.app-logo span,
.avatar-button,
.profile-preview {
  width: 42px;
  height: 42px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-button,
.profile-preview {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 900;
}

.avatar-button img,
.profile-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 56px;
}

.chat-body .workspace {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto 38px;
  padding-top: 40px;
}

.chat-hero {
  border-radius: 8px;
  padding: 28px;
}

.chat-body .chat-hero {
  min-height: calc(100vh - 170px);
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
}

.chat-heading {
  text-align: center;
  margin-bottom: 20px;
}

.chat-body .chat-heading {
  margin: 0 auto 26px;
  width: min(780px, 100%);
}

.chat-heading h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
}

.chat-body .chat-heading h1 {
  margin: 26px 0 22px;
  color: #2f3035;
  font-size: clamp(2rem, 4vw, 3.05rem);
  font-weight: 650;
  line-height: 1.08;
}

.prompt-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prompt-row button {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #3d3e44;
  cursor: pointer;
  font-weight: 650;
}

.prompt-row button:hover {
  background: #f4f4f5;
  border-color: #d6d6da;
}

.chat-window {
  height: min(52vh, 560px);
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(238, 244, 246, 0.64), rgba(255, 255, 255, 0.94));
}

.chat-body .chat-window {
  flex: 1;
  height: auto;
  min-height: 360px;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 10px 0 22px;
  background: #ffffff;
}

.message {
  display: flex;
  margin: 0 0 14px;
}

.chat-body .message {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 18px 0;
  gap: 12px;
  align-items: flex-start;
}

.message.user {
  justify-content: flex-end;
}

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

.message-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #202123;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  overflow: hidden;
  border: 1px solid #e4e7eb;
}

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

.message-bubble {
  max-width: min(760px, 88%);
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  line-height: 1.55;
}

.chat-body .message-bubble {
  max-width: min(690px, 100%);
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.65;
  color: #303136;
}

.message.thinking .message-bubble {
  color: #5f6066;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.message.thinking .message-bubble::after {
  content: "";
  width: 24px;
  height: 1em;
  display: inline-block;
  background: radial-gradient(circle, currentColor 45%, transparent 50%) 0 60% / 8px 8px repeat-x;
  animation: thinkingDots 1.1s steps(4, end) infinite;
}

@keyframes thinkingDots {
  from { clip-path: inset(0 24px 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.chat-body .message.user .message-bubble {
  max-width: min(620px, 84%);
  padding: 11px 14px;
  border-radius: 18px;
  background: #f4f4f5;
  color: #202123;
}

.message.user .message-bubble {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 14px;
}

.chat-body .chat-form {
  position: sticky;
  bottom: 18px;
  width: min(780px, 100%);
  margin: 0 auto;
  grid-template-columns: 1fr 40px 40px;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9d9de;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.chat-form textarea {
  min-height: 54px;
  max-height: 160px;
}

.chat-body .chat-form textarea {
  min-height: 40px;
  max-height: 180px;
  padding: 9px 8px 8px 12px;
  border: 0;
  border-radius: 16px;
  resize: none;
  box-shadow: none;
}

.chat-body .chat-form textarea:focus {
  box-shadow: none;
}

.send-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 50%;
  background: #202123;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 900;
}

.send-button:hover {
  background: #10a37f;
}

.icon-send,
.icon-mic {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}

.icon-send::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #ffffff;
}

.icon-send::after {
  content: "";
  position: absolute;
  inset: 3px 2px 2px 3px;
  border-top: 3px solid #ffffff;
  border-right: 3px solid #ffffff;
  transform: rotate(45deg);
}

.voice-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f1f1f3;
  color: #343541;
  cursor: pointer;
  font-size: 1rem;
}

.voice-button:hover {
  background: #e7e7ea;
}

.icon-mic::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: 2px solid #4f5961;
  border-radius: 999px;
}

.icon-mic::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 10px;
  height: 7px;
  border-right: 2px solid #4f5961;
  border-bottom: 2px solid #4f5961;
  border-left: 2px solid #4f5961;
  border-radius: 0 0 8px 8px;
}

.voice-button.listening .icon-mic::before,
.voice-button.listening .icon-mic::after {
  border-color: var(--primary-2);
}

.voice-button.listening {
  background: #dcf4ee;
  color: var(--primary-2);
  box-shadow: 0 0 0 6px rgba(16, 163, 127, 0.12);
  animation: voicePulse 1.4s ease-in-out infinite;
}

.voice-button.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.voice-status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -2px 10px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.empty-state.compact {
  margin: 4px 8px;
  padding: 10px;
  font-size: 0.84rem;
}

.answer-content {
  display: grid;
  gap: 10px;
}

.answer-content p {
  margin: 0;
  line-height: 1.62;
}

.answer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: #142f3f;
  font-size: 0.98rem;
}

.answer-heading:first-child {
  margin-top: 0;
}

.answer-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
}

.answer-list li {
  line-height: 1.55;
}

.answer-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f0f2f4;
}

@keyframes voicePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.sources {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.sources strong {
  width: 100%;
  color: var(--text);
}

.sources span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: #f7fafb;
}

.info-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.chat-body .info-grid {
  width: min(980px, 100%);
  margin: 28px auto 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-panel {
  border-radius: 8px;
  padding: 20px;
}

.chat-body .info-panel {
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: none;
  background: #fafafa;
  backdrop-filter: none;
}

.info-panel h2 {
  font-size: 1.05rem;
}

.card-list,
.data-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.chat-body .info-card {
  border-color: transparent;
  background: #ffffff;
  box-shadow: none;
}

.info-card.accent {
  border-color: rgba(192, 90, 67, 0.35);
  background: #fff8f6;
}

.info-card h3 {
  margin: 6px 0;
  font-size: 1rem;
}

.info-card p {
  margin: 0;
  line-height: 1.45;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  border-radius: 8px;
  padding: 26px;
}

.modal::backdrop {
  background: rgba(15, 25, 33, 0.42);
}

.modal-close-form {
  display: flex;
  justify-content: flex-end;
}

.modal-close-form button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-preview {
  width: 66px;
  height: 66px;
  font-size: 1.2rem;
}

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

.form-grid .primary-button,
.form-grid .danger-button,
.form-grid .form-message {
  grid-column: span 2;
}

.admin-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 26px auto 56px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 18px;
}

.admin-sidebar,
.admin-content {
  border-radius: 8px;
}

.admin-sidebar {
  padding: 12px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.tab-button {
  justify-content: flex-start;
}

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

.admin-content {
  padding: 24px;
}

.admin-heading {
  margin-bottom: 20px;
}

.admin-tab {
  display: none;
}

.admin-tab.active {
  display: block;
}

.admin-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.admin-form.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.document-form {
  grid-template-columns: 1.2fr 0.7fr 0.7fr auto;
}

.document-form textarea {
  grid-column: 1 / -1;
  min-height: 190px;
}

.file-loader input {
  display: none;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.data-row.document-row {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.data-row strong {
  display: block;
  margin-bottom: 4px;
}

.data-row p,
.data-row small {
  margin: 0;
  line-height: 1.4;
}

.mini-danger {
  min-height: 34px;
  padding: 0 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 920px) {
  .login-shell,
  .info-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav,
  .chat-history-panel,
  .side-note {
    grid-column: 1 / -1;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .side-note {
    display: none;
  }

  .chat-history-panel {
    max-height: 170px;
  }

  .chat-history-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 240px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .conversation-topbar {
    top: 0;
  }

  .chat-body .workspace {
    width: min(100% - 24px, 980px);
    padding-top: 22px;
  }

  .prompt-row,
  .chat-body .info-grid {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 360px;
  }

  .admin-sidebar {
    display: flex;
    overflow-x: auto;
  }

  .admin-form,
  .admin-form.wide,
  .document-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .document-form textarea,
  .form-grid .primary-button,
  .form-grid .danger-button,
  .form-grid .form-message {
    grid-column: auto;
  }

  .data-row,
  .data-row.document-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: auto;
    padding: 14px;
    gap: 12px;
  }

  .app-logo strong {
    display: none;
  }

  .workspace,
  .admin-layout {
    width: min(100% - 20px, 1180px);
    margin-top: 14px;
  }

  .chat-body .workspace {
    width: min(100% - 18px, 980px);
    margin-top: 0;
  }

  .conversation-topbar {
    padding: 0 14px;
  }

  .conversation-topbar strong {
    font-size: 0.86rem;
  }

  .chat-sidebar {
    padding: 10px;
  }

  .side-logo strong {
    display: none;
  }

  .side-action {
    width: auto;
    min-width: 150px;
  }

  .history-title-row {
    padding-left: 2px;
  }

  .chat-hero {
    padding: 16px;
  }

  .chat-body .chat-hero {
    min-height: calc(100vh - 208px);
    padding: 0;
  }

  .chat-body .chat-heading h1 {
    font-size: 2rem;
  }

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

  .chat-body .chat-form {
    grid-template-columns: 1fr 38px 38px;
    bottom: 10px;
    border-radius: 20px;
  }

  .send-button,
  .voice-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

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

  .chat-body .message {
    padding: 14px 0;
  }

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

/* =========================================================
   Interface corporativa — Login e Painel Administrativo
   Mantém a experiência do chat praticamente inalterada.
   ========================================================= */

.login-body {
  background: #eef2f5;
  background-image: none;
  animation: none;
}

.login-shell {
  width: min(1040px, 100%);
  gap: 0;
  border: 1px solid #d7dfe6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 42, 58, 0.12);
}

.login-brand {
  min-height: 550px;
  padding: 52px;
  border: 0;
  border-radius: 0;
  background: #17354a;
  color: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.login-brand::before {
  display: none;
}

.login-brand .brand-mark {
  background: #fff;
  color: #17354a;
  border-radius: 6px;
}

.login-brand h1 {
  margin: auto 0 14px;
  max-width: 430px;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.login-brand p {
  color: #c8d6df;
  max-width: 430px;
  font-size: 1.04rem;
}

.login-metrics span {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #dce8ee;
}

.login-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.login-card .eyebrow {
  color: #557080;
}

.login-card h2 {
  color: #17354a;
  font-size: 1.8rem;
}

.login-card .primary-button {
  background: #1f5c78;
}

.login-card .primary-button:hover {
  background: #174a62;
}

.admin-body {
  --admin-navy: #17354a;
  --admin-blue: #1f5c78;
  --admin-bg: #eef2f5;
  --admin-line: #d8e0e6;
  --admin-soft: #f7f9fa;
  --admin-text: #1c2b36;
  --admin-muted: #657681;
  min-height: 100vh;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.admin-body button:hover,
.admin-body a:hover {
  transform: none;
}

.admin-topbar {
  height: 68px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--admin-navy);
  border-bottom: 1px solid #102a3b;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.admin-brand-mark {
  width: 78px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff;
  color: var(--admin-navy);
  font-weight: 850;
  font-size: 0.86rem;
}

.admin-brand-mark img {
  width: 70px;
  height: 30px;
  object-fit: contain;
}

.admin-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.admin-brand strong {
  font-size: 0.94rem;
  letter-spacing: 0.01em;
}

.admin-brand small {
  color: #b9cad5;
  font-size: 0.76rem;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-chat-link {
  color: #dbe6ec;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.86rem;
  padding: 8px 10px;
}

.admin-topbar .avatar-button {
  border-color: rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.admin-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 24px auto 48px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-body .admin-sidebar {
  position: sticky;
  top: 92px;
  display: block;
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(20, 42, 58, 0.05);
  backdrop-filter: none;
}

.admin-sidebar-header {
  padding: 8px 8px 14px;
  border-bottom: 1px solid #e6ebef;
  display: grid;
  gap: 2px;
}

.admin-sidebar-header span {
  color: #7c8b94;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.admin-sidebar-header strong {
  color: var(--admin-navy);
  font-size: 1rem;
}

.admin-nav {
  display: grid;
  gap: 4px;
  padding: 10px 0;
}

.admin-body .tab-button {
  width: 100%;
  min-height: 58px;
  padding: 9px 11px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #354957;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.admin-body .tab-button span {
  font-size: 0.9rem;
  font-weight: 750;
}

.admin-body .tab-button small {
  color: #84939c;
  font-size: 0.72rem;
  font-weight: 500;
}

.admin-body .tab-button:hover {
  background: #f3f6f8;
}

.admin-body .tab-button.active {
  border-left-color: var(--admin-blue);
  background: #eef5f8;
  color: var(--admin-navy);
}

.admin-body .tab-button.active small {
  color: #5f7887;
}

.admin-sidebar-note {
  margin-top: 8px;
  padding: 13px 12px;
  border-top: 1px solid #e6ebef;
}

.admin-sidebar-note strong {
  color: #455b69;
  font-size: 0.8rem;
}

.admin-sidebar-note p {
  margin: 6px 0 0;
  color: #7b8b95;
  font-size: 0.76rem;
  line-height: 1.48;
}

.admin-body .admin-content {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(20, 42, 58, 0.05);
  backdrop-filter: none;
}

.admin-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e5eaee;
}

.admin-body .admin-heading {
  margin: 0;
}

.admin-body .admin-heading .eyebrow {
  color: #67808f;
  letter-spacing: 0.06em;
}

.admin-body .admin-heading h1 {
  margin-top: 5px;
  color: var(--admin-navy);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.02em;
}

.admin-body .admin-heading p {
  margin: 7px 0 0;
  color: var(--admin-muted);
  line-height: 1.5;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid #cfe0d5;
  border-radius: 999px;
  padding: 8px 11px;
  color: #426553;
  background: #f4faf6;
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3e8d63;
}

.admin-banner {
  margin-top: 18px;
  border: 1px solid #d8e0e6;
  border-radius: 6px;
  padding: 11px 13px;
  background: #f7f9fa;
  color: #4d626f;
  font-size: 0.86rem;
  font-weight: 650;
}

.admin-banner[data-type="error"] {
  border-color: #f0c9c5;
  background: #fff5f4;
  color: #9e342c;
}

.admin-banner[data-type="success"] {
  border-color: #cbe1d4;
  background: #f5faf7;
  color: #34674b;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 26px;
}

.admin-kpis article {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 15px 17px;
  border: 1px solid #dde4e9;
  border-radius: 6px;
  background: #fafbfc;
}

.admin-kpis span {
  color: #71828d;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-kpis strong {
  color: var(--admin-navy);
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.admin-body .admin-tab {
  display: none;
}

.admin-body .admin-tab.active {
  display: block;
}

.admin-body .admin-tab[hidden] {
  display: none !important;
}

.admin-section-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 16px;
}

.admin-section-head > div {
  display: grid;
  gap: 3px;
}

.admin-section-head span {
  color: #738792;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-section-head h2 {
  margin: 0;
  color: var(--admin-navy);
  font-size: 1.35rem;
}

.admin-section-head p {
  margin: 0;
  color: #758690;
  font-size: 0.84rem;
  line-height: 1.5;
}

.admin-body .admin-form {
  display: grid;
  align-items: end;
  gap: 13px;
  padding: 18px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  background: #f8fafb;
}

.admin-form-compact {
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.4fr) minmax(220px, 1fr) auto;
}

.admin-form-access {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.admin-body .admin-form label {
  gap: 6px;
  color: #4d626f;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-body .admin-form input,
.admin-body .admin-form select,
.admin-body .admin-form textarea {
  min-height: 42px;
  border-color: #ccd7de;
  border-radius: 5px;
  padding: 10px 11px;
  color: #203440;
  background: #fff;
  font-size: 0.87rem;
}

.admin-body .admin-form select[multiple] {
  min-height: 92px;
  padding: 8px;
}

.admin-body .admin-form input:focus,
.admin-body .admin-form select:focus,
.admin-body .admin-form textarea:focus {
  border-color: #6590a5;
  box-shadow: 0 0 0 3px rgba(31, 92, 120, 0.10);
}

.admin-body .primary-button {
  min-height: 42px;
  border-radius: 5px;
  background: var(--admin-blue);
  font-size: 0.84rem;
  font-weight: 750;
}

.admin-body .primary-button:hover {
  background: #174a62;
}

.admin-body .primary-button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.admin-body .document-form {
  grid-template-columns: 1.2fr 0.7fr 1.2fr 1.2fr;
  margin-top: 14px;
}

.admin-body .folder-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
  margin-bottom: 14px;
}

.admin-body .folder-list {
  margin-bottom: 18px;
}

.document-explorer {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 620px;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.explorer-sidebar {
  border-right: 1px solid #dfe6eb;
  background: #f6f8fa;
}

.explorer-sidebar-head {
  min-height: 62px;
  padding: 15px 16px;
  border-bottom: 1px solid #dfe6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.explorer-sidebar-head strong {
  color: #243b49;
  font-size: 0.92rem;
}

.explorer-sidebar-head span {
  color: #7b8c96;
  font-size: 0.74rem;
}

.explorer-tree {
  max-height: 560px;
  overflow: auto;
  padding: 10px;
}

.explorer-tree-node {
  display: grid;
  gap: 2px;
}

.explorer-tree-children {
  margin-left: 15px;
  padding-left: 8px;
  border-left: 1px solid #dfe6eb;
}

.explorer-tree-item {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 7px 8px;
  background: transparent;
  color: #334b59;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
}

.explorer-tree-item span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-tree-item small {
  color: #84939b;
  font-size: 0.66rem;
  font-weight: 700;
}

.explorer-tree-item:hover,
.explorer-tree-item.active {
  border-color: #cbd8df;
  background: #fff;
}

.explorer-tree-item.active {
  color: #153f55;
  box-shadow: 0 1px 3px rgba(20, 42, 58, 0.06);
}

.explorer-folder-mark,
.explorer-file-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 17px;
  border-radius: 3px;
  background: #d8a63c;
  box-shadow: inset 0 -2px 0 rgba(87, 62, 15, 0.12);
}

.explorer-folder-mark::before,
.explorer-file-icon.folder::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -4px;
  width: 10px;
  height: 6px;
  border-radius: 3px 3px 0 0;
  background: #e7bd5a;
}

.explorer-main {
  min-width: 0;
  background: #fff;
}

.explorer-actions {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #dfe6eb;
}

.explorer-breadcrumb {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #738792;
  font-size: 0.72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-actions h3 {
  margin: 3px 0 2px;
  color: #223846;
  font-size: 1.08rem;
}

.explorer-actions p {
  margin: 0;
  color: #758690;
  font-size: 0.78rem;
}

.explorer-action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-body .secondary-button {
  min-height: 42px;
  border: 1px solid #cdd9e0;
  border-radius: 5px;
  padding: 0 13px;
  background: #fff;
  color: #334c5b;
  font-size: 0.84rem;
  font-weight: 750;
}

.admin-body .secondary-button:hover {
  background: #f5f8fa;
}

.admin-body .secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.explorer-forms {
  padding: 14px 16px 0;
}

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  align-content: start;
  min-height: 460px;
  padding: 16px;
}

.explorer-grid.drag-over {
  outline: 2px dashed #1f5c78;
  outline-offset: -10px;
  background: #f5fafc;
}

.explorer-card {
  position: relative;
  min-height: 142px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid #dfe6eb;
  border-radius: 7px;
  padding: 14px;
  background: #fff;
  color: #283f4d;
  text-align: left;
}

.explorer-card:hover {
  border-color: #bfcfd8;
  background: #fbfcfd;
  box-shadow: 0 8px 20px rgba(20, 42, 58, 0.06);
}

.folder-card-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.folder-card:hover .folder-card-actions {
  opacity: 1;
}

.folder-card-actions span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 4px;
  padding: 0 8px;
  color: #a24841;
  background: #fff7f6;
  font-size: 0.72rem;
  font-weight: 800;
}

.explorer-card strong {
  min-width: 0;
  color: #233b49;
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.explorer-card small {
  color: #7d8d96;
  font-size: 0.72rem;
  font-weight: 700;
}

.explorer-card p {
  margin: 0;
  color: #71818b;
  font-size: 0.73rem;
  line-height: 1.35;
}

.explorer-file-icon {
  width: 36px;
  height: 42px;
  border: 1px solid #cbd8df;
  border-radius: 5px;
  background: #f8fafb;
  box-shadow: none;
}

.explorer-file-icon.folder {
  width: 40px;
  height: 30px;
  border: 0;
  background: #d8a63c;
  box-shadow: inset 0 -3px 0 rgba(87, 62, 15, 0.12);
}

.explorer-file-icon.text::after,
.explorer-file-icon.pdf::after {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 7px;
  color: #657985;
  font-size: 0.62rem;
  font-weight: 850;
  text-align: center;
}

.explorer-file-icon.text::after {
  content: "TXT";
}

.explorer-file-icon.pdf::after {
  content: "PDF";
  color: #a24841;
}

.explorer-file-icon.text::before,
.explorer-file-icon.pdf::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  border-top: 12px solid #dfe6eb;
  border-left: 12px solid transparent;
  width: 0;
  height: 0;
}

.document-card .mini-danger {
  justify-self: start;
  margin-top: 2px;
  padding-left: 0;
}

.admin-body .document-form .file-loader {
  min-height: 42px;
  align-self: end;
  border: 1px dashed #aebdc7;
  border-radius: 5px;
  background: #fff;
  color: #506976;
  font-size: 0.8rem;
}

.document-content-label {
  grid-column: 1 / -1;
}

.admin-body .document-form textarea {
  min-height: 185px;
}

.field-disabled {
  opacity: 0.58;
}

.form-feedback {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: #6d7e88;
  font-size: 0.78rem;
  font-weight: 650;
}

.form-feedback[data-type="success"] {
  color: #31704d;
}

.form-feedback[data-type="error"] {
  color: #a63b33;
}

.admin-list-head {
  margin: 24px 2px 10px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #758690;
  font-size: 0.76rem;
}

.admin-list-head strong {
  color: #455b68;
  font-size: 0.82rem;
}

.admin-body .data-list {
  display: grid;
  gap: 8px;
}

.admin-body .data-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 18px;
  align-items: center;
  min-height: 70px;
  padding: 13px 15px;
  border: 1px solid #dfe5e9;
  border-radius: 5px;
  background: #fff;
}

.admin-body .data-row:hover {
  border-color: #c9d5dc;
  background: #fcfdfd;
}

.admin-body .data-row.document-row {
  grid-template-columns: minmax(300px, 1fr) auto;
}

.admin-body .data-row-folder {
  grid-template-columns: minmax(300px, 1fr) auto auto;
}

.admin-body .data-row-user {
  grid-template-columns: minmax(260px, 1fr) auto auto auto auto;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-body .mini-action {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #d6e0e6;
  border-radius: 4px;
  background: #fff;
  color: #365467;
  font-size: 0.73rem;
  font-weight: 750;
}

.admin-body .mini-action:hover {
  background: #f5f8fa;
}

.admin-body .data-row-term {
  grid-template-columns: minmax(300px, 1fr) auto auto;
}

.data-main {
  min-width: 0;
}

.admin-body .data-main > strong,
.admin-body .data-title-line > strong {
  color: #213744;
  font-size: 0.9rem;
}

.admin-body .data-main p,
.admin-body .data-main small {
  color: #71818b;
  font-size: 0.78rem;
  line-height: 1.45;
}

.data-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.data-metric {
  min-width: 68px;
  display: grid;
  justify-items: end;
  gap: 1px;
}

.data-metric strong {
  color: #385567;
  font-size: 0.94rem;
}

.data-metric span {
  color: #87959d;
  font-size: 0.68rem;
  text-transform: none;
}

.data-scope {
  color: #607582 !important;
  font-size: 0.76rem !important;
  font-weight: 650 !important;
  text-transform: none !important;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid #d9e1e6;
  border-radius: 999px;
  background: #f7f9fa;
  color: #5f717c !important;
  font-size: 0.68rem !important;
  font-weight: 750 !important;
  line-height: 1;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.status-admin,
.scope-individual {
  border-color: #cbdce7;
  background: #f0f6fa;
  color: #315f78 !important;
}

.status-supervisor {
  border-color: #d9d0ea;
  background: #f7f2ff;
  color: #67508f !important;
}

.status-active {
  border-color: #cce3d6;
  background: #f3faf6;
  color: #3d7254 !important;
}

.status-inactive {
  border-color: #ead2d0;
  background: #fff6f5;
  color: #9c4c45 !important;
}

.scope-sector {
  border-color: #ddd9c7;
  background: #faf9f3;
  color: #746c42 !important;
}

.scope-general,
.priority-normal {
  border-color: #d9e1e6;
  background: #f7f9fa;
}

.priority-media {
  border-color: #eadcb2;
  background: #fffaf0;
  color: #82681b !important;
}

.priority-alta {
  border-color: #efcac5;
  background: #fff5f4;
  color: #9d3a31 !important;
}

.admin-body .mini-danger {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #a24841;
  font-size: 0.73rem;
  font-weight: 700;
}

.admin-body .mini-danger:hover {
  border-color: #efceca;
  background: #fff7f6;
}

.admin-body .empty-state {
  margin: 0;
  border: 1px dashed #cbd6dd;
  border-radius: 5px;
  background: #fafcfd;
  color: #7c8c95;
  font-size: 0.82rem;
}

.admin-body .modal {
  border: 1px solid #d6dfe5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(20, 42, 58, 0.2);
  backdrop-filter: none;
}

@media (max-width: 1100px) {
  .admin-form-access,
  .admin-body .folder-form,
  .admin-body .document-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-explorer {
    grid-template-columns: 230px minmax(0, 1fr);
  }

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

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 260px;
  }

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

  .admin-body .admin-sidebar {
    position: static;
    padding: 10px;
  }

  .admin-sidebar-header,
  .admin-sidebar-note {
    display: none;
  }

  .admin-nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 0;
  }

  .admin-body .tab-button {
    min-width: 145px;
    min-height: 50px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .admin-body .tab-button.active {
    border-bottom-color: var(--admin-blue);
  }

  .admin-section-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .document-explorer {
    grid-template-columns: 1fr;
  }

  .explorer-sidebar {
    border-right: 0;
    border-bottom: 1px solid #dfe6eb;
  }

  .explorer-tree {
    max-height: 260px;
  }

  .explorer-actions {
    grid-template-columns: 1fr;
  }

  .explorer-action-buttons {
    justify-content: stretch;
  }

  .explorer-action-buttons button {
    flex: 1;
  }
}

@media (max-width: 680px) {
  .admin-topbar {
    padding: 0 14px;
  }

  .admin-brand small,
  .admin-chat-link {
    display: none;
  }

  .admin-shell {
    width: min(100% - 18px, 1440px);
    margin-top: 10px;
    gap: 10px;
  }

  .admin-body .admin-content {
    padding: 18px 14px;
  }

  .admin-heading-row {
    display: block;
  }

  .admin-status-pill {
    margin-top: 14px;
  }

  .admin-kpis,
  .admin-form-access,
  .admin-form-compact,
  .admin-body .folder-form,
  .admin-body .document-form {
    grid-template-columns: 1fr;
  }

  .document-content-label {
    grid-column: auto;
  }

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

  .admin-body .data-row,
  .admin-body .data-row.document-row,
  .admin-body .data-row-term,
  .admin-body .data-row-announcement {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .data-metric {
    justify-items: start;
  }

  .admin-list-head span {
    display: none;
  }

  .login-card {
    padding: 34px 24px;
  }
}
