:root {
  --navy: #0a1e36;
  --ink: #142d4c;
  --blue: #3276e8;
  --coral: #ff6846;
  --lime: #cfef6b;
  --paper: #f4f6f8;
  --white: #fff;
  --muted: #66788d;
  --line: #d9e0e7;
  --body: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); }
button, input, textarea { color: inherit; font: inherit; }
button, a, .file-button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.admin-header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: 74px;
  display: grid;
  grid-template-columns: 270px 1fr auto;
  align-items: center;
  color: white;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.admin-brand { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-right: 1px solid rgba(255,255,255,.12); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.admin-brand span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--navy); background: var(--coral); border-radius: 9px; font-weight: 900; }
.save-state { display: flex; align-items: center; gap: 10px; padding-left: 28px; color: #9eb0c3; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.save-state i { width: 7px; height: 7px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 4px rgba(207,239,107,.1); }
.save-state.unsaved i { background: var(--coral); }
.header-actions { display: flex; gap: 10px; padding-right: 18px; }

.primary-button, .ghost-button, .danger-button, .add-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { color: var(--navy); background: var(--lime); border: 1px solid var(--lime); }
.ghost-button { color: inherit; background: transparent; border: 1px solid currentColor; }
.admin-header .ghost-button { color: white; border-color: rgba(255,255,255,.3); }
.danger-button { color: #b33a2d; background: #fff2ef; border: 1px solid #f0c9c2; }
.add-button { color: white; background: var(--blue); border: 0; }

.admin-layout { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; padding-top: 74px; }
.admin-sidebar { position: fixed; top: 74px; bottom: 0; width: 270px; display: flex; flex-direction: column; padding: 31px 20px 22px; color: #c5d0dc; background: var(--navy); }
.admin-sidebar > p { margin: 0 12px 17px; color: #708499; font-family: var(--mono); font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 8px; font-size: 12px; transition: background .2s, color .2s; }
.admin-sidebar nav a:hover { color: white; background: rgba(255,255,255,.07); }
.admin-sidebar nav span { color: var(--coral); font-family: var(--mono); font-size: 8px; }
.storage-note { margin-top: auto; padding: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; }
.storage-note strong { color: var(--lime); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.storage-note p { margin: 8px 0 0; color: #8ea0b2; font-size: 11px; line-height: 1.55; }

.admin-main { grid-column: 2; width: min(100%, 1060px); padding: 62px 64px 100px; }
.admin-intro { display: grid; grid-template-columns: 1.4fr .6fr; gap: 50px; align-items: end; margin-bottom: 55px; }
.kicker { margin: 0 0 12px; color: var(--blue); font-family: var(--mono); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.admin-intro h1 { margin: 0; color: var(--navy); font-family: var(--display); font-size: clamp(46px, 5vw, 68px); font-weight: 400; letter-spacing: -.05em; line-height: 1; }
.admin-intro > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

#content-form { display: grid; gap: 22px; }
.editor-section { padding: 34px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.section-title { display: grid; grid-template-columns: 35px 1fr; gap: 10px; align-items: start; margin-bottom: 30px; }
.section-title.with-action { grid-template-columns: 35px 1fr auto; }
.section-title > span { padding-top: 7px; color: var(--coral); font-family: var(--mono); font-size: 9px; font-weight: 800; }
.section-title h2 { margin: 0; color: var(--navy); font-family: var(--display); font-size: 31px; font-weight: 400; letter-spacing: -.03em; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
label { display: grid; gap: 7px; color: var(--ink); font-family: var(--mono); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
label.wide { grid-column: 1 / -1; }
label small { color: var(--muted); font-family: var(--body); font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; }
input, textarea { width: 100%; padding: 12px 13px; color: var(--ink); background: #f7f9fb; border: 1px solid #dbe2e9; border-radius: 8px; font-family: var(--body); font-size: 13px; font-weight: 500; letter-spacing: 0; line-height: 1.5; text-transform: none; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(50,118,232,.1); outline: 0; }
.standalone-label + .standalone-label { margin-top: 18px; }

.repeater-list { display: grid; gap: 13px; }
.repeater-card { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 15px; padding: 22px; background: #f7f9fb; border: 1px solid #dfe6ec; border-radius: 12px; }
.repeater-index { color: var(--blue); font-family: var(--mono); font-size: 10px; font-weight: 800; }
.repeater-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.repeater-fields .wide { grid-column: 1 / -1; }
.remove-item { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: #9a493e; background: white; border: 1px solid #eccdc8; border-radius: 50%; cursor: pointer; }

.data-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 45px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bottom-save { position: sticky; z-index: 5; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 14px 14px 20px; color: white; background: rgba(10,30,54,.96); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; box-shadow: 0 16px 40px rgba(10,30,54,.22); backdrop-filter: blur(12px); }
.bottom-save p { margin: 0; color: #aab9c8; font-size: 11px; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; padding: 13px 17px; color: var(--navy); background: var(--lime); border-radius: 9px; box-shadow: 0 15px 40px rgba(10,30,54,.25); font-size: 12px; font-weight: 800; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .admin-header { grid-template-columns: 1fr auto; }
  .admin-brand { border: 0; }
  .save-state, .admin-sidebar, .admin-header .ghost-button { display: none; }
  .admin-layout { display: block; }
  .admin-main { padding: 45px 20px 90px; }
  .admin-intro { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 600px) {
  .admin-header { height: 66px; }
  .admin-brand { padding-left: 14px; }
  .admin-brand strong { display: none; }
  .header-actions { padding-right: 10px; }
  .admin-layout { padding-top: 66px; }
  .editor-section { padding: 24px 18px; }
  .section-title, .section-title.with-action { grid-template-columns: 27px 1fr; }
  .section-title.with-action .add-button { grid-column: 2; width: fit-content; margin-top: 10px; }
  .form-grid, .repeater-fields { grid-template-columns: 1fr; }
  label.wide, .repeater-fields .wide { grid-column: 1; }
  .repeater-card { grid-template-columns: 1fr; padding: 19px 15px; }
  .repeater-index { padding-right: 40px; }
  .data-actions { padding-left: 0; }
  .bottom-save p { display: none; }
  .bottom-save { justify-content: stretch; }
  .bottom-save .primary-button { width: 100%; }
}
