.admin-body {
  min-height: 100vh;
  background: #111;
}

.admin-header {
  position: fixed;
  z-index: 10;
  top: 0;
  width: 100%;
  height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.admin-header > div {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.save-status {
  color: var(--sage);
  font-size: 0.75rem;
}

.admin-preview {
  padding: 0.7rem 1rem;
  border: 1px solid var(--paper);
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  padding-top: 76px;
}

.admin-sidebar {
  position: fixed;
  top: 76px;
  bottom: 0;
  width: 250px;
  padding: 2.5rem 1.5rem;
  border-right: 1px solid var(--line);
}

.admin-sidebar > p {
  color: var(--sage);
  font: 500 0.75rem "Barlow Condensed", sans-serif;
  letter-spacing: 0.15em;
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 2rem;
}

.admin-tab,
.reset-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.85rem;
  text-align: left;
  font: 400 1rem "DM Sans", sans-serif;
  cursor: pointer;
}

.admin-tab {
  display: flex;
  justify-content: space-between;
}

.admin-tab.active,
.admin-tab:hover {
  background: rgba(143, 149, 136, 0.14);
  color: var(--paper);
}

.admin-tab span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--ink);
  font-size: 0.7rem;
}

.reset-button {
  position: absolute;
  bottom: 1.5rem;
  color: #a77;
  font-size: 0.75rem;
}

.admin-content {
  grid-column: 2;
  width: min(900px, calc(100vw - 300px));
  padding: 4rem;
}

.admin-panel {
  display: none;
}

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

.admin-panel > h1 {
  margin: 0.7rem 0 3rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
}

.editor-form,
#services-editor {
  display: grid;
  gap: 1.5rem;
}

.editor-card,
.service-editor,
.appointment-card {
  padding: 2rem;
  border: 1px solid var(--line);
  background: #161616;
}

.editor-card h2 {
  margin: 0 0 2rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
}

.editor-card label,
.service-editor label {
  display: block;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.editor-card input,
.editor-card textarea,
.service-editor input,
.service-editor textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: #0c0c0c;
  color: var(--paper);
  font: 1rem "DM Sans", sans-serif;
  resize: vertical;
}

.admin-save,
.add-service {
  width: fit-content;
  padding: 1rem 1.4rem;
  border: 0;
  background: var(--sage);
  color: var(--ink);
  font: 600 0.9rem "DM Sans", sans-serif;
  cursor: pointer;
}

.service-editor {
  position: relative;
}

.remove-service,
.delete-appointment {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: #c88;
  cursor: pointer;
}

.color-editor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.color-editor input {
  height: 70px;
  padding: 0.3rem;
}

.appearance-preview {
  min-height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  background: var(--ink);
  color: var(--paper);
  font: 700 2rem "Barlow Condensed", sans-serif;
}

.appearance-preview img {
  width: 110px;
}

#appointments-list {
  display: grid;
  gap: 1rem;
}

.appointment-card {
  position: relative;
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  gap: 1rem;
}

.appointment-card time {
  color: var(--sage);
  font: 600 1.5rem "Barlow Condensed", sans-serif;
}

.appointment-card p {
  margin: 0.3rem 0;
}

.empty-state {
  padding: 4rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .save-status {
    display: none;
  }

  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-sidebar nav {
    overflow-x: auto;
    flex-direction: row;
    margin-top: 1rem;
  }

  .admin-tab {
    white-space: nowrap;
  }

  .reset-button {
    display: none;
  }

  .admin-content {
    width: 100%;
    padding: 2rem 1rem;
  }

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

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.analytics-grid article {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #151515;
}

.analytics-grid span {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
}

.analytics-grid small {
  color: var(--muted);
}

.analytics-summary h2 {
  margin-bottom: 1rem;
}

.analytics-summary p {
  color: var(--muted);
  line-height: 1.65;
}

.analytics-reset {
  margin-top: 1rem;
  border: 0;
  background: transparent;
  color: #c99;
  cursor: pointer;
}

.seo-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
  align-items: start;
}

.field-counter {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.seo-score-card,
.google-preview {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #151515;
}

.seo-score-card > span {
  display: block;
  font-size: 4rem;
  font-weight: 300;
}

.seo-score-card > small,
.google-preview > small {
  color: var(--muted);
}

.seo-score-track {
  height: 6px;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: 99px;
  background: #282828;
}

.seo-score-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
  transition: width 0.35s ease;
}

#seo-checklist {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
}

#seo-checklist li.valid {
  color: var(--sage);
}

.google-preview {
  margin-top: 1rem;
  background: #fff;
  color: #202124;
}

.google-preview cite {
  display: block;
  margin: 1.5rem 0 0.5rem;
  color: #202124;
  font: normal 0.75rem Arial, sans-serif;
}

.google-preview h3 {
  margin: 0;
  color: #1a0dab;
  font: 400 1.2rem Arial, sans-serif;
}

.google-preview p {
  color: #4d5156;
  font: 0.82rem/1.5 Arial, sans-serif;
}

.admin-access-link {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

@media (max-width: 900px) {
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 560px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Intuitive dashboard */
.admin-body {
  background: #0b0b0b;
}

.admin-sidebar {
  background: #0e0e0e;
}

.admin-sidebar > p {
  margin: 0 0 1.5rem 0.85rem;
}

.admin-sidebar nav {
  gap: 0.2rem;
}

.admin-tab {
  border-radius: 10px;
  font-size: 0.88rem;
}

.admin-tab.active {
  background: var(--paper);
  color: var(--ink);
}

.admin-content {
  width: min(1080px, calc(100vw - 290px));
  padding: clamp(2.5rem, 5vw, 5rem);
}

.dashboard-lead {
  max-width: 560px;
  margin: -2rem 0 3rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.dashboard-stats button {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #151515;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.dashboard-stats button:hover,
.quick-actions button:hover {
  border-color: var(--sage);
  transform: translateY(-3px);
}

.dashboard-stats span {
  font-size: 3rem;
  font-weight: 300;
}

.dashboard-stats small {
  color: var(--muted);
}

.dashboard-title {
  margin: 4rem 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.quick-actions button {
  min-height: 110px;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121212;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.quick-actions b {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(143, 149, 136, 0.18);
  color: var(--sage);
  font-size: 1.25rem;
}

.quick-actions span {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 1rem;
}

.quick-actions small {
  color: var(--muted);
  font-size: 0.75rem;
}

.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.password-rules span {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(143, 149, 136, 0.14);
  color: var(--sage);
  font-size: 0.72rem;
}

.security-note {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(143, 149, 136, 0.25);
  border-radius: 16px;
  background: rgba(143, 149, 136, 0.07);
}

.security-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-intro {
  margin: -2rem 0 2.5rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 980px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .admin-content {
    width: 100%;
  }

  .dashboard-stats,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-stats button {
    min-height: 120px;
  }
}

#portfolio-editor,
#quotes-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.portfolio-admin-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #161616;
}

.portfolio-admin-item img {
  width: 150px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.portfolio-admin-item h3 {
  margin: 0 0 0.4rem;
}

.portfolio-admin-item p {
  margin: 0;
  color: var(--muted);
}

.portfolio-admin-item button {
  border: 0;
  background: transparent;
  color: #c88;
  cursor: pointer;
}

.service-editor-grid {
  display: grid;
  grid-template-columns: 1fr 0.4fr;
  gap: 1rem;
}

.admin-help {
  color: var(--muted);
  line-height: 1.6;
}

.media-editor {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.media-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: #161616;
}

.media-preview {
  width: 240px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: 45% 55% 38% 62% / 52% 42% 58% 48%;
  background: #222 center / cover;
  color: var(--muted);
  font: 500 0.7rem "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
}

.media-upload {
  display: inline-block;
  padding: 0.8rem 1rem;
  background: var(--sage);
  color: var(--ink);
  cursor: pointer;
}

.media-upload input {
  display: none;
}

.media-remove {
  display: block;
  margin-top: 1rem;
  border: 0;
  background: transparent;
  color: #c88;
  cursor: pointer;
}

.admin-logout {
  position: fixed;
  right: 2rem;
  bottom: 1.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid #966;
  background: var(--ink);
  color: #c99;
  cursor: pointer;
}

.login-body {
  min-height: 100svh;
  background: var(--ink);
}

.login-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  align-items: center;
  gap: 8vw;
  padding: clamp(2rem, 8vw, 8rem);
}

.login-shell > .brand {
  justify-self: center;
  font-size: 2rem;
}

.login-shell > .brand img {
  width: 120px;
  height: 110px;
}

.login-card {
  max-width: 560px;
  padding: clamp(2rem, 5vw, 5rem);
  border: 1px solid var(--line);
  border-radius: 5rem 0.5rem 5rem 5rem;
  background: #101010;
}

.login-card h1 {
  margin: 1rem 0 3rem;
  font: 700 clamp(3rem, 6vw, 6rem) "Barlow Condensed", sans-serif;
}

.login-card label {
  display: block;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.login-card input {
  width: 100%;
  padding: 0.9rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font: 1rem "DM Sans", sans-serif;
}

.login-card button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin: 2rem 0 1.5rem;
  padding: 1rem;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.login-card > a {
  color: var(--muted);
  font-size: 0.8rem;
}

.login-error {
  min-height: 1.2em;
  color: #d99;
}

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

  .login-shell > .brand {
    display: none;
  }

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

  .media-preview {
    width: 100%;
  }
}
