:root {
  color-scheme: dark;
  --bg: #171312;
  --panel: #241d1b;
  --panel-2: #302622;
  --line: #4a3a33;
  --text: #f4ece2;
  --muted: #b9a99a;
  --accent: #d2a24b;
  --accent-2: #7fb18f;
  --danger: #d86d5a;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(110deg, rgba(210, 162, 75, 0.08), transparent 34%),
    radial-gradient(circle at top right, rgba(127, 177, 143, 0.12), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar,
.person-strip,
.workbench,
.panel-header,
.bill-footer,
.menu-tools {
  display: flex;
  gap: 16px;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.view-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-2);
}

.view-tab.is-active {
  border-color: transparent;
  background: var(--accent);
  color: #201510;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.4rem);
}

h2 {
  font-size: 1.75rem;
}

.grand-total,
.bill-total {
  display: grid;
  gap: 4px;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(36, 29, 27, 0.82);
  padding: 12px 16px;
  box-shadow: 0 14px 36px var(--shadow);
}

.grand-total span,
.bill-total span {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
}

.grand-total strong,
.bill-total strong {
  color: var(--accent);
  font-size: 1.65rem;
}

.sync-status {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
}

.sync-status[data-mode="shared"] {
  color: var(--accent-2);
}

.person-strip {
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(36, 29, 27, 0.94);
  padding: 10px;
  backdrop-filter: blur(10px);
}

.person-tabs,
.category-tabs,
.subcategory-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.person-tabs {
  flex: 1;
}

.person-tab,
.category-tab,
.subcategory-tab,
.ghost-button,
.primary-button,
.small-button,
.icon-button,
.person-form button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
}

.category-tab,
.subcategory-tab {
  white-space: nowrap;
  padding: 0 14px;
}

.subcategory-tabs {
  margin: -4px 0 14px;
}

.manual-item-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(110px, 150px) minmax(130px, 180px);
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 10px;
  background: rgba(24, 18, 16, 0.45);
}

.subcategory-tab {
  min-height: 36px;
  border-color: rgba(74, 58, 51, 0.75);
  color: var(--muted);
  background: #181210;
}

.person-tab {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  min-width: max-content;
  overflow: hidden;
  padding: 0;
}

.person-tab.is-dragging {
  opacity: 0.45;
}

.person-tab.is-drop-target {
  border-color: var(--accent-2);
}

.person-select,
.person-remove {
  min-height: 40px;
  border: 0;
  color: inherit;
  background: transparent;
}

.person-select {
  padding: 0 8px 0 14px;
  white-space: nowrap;
}

.person-remove {
  width: 34px;
  color: var(--muted);
  font-size: 1.1rem;
}

.person-remove:hover {
  color: #ffd6cd;
  background: rgba(216, 109, 90, 0.16);
}

.person-tab.is-active,
.category-tab.is-active,
.subcategory-tab.is-active,
.primary-button {
  border-color: transparent;
  background: var(--accent);
  color: #201510;
  font-weight: 700;
}

.person-form {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 44px;
  gap: 8px;
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #181210;
  color: var(--text);
  padding: 0 12px;
}

select {
  appearance: none;
  padding-right: 38px;
  background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--accent) 50%, transparent 50%) right 12px center / 7px 7px no-repeat,
    #181210;
  cursor: pointer;
}

select option {
  background: #181210;
  color: var(--text);
}

textarea {
  min-height: 78px;
  resize: vertical;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

.workbench {
  align-items: flex-start;
}

.bill-panel,
.menu-panel,
.paid-view,
.orders-view,
.rooms-view,
.telegrams-view,
.products-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(36, 29, 27, 0.9);
  box-shadow: 0 18px 42px var(--shadow);
}

.paid-view,
.orders-view,
.rooms-view,
.telegrams-view,
.products-view {
  padding: 18px;
}

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

.paid-list {
  display: grid;
  gap: 12px;
}

.room-counter {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.room-counter div {
  min-width: 88px;
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(24, 18, 16, 0.7);
}

.room-counter span {
  display: block;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
}

.room-counter strong {
  color: var(--accent-2);
  font-size: 1.2rem;
}

.room-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 220px) minmax(150px, 210px);
  gap: 10px;
  margin-bottom: 14px;
}

.rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.room-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #302622, #221a18);
  padding: 12px;
}

.room-card.is-occupied {
  border-color: rgba(127, 177, 143, 0.45);
}

.room-card.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(210, 162, 75, 0.26);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(74, 58, 51, 0.65);
  padding-bottom: 8px;
}

.room-card-header h3 {
  margin: 0;
}

.room-card-header small,
.room-meta span {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.room-card-header > strong {
  color: var(--accent);
}

.room-status {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 9px;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.room-status.is-free {
  color: #dff6e6;
  background: rgba(127, 177, 143, 0.18);
}

.room-status.is-occupied {
  color: #201510;
  background: var(--accent);
}

.room-status.is-expired {
  color: #ffd6cd;
  background: rgba(216, 109, 90, 0.18);
}

.room-calendar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.room-calendar:empty {
  display: none;
}

.room-calendar-head,
.room-calendar-list,
.room-calendar-entry {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  background: rgba(24, 18, 16, 0.62);
}

.room-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.room-calendar-head h3,
.room-calendar-head p {
  margin: 0;
}

.room-calendar-head small {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.room-calendar-list {
  display: grid;
  gap: 8px;
  max-height: 252px;
  overflow-y: auto;
  padding: 10px;
}

.room-calendar-filter {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(180px, 320px);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(24, 18, 16, 0.62);
}

.room-calendar-filter span,
.room-calendar-empty {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.room-calendar-filter select,
.room-booking-menu select {
  border-color: rgba(210, 162, 75, 0.48);
  background-color: rgba(24, 18, 16, 0.92);
}

.room-calendar-empty {
  border: 1px dashed rgba(74, 58, 51, 0.75);
  border-radius: 8px;
  padding: 12px;
}

.room-month-calendar {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  background: rgba(24, 18, 16, 0.62);
  padding: 10px;
}

.room-month-head,
.room-month-weekdays,
.room-month-grid,
.room-month-legend {
  display: grid;
  gap: 6px;
}

.room-month-head {
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  margin-bottom: 8px;
}

.room-month-head strong {
  text-align: center;
  text-transform: capitalize;
}

.room-month-head button {
  min-height: 34px;
  padding: 0;
}

.room-month-weekdays,
.room-month-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.room-month-weekdays span {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  text-align: center;
}

.room-month-day {
  min-height: 34px;
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 0;
  background: #181210;
  color: var(--text);
  cursor: pointer;
}

.room-month-day:disabled {
  cursor: default;
}

.room-month-day:not(.is-active):not(.is-reserved):not(:disabled):hover {
  border-color: rgba(127, 177, 143, 0.75);
  background: rgba(127, 177, 143, 0.14);
}

.room-month-day.is-muted {
  opacity: 0.36;
}

.room-month-day.is-active,
.room-month-day.is-reserved {
  border-color: rgba(216, 109, 90, 0.68);
  background: rgba(216, 109, 90, 0.28);
  color: #ffd6cd;
}

.room-month-day.is-today {
  outline: 2px solid rgba(210, 162, 75, 0.55);
  outline-offset: -2px;
}

.room-month-legend {
  display: flex;
  gap: 14px;
  margin-top: 9px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
}

.room-month-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.room-month-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(216, 109, 90, 0.36);
}

.room-calendar-entry {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr) minmax(170px, 1.2fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  cursor: pointer;
}

.room-calendar-entry:hover {
  border-color: rgba(210, 162, 75, 0.72);
}

.room-calendar-entry strong {
  color: var(--accent);
}

.room-calendar-entry span,
.room-calendar-entry small,
.room-calendar-entry em {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-style: normal;
}

.room-calendar-entry.is-active em,
.room-calendar-entry.is-reserved em {
  color: var(--accent-2);
}

.room-calendar-entry.is-expired em {
  color: #ffd6cd;
}

.room-book-form,
.room-meta {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.room-book-form {
  grid-template-columns: minmax(0, 1.15fr) minmax(112px, 0.9fr) minmax(50px, 0.42fr) minmax(76px, 0.62fr);
  overflow: hidden;
}

.room-book-form textarea,
.room-book-form button,
.room-booking-hint {
  grid-column: 1 / -1;
}

.room-booking-hint {
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
}

.room-book-form input {
  min-width: 0;
  min-height: 40px;
  padding-inline: 9px;
}

.room-book-form input[name="nights"] {
  padding-inline: 7px;
}

.room-book-form textarea {
  min-height: 58px;
}

.room-meta {
  grid-template-columns: repeat(2, 1fr);
}

.room-meta.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-bookings {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.room-booking,
.room-booking-empty {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  background: rgba(24, 18, 16, 0.48);
  padding: 8px 10px;
}

.room-booking {
  cursor: pointer;
}

.room-booking[draggable="true"],
.room-calendar-entry[draggable="true"] {
  user-select: none;
}

.room-booking.is-active {
  border-color: rgba(127, 177, 143, 0.55);
}

.room-booking.is-reserved {
  border-color: rgba(210, 162, 75, 0.55);
}

.room-booking.is-expired {
  border-color: rgba(216, 109, 90, 0.45);
  opacity: 0.82;
}

.room-booking-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.room-booking-head strong {
  color: var(--accent);
}

.room-booking-head small,
.room-booking-empty {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.room-booking-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.room-booking-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 9, 8, 0.72);
}

.room-booking-menu {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(130px, 170px);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #241d1b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  padding: 16px;
}

.room-booking-menu-head,
.room-booking-menu textarea,
.room-booking-menu-summary,
.room-booking-menu-actions {
  grid-column: 1 / -1;
}

.room-booking-menu-head,
.room-booking-menu-actions,
.room-booking-menu-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room-booking-menu-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.room-booking-menu-head h2,
.room-booking-menu-head p {
  margin: 0;
}

.room-booking-menu-close {
  width: 42px;
  padding: 0;
  font-size: 1.3rem;
}

.room-booking-menu textarea {
  min-height: 96px;
}

.room-booking-menu-summary {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(24, 18, 16, 0.48);
}

.room-booking-menu-summary span {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.room-booking-menu-summary strong {
  color: var(--accent);
}

.room-booking-menu-actions {
  justify-content: flex-end;
}

.room-booking-menu-delete {
  margin-right: auto;
  color: #ffd6cd;
  border-color: rgba(216, 109, 90, 0.45);
  background: rgba(216, 109, 90, 0.16);
}

.room-meta div {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 9px;
  background: rgba(24, 18, 16, 0.45);
}

.room-meta span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.room-meta strong {
  color: var(--accent-2);
}

.room-note-field {
  margin: 12px 0;
}

.room-book-form + .paid-card-actions {
  margin-top: 8px;
}

.telegram-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(130px, 180px) minmax(160px, 1fr) minmax(130px, 180px);
  gap: 10px;
  margin-bottom: 12px;
}

.telegram-search {
  max-width: 420px;
  margin-bottom: 14px;
}

.telegrams-list {
  display: grid;
  gap: 8px;
}

.telegram-list-header {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(110px, 160px) minmax(140px, 1fr) minmax(190px, auto);
  gap: 14px;
  padding: 0 12px 4px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.telegram-card {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(110px, 160px) minmax(140px, 1fr) minmax(190px, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #302622, #221a18);
  padding: 10px 12px;
}

.telegram-card h3 {
  margin: 0;
}

.telegram-card strong {
  display: block;
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
}

.telegram-card small {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.telegram-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 8px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 10px;
  overflow-x: auto;
}

.settings-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-2);
  white-space: nowrap;
}

.settings-tab.is-active {
  border-color: transparent;
  background: var(--accent);
  color: #201510;
  font-weight: 700;
}

.settings-section {
  display: grid;
  gap: 12px;
}

.settings-home {
  display: grid;
  width: 100%;
  gap: 10px;
}

.settings-entry {
  display: grid;
  grid-template-columns: 1fr minmax(90px, auto);
  min-height: 74px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: linear-gradient(180deg, #302622, #221a18);
  text-align: left;
}

.settings-entry strong,
.settings-entry small {
  display: block;
}

.settings-entry small {
  color: var(--muted);
  font-family: Arial, sans-serif;
  margin-top: 4px;
}

.settings-entry > span:last-child {
  justify-self: end;
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.product-form {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(80px, 110px) minmax(110px, 130px) minmax(150px, 190px);
  gap: 10px;
  margin-bottom: 12px;
}

.subcategory-form {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(150px, 220px) minmax(160px, 220px);
  gap: 10px;
  margin-bottom: 12px;
}

.subcategory-admin-list {
  display: grid;
  gap: 8px;
  max-width: 720px;
  margin-bottom: 12px;
}

.subcategory-admin-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 160px) minmax(90px, 130px) minmax(96px, 120px);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #302622, #221a18);
}

.subcategory-admin-row strong {
  color: var(--accent);
}

.subcategory-admin-row span,
.subcategory-admin-row em {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-style: normal;
}

.subcategory-admin-row button {
  width: 100%;
}

.product-form select,
.product-edit-menu select {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.display-settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(160px, 220px);
  gap: 10px;
  max-width: 860px;
}

.product-available-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #181210;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.product-available-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent-2);
}

.product-search {
  max-width: 420px;
  margin-bottom: 14px;
}

.products-list {
  display: grid;
  gap: 8px;
}

.product-list-header,
.product-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(100px, 0.7fr) minmax(110px, 0.8fr) minmax(80px, 96px) minmax(100px, 118px) minmax(330px, 330px);
  align-items: center;
  gap: 10px;
}

.product-list-header {
  padding: 0 12px 4px 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #302622, #221a18);
  padding: 10px 12px;
}

.product-row.is-unavailable {
  opacity: 0.62;
}

.product-row > strong {
  color: var(--accent);
}

.product-row span {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.product-status {
  color: var(--accent-2) !important;
  font-weight: 700;
}

.product-row.is-unavailable .product-status {
  color: #ffd6cd !important;
}

.product-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.product-actions button {
  min-width: 0;
  padding: 0 12px;
}

.product-actions .product-delete {
  color: #ffd6cd;
  border-color: rgba(216, 109, 90, 0.45);
  background: rgba(216, 109, 90, 0.16);
}

.product-edit-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 9, 8, 0.72);
}

.product-edit-menu {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #241d1b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  padding: 16px;
}

.product-edit-menu-head,
.product-edit-menu-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-edit-menu-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.product-edit-menu-head h2,
.product-edit-menu-head p {
  margin: 0;
}

.product-edit-menu-close {
  width: 42px;
  padding: 0;
  font-size: 1.3rem;
}

.paid-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #302622, #221a18);
  overflow: hidden;
}

.orders-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.orders-board > section {
  min-width: 0;
}

.orders-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.orders-column-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.orders-column-header strong {
  display: grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #201510;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #302622, #221a18);
  padding: 14px;
}

.order-card ul {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.order-card li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.order-card label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.order-card input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent-2);
}

.order-item.is-checked span {
  color: var(--accent-2);
  text-decoration: line-through;
}

.order-note {
  border: 1px solid rgba(127, 177, 143, 0.35);
  border-radius: 8px;
  margin: 12px 0 0;
  padding: 10px;
  color: var(--text);
  background: rgba(127, 177, 143, 0.08);
  font-family: Arial, sans-serif;
}

.order-deposit-panel {
  border-top: 1px solid rgba(74, 58, 51, 0.65);
  margin-top: 12px;
  padding-top: 12px;
}

.order-deposit-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.order-deposit-total strong {
  color: var(--accent-2);
}

.order-deposit-form {
  margin-bottom: 10px;
}

.order-card li strong {
  color: var(--accent);
}

.order-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.order-title-line h3 {
  margin: 0;
}

.order-title-line .small-button {
  min-height: 34px;
}

.paid-card-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 220px) minmax(100px, 140px) minmax(120px, 150px);
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.paid-list-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 220px) minmax(100px, 140px) minmax(120px, 150px);
  gap: 12px;
  padding: 0 14px 2px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.paid-card-header::-webkit-details-marker {
  display: none;
}

.paid-card[open] .paid-card-header {
  border-bottom: 1px solid rgba(74, 58, 51, 0.65);
}

.paid-card-body {
  padding: 0 14px 14px;
}

.paid-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.paid-card small,
.paid-card li {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.paid-card ul {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.paid-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.paid-card li strong,
.paid-card-header > strong {
  color: var(--accent);
}

.paid-expand {
  color: var(--accent-2);
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.paid-card[open] .paid-expand {
  color: var(--muted);
}

.paid-delete,
.paid-reopen {
  min-height: 38px;
}

.paid-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.paid-rest {
  border-top: 1px solid rgba(74, 58, 51, 0.65);
  padding-top: 8px;
}

.bill-panel {
  position: sticky;
  top: 82px;
  display: flex;
  flex: 0 0 390px;
  flex-direction: column;
  max-height: calc(100vh - 104px);
}

.panel-header {
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.small-button {
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
}

.icon-button {
  width: 42px;
  font-size: 1.55rem;
}

.danger {
  color: #ffd6cd;
  border-color: rgba(216, 109, 90, 0.45);
  background: rgba(216, 109, 90, 0.16);
}

.bill-items {
  min-height: 260px;
  overflow: auto;
  padding: 10px;
}

.deposit-panel {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.order-note-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

#orderNote {
  min-height: 132px;
  resize: vertical;
}

.order-note-field span {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
}

.order-card-note {
  margin: 12px 0 0;
}

.deposit-form {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(110px, 1fr) 42px;
  gap: 8px;
  margin-bottom: 10px;
}

.deposit-form button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
}

.discount-field {
  display: grid;
  grid-template-columns: 1fr 110px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.discount-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
}

.discount-input-wrap input {
  width: 100%;
  min-height: 38px;
  text-align: right;
}

.order-discount-field {
  margin: 10px 0 0;
}

.order-price-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.order-price-summary div {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 9px;
}

.order-price-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
}

.order-price-summary strong {
  color: var(--accent-2);
}

.deposit-list {
  display: grid;
  gap: 6px;
}

.deposit-empty {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.deposit-row {
  display: grid;
  grid-template-columns: 1fr 32px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 8px;
}

.deposit-row strong {
  color: var(--accent-2);
}

.deposit-row small {
  display: block;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.deposit-row button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(216, 109, 90, 0.45);
  border-radius: 8px;
  color: #ffd6cd;
  background: rgba(216, 109, 90, 0.16);
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-family: Arial, sans-serif;
}

.bill-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(74, 58, 51, 0.65);
  padding: 10px 6px;
}

.bill-row strong {
  display: block;
}

.bill-row small {
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.quantity-controls {
  display: grid;
  grid-template-columns: 34px 58px 34px;
  align-items: center;
  text-align: center;
}

.quantity-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181210;
  color: var(--text);
}

.quantity-controls input {
  width: 58px;
  min-height: 34px;
  padding: 0 4px;
  text-align: center;
}

.bill-footer {
  margin-top: auto;
  flex-direction: column;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.bill-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.bill-summary div {
  border: 1px solid rgba(74, 58, 51, 0.65);
  border-radius: 8px;
  padding: 10px;
}

.bill-summary span {
  display: block;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.bill-summary strong {
  color: var(--accent-2);
}

.bill-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wide-action {
  grid-column: 1 / -1;
}

.ghost-button,
.primary-button {
  width: 100%;
  padding: 0 14px;
}

.menu-panel {
  flex: 1;
  min-width: 0;
  padding: 14px;
}

.menu-tools {
  align-items: center;
  margin-bottom: 14px;
}

.search-wrap {
  flex: 0 0 240px;
}

.category-tabs {
  flex: 1;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.menu-item {
  display: grid;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #302622, #221a18);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.menu-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.menu-item strong {
  align-self: end;
  min-height: 42px;
  font-size: 1.05rem;
}

.menu-item span {
  align-self: end;
  color: var(--accent-2);
  font-family: Arial, sans-serif;
  font-weight: 700;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .workbench,
  .menu-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .person-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .bill-panel {
    position: static;
    flex-basis: auto;
    max-height: none;
  }

  .search-wrap {
    flex-basis: auto;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .deposit-form,
  .manual-item-form,
  .paid-card-actions,
  .bill-summary,
  .order-price-summary,
  .orders-board,
  .rooms-list,
  .room-calendar-entry,
  .room-form,
  .room-book-form,
  .room-booking-menu,
  .room-calendar-filter,
  .room-meta,
  .telegram-form,
  .subcategory-form,
  .product-edit-menu,
  .product-form {
    grid-template-columns: 1fr;
  }

  .display-settings-form {
    grid-template-columns: 1fr;
  }

  .telegram-card,
  .telegram-list-header,
  .product-row,
  .product-list-header,
  .paid-card-header {
    grid-template-columns: 1fr;
  }

  .telegram-list-header,
  .product-list-header,
  .paid-list-header {
    display: none;
  }

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

  .room-book-form textarea,
  .room-book-form button {
    grid-column: auto;
  }
}

@media (max-width: 1180px) {
  .rooms-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}
