.admin-body {
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: clip;
  background: #071426;
}

[hidden] {
  display: none !important;
}

.demo-login {
  position: relative;
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(420px, 0.88fr) minmax(520px, 1.12fr);
  overflow: hidden;
  background: #071426;
}

.login-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: linear-gradient(100deg, black, transparent 74%);
  pointer-events: none;
}

.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  max-width: 720px;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 90px);
  border-right: 1px solid var(--line);
}

.login-panel > .brand {
  position: absolute;
  top: 36px;
  left: clamp(34px, 6vw, 90px);
}

.login-copy h1 {
  max-width: 640px;
  margin-bottom: 26px;
  font-size: clamp(2.6rem, 3.85vw, 4.2rem);
  overflow-wrap: normal;
}

.login-copy > p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
}

.login-notice {
  max-width: 600px;
  margin: 34px 0 24px;
  border-left: 2px solid var(--accent-light);
  padding: 13px 18px;
  background: rgba(102, 199, 255, 0.055);
}

.login-notice span {
  color: var(--accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.login-notice p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.login-button {
  width: fit-content;
  margin-bottom: 22px;
}

.login-visual {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(36px, 4.5vw, 72px);
  background:
    radial-gradient(circle at 70% 35%, rgba(79, 140, 255, 0.18), transparent 32%),
    rgba(5, 15, 29, 0.35);
}

.login-visual::before {
  position: absolute;
  inset: 12% 10%;
  border: 1px solid rgba(102, 199, 255, 0.1);
  content: "";
}

.login-visual-top,
.login-visual-footer,
.login-lead {
  position: relative;
  z-index: 1;
}

.login-visual-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.67rem;
  letter-spacing: 0.13em;
}

.login-visual-top i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(86, 214, 164, 0.08);
}

.login-lead {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  border: 1px solid var(--line);
  padding: 18px;
  background: rgba(13, 32, 57, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.login-lead.active {
  border-color: rgba(102, 199, 255, 0.36);
  transform: translateX(-12px);
}

.login-lead b {
  color: var(--accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.login-lead div {
  display: grid;
  gap: 3px;
}

.login-lead strong {
  font-size: 0.88rem;
}

.login-lead div span {
  color: var(--faint);
  font-size: 0.7rem;
}

.login-lead em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-visual-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 262px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  height: 100dvh;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: #061120;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 84px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.demo-mode {
  border: 1px solid rgba(244, 189, 99, 0.28);
  padding: 4px 7px;
  color: var(--warning);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 22px 12px;
}

.admin-nav button {
  display: grid;
  min-height: 52px;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 10px 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.admin-nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.admin-nav button.active {
  border-color: rgba(79, 140, 255, 0.24);
  background: rgba(79, 140, 255, 0.1);
  color: var(--text);
}

.admin-nav button > span {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
}

.admin-nav button.active > span {
  color: var(--accent-light);
}

.admin-nav button i {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.62rem;
  font-style: normal;
}

.sidebar-foot {
  padding: 18px 20px 24px;
  border-top: 1px solid var(--line);
}

.sidebar-foot p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--faint);
  font-size: 0.68rem;
}

.sidebar-foot p i,
.sync-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.sidebar-foot a {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.admin-main {
  min-width: 0;
  background: #071426;
}

.admin-topbar {
  display: flex;
  min-height: 122px;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  padding: 24px clamp(24px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 20, 38, 0.92);
}

.admin-topbar > div:first-child > p {
  margin-bottom: 7px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
}

.admin-topbar > div:first-child > p span {
  color: var(--accent-light);
}

.admin-topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 0.68rem;
}

.admin-section {
  padding: clamp(26px, 4vw, 58px);
}

.lead-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 28px;
  border: 1px solid var(--line);
  background: var(--bg-secondary);
}

.lead-summary-grid article {
  display: grid;
  min-height: 152px;
  grid-template-rows: auto 1fr auto;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.lead-summary-grid article:last-child {
  border-right: 0;
}

.lead-summary-grid article > span,
.lead-summary-grid article > small {
  color: var(--faint);
  font-size: 0.68rem;
}

.lead-summary-grid article > span {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-summary-grid strong {
  align-self: center;
  font-size: clamp(2.25rem, 4vw, 3.4rem);
  font-weight: 520;
  letter-spacing: -0.05em;
}

.data-panel,
.editor-panel,
.settings-panel {
  border: 1px solid var(--line);
  background: var(--bg-secondary);
}

.panel-heading,
.section-toolbar,
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.panel-heading {
  min-height: 92px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-label {
  margin-bottom: 7px;
  color: var(--accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.panel-heading h3,
.section-toolbar h2,
.editor-heading h3 {
  margin: 0;
}

.panel-heading h3 {
  font-size: 1.25rem;
}

.lead-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.lead-filters [data-reset-demo] {
  min-height: 42px;
  white-space: nowrap;
}

.lead-filters input,
.lead-filters select,
.admin-select-label select {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 12px;
  background: #08172b;
  color: var(--text);
  font-size: 0.76rem;
}

.lead-filters input {
  width: min(260px, 28vw);
}

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  contain: layout paint;
}

.lead-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.lead-table th,
.lead-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.lead-table th {
  color: var(--faint);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lead-table td {
  color: var(--muted);
  font-size: 0.77rem;
}

.lead-table td:first-child {
  display: grid;
  min-width: 170px;
  gap: 3px;
}

.lead-table td:first-child strong {
  color: var(--text);
  font-size: 0.82rem;
}

.lead-table td:first-child small {
  color: var(--faint);
  font-size: 0.66rem;
}

.source-cell {
  text-transform: capitalize;
}

.status-pill {
  display: inline-flex;
  max-width: 190px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 5px 9px;
  font-size: 0.62rem;
  line-height: 1.3;
}

.status-new { border-color: rgba(102, 199, 255, 0.32); color: var(--accent-light); }
.status-qualified { border-color: rgba(86, 214, 164, 0.28); color: var(--success); }
.status-handoff { border-color: rgba(244, 189, 99, 0.3); color: var(--warning); }
.status-progress { border-color: rgba(159, 126, 255, 0.3); color: #b9a4ff; }
.status-closed { color: var(--faint); }

.row-action,
.small-action,
.remove-editor-row {
  border: 0;
  padding: 5px 0;
  background: transparent;
  color: var(--accent-light);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(102, 199, 255, 0.28);
  text-underline-offset: 4px;
}

.row-action:hover,
.small-action:hover {
  text-decoration-color: var(--accent-light);
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.section-toolbar {
  align-items: end;
  margin-bottom: 36px;
}

.section-toolbar > div {
  max-width: 850px;
}

.section-toolbar h2 {
  font-size: clamp(2.1rem, 4vw, 3.8rem);
}

.section-toolbar > div > p:last-child {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
}

.admin-select-label {
  display: grid;
  min-width: 220px;
  gap: 7px;
  color: var(--faint);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.knowledge-form {
  display: grid;
  gap: 24px;
}

.editor-heading {
  min-height: 82px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.editor-heading > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.editor-heading > div > span {
  color: var(--accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.67rem;
}

.editor-heading p {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 22px;
}

.form-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.form-grid label > span,
.dialog-status > span {
  color: var(--faint);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.form-grid input,
.form-grid textarea,
.dialog-status select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 11px 12px;
  background: #08172b;
  color: var(--text);
  resize: vertical;
}

.form-grid input {
  min-height: 44px;
}

.full-field {
  grid-column: 1 / -1;
}

.editor-list {
  display: grid;
}

.editor-row {
  border-bottom: 1px solid var(--line);
}

.editor-row:last-child {
  border-bottom: 0;
}

.editor-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px 0;
}

.editor-row-header strong {
  font-size: 0.82rem;
}

.remove-editor-row {
  color: var(--danger);
  text-decoration-color: rgba(255, 125, 125, 0.3);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 4px 0 20px;
}

.save-state {
  min-height: 22px;
  margin-left: 8px;
  color: var(--success);
  font-size: 0.72rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.template-card {
  display: grid;
  min-height: 330px;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid var(--line);
  padding: 26px;
  background: var(--bg-secondary);
}

.template-card.active {
  border-color: rgba(102, 199, 255, 0.38);
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.13), var(--bg-secondary));
}

.template-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-card-top > span {
  color: var(--accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.67rem;
}

.template-card-top em {
  color: var(--success);
  font-size: 0.58rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

.template-card h3 {
  margin: 54px 0 16px;
  font-size: 2rem;
}

.template-card p {
  color: var(--muted);
}

.template-card .button {
  width: fit-content;
}

.architecture-note {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 24px;
  margin-top: 20px;
  border: 1px dashed var(--line-strong);
  padding: 26px;
}

.architecture-note > span {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--accent-light);
  font-size: 1.6rem;
}

.architecture-note h3 {
  margin-bottom: 10px;
}

.architecture-note p {
  margin: 0;
  color: var(--muted);
}

.architecture-note code,
.mock-warning code {
  border: 1px solid var(--line);
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-light);
  font-size: 0.82em;
}

.settings-panel {
  max-width: 980px;
}

.settings-panel .form-actions {
  padding: 0 22px 24px;
}

.notification-settings {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.channel-list,
.owner-message-preview {
  border: 1px solid var(--line);
  padding: 24px;
  background: var(--bg-secondary);
}

.channel-row {
  position: relative;
  display: grid;
  min-height: 84px;
  grid-template-columns: 44px 1fr 48px;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.channel-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
  font-weight: 800;
}

.channel-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.channel-row strong {
  font-size: 0.85rem;
}

.channel-row small {
  color: var(--faint);
  font-size: 0.68rem;
}

.channel-row input {
  position: absolute;
  opacity: 0;
}

.channel-row > i {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #071426;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.channel-row > i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--faint);
  content: "";
  transition: transform 180ms ease, background-color 180ms ease;
}

.channel-row input:focus-visible + i {
  outline: 3px solid var(--accent-light);
  outline-offset: 3px;
}

.channel-row input:checked + i {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.23);
}

.channel-row input:checked + i::after {
  background: var(--accent-light);
  transform: translateX(20px);
}

.mock-warning {
  margin-top: 28px;
  border-left: 2px solid var(--warning);
  padding: 14px 16px;
  background: rgba(244, 189, 99, 0.055);
}

.mock-warning strong {
  color: var(--warning);
  font-size: 0.74rem;
}

.mock-warning p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.preview-label {
  display: block;
  margin-bottom: 20px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.owner-message-preview article {
  border: 1px solid var(--line-strong);
  padding: 18px;
  background: #08172b;
}

.owner-message-preview article header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.owner-message-preview article header > div {
  display: grid;
  gap: 2px;
}

.owner-message-preview article header strong {
  font-size: 0.76rem;
}

.owner-message-preview article header span {
  color: var(--faint);
  font-size: 0.64rem;
}

.owner-message-preview pre {
  max-height: 360px;
  margin: 18px 0;
  overflow: auto;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.73rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.owner-message-preview article > div:last-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.owner-message-preview button,
.dialog-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
}

.lead-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  margin: auto;
  overflow: auto;
  border: 1px solid var(--line-strong);
  padding: 0;
  background: var(--bg-secondary);
  color: var(--text);
  box-shadow: var(--shadow);
}

.lead-dialog::backdrop {
  background: rgba(2, 8, 16, 0.78);
  backdrop-filter: blur(8px);
}

.lead-dialog-shell > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.lead-dialog-shell > header span {
  color: var(--accent-light);
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0.11em;
}

.lead-dialog-shell > header h2 {
  margin: 5px 0 0;
  font-size: 1.7rem;
}

.lead-dialog-shell > header button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 24px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.lead-detail-grid > div {
  min-height: 86px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lead-detail-grid dt {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lead-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.lead-detail-grid .full-detail {
  grid-column: 1 / -1;
}

.dialog-status {
  display: grid;
  gap: 8px;
  margin: 0 24px 20px;
}

.dialog-status select {
  min-height: 46px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 0 24px;
}

.dialog-actions button {
  min-height: 46px;
  cursor: pointer;
}

.dialog-actions button:hover {
  border-color: var(--accent-light);
  color: var(--text);
}

.dialog-note {
  margin: 18px 24px 24px;
  color: var(--faint);
  font-size: 0.68rem;
}

.admin-toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 28px));
  border: 1px solid rgba(86, 214, 164, 0.32);
  padding: 13px 16px;
  background: #0d2039;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.76rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.admin-toast.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1080px) {
  .demo-login {
    grid-template-columns: 1fr 0.8fr;
  }

  .login-visual {
    padding: 50px 36px;
  }

  .admin-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar-top {
    align-items: start;
    flex-direction: column;
  }

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

  .lead-summary-grid article:nth-child(2) {
    border-right: 0;
  }

  .lead-summary-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .notification-settings {
    grid-template-columns: 1fr;
  }
}

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

  .login-panel {
    max-width: none;
    border-right: 0;
  }

  .login-visual {
    display: none;
  }

  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: sticky;
    width: 100%;
    height: auto;
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-top {
    min-height: 68px;
    align-items: center;
    flex-direction: row;
    padding: 12px 16px;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
    contain: layout paint;
    gap: 6px;
    padding: 8px 12px 12px;
    scrollbar-width: none;
  }

  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-nav button {
    min-width: max-content;
    grid-template-columns: 24px auto auto;
  }

  .sidebar-foot {
    display: none;
  }

  .admin-topbar {
    min-height: 106px;
  }

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

  .admin-select-label {
    width: min(100%, 340px);
  }
}

@media (max-width: 700px) {
  .login-panel {
    padding: 100px 22px 50px;
  }

  .login-panel > .brand {
    top: 24px;
    left: 22px;
  }

  .login-copy h1 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 20px 18px;
  }

  .topbar-actions {
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar-actions .button {
    max-width: 100%;
    white-space: normal;
  }

  .admin-section {
    padding: 24px 14px 48px;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .lead-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lead-filters [data-reset-demo] {
    grid-column: 1 / -1;
  }

  .lead-filters input,
  .lead-filters select {
    width: 100%;
  }

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

  .full-field {
    grid-column: auto;
  }

  .editor-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
  }

  .editor-heading p {
    display: none;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  .save-state {
    margin-left: 0;
  }

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

  .template-card {
    min-height: 300px;
  }

  .architecture-note {
    grid-template-columns: 1fr;
  }

  .lead-detail-grid {
    grid-template-columns: 1fr;
    margin: 18px;
  }

  .lead-detail-grid .full-detail {
    grid-column: auto;
  }

  .dialog-status,
  .dialog-actions,
  .dialog-note {
    margin-inline: 18px;
  }

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

@media (max-width: 430px) {
  .brand-copy span {
    display: grid;
  }

  .sidebar-top .brand-copy span {
    display: none;
  }

  .admin-nav button {
    min-height: 44px;
    padding: 7px 9px;
    font-size: 0.75rem;
  }

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

  .lead-summary-grid article {
    min-height: 132px;
    padding: 15px;
  }

  .lead-summary-grid strong {
    font-size: 2.2rem;
  }

  .lead-filters {
    grid-template-columns: 1fr;
  }

  .section-toolbar h2 {
    font-size: 2.25rem;
  }

  .channel-list,
  .owner-message-preview {
    padding: 17px;
  }

  .channel-row {
    grid-template-columns: 38px 1fr 44px;
    gap: 10px;
  }

  .channel-icon {
    width: 34px;
    height: 34px;
  }

  .lead-dialog {
    width: calc(100% - 10px);
    max-height: calc(100dvh - 10px);
  }
}
