:root {
  --cream: #FBF6EC;
  --paper: #FFFDF9;
  --ink: #172421;
  --ink-soft: #52625E;
  --teal: #0C332F;
  --teal-700: #14544C;
  --gold: #E9A825;
  --gold-deep: #B97F12;
  --clay: #B4472B;
  --line: rgba(23, 36, 33, .12);
  --shadow: 0 10px 30px rgba(12, 51, 47, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Karla", "Segoe UI", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.admin-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--teal);
  color: var(--cream);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: .85rem 0;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.admin-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(233, 168, 37, .5);
}

.admin-brand strong {
  display: block;
  font-size: .98rem;
  letter-spacing: .01em;
}

.admin-brand small {
  display: block;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(251, 246, 236, .6);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: 999px;
  font-size: .86rem;
  text-decoration: none;
  color: rgba(251, 246, 236, .8);
  border: 1px solid transparent;
}

.admin-nav a:hover {
  background: rgba(251, 246, 236, .1);
  color: var(--cream);
}

.admin-nav a.is-active {
  background: rgba(251, 246, 236, .14);
  border-color: rgba(251, 246, 236, .2);
  color: var(--cream);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--gold);
  color: #241A05;
  font-size: .7rem;
  font-weight: 700;
}

.admin-session {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .82rem;
  color: rgba(251, 246, 236, .72);
}

.admin-session form { margin: 0; }

.who {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-site {
  text-decoration: none;
  padding: .3rem .75rem;
  border: 1px solid rgba(251, 246, 236, .28);
  border-radius: 999px;
  font-size: .78rem;
}

.view-site:hover { background: rgba(251, 246, 236, .1); }

.link-button {
  font: inherit;
  background: none;
  border: 0;
  color: rgba(251, 246, 236, .72);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover { color: var(--cream); }

.admin-main {
  padding: 2.2rem 0 4rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.page-head h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -.02em;
}

.page-head p {
  margin: .2rem 0 0;
  color: var(--ink-soft);
  font-size: .92rem;
}

.flash {
  margin-bottom: 1.4rem;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  font-size: .9rem;
  background: #EAF5EC;
  border: 1px solid #B7E0C0;
  color: #22663A;
}

.flash.bad {
  background: #FBEDEA;
  border-color: #EFC3B9;
  color: #8A2F18;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.2rem, 2.5vw, 1.8rem);
  box-shadow: var(--shadow);
}

.panel + .panel { margin-top: 1.4rem; }

.panel h2 {
  margin: 0 0 .3rem;
  font-size: 1.1rem;
}

.panel-note {
  margin: 0 0 1.3rem;
  color: var(--ink-soft);
  font-size: .88rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.image-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.image-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #EFE7D8;
}

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

.image-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1rem;
  flex: 1;
}

.image-body h2 {
  margin: 0;
  font-size: .98rem;
}

.image-body .hint {
  margin: 0;
  font-size: .78rem;
  color: var(--ink-soft);
}

.image-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .95rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--cream);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--teal);
  transition: background-color .2s ease;
}

.upload-label:hover { background: var(--teal-700); }

.upload-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

button,
.button {
  font: inherit;
  cursor: pointer;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  font-size: .82rem;
  text-decoration: none;
  color: var(--ink);
}

button:hover,
.button:hover { border-color: rgba(23, 36, 33, .35); }

button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
}

button.primary:hover { background: var(--teal-700); }

button.danger {
  color: var(--clay);
  border-color: rgba(180, 71, 43, .35);
}

button.danger:hover { background: #FBEDEA; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

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

.field label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input {
  font: inherit;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid rgba(233, 168, 37, .55);
  outline-offset: 1px;
  border-color: var(--gold);
}

.field .help {
  font-size: .78rem;
  color: var(--ink-soft);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: .86rem;
  text-decoration: none;
}

.tab strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 .3rem;
  border-radius: 999px;
  background: rgba(23, 36, 33, .08);
  font-size: .72rem;
}

.tab.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
}

.tab.is-active strong { background: rgba(251, 246, 236, .22); }

.review-list { display: grid; gap: 1rem; }

.review-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 4px 14px rgba(12, 51, 47, .05);
}

.review-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}

.review-head h2 { margin: 0; font-size: 1.05rem; }

.review-meta {
  margin: .15rem 0 0;
  font-size: .78rem;
  color: var(--ink-soft);
}

.review-stars {
  color: var(--gold-deep);
  letter-spacing: .12em;
  font-size: .9rem;
}

.review-text {
  margin: .6rem 0 1rem;
  white-space: pre-line;
}

.review-mail {
  font-size: .8rem;
  color: var(--ink-soft);
  word-break: break-all;
}

.review-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.review-actions form { margin: 0; }

.empty {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, .6);
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: .3rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(50% 40% at 50% 0%, rgba(233, 168, 37, .12), transparent 70%),
    var(--cream);
}

.login-card {
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2.2rem 2rem;
  box-shadow: 0 24px 60px rgba(12, 51, 47, .16);
}

.login-brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: .5rem;
  margin-bottom: 1.6rem;
}

.login-brand img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(233, 168, 37, .5);
}

.login-brand h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.login-brand p {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.login-form .field + .field { margin-top: .9rem; }

.login-form button[type="submit"] {
  width: 100%;
  margin-top: 1.3rem;
  padding: .75rem 1rem;
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
  font-weight: 700;
}

.login-form button[type="submit"]:hover { background: var(--teal-700); }

.login-error {
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  border-radius: 10px;
  background: #FBEDEA;
  border: 1px solid #EFC3B9;
  color: #8A2F18;
  font-size: .86rem;
}

.login-foot {
  margin: 1.3rem 0 0;
  text-align: center;
  font-size: .8rem;
  color: var(--ink-soft);
}

.login-foot a { color: var(--teal-700); }

.password-wrap {
  position: relative;
}

.password-wrap input { width: 100%; padding-right: 4.2rem; }

.password-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: .3rem .5rem;
  font-size: .76rem;
  color: var(--ink-soft);
}

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

@media (max-width: 640px) {
  .image-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .top-inner { justify-content: center; text-align: center; }
  .admin-session { width: 100%; justify-content: center; }
  .who { display: none; }
}

@media (max-width: 1100px) {
  .who {
    display: none;
  }
}

.login-hint {
  margin: 1.1rem 0 0;
  padding: .7rem .85rem;
  border-radius: 10px;
  background: rgba(233, 168, 37, .1);
  border: 1px solid rgba(233, 168, 37, .28);
  color: #6B4E0F;
  font-size: .78rem;
  line-height: 1.5;
  text-align: left;
}

.menu-admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.menu-admin-stat {
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.menu-admin-stat span {
  display: block;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.menu-admin-stat strong {
  display: block;
  margin-top: .2rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink);
}

.menu-admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.menu-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  white-space: nowrap;
}

.menu-admin-table th {
  padding: .7rem .8rem;
  background: #F6F1E6;
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.menu-admin-table td {
  padding: .75rem .8rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

.menu-admin-table tr:hover td {
  background: rgba(233, 168, 37, .05);
}

.menu-admin-today {
  display: inline-block;
  margin-left: .4rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  background: rgba(233, 168, 37, .18);
  color: #7A5207;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.menu-admin-status {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #EEE9DE;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 700;
}

.menu-admin-status.is-live {
  background: #E4F3E8;
  color: #256338;
}

.menu-admin-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.menu-admin-actions a,
.menu-admin-actions .link-danger {
  color: var(--teal-700);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}

.menu-admin-actions a:hover {
  text-decoration: underline;
}

.menu-admin-actions form {
  margin: 0;
}

.link-danger {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9B3A22 !important;
  cursor: pointer;
  font: inherit;
}

.link-danger:hover {
  text-decoration: underline;
}

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