.dashboard-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 170, 167, 0.28), transparent 26%),
    radial-gradient(circle at 90% 10%, rgba(145, 171, 237, 0.26), transparent 28%),
    var(--paper);
}

.dashboard-page h1,
.dashboard-page h2,
.dashboard-page h3,
.dashboard-page p {
  margin-top: 0;
}

.dashboard-page .eyebrow {
  margin-bottom: 10px;
  color: rgba(46, 33, 27, 0.72);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.dashboard-page:not(.is-authenticated) {
  display: block;
}

.dashboard-page:not(.is-authenticated) .dash-sidebar,
.dashboard-page:not(.is-authenticated) .dash-main {
  display: none;
}

.dashboard-page.is-authenticated .login-gate {
  display: none;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 70px);
  background:
    linear-gradient(135deg, rgba(255, 248, 135, 0.64), transparent 38%),
    radial-gradient(circle at 82% 22%, rgba(206, 176, 239, 0.5), transparent 28%),
    radial-gradient(circle at 18% 76%, rgba(176, 211, 183, 0.48), transparent 30%),
    var(--paper);
}

.login-card {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1fr);
  gap: clamp(18px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 48px);
  background: rgba(251, 248, 235, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-copy {
  display: grid;
  align-content: center;
  gap: 18px;
}

.login-copy .brand {
  font-size: clamp(58px, 10vw, 116px);
}

.login-copy h1 {
  max-width: 560px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  line-height: 0.88;
}

.login-copy p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.demo-accounts {
  display: grid;
  gap: 10px;
}

.demo-accounts button {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-accounts button:hover,
.demo-accounts button.is-selected {
  background: var(--yellow);
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(46, 33, 27, 0.1);
}

.demo-accounts span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  min-height: 66px;
  border-radius: 8px;
  background: var(--pink);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.demo-accounts button:nth-child(2) span {
  background: var(--green);
}

.demo-accounts button:nth-child(3) span {
  background: var(--blue);
}

.demo-accounts b {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}

.demo-accounts small,
.login-note {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 12px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.dash-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 34px;
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  background: rgba(251, 248, 235, 0.82);
  backdrop-filter: blur(18px);
}

.dash-sidebar::after {
  height: 1px;
  margin-top: -16px;
  background: linear-gradient(90deg, transparent, rgba(46, 33, 27, 0.18), transparent);
  content: "";
}

.dash-sidebar .brand {
  font-size: 58px;
}

.session-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.session-card span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--yellow);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
}

.session-card b,
.session-card p {
  display: block;
  margin: 0;
}

.session-card b {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.session-card p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.dash-sidebar nav {
  display: grid;
  gap: 8px;
}

.dash-sidebar button,
.dash-view-site,
.dash-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dash-sidebar button {
  position: relative;
  text-align: left;
}

.dash-sidebar button.active::before {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
  transform: translateY(-50%);
}

.dash-sidebar button:hover,
.dash-sidebar button.active,
.dash-button.primary,
.dash-view-site:hover {
  background: var(--yellow);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(46, 33, 27, 0.09);
}

.dash-view-site {
  margin-top: auto;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
}

.dash-main {
  min-width: 0;
  padding: 34px clamp(18px, 4vw, 52px) 60px;
}

.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  background: rgba(251, 248, 235, 0.44);
}

.dash-top h1,
.panel-heading h2,
.live-preview h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 700;
  line-height: 0.9;
}

.dash-subtitle,
.panel-heading p:not(.eyebrow),
.card-heading p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.dash-subtitle {
  max-width: 520px;
  font-size: 17px;
}

.dash-top .eyebrow {
  margin-bottom: 8px;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 18px;
}

.panel-heading div {
  min-width: 0;
}

.panel-heading h2,
.live-preview h2 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.96;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dash-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.dash-button.ghost {
  background: rgba(255, 255, 255, 0.46);
}

.dash-button.danger {
  background: rgba(255, 170, 167, 0.7);
}

.dash-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(46, 33, 27, 0.09);
}

.import-control input {
  display: none;
}

.dash-panel {
  display: none;
}

.dash-panel.active {
  display: block;
  animation: panelIn 0.24s ease both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-grid article,
.live-preview,
.quick-save,
.editor-card,
.collection-editor,
.settings-card,
.inbox-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 18px 45px rgba(46, 33, 27, 0.08);
}

.metric-grid article {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 20px;
}

.metric-grid article::after {
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 248, 135, 0.65);
  content: "";
}

.metric-grid span {
  display: block;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 0.9;
}

.metric-grid p,
.live-preview p,
.quick-save p,
.inbox-card p {
  color: var(--muted);
}

.metric-grid p {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.live-preview > p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.65;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

.live-preview,
.quick-save,
.settings-card {
  padding: clamp(20px, 3vw, 34px);
}

.preview-pills,
.item-actions,
.collection-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-pills span,
.cms-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(176, 211, 183, 0.55);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

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

.editor-card,
.collection-editor {
  padding: 18px;
}

.collection-layout > div {
  min-width: 0;
}

.collection-layout > div:last-child {
  grid-column: 1 / -1;
}

.collection-editor {
  display: grid;
  gap: 14px;
  align-content: start;
}

.collection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.collection-header h3,
.editor-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 0.98;
}

.card-heading {
  display: grid;
  gap: 0;
}

.card-heading p {
  margin-top: 8px;
  font-size: 14px;
}

.item-row {
  display: grid;
  gap: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(251, 248, 235, 0.38);
}

.item-row + .item-row {
  margin-top: 2px;
}

.item-row:first-of-type {
  padding-top: 14px;
}

.item-row:not(:first-of-type) {
  border-top: 1px solid var(--soft-line);
}

.item-actions {
  justify-content: flex-end;
}

.item-actions .dash-button {
  min-height: 38px;
  padding-inline: 12px;
}

.item-actions .dash-button.primary {
  margin-right: auto;
}

.quick-save,
.settings-card {
  display: grid;
  gap: 14px;
}

.quick-save .eyebrow {
  margin-bottom: -2px;
}

.live-preview {
  min-height: 100%;
}

.live-preview .preview-pills {
  margin-top: 22px;
}

.editor-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.field-grid label.full,
.item-row label.full {
  grid-column: 1 / -1;
}

.dashboard-page label {
  display: grid;
  gap: 7px;
  color: rgba(46, 33, 27, 0.76);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.dashboard-page input,
.dashboard-page textarea,
.dashboard-page select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(251, 248, 235, 0.88);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  outline: 0;
}

.dashboard-page input::placeholder,
.dashboard-page textarea::placeholder {
  color: rgba(111, 96, 89, 0.58);
}

.dashboard-page input:hover,
.dashboard-page textarea:hover,
.dashboard-page select:hover {
  border-color: rgba(46, 33, 27, 0.32);
}

.dashboard-page select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.dashboard-page textarea {
  resize: vertical;
}

.dashboard-page input:focus,
.dashboard-page textarea:focus,
.dashboard-page select:focus {
  border-color: rgba(46, 33, 27, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 248, 135, 0.52);
}

.inbox-list {
  display: grid;
  gap: 12px;
}

.inbox-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.inbox-card b {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.05;
}

.inbox-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--yellow);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .dash-sidebar {
    position: sticky;
    z-index: 10;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }

  .dash-sidebar::after {
    display: none;
  }

  .dash-sidebar .brand {
    font-size: 42px;
  }

  .session-card {
    grid-template-columns: 40px 1fr;
    min-width: 0;
    padding: 10px;
  }

  .session-card span {
    width: 40px;
    height: 40px;
    font-size: 23px;
  }

  .dash-sidebar nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 8px;
    margin-inline: -18px;
    overflow-x: auto;
    padding: 0 18px 4px;
    scrollbar-width: none;
  }

  .dash-sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .dash-sidebar nav button {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 10px 13px;
  }

  .dash-sidebar button.active::before {
    top: auto;
    right: 13px;
    bottom: 5px;
    left: 13px;
    width: auto;
    height: 2px;
    border-radius: 999px;
    transform: none;
  }

  .dash-view-site {
    grid-column: 3;
    grid-row: 1;
    margin-top: 0;
    min-width: 118px;
    padding-block: 10px;
  }

  .dash-main {
    padding: 18px 18px 50px;
  }

  .dash-top {
    display: grid;
    gap: 18px;
  }

  .dash-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  .dash-actions .dash-button {
    width: 100%;
    padding-inline: 8px;
  }

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

  .preview-grid,
  .editor-grid,
  .collection-layout {
    grid-template-columns: 1fr;
  }

  .collection-layout > div:last-child {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .dash-sidebar {
    grid-template-columns: 1fr;
  }

  .dash-sidebar nav,
  .dash-view-site {
    grid-column: auto;
    grid-row: auto;
  }

  .dash-sidebar .brand {
    font-size: 48px;
  }

  .dash-top,
  .panel-heading,
  .collection-header,
  .inbox-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .dash-sidebar nav,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .dash-actions,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .demo-accounts button {
    grid-template-columns: 1fr;
  }

  .demo-accounts span {
    grid-row: auto;
  }
}

@media (max-width: 430px) {
  .dash-actions,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
