:root {
  --ink: #17251f;
  --ink-soft: #516059;
  --paper: #f3eee4;
  --surface: #fffdf7;
  --surface-2: #e8dfcf;
  --line: rgba(23,37,31,.18);
  --tomato: #d65434;
  --tomato-dark: #aa3b25;
  --lemon: #efc84a;
  --green: #708542;
  --danger: #b52d26;
  --shadow: 0 20px 60px rgba(20,33,27,.12);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, rgba(239,200,74,.3), transparent 28rem), var(--ink); }
.login-card { width: min(480px,100%); padding: clamp(30px,6vw,58px); background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); }
.admin-mark { display: grid; width: 48px; height: 48px; place-items: center; flex: 0 0 auto; color: var(--ink); background: var(--lemon); border-radius: 50% 42% 54% 46%; font-weight: 900; transform: rotate(-6deg); }
.eyebrow { margin: 20px 0 8px; color: var(--tomato-dark); font-size: 11px; font-weight: 850; letter-spacing: .15em; }
.login-card h1, .panel-heading h1 { margin: 0; font: 700 clamp(36px,6vw,60px)/1 Georgia,serif; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow,.form-error) { color: var(--ink-soft); }
.login-card > a { display: inline-block; margin-top: 20px; color: var(--ink-soft); text-underline-offset: 4px; }
.form-error { padding: 10px 12px; color: #fff; background: var(--danger); border-radius: 9px; }

.admin-header { position: sticky; top: 0; z-index: 100; min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px clamp(14px,3vw,36px); color: #fff; background: rgba(23,37,31,.98); border-bottom: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(14px); }
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand div { display: flex; flex-direction: column; }
.admin-brand span { color: rgba(255,255,255,.65); font-size: 12px; }
.admin-actions { display: flex; align-items: center; gap: 9px; }
.primary-button, .secondary-button, .ghost-button, .upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border-radius: 999px; border: 0; font-weight: 800; text-decoration: none; }
.primary-button { color: var(--ink); background: var(--lemon); }
.primary-button:hover { background: #ffdc65; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { color: #fff; background: var(--tomato); }
.ghost-button { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.3); }
.upload-button { color: #fff; background: var(--ink); cursor: pointer; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-button.is-disabled { opacity: .45; cursor: not-allowed; }

.admin-status { position: sticky; top: 74px; z-index: 90; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 16px; color: var(--ink-soft); background: #e3d9c7; border-bottom: 1px solid var(--line); font-size: 13px; }
.admin-status.is-dirty { color: #7d4c00; background: #f6dfa5; }
.admin-status.is-error { color: #fff; background: var(--danger); }
.admin-status.is-success { color: #fff; background: var(--green); }
.admin-status button { padding: 4px 9px; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 999px; }

.admin-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: calc(100vh - 114px); }
.admin-sidebar { position: sticky; top: 114px; align-self: start; height: calc(100vh - 114px); display: flex; flex-direction: column; gap: 26px; padding: 30px 20px; background: #dfd6c5; border-right: 1px solid var(--line); overflow-y: auto; }
.admin-sidebar nav { display: grid; gap: 6px; }
.tab-button { display: flex; justify-content: space-between; width: 100%; padding: 11px 13px; text-align: left; background: transparent; border: 0; border-radius: 10px; font-weight: 700; }
.tab-button:hover { background: rgba(255,255,255,.45); }
.tab-button.is-active { color: #fff; background: var(--ink); }
.tab-button span { margin-left: 7px; opacity: .6; }
.edit-language { display: grid; gap: 9px; padding-top: 20px; border-top: 1px solid var(--line); }
.edit-language > span { font-weight: 750; }
.edit-language > div { display: flex; gap: 5px; }
.edit-language button { width: 46px; height: 36px; background: transparent; border: 1px solid var(--line); border-radius: 999px; font-weight: 800; }
.edit-language button.is-active { color: #fff; background: var(--tomato); border-color: var(--tomato); }
.edit-language small, .safety-note span { color: var(--ink-soft); }
.safety-note { display: grid; gap: 6px; margin-top: auto; padding: 16px; background: rgba(255,255,255,.5); border-radius: 12px; font-size: 12px; }

.admin-content { min-width: 0; padding: clamp(24px,4vw,64px); }
.admin-panel { display: none; max-width: 1240px; margin: 0 auto; }
.admin-panel.is-active { display: block; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; padding-bottom: 26px; border-bottom: 2px solid var(--ink); }
.panel-heading .eyebrow { margin-top: 0; }
.panel-heading > p { max-width: 420px; margin: 0; color: var(--ink-soft); }
.editor-note { margin: -14px 0 28px; padding: 15px 18px; background: var(--surface-2); border-radius: 12px; }
.stack { display: grid; gap: 20px; }

.editor-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 20px rgba(23,37,31,.04); }
.editor-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; background: #ebe3d5; border-bottom: 1px solid var(--line); }
.editor-card-header h2, .editor-card-header h3 { margin: 0; font: 700 24px/1.1 Georgia,serif; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; }
.icon-button:hover { border-color: var(--ink); }
.icon-button.danger { color: var(--danger); }
.editor-card-body { padding: 20px; }
.fields-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 15px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.field { min-width: 0; display: grid; gap: 6px; }
.field > span, .field-label { font-size: 12px; font-weight: 780; letter-spacing: .025em; }
.field small { color: var(--ink-soft); }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.field textarea { min-height: 76px; resize: vertical; overflow-y: hidden; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid rgba(239,200,74,.48); border-color: var(--ink); }
.toggle-field { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.toggle-field input { width: 20px; height: 20px; accent-color: var(--tomato); }
.language-label { color: var(--tomato-dark); font-weight: 900; }
.danger-text { padding: 6px 0; color: var(--danger); background: transparent; border: 0; font-weight: 750; }

.photo-editor { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 18px; margin-top: 18px; padding: 16px; background: var(--surface-2); border-radius: 13px; }
.photo-preview { min-height: 130px; display: grid; place-items: center; overflow: hidden; background: #d4c9b5; border: 1px solid var(--line); border-radius: 10px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder-art { position: relative; width: 100%; height: 100%; min-height: 130px; display: grid; place-items: center; overflow: hidden; color: var(--ink); background: #efe4cc; font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.photo-placeholder-art::before, .photo-placeholder-art::after { content: ""; position: absolute; width: 80px; height: 80px; z-index: 0; background: var(--tomato); border-radius: 50% 30% 55% 45%; transform: translate(45px,-40px); }
.photo-placeholder-art::after { background: var(--green); transform: translate(-55px,48px); }
.photo-placeholder-art span { position: relative; z-index: 1; padding: 6px 9px; background: rgba(255,255,255,.75); border-radius: 999px; }
.photo-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.photo-state { color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
.photo-controls small { color: var(--ink-soft); }

.item-stack { display: grid; gap: 12px; margin-top: 20px; }
.item-card { padding: 16px; background: #f4eee3; border: 1px solid var(--line); border-radius: 13px; }
.item-card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.item-card-header strong { font: 700 19px/1.2 Georgia,serif; }
.allergen-picker { display: flex; flex-wrap: wrap; gap: 7px; padding: 7px 0; }
.allergen-picker label { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 750; }
.allergen-picker input { accent-color: var(--tomato); }
.add-item-button { width: 100%; margin-top: 14px; padding: 13px; color: var(--ink); background: transparent; border: 1px dashed rgba(23,37,31,.4); border-radius: 12px; font-weight: 750; }
.add-item-button:hover { background: rgba(255,255,255,.6); }
.hours-editor { display: grid; gap: 10px; }
.hours-row-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: sticky; top: 114px; z-index: 80; height: auto; display: block; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .admin-sidebar nav { display: flex; width: max-content; }
  .tab-button { width: auto; white-space: nowrap; }
  .edit-language { display: flex; align-items: center; gap: 10px; margin-top: 9px; padding: 9px 0 0; }
  .edit-language small, .safety-note { display: none; }
  .admin-content { padding-top: 30px; }
  .span-8, .span-6, .span-4, .span-3 { grid-column: span 12; }
}

@media (max-width: 620px) {
  .admin-header { align-items: flex-start; }
  .admin-brand div { display: none; }
  .admin-actions { flex-wrap: wrap; justify-content: flex-end; }
  .admin-actions .ghost-button:first-child { display: none; }
  .admin-actions .ghost-button, .admin-actions .primary-button { min-height: 38px; padding: 8px 11px; font-size: 12px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading > p { max-width: none; }
  .editor-card-header { align-items: flex-start; }
  .photo-editor { grid-template-columns: 1fr; }
  .photo-preview { min-height: 180px; }
  .hours-row-editor { grid-template-columns: 1fr; }
  .admin-content { padding-inline: 12px; }
  .editor-card-body { padding: 14px; }
}
