:root {
  color-scheme: light;
  --forest: #183c32;
  --leaf: #82977b;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --ink: #1d2924;
  --muted: #788078;
  --line: #e7e5dc;
  --accent: #c97b54;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); font-family: var(--sans); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.admin-header { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(5vw, 22px); border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--forest); text-decoration: none; }
.brand-logo { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; object-fit: contain; }
.brand-copy { display: block; }
.brand-copy strong { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; }
.admin-main { width: min(1120px, calc(100% - 40px)); min-height: calc(100vh - 76px); margin: 0 auto; padding: 48px 0 80px; }
.eyebrow { margin: 0 0 9px; color: var(--leaf); font-size: 10px; font-weight: 700; letter-spacing: .17em; }
h1, h2 { color: var(--forest); font-family: var(--serif); }
h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.admin-heading > div > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.button { min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 700; }
.button:disabled { opacity: .6; cursor: not-allowed; }
.button-primary { background: var(--forest); color: white; }
.button-primary:hover:not(:disabled) { background: #245344; }
.button-outline { border-color: #d7d9d0; background: transparent; color: var(--forest); text-decoration: none; }
.button-outline:hover { background: #f1f0e9; }
.settings-panel { margin-top: 30px; padding: 21px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.settings-heading-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: end; gap: 8px; }
.settings-toggle { white-space: nowrap; }
.settings-content[hidden] { display: none; }
.password-form { display: grid; gap: 14px; margin-top: 18px; }
.password-form .form-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.password-form > .button { justify-self: start; }
.settings-heading h2 { margin: 0; font-size: 22px; }
.settings-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.social-settings-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.social-setting { display: flex; align-items: end; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.social-setting-details { display: grid; flex: 1; gap: 7px; min-width: 0; }
.social-setting-details input { min-width: 0; }
.social-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 40px; }
.social-toggle span { min-width: 29px; padding: 5px 6px; border-radius: 99px; background: #f1f0e9; color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; }
.social-toggle input:checked + span { background: #eaf6ed; color: #287044; }
.copy-language-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.copy-language-tabs .is-active { border-color: var(--forest); background: var(--forest); color: #fff; }
.copy-settings-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.copy-setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.copy-setting-label { grid-column: 1 / -1; }
.copy-setting > input, .copy-setting > textarea { min-width: 0; }
.copy-setting > textarea { resize: vertical; }
.copy-toggle { align-self: center; min-height: 40px; }
.copy-hidden { visibility: hidden !important; }
.qr-settings-form { display: grid; gap: 14px; margin-top: 20px; }
.qr-settings-form .form-row { align-items: start; }
.qr-settings-form .form-row > div { align-content: start; }
.qr-settings-form small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.qr-settings-form input[type="file"] { padding: 7px; }
.qr-file-row { align-items: center; }
.qr-remove-logo { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.qr-remove-logo input { flex: 0 0 auto; }
.qr-template-preview-wrap { display: grid; justify-items: start; gap: 7px; }
.qr-template-preview-wrap .eyebrow, .qr-template-help { margin: 0; }
.qr-template-help { color: var(--muted); font-size: 11px; }
.qr-template-editor { position: relative; width: min(100%, 360px); line-height: 0; cursor: crosshair; touch-action: none; user-select: none; }
.qr-template-editor > img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; pointer-events: none; }
.qr-template-selection { position: absolute; pointer-events: none; }
.qr-template-selection img { position: absolute; image-rendering: pixelated; }
.qr-preview-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #f9f8f3; }
.qr-preview-panel .eyebrow { margin-bottom: 10px; }
.qr-code-preview { width: 190px; height: 190px; display: block; border: 8px solid white; image-rendering: pixelated; }
.qr-preview-url { max-width: 400px; margin: 8px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.qr-preview-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.admin-category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.admin-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; transition: border-color .18s, transform .18s, box-shadow .18s; }
.admin-category:hover { transform: translateY(-1px); border-color: #d7dfd2; box-shadow: 0 5px 14px rgba(24, 60, 50, .06); }
.admin-category.is-subcategory { margin-left: 12px; }
.admin-category.is-disabled { background: #f5f4ef; }
.admin-category-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid #e1e9dd; border-radius: 11px; background: linear-gradient(145deg, #f1f6ee, #e5eee2); color: var(--forest); }
.admin-category-icon.is-subcategory { width: 34px; height: 34px; flex-basis: 34px; border-color: #f0e2d6; border-radius: 10px; background: linear-gradient(145deg, #fff7ef, #f5e9dd); color: var(--accent); }
.admin-category-icon svg { width: 20px; height: 20px; }
.admin-category-icon.is-subcategory svg { width: 15px; height: 15px; }
.admin-category-details { flex: 1; min-width: 0; }
.admin-category-details h3 { overflow: hidden; margin: 0; color: var(--forest); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.admin-category-details p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.admin-category-details small { color: var(--muted); font-size: 9px; }
.admin-category-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.category-status-button { min-width: 48px; padding: 7px 10px; border: 1px solid transparent; border-radius: 99px; font-size: 10px; font-weight: 700; }
.category-status-button.is-on { border-color: #cae4d1; background: #eaf6ed; color: #287044; }
.category-status-button.is-off { border-color: #dfded7; background: #f1f0e9; color: var(--muted); }
.login-panel { width: min(450px, 100%); margin: 8vh auto 0; padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 12px 35px rgba(24,60,50,.05); }
.login-panel h1 { font-size: 30px; }
.login-form { display: grid; gap: 11px; margin-top: 24px; }
label { color: #435046; font-size: 11px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #dfe1d8; border-radius: 5px; outline: 0; background: #fff; color: var(--ink); font-size: 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(130,151,123,.14); }
input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--forest); }
.notice { margin-top: 20px; padding: 15px; border: 1px solid #ead8c3; border-radius: 5px; background: #fff9f0; color: #675038; font-size: 12px; line-height: 1.55; }
.notice p { margin: 8px 0; }
.notice code { display: block; overflow-wrap: anywhere; padding: 9px; border-radius: 4px; background: #f3eadc; font-size: 11px; }
.admin-tools { display: flex; align-items: center; gap: 12px; margin: 27px 0 15px; }
.admin-tools label { flex: 0 0 auto; }
.admin-tools input { max-width: 350px; }
.admin-tools span { margin-left: auto; color: var(--muted); font-size: 11px; }
.admin-menu-list { display: grid; gap: 9px; }
.admin-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.admin-item-image { width: 72px; height: 62px; border-radius: 4px; background: #eeece4; object-fit: contain; }
.admin-item-details { min-width: 0; }
.admin-item-details h2 { overflow: hidden; margin: 0; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-details p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.admin-item-actions { display: flex; align-items: center; gap: 8px; }
.status-button { min-width: 88px; padding: 7px 10px; border: 1px solid transparent; border-radius: 99px; font-size: 10px; font-weight: 700; }
.status-button.is-available { border-color: #cae4d1; background: #eaf6ed; color: #287044; }
.status-button.is-unavailable { border-color: #efcfca; background: #fff0ed; color: #a1483b; }
.edit-button { min-height: 32px; padding: 6px 12px; }
.admin-message, .form-error { padding: 11px 13px; border-radius: 5px; font-size: 12px; line-height: 1.5; }
.admin-message { border: 1px solid #cae4d1; background: #eaf6ed; color: #287044; }
.form-error { border: 1px solid #efcfca; background: #fff0ed; color: #a1483b; }
.list-empty { grid-column: 1 / -1; padding: 35px; color: var(--muted); text-align: center; }
.form-dialog { width: min(680px, calc(100% - 24px)); max-height: min(92vh, 900px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 22px 80px rgba(11,25,18,.28); }
.form-dialog::backdrop { background: rgba(13,30,24,.67); backdrop-filter: blur(3px); }
.menu-form { display: grid; gap: 10px; padding: 27px; }
.form-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 8px; }
.form-heading h2 { margin: 0; font-size: 27px; }
.close-button { width: 33px; height: 33px; border: 0; border-radius: 50%; background: #f1f0e9; color: var(--forest); font-size: 23px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row > div { display: grid; gap: 8px; }
.menu-form > label { margin-top: 3px; }
.menu-form textarea { resize: vertical; }
.image-status-row { align-items: center; margin-top: 5px; }
.image-status-row input[type="file"] { padding: 7px; }
.image-status-row small { color: var(--muted); font-size: 10px; }
.availability-control { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.current-image { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 10px; }
.current-image img { width: 62px; height: 52px; border-radius: 4px; background: #eeece4; object-fit: contain; }
.form-actions { display: flex; justify-content: end; gap: 9px; margin-top: 10px; }
[hidden] { display: none !important; }

@media (max-width: 650px) {
  .admin-main { width: calc(100% - 28px); padding-top: 31px; }
  .admin-heading { align-items: start; flex-direction: column; }
  .settings-heading { align-items: stretch; flex-direction: column; }
  .settings-heading-actions { justify-content: start; }
  .password-form .form-row { grid-template-columns: 1fr; }
  .social-settings-list { grid-template-columns: 1fr; }
  .copy-settings-list { grid-template-columns: 1fr; }
  .admin-category-list { grid-template-columns: 1fr; }
  .qr-preview-panel { align-items: stretch; flex-direction: column; }
  .qr-preview-actions { flex-direction: column; }
  .qr-preview-actions .button { width: 100%; }
  .admin-tools { align-items: stretch; flex-wrap: wrap; }
  .admin-tools input { order: 2; max-width: none; }
  .admin-tools span { order: 1; }
  .admin-tools label { order: 0; }
  .admin-item { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .admin-item-image { width: 58px; height: 54px; }
  .admin-item-actions { grid-column: 2; justify-content: start; }
  .form-row { grid-template-columns: 1fr; }
  .menu-form { padding: 20px; }
  .login-panel { padding: 25px 20px; }
}
