:root {
  --forest: #123c36;
  --lime: #d9ed83;
  --cream: #f7f2e8;
  --paper: #fffdf8;
  --ink: #17211e;
  --muted: #6d7772;
  --line: #e5e2d9;
  --danger: #b44338;
  --shadow: 0 18px 55px rgba(20,42,36,.12);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.admin-topbar { height: 80px; padding: 0 28px; background: var(--forest); color: white; display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 20; }
.admin-brand { color: white; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--lime); color: var(--forest); display: grid; place-items: center; font: 900 23px/1 Georgia, serif; transform: rotate(-3deg); }
.admin-brand strong { display: block; font-family: Georgia, serif; letter-spacing: .065em; font-size: 17px; }
.admin-brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.58); font-size: 8px; letter-spacing: .2em; font-weight: 800; }
.back-button { height: 42px; padding: 0 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; color: white; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 11px; font-weight: 850; }
.back-button span { font-size: 18px; }
.menu-nav { display: flex; align-items: center; gap: 9px; }
.admin-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 46px 0 64px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 7px; color: #84908a; font-size: 9px; font-weight: 900; letter-spacing: .2em; }
h1 { margin: 0; font: 700 clamp(34px, 4vw, 48px)/1 Georgia, serif; letter-spacing: -.035em; }
.page-heading > div > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button { height: 48px; padding: 0 18px; border-radius: 14px; font-size: 12px; font-weight: 850; cursor: pointer; }
.primary-button { border: 0; background: var(--forest); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-button:disabled { background: #bfc5c1; cursor: not-allowed; }
.primary-button span { font-size: 22px; line-height: 1; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--forest); }
.stats { margin: 30px 0 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 190px)); gap: 10px; }
.stats article { padding: 15px 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stats span { color: var(--muted); font-size: 10px; font-weight: 800; }
.stats strong { font: 700 23px Georgia, serif; color: var(--forest); }
.admin-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.category-panel, .items-panel { border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 12px 35px rgba(20,42,36,.055); }
.category-panel { padding: 22px; position: sticky; top: 98px; }
.panel-title h2, .items-toolbar h2 { margin: 0; font: 700 24px/1 Georgia, serif; }
.category-form { margin: 22px 0 18px; }
.category-form > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.category-form > div { height: 44px; padding-left: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; display: flex; overflow: hidden; }
.category-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.category-form button { width: 44px; border: 0; background: var(--forest); color: white; font-size: 21px; cursor: pointer; }
.category-list { display: grid; gap: 7px; }
.category-row { min-width: 0; height: 45px; padding: 0 8px 0 12px; border: 1px solid transparent; border-radius: 12px; background: #f1efe9; display: flex; align-items: center; gap: 8px; }
.category-row.active { border-color: var(--forest); background: white; }
.category-select { min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; font-size: 11px; font-weight: 850; }
.category-select b { min-width: 23px; height: 23px; padding: 0 6px; border-radius: 8px; background: white; color: var(--muted); display: grid; place-items: center; font-size: 9px; }
.category-row.active .category-select b { background: var(--forest); color: white; }
.delete-category { flex: 0 0 auto; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #a36a63; cursor: pointer; font-size: 16px; }
.items-panel { min-width: 0; padding: 22px; }
.items-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-search { width: min(280px, 46%); height: 43px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: white; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.admin-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-chips { margin: 20px 0 17px; padding-bottom: 2px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: #68736e; font-size: 10px; font-weight: 850; cursor: pointer; }
.filter-chip.active { border-color: var(--forest); background: var(--forest); color: white; }
.admin-menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.admin-item-card { min-width: 0; min-height: 150px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: white; display: flex; flex-direction: column; }
.item-category { color: #87908c; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.admin-item-card h3 { margin: 11px 0 7px; font-size: 13px; line-height: 1.35; }
.admin-item-card > strong { color: var(--forest); font-size: 15px; }
.item-actions { margin-top: auto; padding-top: 15px; display: grid; grid-template-columns: 1fr 34px; gap: 7px; }
.item-actions button { height: 34px; border-radius: 10px; font-size: 9px; font-weight: 850; cursor: pointer; }
.edit-item { border: 1px solid #d2d7d2; background: #f4f3ee; color: var(--forest); }
.delete-item { border: 1px solid #ead7d3; background: #fff8f6; color: var(--danger); font-size: 15px !important; }
.empty-state { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state[hidden] { display: none !important; }
.empty-state > span { width: 60px; height: 60px; border-radius: 20px; background: #efeee8; color: #969f9b; display: grid; place-items: center; font-size: 27px; }
.empty-state h3 { margin: 15px 0 5px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
.item-dialog { width: auto; max-width: none; height: auto; max-height: none; padding: 0; border: 0; background: transparent; color: var(--ink); }
.item-dialog::backdrop { background: rgba(11,27,23,.58); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.item-form { width: min(92vw, 470px); padding: 26px; border: 1px solid rgba(255,255,255,.4); border-radius: 24px; background: var(--paper); box-shadow: 0 30px 90px rgba(11,31,25,.28); }
.item-form header { margin-bottom: 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.item-form h2 { margin: 0; font: 700 28px/1 Georgia, serif; }
.dialog-close { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--muted); font-size: 23px; cursor: pointer; }
.item-form > label { margin-top: 14px; color: var(--muted); display: block; font-size: 10px; font-weight: 850; }
.item-form > label > input, .item-form select, .price-field { width: 100%; height: 48px; margin-top: 7px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); outline: 0; font-size: 13px; }
.item-form select { appearance: none; -webkit-appearance: none; }
.price-field { display: flex; align-items: center; gap: 8px; }
.price-field span { color: #8a938e; font-size: 12px; font-weight: 850; }
.price-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 850; }
.form-actions { margin-top: 25px; display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; }
.toast { min-width: 230px; max-width: calc(100vw - 32px); padding: 13px 17px; border-radius: 13px; background: #17211e; color: white; box-shadow: var(--shadow); position: fixed; z-index: 100; left: 50%; top: 94px; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; font-size: 12px; font-weight: 750; text-align: center; transition: transform .2s, opacity .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .admin-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .admin-topbar { height: 68px; padding: 0 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .admin-brand strong { font-size: 14px; }
  .back-button { width: 42px; padding: 0; justify-content: center; font-size: 0; }
  .back-button span { font-size: 20px; }
  .admin-shell { width: min(100% - 28px, 600px); padding: 28px 0 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .page-heading .primary-button { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .admin-layout { display: block; }
  .category-panel { margin-bottom: 14px; position: static; }
  .category-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .items-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-search { width: 100%; }
}
@media (max-width: 460px) {
  .admin-menu-grid { grid-template-columns: 1fr; }
  .category-list { grid-template-columns: 1fr; }
  .stats article { align-items: flex-start; flex-direction: column; gap: 5px; }
  .items-panel, .category-panel { padding: 18px; border-radius: 19px; }
}
