/* --------------------------------- tokens --------------------------------- */

:root {
  --a-bg: #f3f1eb;
  --a-surface: #ffffff;
  --a-soft: #faf8f4;
  --a-ink: #1a1611;
  --a-ink-soft: #46403a;
  --a-muted: #7c7468;
  --a-line: #e6e0d4;
  --a-line-strong: #d6cdbe;
  --a-accent: #b8482b;
  --a-accent-soft: rgba(184, 72, 43, 0.09);
  --a-danger: #b3372b;
  --a-sidebar: #15120e;
  --a-sidebar-soft: #1c1813;
  --a-radius: 18px;
  --a-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --a-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --a-shadow: 0 18px 42px -32px rgba(36, 24, 10, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--a-font);
  color: var(--a-ink);
  background: var(--a-bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

svg {
  display: block;
}

::selection {
  background: rgba(184, 72, 43, 0.2);
}

:focus-visible {
  outline: 2px solid var(--a-accent);
  outline-offset: 2px;
}

/* ---------------------------------- login --------------------------------- */

.login-page {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(184, 72, 43, 0.14), transparent 60%),
    var(--a-bg);
  min-height: 100vh;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(32px, 5vw, 60px);
  background:
    radial-gradient(620px 420px at 85% 8%, rgba(184, 72, 43, 0.42), transparent 62%),
    radial-gradient(520px 420px at 0% 100%, rgba(184, 72, 43, 0.2), transparent 60%),
    #15120e;
  color: #f5eee3;
}

.login-brand::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(245, 238, 227, 0.12);
}

.login-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.side-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--a-accent);
  color: #fff8f2;
  font-family: var(--a-serif);
  font-size: 15px;
  letter-spacing: 0.03em;
  flex: none;
}

.login-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.login-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(245, 238, 227, 0.55);
}

.login-brand-copy h1 {
  margin-top: 18px;
  font-family: var(--a-serif);
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  font-weight: 420;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #f8f1e6;
}

.login-brand-copy > p:not(.login-eyebrow) {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(245, 238, 227, 0.66);
  max-width: 42ch;
}

.login-points {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.login-points li {
  position: relative;
  padding-left: 22px;
  font-size: 12.5px;
  color: rgba(245, 238, 227, 0.72);
}

.login-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--a-accent);
}

.login-brand-foot {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 238, 227, 0.35);
}

.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-card {
  width: min(400px, 100%);
  background: var(--a-surface);
  border: 1px solid var(--a-line);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 40px);
  box-shadow: var(--a-shadow);
  display: grid;
  gap: 18px;
}

.login-head {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.login-mark {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--a-accent);
  color: #fff8f2;
  font-family: var(--a-serif);
  font-size: 15px;
  margin-bottom: 6px;
}

.login-head h2 {
  font-family: var(--a-serif);
  font-size: 1.9rem;
  font-weight: 450;
  letter-spacing: -0.02em;
}

.login-head p {
  font-size: 13px;
  color: var(--a-muted);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 74px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--a-muted);
  padding: 7px 8px;
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--a-accent);
}

.form-error {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(179, 55, 43, 0.08);
  border: 1px solid rgba(179, 55, 43, 0.22);
  color: var(--a-danger);
  font-size: 12.5px;
}

.login-submit {
  width: 100%;
  justify-content: center;
  height: 46px;
  margin-top: 4px;
}

.login-back {
  text-align: center;
  font-size: 12px;
  color: var(--a-muted);
  transition: color 0.2s ease;
}

.login-back:hover {
  color: var(--a-accent);
}

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

  .login-brand {
    display: none;
  }

  .login-form-wrap {
    min-height: 100vh;
  }

  .login-mark {
    display: grid;
  }
}

/* --------------------------------- admin ---------------------------------- */

.admin-page {
  min-height: 100vh;
  background: var(--a-bg);
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* sidebar */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: 264px;
  padding: 22px 16px 18px;
  background: var(--a-sidebar);
  color: #eee7dc;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
}

.side-brand-text {
  display: grid;
  line-height: 1.25;
}

.side-brand-text strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.side-brand-text em {
  font-style: normal;
  font-size: 10.5px;
  color: rgba(238, 231, 220, 0.42);
}

.side-label {
  padding: 6px 12px 10px;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(238, 231, 220, 0.32);
}

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

.side-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(238, 231, 220, 0.62);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease;
  position: relative;
}

.side-nav button .icon {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.8;
}

.side-nav button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 231, 220, 0.92);
}

.side-nav button.active {
  background: rgba(255, 255, 255, 0.085);
  color: #fdf8ef;
}

.side-nav button.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--a-accent);
}

.side-nav button.active .icon {
  color: #e09a7f;
  opacity: 1;
}

.side-nav .badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(238, 231, 220, 0.55);
}

.side-nav button.active .badge {
  background: rgba(184, 72, 43, 0.3);
  color: #f3c1b0;
}

.side-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.side-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--a-accent);
  color: #fff8f2;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.side-user-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.side-user-text strong {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-text em {
  font-style: normal;
  font-size: 10px;
  color: rgba(238, 231, 220, 0.4);
}

.side-logout {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  border-radius: 9px;
  padding: 9px;
  font-size: 11.5px;
  color: rgba(238, 231, 220, 0.68);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.side-logout:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

/* main */

.admin-main {
  margin-left: 264px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 3vw, 34px);
  background: rgba(243, 241, 235, 0.86);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--a-line);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-heading h1 {
  font-family: var(--a-serif);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-heading p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--a-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

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

.mobile-menu {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--a-line);
  background: var(--a-surface);
}

.mobile-menu svg {
  width: 18px;
  height: 18px;
}

/* buttons */

.btn-line,
.btn-save,
.btn-line svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn-line {
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--a-line-strong);
  background: var(--a-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--a-ink-soft);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.btn-line:hover {
  border-color: var(--a-ink);
  color: var(--a-ink);
}

.btn-line svg {
  width: 14px;
  height: 14px;
}

.btn-save {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--a-accent);
  background: var(--a-accent);
  color: #fff8f2;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px -16px rgba(184, 72, 43, 0.9);
}

.btn-save > svg {
  width: 15px;
  height: 15px;
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -16px rgba(184, 72, 43, 0.95);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.save-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe3d8;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.btn-save.is-dirty .save-dot {
  display: inline-block;
  animation: dotPulse 1.8s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.dirty-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px clamp(18px, 3vw, 34px);
  background: #fff4e5;
  border-bottom: 1px solid #f1dcc0;
  color: #8a5a12;
  font-size: 12px;
}

.dirty-bar button {
  border: 0;
  background: transparent;
  color: #8a4a0c;
  font-weight: 600;
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* editor */

.editor {
  width: min(1020px, 100%);
  margin-inline: auto;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 34px) 90px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.editor-loading {
  padding: 80px 0;
  text-align: center;
  color: var(--a-muted);
  font-size: 13px;
}

.card {
  background: var(--a-surface);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius);
  padding: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--a-shadow);
}

.card + .card {
  margin-top: 0;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.card-head h2 {
  font-family: var(--a-serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.card-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--a-muted);
  max-width: 60ch;
}

.count-pill {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--a-soft);
  border: 1px solid var(--a-line);
  color: var(--a-muted);
  letter-spacing: 0.02em;
}

/* fields */

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field.span-2 {
  grid-column: 1 / -1;
}

.field > label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--a-ink-soft);
  letter-spacing: 0.01em;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='url'],
.field input[type='number'],
.field input[type='password'],
.field input[type='color'],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--a-line);
  background: var(--a-soft);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--a-ink);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b3aa9b;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--a-accent);
  background: var(--a-surface);
  box-shadow: 0 0 0 3px var(--a-accent-soft);
}

.field textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.6;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7468' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.hint {
  font-size: 10.5px;
  color: var(--a-muted);
  line-height: 1.5;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.range-row input[type='range'] {
  flex: 1;
  accent-color: var(--a-accent);
  height: 4px;
}

.range-row output {
  flex: none;
  min-width: 42px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--a-accent);
  font-variant-numeric: tabular-nums;
}

/* item cards */

.items {
  display: grid;
  gap: 12px;
}

.item-card {
  border: 1px solid var(--a-line);
  border-radius: 13px;
  padding: 16px;
  background: var(--a-soft);
}

.item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.item-num {
  font-family: var(--a-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--a-accent);
  flex: none;
}

.item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--a-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--a-muted);
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.icon-btn:hover {
  background: var(--a-surface);
  border-color: var(--a-line);
  color: var(--a-ink);
}

.icon-btn.danger:hover {
  color: var(--a-danger);
  border-color: rgba(179, 55, 43, 0.28);
  background: rgba(179, 55, 43, 0.06);
}

.icon-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.add-btn {
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  border-radius: 11px;
  border: 1px dashed var(--a-line-strong);
  background: transparent;
  color: var(--a-ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.add-btn:hover {
  border-color: var(--a-accent);
  color: var(--a-accent);
  background: var(--a-accent-soft);
}

.empty-state {
  padding: 26px;
  border-radius: 12px;
  border: 1px dashed var(--a-line-strong);
  text-align: center;
  font-size: 12px;
  color: var(--a-muted);
}

/* photo */

.photo-editor {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--a-line);
  border-radius: 13px;
  background: var(--a-soft);
  margin-bottom: 18px;
}

.photo-preview {
  width: 86px;
  height: 108px;
  border-radius: 12px;
  background: var(--a-bg);
  border: 1px solid var(--a-line);
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--a-serif);
  font-size: 28px;
  color: var(--a-accent);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.photo-actions .hint {
  flex-basis: 100%;
  margin-top: 2px;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.danger-line {
  color: var(--a-danger);
  border-color: rgba(179, 55, 43, 0.28);
}

.danger-line:hover {
  border-color: var(--a-danger);
  color: var(--a-danger);
}

/* swatches */

.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 0.16s ease;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--a-surface), 0 0 0 4px var(--a-ink);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--a-line);
  background: var(--a-soft);
  border-radius: 9px;
  padding: 5px 10px 5px 6px;
}

.color-input-wrap input[type='color'] {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.color-input-wrap input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-wrap input[type='color']::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}

.color-input-wrap code {
  font-size: 11px;
  color: var(--a-muted);
}

.preview-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--a-line);
  background: var(--a-soft);
}

.preview-strip span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--a-muted);
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--a-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--a-accent);
}

/* security */

.security-form {
  display: grid;
  gap: 16px;
  max-width: 460px;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.backup-actions .btn-line {
  min-height: 40px;
}

.security-meta code {
  font-family: var(--a-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.95em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--a-soft);
  border: 1px solid var(--a-line);
}

.note-box {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--a-soft);
  border: 1px solid var(--a-line);
  font-size: 12px;
  color: var(--a-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.note-box svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--a-accent);
  margin-top: 2px;
}

.security-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.security-meta strong {
  font-size: 13px;
}

.security-meta span {
  font-size: 11.5px;
  color: var(--a-muted);
}

/* toast */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 16px;
  border-radius: 11px;
  background: #1b1712;
  color: #f6efe4;
  font-size: 12.5px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.toast.error {
  background: #7f2a20;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(20, 16, 11, 0.44);
  backdrop-filter: blur(2px);
}

/* responsive */

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .admin-main {
    margin-left: 0;
  }

  .mobile-menu {
    display: grid;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
  }

  .page-heading p {
    max-width: 46vw;
  }

  .hide-sm {
    display: none;
  }

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

  .editor {
    padding: 16px 14px 80px;
  }

  .card-head {
    flex-direction: column;
    gap: 10px;
  }

  .photo-editor {
    flex-direction: column;
  }

  .photo-preview {
    width: 78px;
    height: 98px;
  }

  .btn-save {
    padding: 0 13px;
  }

  #saveLabel {
    font-size: 11.5px;
  }
}

@media (max-width: 420px) {
  .page-heading p {
    display: none;
  }

  #saveLabel {
    display: none;
  }

  .btn-save {
    width: 38px;
    padding: 0;
  }

  .btn-save .save-dot {
    display: none !important;
  }
}

/* ----------------------------- template gallery ---------------------------- */

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

.template-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-soft);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.template-card:hover {
  border-color: var(--a-line-strong);
  box-shadow: 0 18px 32px -26px rgba(36, 24, 10, 0.55);
  transform: translateY(-2px);
}

.template-card.active {
  border-color: var(--a-accent);
  box-shadow: 0 0 0 2px var(--a-accent-soft);
}

.template-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--a-line);
  background: #e9e4da;
  overflow: hidden;
  cursor: pointer;
}

.template-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.template-card:hover .template-shot img {
  transform: scale(1.03);
}

.template-shot:focus-visible {
  outline-offset: -3px;
}

.template-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(21, 18, 14, 0.72);
  color: #f6efe4;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.template-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--a-accent);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.template-check .icon {
  width: 13px;
  height: 13px;
}

.template-meta {
  display: grid;
  gap: 3px;
  padding: 11px 12px 8px;
}

.template-meta strong {
  font-size: 12.5px;
  font-weight: 600;
}

.template-meta span {
  font-size: 11px;
  line-height: 1.45;
  color: var(--a-muted);
}

.template-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 12px;
  margin-top: auto;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--a-muted);
}

.template-accent {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(26, 22, 17, 0.06);
  flex: none;
}

.template-preview {
  margin-left: auto;
  color: var(--a-ink-soft);
  text-transform: none;
  letter-spacing: 0;
  font-size: 10.5px;
  border-bottom: 1px solid var(--a-line-strong);
  padding-bottom: 1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.template-preview:hover {
  color: var(--a-accent);
  border-color: var(--a-accent);
}

.template-note {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--a-muted);
}

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

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