:root {
  color: #1d1b16;
  background: #f8f2e8;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --accent: #e0602f;
  --accent-dark: #9e3f1e;
  --card: rgba(255, 252, 246, 0.92);
  --ink-soft: #756c5c;
  --line: rgba(80, 58, 35, 0.14);
  --shadow: 0 24px 70px rgba(84, 51, 21, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 121, 0.45), transparent 32rem),
    linear-gradient(135deg, #fff8ee 0%, #f6ead9 46%, #efe0cc 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(224, 96, 47, 0.35);
  outline-offset: 3px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 44px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.76);
  box-shadow: 0 14px 34px rgba(90, 61, 27, 0.09);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ef9b3e);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.nav-button,
.reset-button,
.availability-button {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.nav-button:hover,
.reset-button:hover,
.availability-button:hover {
  transform: translateY(-1px);
}

.nav-button {
  padding: 12px 18px;
  color: #4d4335;
  background: transparent;
}

.nav-button.active {
  color: #fff;
  background: #1f1a15;
  box-shadow: 0 12px 24px rgba(31, 26, 21, 0.16);
}

.page {
  padding-top: 34px;
}

.hero-card,
.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 40px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 8vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.hero-text,
.admin-hero p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.hero-stat {
  display: grid;
  width: 172px;
  height: 172px;
  place-items: center;
  padding: 22px;
  border-radius: 50%;
  color: #fff;
  background: #1f1a15;
  text-align: center;
  box-shadow: 0 22px 42px rgba(31, 26, 21, 0.2);
}

.hero-stat strong {
  display: block;
  font-size: 3.7rem;
  line-height: 0.9;
}

.hero-stat span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
}

.category-list {
  display: grid;
  gap: 34px;
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.55rem);
  letter-spacing: -0.04em;
}

.section-heading span {
  min-width: 42px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(224, 96, 47, 0.12);
  font-weight: 900;
  text-align: center;
}

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

.menu-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.78);
  box-shadow: 0 14px 40px rgba(84, 51, 21, 0.08);
}

.dish-image,
.admin-dish-image {
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #fff2dc;
}

.dish-image {
  width: 78px;
  height: 78px;
  font-size: 2.35rem;
}

.dish-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dish-title-row h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.dish-title-row strong {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 1.08rem;
}

.dish-content p {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.empty-state {
  margin-top: 34px;
  padding: 36px;
  border: 1px dashed rgba(80, 58, 35, 0.28);
  border-radius: 32px;
  background: rgba(255, 252, 246, 0.6);
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.admin-hero {
  align-items: center;
}

.admin-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 7vw, 4.8rem);
}

.reset-button {
  padding: 14px 20px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(224, 96, 47, 0.22);
}

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

.admin-summary div {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 252, 246, 0.72);
}

.admin-summary strong,
.admin-summary span {
  display: block;
}

.admin-summary strong {
  font-size: 2.1rem;
  line-height: 1;
}

.admin-summary span {
  margin-top: 6px;
  color: var(--ink-soft);
}

.admin-table {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 140px;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.82);
  box-shadow: 0 12px 34px rgba(84, 51, 21, 0.06);
}

.admin-row.stopped {
  opacity: 0.66;
}

.admin-dish-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.admin-dish-image {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  font-size: 1.8rem;
}

.admin-dish-main h2 {
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-dish-main p,
.price-field span {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.price-field {
  display: grid;
  gap: 7px;
}

.price-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(80, 58, 35, 0.22);
  border-radius: 16px;
  color: #1d1b16;
  background: #fffaf2;
  font-weight: 800;
}

.availability-button {
  min-height: 48px;
  padding: 12px 14px;
  color: #174228;
  background: #dff5dd;
}

.availability-button.stopped {
  color: #7b221f;
  background: #ffe0dc;
}

@media (max-width: 860px) {
  .hero-card,
  .admin-hero,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    width: 150px;
    height: 150px;
  }

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

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    border-radius: 24px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nav-button {
    padding: 12px;
  }

  .hero-card,
  .admin-hero {
    border-radius: 30px;
  }

  .menu-card {
    grid-template-columns: 1fr;
  }

  .dish-title-row {
    align-items: baseline;
  }
}

.image-logo {
  overflow: hidden;
  padding: 0;
  background: #fff;
}

.image-logo img,
.has-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.restaurant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.restaurant-meta span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #5a4b3a;
  background: rgba(255, 255, 255, 0.58);
  font-weight: 800;
}

.menu-tools {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 252, 246, 0.76);
  box-shadow: 0 14px 40px rgba(84, 51, 21, 0.07);
}

.search-field,
.admin-field,
.sort-row label {
  display: grid;
  gap: 8px;
}

.search-field span,
.admin-field span,
.sort-row label span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-field input,
.admin-field input,
.admin-field select,
.admin-field textarea,
.sort-row select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(80, 58, 35, 0.2);
  border-radius: 16px;
  color: #1d1b16;
  background: #fffaf2;
  font-weight: 750;
}

.admin-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.category-chips,
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chips button,
.quick-filters button,
.clear-filters,
.secondary-button,
.upload-button {
  border: 1px solid rgba(80, 58, 35, 0.16);
  border-radius: 999px;
  color: #4d4335;
  background: #fffaf2;
  font-weight: 900;
}

.category-chips button,
.quick-filters button,
.clear-filters,
.secondary-button {
  padding: 11px 14px;
}

.category-chips button.active,
.quick-filters button.active {
  color: #fff;
  border-color: #1f1a15;
  background: #1f1a15;
}

.sort-row {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px) auto;
  align-items: end;
  gap: 12px;
}

.result-count {
  align-self: center;
  color: var(--accent-dark);
  font-weight: 900;
}

.clear-filters {
  min-height: 48px;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.dish-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #7c4128;
  background: rgba(224, 96, 47, 0.11);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-card {
  margin-top: 18px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 252, 246, 0.78);
  box-shadow: 0 14px 40px rgba(84, 51, 21, 0.07);
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-grid,
.add-dish-form,
.admin-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.file-field input,
.upload-button input {
  display: none;
}

.file-field {
  justify-content: end;
}

.file-field::after {
  content: "Выбрать файл";
  display: inline-grid;
  min-height: 48px;
  place-items: center;
  padding: 0 14px;
  border-radius: 16px;
  color: #fff;
  background: #1f1a15;
  font-weight: 900;
}

.secondary-button {
  margin-top: 14px;
}

.add-dish-form {
  align-items: end;
}

.expanded-admin-row {
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.65fr) minmax(180px, 0.55fr);
  align-items: start;
}

.admin-row-actions {
  display: grid;
  gap: 10px;
}

.check-pill,
.upload-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
}

.check-pill {
  border: 1px solid rgba(80, 58, 35, 0.16);
  border-radius: 999px;
  color: #4d4335;
  background: #fffaf2;
  font-weight: 900;
}

.check-pill input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.upload-button {
  cursor: pointer;
}

.admin-dish-image.has-photo,
.dish-image.has-photo {
  overflow: hidden;
  background: #fff;
}

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

.export-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 250, 242, 0.72);
}

.export-panel h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.export-panel p {
  color: var(--ink-soft);
  line-height: 1.55;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.export-actions .secondary-button {
  margin-top: 0;
}

.qr-preview {
  display: grid;
  width: min(260px, 100%);
  margin: 8px 0 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.qr-preview svg {
  width: 100%;
  height: auto;
}

.qr-fallback {
  padding: 24px;
  color: #7b221f;
  text-align: center;
}

.menu-link-field {
  display: grid;
  gap: 8px;
}

.menu-link-field span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.menu-link-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(80, 58, 35, 0.2);
  border-radius: 16px;
  color: #1d1b16;
  background: #fffaf2;
  font-weight: 800;
}

.print-root {
  display: none;
}

.print-logo {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background: #1f1a15;
  font-weight: 900;
  font-size: 1.4rem;
}

.print-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff !important;
  }

  body.print-mode .app-shell {
    display: none !important;
  }

  body.print-mode .print-root {
    display: block;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .print-menu {
    display: grid;
    gap: 18px;
  }

  .print-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #111;
  }

  .print-header h1,
  .print-qr-page h1 {
    margin: 0 0 6px;
    font-size: 30px;
    letter-spacing: -0.03em;
  }

  .print-header p,
  .print-header span,
  .print-qr-page p {
    margin: 0;
    color: #444;
  }

  .print-category {
    break-inside: avoid;
  }

  .print-category h2 {
    margin: 14px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #bbb;
    font-size: 19px;
  }

  .print-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding: 9px 0;
    border-bottom: 1px solid #e2e2e2;
    break-inside: avoid;
  }

  .print-item h3 {
    margin: 0 0 4px;
    font-size: 15px;
  }

  .print-item p {
    margin: 0;
    color: #555;
    font-size: 12px;
    line-height: 1.35;
  }

  .print-item strong {
    font-size: 15px;
  }

  .print-stopped {
    color: #777;
  }

  .print-qr-page {
    display: grid;
    min-height: 240mm;
    align-content: center;
    justify-items: center;
    gap: 14px;
    text-align: center;
  }

  .print-qr-code {
    width: 82mm;
  }

  .print-qr-code svg {
    width: 100%;
    height: auto;
  }

  .print-qr-page strong {
    max-width: 150mm;
    overflow-wrap: anywhere;
    font-size: 12px;
  }
}

@media (max-width: 1000px) {
  .sort-row,
  .expanded-admin-row,
  .settings-grid,
  .add-dish-form,
  .admin-edit-grid,
  .admin-export-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .restaurant-meta,
  .category-chips,
  .quick-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
