﻿@font-face {
  font-family: "Kyselka Sans";
  src: url("assets/fonts/KyselkaSans-Regular.woff") format("woff"),
    url("assets/fonts/KyselkaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  font-synthesis: none;
}

@font-face {
  font-family: "Kyselka Sans";
  src: url("assets/fonts/KyselkaSans-Bold.woff") format("woff"),
    url("assets/fonts/KyselkaSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  font-synthesis: none;
}

:root {
  color-scheme: light;
  --brand: #e6215a;
  --green: #00554b;
  --bg: #eef2f5;
  --surface: #ffffff;
  --line: #d9e1ea;
  --text: #253654;
  --muted: #6b7788;
  font-family: "Kyselka Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  font-synthesis: none;
}

h1,
h2,
h3 {
  font-family: "Kyselka Sans", sans-serif;
  font-weight: 700;
}

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

button,
.header-actions a,
.import-label {
  border: 0;
  background: var(--green);
  color: white;
  padding: 11px 16px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
.header-actions a:hover,
.import-label:hover {
  background: var(--brand);
}

.danger {
  background: #b42318;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 24px 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.admin-header p {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1;
}

.admin-role-badge {
  display: inline-flex;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  font-weight: 850;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 900px);
  justify-content: center;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 60px;
}

.admin-sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
  display: grid;
  gap: 1px;
  background: white;
  border: 1px solid var(--line);
}

.admin-sidebar a {
  color: var(--text);
  padding: 13px 16px;
  text-decoration: none;
  font-weight: 700;
  background: white;
}

.admin-sidebar a:hover,
.admin-sidebar a:focus-visible {
  background: #fcf0f0;
  color: var(--brand);
}

.admin-content {
  display: grid;
  gap: 22px;
}

.notice,
.panel {
  background: white;
  border: 1px solid var(--line);
}

.notice {
  padding: 16px 18px;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  padding: 22px;
}

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

.panel h2,
.panel h3 {
  margin: 0;
}

.panel h3 {
  margin-top: 24px;
  margin-bottom: 10px;
}

.panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.editor-list {
  display: grid;
  gap: 14px;
}

.editor-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 14px;
}

.editor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-card-head strong {
  color: var(--brand);
}

.menu-detail-type {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  background: #fcf0f0;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
}

.nav-detail-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.nav-detail-panel p {
  margin: 4px 0 0;
}

.nav-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-detail-button {
  background: white;
  color: var(--green);
  border: 1px solid var(--green);
  padding: 9px 12px;
}

.nav-detail-button:hover,
.nav-detail-button:focus-visible {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.nav-detail-empty {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-inline-detail-list {
  display: grid;
  gap: 10px;
}

.nav-inline-detail {
  border: 1px solid var(--line);
  background: white;
}

.nav-inline-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.nav-inline-detail summary::-webkit-details-marker {
  display: none;
}

.nav-inline-detail summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: #fcf0f0;
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.nav-inline-detail[open] summary::after {
  content: "-";
  background: var(--brand);
  color: white;
}

.nav-inline-detail summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.nav-inline-detail .field-grid {
  border-top: 1px solid var(--line);
  padding: 14px;
}

.spec-editor {
  display: grid;
  gap: 10px;
}

.spec-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spec-editor-head strong {
  color: var(--muted);
  font-size: 0.88rem;
}

.spec-add-button {
  background: var(--brand);
  padding: 9px 12px;
}

.spec-editor-grid {
  display: grid;
  gap: 9px;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  border-left: 4px solid var(--brand);
  background: #fcf0f0;
  padding: 10px;
}

.spec-row input {
  border-color: rgba(230, 33, 90, 0.26);
}

.spec-remove-button {
  min-height: 42px;
  background: white;
  border: 1px solid var(--brand);
  color: var(--brand);
  padding: 9px 12px;
}

.spec-remove-button:hover,
.spec-remove-button:focus-visible {
  background: #b42318;
  border-color: #b42318;
  color: white;
}

.menu-detail-card.is-highlighted {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(230, 33, 90, 0.16);
  animation: admin-detail-pulse 1.2s ease;
}

@keyframes admin-detail-pulse {
  0% {
    transform: translateY(-2px);
  }

  100% {
    transform: translateY(0);
  }
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
}

.toggle-row input {
  width: 22px;
  min-height: 22px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.maintenance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 18px;
  margin-bottom: 16px;
}

.maintenance-card h3 {
  margin: 0 0 6px;
}

.maintenance-card p {
  margin: 0;
}

.maintenance-card button {
  width: auto;
  min-width: 230px;
}

.photo-grid,
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.image-preview {
  display: none;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.image-preview.visible {
  display: block;
}

.import-label input {
  display: none;
}

#jsonBackup {
  margin-top: 14px;
  font-family: Consolas, monospace;
  font-size: 0.86rem;
}

@media (max-width: 940px) {
  .admin-header,
  .panel-head,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    grid-auto-flow: column;
    grid-auto-columns: minmax(126px, 1fr);
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 10px;
    border: 0;
    background: var(--bg);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .admin-sidebar a {
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    padding: 10px 12px;
    background: white;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .field-grid,
  .maintenance-card,
  .photo-grid,
  .system-grid,
  .nav-detail-actions,
  .spec-row {
    grid-template-columns: 1fr;
  }

  .maintenance-card {
    align-items: stretch;
    flex-direction: column;
  }

  .maintenance-card button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .admin-header {
    gap: 14px;
    padding: 16px 14px;
    position: static;
  }

  .admin-header h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
    line-height: 1.05;
  }

  .admin-role-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: white;
    background: var(--green);
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .header-actions a,
  .header-actions button {
    min-height: 44px;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.86rem;
  }

  .panel {
    padding: 16px;
  }

  .admin-layout {
    width: calc(100% - 16px);
    gap: 12px;
    margin-top: 10px;
  }

  .admin-sidebar {
    top: 0;
    margin-inline: -2px;
    padding: 8px 2px 10px;
  }

  .editor-card-head,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .field-grid label,
  .toggle-box,
  .editor-card,
  .admin-user-card {
    min-width: 0;
  }

  .admin-user-invite {
    margin-bottom: 18px;
  }

  .admin-user-invite button {
    width: 100%;
  }

  .admin-user-card {
    display: grid;
  }

  .admin-user-card button {
    justify-self: start;
  }

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

  .admin-invite-link input,
  .admin-invite-link button {
    width: 100%;
  }

  .nav-detail-actions {
    display: grid;
  }
}


.image-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.image-preview-list .image-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.admin-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(0, 85, 75, 0.92), rgba(230, 33, 90, 0.86)),
    url("assets/hero-station.png") center / cover no-repeat;
}

.admin-login-shell {
  width: min(520px, calc(100% - 32px));
}

.admin-login-card {
  background: var(--surface);
  border-top: 8px solid var(--brand);
  padding: clamp(28px, 5vw, 46px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.admin-login-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.admin-login-card h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.admin-login-text {
  margin: 16px 0 24px;
  color: var(--muted);
  line-height: 1.65;
}

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

.admin-login-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.admin-login-form input {
  min-height: 52px;
  border: 1px solid var(--line);
  padding: 10px 13px;
  background: #f8fafc;
}

.admin-login-form input:focus {
  outline: 3px solid rgba(230, 33, 90, 0.2);
  border-color: var(--brand);
}

.admin-login-button,
.admin-login-back {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  margin-top: 18px;
  color: var(--green);
  font-weight: 900;
}

.admin-login-button {
  padding: 11px 16px;
  background: var(--green);
  color: white;
  text-decoration: none;
}

.admin-login-error,
.admin-login-message {
  padding: 12px 14px;
  font-weight: 800;
}

.admin-login-error {
  background: #ffe8e8;
  color: #b42318;
}

.admin-login-message {
  background: #e7f5ef;
  color: var(--green);
}

.admin-2fa-secret {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  border: 1px solid rgba(230, 33, 90, 0.28);
  background: #fcf0f0;
  padding: 14px;
}

.admin-2fa-secret span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-2fa-secret strong {
  color: var(--text);
  font-family: Consolas, monospace;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  overflow-wrap: anywhere;
}

.admin-2fa-secret small {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.admin-user-invite {
  align-items: end;
  margin-bottom: 24px;
}

.admin-user-invite button {
  min-height: 49px;
  background: var(--brand);
  color: white;
}

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

.admin-user-list {
  display: grid;
  gap: 10px;
}

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

.admin-user-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-user-card strong,
.admin-user-card span,
.admin-user-card small {
  overflow-wrap: anywhere;
}

.admin-user-card span,
.admin-user-card small {
  color: var(--muted);
}

.admin-twofa-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-twofa-badge.is-ok {
  color: #00554b;
  background: #dff4ec;
  border-color: rgba(0, 85, 75, 0.2);
}

.admin-twofa-badge.is-waiting {
  color: #8a4b00;
  background: #fff2c2;
  border-color: rgba(138, 75, 0, 0.22);
}

.admin-user-card-editable {
  align-items: stretch;
  flex-direction: column;
}

.admin-user-card-editable > button[data-disable-user] {
  display: none;
}

.admin-user-edit-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-user-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr);
  gap: 10px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-actions button {
  min-height: 42px;
  padding: 9px 12px;
}

.admin-user-profile-grid {
  align-items: start;
}

.admin-profile-note {
  grid-column: 1 / -1;
}

.admin-profile-note textarea {
  min-height: 82px;
  resize: vertical;
}

.admin-user-card button {
  flex: 0 0 auto;
  background: white;
  color: var(--brand);
  border-color: var(--brand);
}

.admin-user-card.is-expired {
  border-color: #f3b6b6;
  background: #fff7f7;
}

.admin-invite-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.admin-invite-link input {
  grid-column: 1 / -1;
  min-height: 38px;
  font-size: 0.82rem;
}

.admin-invite-link button {
  justify-self: start;
}

.admin-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-weight: 800;
}

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

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

/* Admin UX refresh */
body {
  background:
    linear-gradient(180deg, rgba(0, 85, 75, 0.08), rgba(238, 242, 245, 0) 360px),
    var(--bg);
}

.admin-header {
  background: var(--green);
  color: white;
  border-bottom: 0;
  box-shadow: 0 16px 42px rgba(0, 45, 40, 0.18);
}

.admin-header p {
  color: #f4d84b;
}

.admin-role-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
}

.header-actions a,
.header-actions button {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.header-actions a:hover,
.header-actions button:hover {
  background: var(--brand);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(1240px, calc(100% - 32px));
  gap: 18px;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 225, 234, 0.92);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(37, 54, 84, 0.08);
  backdrop-filter: blur(14px);
}

.admin-sidebar a {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.admin-sidebar a:hover,
.admin-sidebar a:focus-visible {
  border-color: rgba(230, 33, 90, 0.3);
}

.admin-content {
  gap: 18px;
}

.notice {
  border: 0;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(37, 54, 84, 0.08);
}

.panel {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(37, 54, 84, 0.09);
  scroll-margin-top: 92px;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid rgba(217, 225, 234, 0.75);
}

.panel h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.editor-card {
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 24px rgba(37, 54, 84, 0.05);
}

.nav-editor-card {
  padding: 0;
  overflow: hidden;
}

.nav-editor-card[open] {
  border-color: rgba(0, 85, 75, 0.35);
}

.nav-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(90deg, rgba(0, 85, 75, 0.06), rgba(230, 33, 90, 0.05)),
    white;
}

.nav-editor-summary::-webkit-details-marker {
  display: none;
}

.nav-editor-summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
}

.nav-editor-card[open] .nav-editor-summary::after {
  content: "-";
  background: var(--brand);
}

.nav-editor-summary span {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 900;
}

.nav-editor-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.nav-editor-body {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.nav-main-fields {
  display: grid;
  gap: 12px;
}

.nav-remove-button {
  justify-self: start;
  background: white;
  color: var(--brand);
  border: 1px solid rgba(230, 33, 90, 0.35);
}

.nav-detail-panel {
  border: 1px solid rgba(217, 225, 234, 0.88);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.nav-inline-detail {
  border-radius: 8px;
  overflow: hidden;
}

.nav-inline-detail summary {
  background: white;
}

.nav-inline-detail[open] summary {
  background: #fcf0f0;
}

.nav-inline-detail .field-grid,
.spec-row {
  background: white;
}

input,
textarea,
select {
  border-radius: 8px;
}

button,
.header-actions a,
.import-label {
  border-radius: 8px;
}

@media (max-width: 700px) {
  .admin-layout {
    width: calc(100% - 18px);
  }

  .admin-sidebar {
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
  }

  .nav-editor-summary {
    min-height: 64px;
    padding: 14px;
  }
}

/* Simple app mode */
.admin-app-ready .admin-content > .panel:not(.is-active-admin-panel) {
  display: none;
}

.admin-app-ready .notice {
  display: none;
}

.admin-sidebar {
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  align-items: stretch;
}

.admin-sidebar a {
  position: relative;
  min-height: 92px;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 10px 22px rgba(37, 54, 84, 0.06);
}

.admin-sidebar a::before {
  content: attr(data-app-icon);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: #fcf0f0;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 950;
}

.admin-sidebar a::after {
  content: "";
  position: absolute;
  inset: auto 14px 10px 14px;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.admin-sidebar a.is-active {
  background: var(--green);
  border-color: var(--green);
  color: white;
  transform: translateY(-1px);
}

.admin-sidebar a.is-active::before {
  background: #f4d84b;
  color: var(--green);
}

.admin-sidebar a.is-active::after {
  background: var(--brand);
}

.admin-sidebar a.is-locked {
  background: #fff0f1;
  border-color: #e6215a;
  color: #9f1239;
  cursor: not-allowed;
  opacity: 0.96;
}

.admin-sidebar a.is-locked::before {
  background: #e6215a;
  color: white;
}

.admin-sidebar a.is-locked::after {
  content: attr(data-lock-label);
  position: static;
  width: auto;
  height: auto;
  padding: 5px 8px;
  border: 1px solid rgba(230, 33, 90, 0.25);
  border-radius: 8px;
  background: white;
  color: #9f1239;
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-sidebar a.is-locked:hover,
.admin-sidebar a.is-locked:focus-visible {
  background: #ffe3e6;
  border-color: #be123c;
  color: #9f1239;
}

.panel.is-active-admin-panel {
  animation: admin-panel-enter 180ms ease-out both;
}

@keyframes admin-panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.panel.is-active-admin-panel .panel-head {
  position: relative;
}

.panel.is-active-admin-panel .panel-head::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 86px;
  height: 4px;
  background: var(--brand);
}

.toggle-row,
.editor-card,
.nav-inline-detail,
.admin-user-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.toggle-row:hover,
.editor-card:hover,
.nav-inline-detail:hover,
.admin-user-card:hover {
  border-color: rgba(230, 33, 90, 0.22);
  box-shadow: 0 14px 32px rgba(37, 54, 84, 0.08);
}

@media (max-width: 700px) {
  .admin-sidebar {
    grid-auto-columns: minmax(126px, 1fr);
  }

  .admin-sidebar a {
    min-height: 78px;
    padding: 12px;
    font-size: 0.9rem;
  }

  .admin-sidebar a::before {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
}

/* The admin frame should scroll away with the page instead of covering content. */
.admin-header,
.admin-sidebar {
  position: static;
  top: auto;
}

/* Phase 2: app-like menu card editor */
.menu-detail-app {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.menu-detail-tree {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e7edf3;
  border-radius: 8px;
  background: #f8fafc;
}

.menu-detail-tree section {
  display: grid;
  gap: 8px;
}

.menu-detail-tree h3 {
  margin: 0;
  color: #00554b;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.menu-detail-tree-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: white;
  color: #253654;
  text-align: left;
  cursor: pointer;
  transition: background 170ms ease, border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.menu-detail-tree-item span {
  font-weight: 900;
}

.menu-detail-tree-item small {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.menu-detail-tree-item:hover,
.menu-detail-tree-item:focus-visible {
  border-color: rgba(230, 33, 90, 0.35);
  box-shadow: 0 10px 22px rgba(37, 54, 84, 0.08);
  transform: translateY(-1px);
}

.menu-detail-tree-item.is-active {
  border-color: #00554b;
  background: #00554b;
  color: white;
  box-shadow: 0 14px 30px rgba(0, 85, 75, 0.2);
}

.menu-detail-tree-item.is-active small {
  color: #f4d84b;
}

.menu-detail-workspace {
  min-width: 0;
  padding: 18px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: white;
}

.menu-detail-workspace .editor-card-head {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf2f7;
}

.menu-detail-fields {
  align-items: start;
}

.nav-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-detail-button {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(230, 33, 90, 0.25);
  background: #fff5f7;
  color: #9f1239;
  font-size: 0.86rem;
  font-weight: 900;
}

.nav-detail-button:hover,
.nav-detail-button:focus-visible {
  background: #e6215a;
  color: white;
}

@media (max-width: 860px) {
  .menu-detail-app {
    grid-template-columns: 1fr;
  }

  .menu-detail-tree {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
