:root {
  --red-900: #6d0308;
  --red-800: #8f0910;
  --red-700: #bc0d15;
  --gold-500: #f2b52b;
  --gold-400: #f7c857;
  --cream-100: #fffaf1;
  --ink-900: #241111;
  --ink-700: #60413b;
  --ink-500: #8f7c74;
  --line: rgba(70, 24, 18, 0.12);
  --card-shadow: 0 24px 64px rgba(56, 10, 10, 0.18);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --sidebar-width: clamp(112px, 20vw, 220px);
  --menu-bg-image: linear-gradient(135deg, rgba(120, 20, 18, 0.1), rgba(242, 181, 43, 0.18));
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 205, 114, 0.45), transparent 34%),
    linear-gradient(145deg, #5a0409 0%, #8f0910 38%, #c00f16 100%);
  color: var(--ink-900);
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

body {
  min-height: 100svh;
}

body.front-page {
  height: 100svh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100svh;
  padding:
    calc(14px + var(--safe-top))
    calc(14px + var(--safe-right))
    calc(14px + var(--safe-bottom))
    calc(14px + var(--safe-left));
  gap: 14px;
}

body.front-page .app-shell {
  height: 100svh;
}

.sidebar,
.content-panel,
.auth-card,
.panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #d90d17 0%, #8f0910 100%);
  color: white;
  min-height: 0;
  height: 100%;
}

.sidebar-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar-label,
.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-head h1,
.menu-header h1,
.home-copy h1,
.auth-card h1,
.admin-header h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.15rem, 2vw, 2rem);
  line-height: 1.05;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  padding: 10px 0;
}

.menu-link {
  display: block;
  padding: 14px 16px;
  border-left: 4px solid transparent;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-link.active {
  background: rgba(255, 255, 255, 0.13);
  border-left-color: var(--gold-500);
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px;
}

.secondary-btn,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #4b1707;
  font-weight: 800;
  cursor: pointer;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.content-panel {
  position: relative;
  min-height: 0;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.92), rgba(255, 250, 241, 0.98)),
    var(--menu-bg-image);
  background-size: cover;
  background-position: center;
}

.content-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.65)),
    var(--menu-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.9;
}

.menu-panel,
.home-panel {
  display: flex;
  flex-direction: column;
  padding: 22px;
  min-height: 0;
}

.menu-header,
.dish-grid,
.home-content {
  position: relative;
  z-index: 1;
}

.menu-header {
  padding-bottom: 18px;
  flex: 0 0 auto;
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.dish-card {
  display: flex;
  flex-direction: column;
  min-height: clamp(220px, 30vw, 330px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(104, 39, 20, 0.08);
  border-radius: 22px;
  overflow: hidden;
}

.dish-image-wrap {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f3cf8a, #b54415);
  overflow: hidden;
}

.dish-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.dish-image-placeholder,
.home-logo-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: white;
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dish-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
}

.dish-topline {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.dish-topline h2 {
  margin: 0;
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  line-height: 1.2;
}

.price {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  font-weight: 800;
}

.dish-desc,
.store-intro,
.auth-card p,
.admin-header p {
  margin: 0;
  color: var(--ink-700);
  line-height: 1.5;
}

.dish-desc {
  flex: 1;
  font-size: 0.92rem;
}

.dish-bottomline {
  min-height: 28px;
}

.spice {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  min-height: 24px;
}

.pepper {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pepper-solid {
  fill: #d83f10;
  stroke: #9a2204;
}

.pepper-outline {
  fill: rgba(216, 63, 16, 0.08);
  stroke: rgba(154, 34, 4, 0.45);
}

.spice-none {
  font-size: 0.85rem;
  color: var(--ink-500);
}

.home-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  min-height: 100%;
  overflow: auto;
  text-align: center;
}

.home-logo-wrap {
  display: flex;
  justify-content: center;
}

.home-logo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 26px;
  border: 1px solid rgba(104, 39, 20, 0.08);
  background: white;
}

.home-copy {
  max-width: min(760px, 90%);
  margin: 0 auto;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  text-align: center;
  border: 1px dashed rgba(117, 47, 18, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.auth-page,
.admin-page {
  min-height: 100svh;
  padding:
    calc(20px + var(--safe-top))
    calc(20px + var(--safe-right))
    calc(20px + var(--safe-bottom))
    calc(20px + var(--safe-left));
}

.auth-page {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  background: rgba(255, 250, 241, 0.96);
}

.admin-page {
  background:
    radial-gradient(circle at top left, rgba(255, 208, 120, 0.3), transparent 24%),
    linear-gradient(180deg, #fff6e8, #fffdf7);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-section-menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: calc(20px + var(--safe-top));
}

.admin-section-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(143, 9, 16, 0.08);
  color: var(--red-800);
  font-weight: 800;
}

.admin-section-menu.vertical {
  flex-direction: column;
  margin-bottom: 0;
}

.admin-section-link.active {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #4b1707;
}

.admin-content {
  min-width: 0;
}

.admin-main-panel {
  width: 100%;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.panel-wide {
  grid-column: span 2;
}

.panel h2 {
  margin-top: 0;
}

.panel h3 {
  margin: 0;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(93, 35, 14, 0.15);
  border-radius: 14px;
  background: white;
}

.admin-form textarea {
  resize: vertical;
  min-height: 110px;
}

.table-wrap {
  overflow: auto;
}

.helper-text {
  margin: 0 0 14px;
  color: var(--ink-700);
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(93, 35, 14, 0.12);
  text-align: left;
  vertical-align: top;
}

.inline-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-sort-form input[type="number"] {
  width: 96px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(93, 35, 14, 0.15);
  border-radius: 12px;
}

.inline-sort-form input[type="text"] {
  width: 140px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(93, 35, 14, 0.15);
  border-radius: 12px;
}

.danger {
  background: linear-gradient(135deg, #c72828, #8f0910);
  color: white;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(143, 9, 16, 0.1);
  font-weight: 700;
  color: var(--red-800);
}

.form-notice {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
}

.form-notice.error {
  background: rgba(199, 40, 40, 0.12);
  color: #932323;
}

.form-notice.success {
  background: rgba(61, 135, 73, 0.12);
  color: #255a31;
  margin-bottom: 18px;
}

.text-link {
  color: var(--red-800);
  font-weight: 800;
}

.secondary-inline-btn {
  display: inline-flex;
  min-height: 38px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(143, 9, 16, 0.1);
  color: var(--red-800);
  font-weight: 800;
  margin-right: 8px;
  white-space: nowrap;
}

.compact-empty {
  min-height: 220px;
}

.category-editor {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 18px;
}

.category-editor-nav {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(143, 9, 16, 0.05);
}

.admin-category-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-category-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 800;
}

.admin-category-link.active {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
}

.category-editor-main {
  min-width: 0;
}

.editor-heading {
  margin-bottom: 14px;
}

.dish-edit-panel {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .dish-grid {
    gap: 12px;
  }

  .dish-card {
    min-height: 210px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .panel-wide {
    grid-column: span 1;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .category-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar-head {
    padding: 16px 12px;
  }

  .menu-link {
    padding: 12px;
    font-size: 0.9rem;
  }

  .menu-panel,
  .home-panel {
    padding: 14px;
  }

  .dish-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dish-body {
    padding: 10px;
  }

  .dish-topline {
    flex-direction: column;
  }

  .price {
    align-self: start;
  }
}
