:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --ink: #17201d;
  --muted: #6c7671;
  --line: #dfe5df;
  --brand: #166b5f;
  --brand-2: #285d8f;
  --accent: #b36b25;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #237a4b;
  --shadow: 0 12px 30px rgba(23, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  letter-spacing: 0;
}

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

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

.app-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 22px 16px;
  color: #eef7f3;
  background: #12352f;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e8f3ed;
  color: #12352f;
  font-weight: 800;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #d6e7e1;
  font-size: 14px;
}

.sidebar a i {
  width: 26px;
  color: #96bbb0;
  font-size: 15px;
  text-align: center;
}

.sidebar a.active,
.sidebar a:hover {
  background: #e8f3ed;
  color: #12352f;
}

.sidebar a.active i,
.sidebar a:hover i {
  color: #12352f;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.topbar h1,
.auth-card h1,
.booking-hero h1 {
  margin: 0;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.icon-button,
.inline-form button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.primary {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.flash,
.public-message {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #e8f3ed;
  color: #12352f;
  border: 1px solid #bad8ca;
}

.flash.error,
.public-message.error {
  background: #fff0ed;
  color: var(--danger);
  border-color: #ffc9c0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi,
.panel,
.auth-card,
.booking-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.kpi span,
.kpi small,
.muted,
small {
  color: var(--muted);
}

.kpi strong {
  font-size: 30px;
}

.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
}

.filters,
.legend,
.top-actions form,
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-loyalty {
  display: grid;
  grid-template-columns: 76px 1fr 42px;
  gap: 8px;
  align-items: center;
}

.inline-loyalty button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7d6;
  color: #7a4b00;
  cursor: pointer;
}

.customer-card details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.customer-card summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand);
}

.customer-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0 18px;
}

.customer-filters label {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.customer-filters label i {
  color: var(--muted);
}

.customer-filters input,
.customer-filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.customer-filters label input {
  border: 0;
  padding-inline: 0;
}

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

.channel-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.channel-status-grid span {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fffdfa;
  color: var(--muted);
  font-weight: 850;
}

.analytics-bars {
  display: grid;
  gap: 13px;
}

.analytics-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr 44px;
  gap: 12px;
  align-items: center;
}

.analytics-bar div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.analytics-bar span,
.analytics-bar small {
  color: var(--muted);
  font-weight: 750;
}

.analytics-bar i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1ebe6;
}

.analytics-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.management-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.management-details summary,
.row-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand);
}

.page-action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.app-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
}

.app-modal::backdrop {
  background: rgba(32, 24, 19, .62);
}

.modal-card {
  overflow: auto;
  max-height: min(860px, calc(100vh - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(43, 33, 28, .24);
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.modal-head h2 {
  font-size: 22px;
}

.modal-head .icon-button {
  width: 42px;
  flex: 0 0 42px;
}

.modal-form {
  padding: 20px;
}

.booking-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  padding: 22px;
  background: var(--surface);
}

.booking-modal-form label,
.new-customer-fields label,
.restaurant-switcher {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.booking-modal-form input,
.booking-modal-form select,
.booking-modal-form textarea,
.restaurant-switcher select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.booking-modal-form input,
.booking-modal-form select,
.restaurant-switcher select {
  min-height: 46px;
  padding: 10px 12px;
}

.booking-modal-form textarea {
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

.booking-modal-form .wide,
.new-customer-fields,
.new-customer-button,
.booking-modal-form > .primary {
  grid-column: 1 / -1;
}

.cover-input {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cover-input input {
  max-width: 110px;
}

.cover-input i,
.cover-input span {
  color: var(--muted);
  font-weight: 650;
}

.new-customer-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.new-customer-fields[hidden] {
  display: none;
}

.restaurant-switcher {
  min-width: 220px;
}

.restaurant-switcher span {
  color: var(--muted);
  font-size: 12px;
}

.reservation-actions {
  display: grid;
  gap: 8px;
  min-width: 360px;
}

.calendar-edit {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffdfa;
}

.reservation-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
  min-width: 620px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.filters span,
.legend span,
.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef1f4;
  color: #49545b;
  font-size: 12px;
  font-weight: 800;
}

.status-pending {
  background: #fff4cc;
  color: #7a4b00;
}

.status-confirmed {
  background: #e5f0ff;
  color: #174d84;
}

.status-arrived {
  background: #efe8ff;
  color: #5f3aa2;
}

.status-seated {
  background: #def7e8;
  color: #1f6a42;
}

.status-completed {
  background: #e8eee9;
  color: #415048;
}

.status-no_show,
.status-cancelled {
  background: #ffe5df;
  color: #9b1c12;
}

.status-free {
  background: #f7faf8;
  color: #42514a;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

td small {
  display: block;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.dense-form,
.booking-form,
.form-grid {
  display: grid;
  gap: 10px;
}

.dense-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dense-form button {
  grid-column: span 1;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 0%, #d8ebe1, transparent 28%), #f4f6f2;
}

.auth-panel {
  width: min(100%, 440px);
}

.auth-card {
  padding: 28px;
}

.auth-brand {
  color: var(--ink);
}

.demo-users {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.public-link {
  display: inline-block;
  margin-top: 16px;
  font-weight: 800;
  color: var(--brand);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-card,
.row-line,
.empty-state,
.settings-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.mini-card {
  padding: 14px;
  display: grid;
  gap: 7px;
}

.row-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
}

.checklist,
.settings-list {
  display: grid;
  gap: 9px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 16px;
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.settings-overview-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-overview-card > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f3ed;
  color: var(--brand);
}

.settings-overview-card strong {
  font-size: 17px;
}

.settings-overview-card span {
  color: var(--muted);
}

.settings-anchor-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(23, 32, 29, 0.06);
  backdrop-filter: blur(10px);
}

.settings-anchor-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.settings-anchor-nav a:hover {
  background: #f2eee9;
  color: var(--ink);
}

.settings-stack {
  display: grid;
  gap: 16px;
}

.settings-section {
  padding: 0;
  overflow: hidden;
}

.settings-section-head,
.settings-block-head {
  align-items: flex-start;
}

.settings-section-head {
  padding: 18px 18px 0;
}

.settings-section-head h2 i {
  color: var(--brand);
  margin-right: 8px;
}

.settings-master-form {
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  padding: 18px;
}

.settings-block,
.settings-provider-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.settings-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.settings-block-head.compact {
  margin-bottom: -2px;
}

.settings-block-head h3,
.settings-block-head h4 {
  margin: 0;
}

.settings-block-head h3 {
  font-size: 18px;
}

.settings-block-head h4 {
  font-size: 16px;
}

.settings-block-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.settings-block-head > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2eee9;
  color: var(--accent);
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-field-grid label,
.settings-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.settings-field-grid label input,
.settings-field-grid label select,
.settings-field-grid label textarea,
.settings-form label input,
.settings-form label select,
.settings-form label textarea {
  font-weight: 600;
}

.settings-field-grid.single {
  grid-template-columns: 1fr;
}

.settings-field-grid .wide {
  grid-column: 1 / -1;
}

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

.settings-toggle {
  align-items: flex-start;
  min-height: 72px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.settings-toggle span {
  display: grid;
  gap: 3px;
}

.settings-toggle small {
  font-weight: 500;
  line-height: 1.35;
}

.settings-channel-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-channel-status > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.settings-channel-status > span > i {
  color: var(--brand);
}

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

.settings-two-column {
  align-items: start;
}

.settings-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.settings-status.is-ready {
  color: #185b38;
  background: #e8f7ee;
  border: 1px solid #bfe3cb;
}

.settings-status.is-missing {
  color: #7a4d14;
  background: #fff7e6;
  border: 1px solid #f3d59b;
}

.settings-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(23, 32, 29, 0.12);
  backdrop-filter: blur(10px);
}

.settings-savebar span {
  color: var(--muted);
  font-weight: 700;
}

.color-input-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 10px;
}

.color-input-row input {
  min-height: 42px;
  padding: 4px;
}

.color-input-row b {
  color: var(--muted);
  font-size: 13px;
}

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

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.settings-form textarea,
.settings-form button,
.settings-form .wide {
  grid-column: 1 / -1;
}

.filters a {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: #e8f3ed;
  color: #12352f;
  font-size: 12px;
  font-weight: 800;
}

.checklist > span,
.settings-list span {
  padding: 10px 12px;
}

.settings-list details,
.row-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px 12px;
}

.settings-list details + details {
  margin-top: 8px;
}

.row-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.row-details form {
  margin-top: 12px;
}

.onboarding-panel {
  overflow: hidden;
}

.onboarding-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2ece7;
  margin: -2px 0 14px;
}

.onboarding-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #e1a36f);
}

.check-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdfa;
  box-shadow: 0 1px 3px rgba(43, 33, 28, .04);
}

.check-item.todo:hover {
  border-color: #d5c8bd;
  background: #fff8f2;
}

.check-item .check-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: #f6eee7;
  color: var(--brand);
}

.check-item strong,
.check-item small {
  display: block;
}

.check-item strong {
  color: var(--ink);
}

.check-item small {
  margin-top: 3px;
}

.check-item em {
  min-width: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
}

.check-item.done {
  background: #fbfdfb;
}

.check-item.done .check-icon {
  background: #e2f8ea;
  color: var(--ok);
}

.service-live {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.live-clock strong {
  display: block;
  font-size: 34px;
  margin-top: 8px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(145px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.timeline-vertical {
  grid-template-columns: 1fr;
  overflow-x: visible;
}

.slot {
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.timeline-slot {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  border-style: solid;
  background: #fffdfa;
}

.timeline-slot strong {
  font-size: 18px;
}

.slot-content {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.reservation-pill {
  display: block;
  margin-top: 8px;
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  font-weight: 800;
}

.timeline-slot .reservation-pill {
  margin-top: 0;
}

.ghost-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.ghost-button:hover {
  border-color: #d8c9bd;
  background: #fff8f2;
}

.map-board {
  position: relative;
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(18, 53, 47, .06) 1px, transparent 1px),
    linear-gradient(rgba(18, 53, 47, .06) 1px, transparent 1px),
    #f9fbfa;
  background-size: 20px 20px;
  transform-origin: top left;
}

.map-table {
  position: absolute;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  border: 4px double rgba(18, 53, 47, .25);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 32, 29, .12);
  touch-action: none;
  user-select: none;
  text-align: center;
  overflow: hidden;
  padding: 4px;
  line-height: 1.05;
}

.map-table.dragging {
  cursor: grabbing;
  opacity: .9;
  z-index: 5;
}

.map-table.is-combinable:not(.is-combined) {
  border-width: 2px;
  border-style: solid;
}

.map-table.is-combined {
  border-width: 4px;
  border-style: double;
  z-index: 4;
}

.map-table.is-snapping {
  outline: 3px solid rgba(207, 106, 71, .38);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(207, 106, 71, .12), 0 8px 20px rgba(43, 33, 28, .14);
}

.map-combination-link {
  position: absolute;
  z-index: 1;
  border: 4px double rgba(207, 106, 71, .9);
  border-radius: 12px;
  background: rgba(207, 106, 71, .08);
  box-shadow: 0 6px 16px rgba(43, 33, 28, .08);
  pointer-events: none;
}

.map-table {
  z-index: 2;
}

.map-table.save-error {
  outline: 3px solid var(--danger);
}

.map-table small {
  font-size: 10px;
  line-height: 1;
}

.map-table strong {
  font-size: 13px;
}

.map-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 10px;
  background: #f2efec;
}

.map-mode-toggle button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.map-mode-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(43, 33, 28, .08);
}

.map-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 14px 0;
}

.map-zoom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-zoom button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.map-board-wrap {
  overflow: auto;
  min-height: 560px;
  border-radius: 8px;
  background: #fffdfa;
}

.map-workspace:not(.is-editing) .map-table {
  cursor: default;
  touch-action: auto;
}

.map-workspace:not(.is-editing) .map-edit-control {
  display: none;
}

.map-workspace.is-editing .map-board {
  outline: 2px solid #f2a9bd;
  outline-offset: -2px;
}

.map-state-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.map-date-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}

.map-date-form label {
  display: grid;
  gap: 5px;
  min-width: 190px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.map-date-form input {
  min-height: 40px;
}

.native-date-field input[type="date"] {
  min-width: 230px;
  padding-right: 42px;
  color-scheme: light;
  font-weight: 850;
  letter-spacing: 0;
}

.native-date-field input[type="date"]::-webkit-calendar-picker-indicator {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  opacity: .85;
  filter: sepia(.2) saturate(.9) hue-rotate(345deg);
}

.native-date-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: #f2efec;
  opacity: 1;
}

.map-state-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-weight: 750;
}

.map-swatch {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.table-capacity {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  color: #6f6258;
}

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

.table-live-summary strong {
  color: var(--ink);
  font-size: 22px;
}

.table-live-summary span:not(.badge) {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
}

.shape-round {
  border-radius: 999px;
}

.public-body {
  background: #f6f6f1;
}

.booking-page {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px;
}

.booking-hero {
  min-height: 260px;
  border-radius: 8px;
  padding: 28px;
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.booking-hero h1 {
  font-size: 44px;
}

.booking-hero p {
  max-width: 620px;
}

.booking-hero address {
  font-style: normal;
  max-width: 260px;
}

.booking-card {
  padding: 18px;
}

.booking-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.booking-form .wide {
  grid-column: span 4;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
}

.public-message {
  display: grid;
  gap: 4px;
}

.customer-portal {
  display: grid;
  gap: 16px;
}

.customer-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-nav a,
.customer-nav button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #f8faf8;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 780px) {
  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

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

  .kpi-grid,
  .split,
  .service-live,
  .cards,
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dense-form,
  .booking-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .booking-form .wide {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 14px;
  }

  .topbar,
  .booking-hero,
  .row-line {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar nav,
  .kpi-grid,
  .split,
  .service-live,
  .cards,
  .settings-grid,
  .settings-form,
  .dense-form,
  .booking-form {
    grid-template-columns: 1fr;
  }

  .booking-form .wide {
    grid-column: span 1;
  }

  .booking-hero h1 {
    font-size: 32px;
  }

  .map-board {
    min-height: 360px;
  }
}

/* Visual skin inspired by the reference screens, without changing navigation or page structure. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #2b211c;
  --muted: #887568;
  --line: #e9e2dc;
  --brand: #c75f3e;
  --brand-2: #8f6f5f;
  --accent: #f0a9b9;
  --danger: #d92d20;
  --warning: #d99a00;
  --ok: #1f9d55;
  --shadow: 0 2px 8px rgba(43, 33, 28, .06);
}

body {
  background: var(--bg);
  color: var(--ink);
}

.app-body {
  grid-template-columns: 284px 1fr;
  background: var(--bg);
}

.sidebar {
  padding: 22px 10px;
  background: #281a12;
  color: #f7f0eb;
}

.brand {
  justify-content: center;
  min-height: 116px;
  margin: -22px -10px 22px;
  padding: 26px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: center;
}

.brand-mark {
  background: #cf6a47;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
  transform: rotate(-4deg);
}

.brand strong {
  color: #fff;
  line-height: 1.05;
}

.sidebar nav {
  gap: 4px;
}

.sidebar a {
  min-height: 42px;
  border-radius: 8px;
  color: #f1e9e2;
  font-size: 15px;
}

.sidebar a i {
  color: #d7c9be;
}

.sidebar a.active,
.sidebar a:hover {
  background: #3b2a20;
  color: #fff;
}

.sidebar a.active i,
.sidebar a:hover i {
  color: #fff;
}

.mobile-sidebar-toggle,
.mobile-sidebar-close,
.sidebar-backdrop {
  display: none;
}

.main {
  padding: 0 32px 40px;
  background: var(--bg);
}

.topbar {
  min-height: 82px;
  margin: 0 -32px 28px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1 {
  color: var(--ink);
  font-size: 36px;
  font-weight: 850;
}

.eyebrow {
  color: var(--muted);
}

.top-actions {
  color: var(--muted);
}

.panel,
.kpi,
.auth-card,
.booking-card,
.mini-card,
.row-line,
.empty-state,
.settings-list span {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}

.kpi {
  min-height: 112px;
  padding: 22px 24px;
}

.kpi span {
  color: var(--ink);
  font-weight: 850;
}

.kpi strong {
  color: var(--ink);
  font-size: 34px;
}

.kpi small,
.muted,
small {
  color: var(--muted);
}

.primary,
.icon-button,
.inline-form button,
.customer-nav a,
.customer-nav button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.primary:hover,
.icon-button:hover,
.inline-form button:hover {
  border-color: #d7ccc2;
  background: #faf7f4;
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.filters span,
.legend span,
.badge,
.filters a {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.status-pending {
  background: #fff3c4;
  color: #7a4d00;
}

.status-confirmed {
  background: #e5efff;
  color: #24508f;
}

.status-seated,
.status-completed {
  background: #e2f8ea;
  color: #17633a;
}

.status-arrived {
  background: #efe9ff;
  color: #5d3ba0;
}

.status-no_show,
.status-cancelled {
  background: #ffe4dd;
  color: #9f1f16;
}

.status-active,
.status-sent,
.status-published {
  background: #e2f8ea;
  color: #17633a;
}

.status-queued,
.status-scheduled,
.status-draft {
  background: #fff3c4;
  color: #7a4d00;
}

.status-failed,
.status-blocked {
  background: #ffe4dd;
  color: #9f1f16;
}

.status-inactive,
.status-paused,
.status-skipped,
.status-completed_with_warnings {
  background: #f1eee9;
  color: #6d5d50;
}

th {
  color: var(--muted);
}

.map-board {
  border-color: var(--line);
  background:
    linear-gradient(90deg, #e8ded6 1px, transparent 1px),
    linear-gradient(#e8ded6 1px, transparent 1px),
    #fffdfa;
  background-size: 20px 20px;
}

.map-table {
  border-color: #22c55e;
  background: #dcfce7;
  box-shadow: 0 2px 8px rgba(43, 33, 28, .08);
}

.map-status-free {
  border-color: #22c55e;
  background: #dcfce7;
  color: #10251a;
}

.map-status-reserved {
  border-color: #f59e0b;
  background: #fff7d6;
  color: #2b211c;
}

.map-status-occupied {
  border-color: #ef4444;
  background: #ffe4dd;
  color: #2b211c;
}

.map-status-inactive {
  border-color: #c8c0b8;
  background: #f2efec;
  color: #776b61;
}

.map-status-inactive .table-capacity {
  color: #8a8077;
}

.map-border-sample {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #fffdfa;
}

.map-border-sample.is-combinable {
  border: 2px solid #22c55e;
}

.map-border-sample.is-combined {
  border: 4px double #cf6a47;
}

.auth-body {
  background: #f7f1e6;
}

.auth-card {
  padding: 34px;
}

.auth-brand {
  justify-content: flex-start;
  min-height: auto;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  text-align: left;
}

@media (max-width: 1020px) {
  .app-body {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 18px;
    padding: 18px 14px;
  }
}

/* Final QA refinements: keep dense admin screens readable on narrow viewports. */
.main,
.panel,
.mini-card,
.booking-card,
.auth-card,
.topbar,
.table-wrap {
  min-width: 0;
}

.panel-head,
.filters,
.legend,
.row-line,
.top-actions {
  flex-wrap: wrap;
}

.primary,
.icon-button,
.inline-form button,
.customer-nav a,
.customer-nav button,
.badge,
.filters a,
.filters span,
.legend span,
summary {
  white-space: normal;
  overflow-wrap: anywhere;
}

.settings-list,
.cards,
.settings-grid,
.split,
.dense-form,
.settings-form {
  min-width: 0;
}

@media (max-width: 1020px) {
  .settings-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-field-grid,
  .settings-provider-grid,
  .settings-two-column {
    grid-template-columns: 1fr;
  }

  .settings-toggle-grid,
  .settings-channel-status {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    min-height: auto;
    margin: -14px -14px 14px;
    padding: 18px 12px;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .panel {
    padding: 18px;
  }

  .dense-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .settings-overview {
    grid-template-columns: 1fr;
  }

  .settings-overview-card {
    min-height: auto;
  }

  .settings-anchor-nav {
    position: static;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 8px;
  }

  .settings-anchor-nav a {
    flex: 0 0 auto;
  }

  .settings-section-head {
    padding: 14px 14px 0;
  }

  .settings-master-form {
    padding: 14px;
  }

  .settings-block,
  .settings-provider-card {
    padding: 13px;
  }

  .settings-block-head,
  .settings-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-savebar .primary {
    width: 100%;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .panel {
    padding: 14px;
  }

  .panel h2 {
    font-size: 19px;
  }

  .kpi {
    min-height: auto;
  }

  .kpi strong {
    font-size: 28px;
  }

  .inline-loyalty {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form button,
  .icon-button {
    width: 100%;
  }

  .check-item {
    grid-template-columns: 34px 1fr;
  }

  .check-item em {
    grid-column: 2;
    justify-self: start;
  }

  .timeline-slot {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .reservation-actions,
  .reservation-edit-form {
    min-width: 560px;
  }

  .booking-modal-form,
  .new-customer-fields,
  .analytics-grid,
  .channel-status-grid,
  .customer-filters {
    grid-template-columns: 1fr;
  }

table {
    min-width: 640px;
  }
}

/* Final UI alignment pass: keep pages visually consistent without changing flow. */
.topbar h1,
.panel h2,
.kpi span,
.mini-card strong,
th {
  letter-spacing: 0;
}

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

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel,
.mini-card,
.kpi,
.empty-state,
.settings-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(43, 33, 28, .055);
}

.panel-head {
  gap: 14px;
}

.panel-head h2 {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary,
.ghost-button,
.icon-button,
.inline-form button,
.map-mode-toggle button,
.map-zoom button,
.customer-filters input,
.customer-filters select,
input,
select,
textarea {
  border-radius: 8px;
}

.primary,
.ghost-button,
.icon-button,
.inline-form button,
.map-mode-toggle button,
.map-zoom button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.primary:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.map-mode-toggle button:focus-visible,
.map-zoom button:focus-visible {
  outline: 3px solid rgba(207, 106, 71, .28);
  outline-offset: 2px;
  border-color: #cf6a47;
}

.badge,
.filters span,
.filters a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  vertical-align: middle;
}

td small {
  display: block;
  margin-top: 3px;
}

.app-modal {
  overflow: hidden;
  background: transparent;
}

.app-modal::backdrop {
  background: rgba(32, 24, 19, .66);
  backdrop-filter: blur(2px);
}

.modal-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-card > form,
.modal-card > .reservation-edit-form,
.modal-card > .booking-modal-form {
  overflow: auto;
}

.customer-filters,
.dense-form,
.settings-form.compact {
  align-items: end;
}

.analytics-grid .panel {
  min-width: 0;
}

.analytics-bar strong,
.analytics-bar span {
  min-width: 0;
}

.analytics-bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-table strong,
.table-capacity {
  pointer-events: none;
}

@media (max-width: 1020px) {
  .topbar {
    align-items: stretch;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .restaurant-switcher {
    width: min(100%, 320px);
  }
}

@media (max-width: 680px) {
  .primary,
  .ghost-button,
  .customer-filters .primary,
  .customer-filters .ghost-button {
    width: 100%;
  }

  .modal-head {
    padding: 16px;
  }

  .modal-form,
  .booking-modal-form {
    padding: 16px;
  }

  .analytics-bar {
    grid-template-columns: 1fr;
  }

  .analytics-bar small {
    justify-self: start;
  }
}

.modal-head .icon-button {
  width: 42px;
  flex: 0 0 42px;
}

@media (max-width: 1020px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-body {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(80vw, 360px);
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    padding: 18px 12px 24px;
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: 18px 0 38px rgba(43, 33, 28, .28);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    border: 0;
    background: rgba(32, 24, 19, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sidebar-toggle,
  .mobile-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
  }

  .mobile-sidebar-toggle {
    position: absolute;
    top: 18px;
    right: 14px;
    z-index: 2;
    font-size: 18px;
  }

  .mobile-sidebar-close {
    position: absolute;
    top: 14px;
    right: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .16);
  }

  .brand {
    min-height: 104px;
    margin: -18px -12px 18px;
    padding: 26px 58px 20px 12px;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }

  .sidebar a {
    min-height: 48px;
    font-size: 16px;
  }

  .topbar {
    position: relative;
    padding-right: 72px;
  }
}
