:root {
  color-scheme: light;
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: #f0f3f9;
  --surface-soft: #f8f9fc;
  --surface-hover: #f7f8ff;
  --ink: #171b2d;
  --ink-soft: #5f677d;
  --ink-faint: #6d768a;
  --brand: #5965e8;
  --brand-strong: #4652d3;
  --brand-soft: #eef0ff;
  --accent: #7b5ce7;
  --lake: #5965e8;
  --sun: #d99a2b;
  --danger: #dc5f68;
  --sky: #3d8bd8;
  --available: #20a581;
  --reserved: #d99a2b;
  --occupied: #5965e8;
  --cleaning: #3d8bd8;
  --maintenance: #dc5f68;
  --line: #e5e8f0;
  --line-strong: #d3d8e5;
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(245, 247, 251, 0.88);
  --overlay: rgba(21, 25, 42, 0.42);
  --scroll-thumb: #c7ccda;
  --chart-grid: rgba(89, 101, 232, 0.11);
  --brand-gradient: linear-gradient(135deg, #5d72f3 0%, #7964ea 100%);
  --brand-gradient-soft: linear-gradient(145deg, #f0f3ff 0%, #faf9ff 100%);
  --radius: 8px;
  --radius-control: 7px;
  --sidebar-width: 232px;
  --topbar-height: 68px;
  --shadow-card: 0 1px 2px rgba(18, 24, 40, 0.025), 0 8px 24px rgba(18, 24, 40, 0.045);
  --shadow-hover: 0 2px 4px rgba(18, 24, 40, 0.035), 0 14px 32px rgba(45, 54, 105, 0.09);
  --shadow-pop: 0 24px 64px rgba(18, 24, 40, 0.18);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  font-family: "MiSans", "HarmonyOS Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0f131d;
  --surface: #171c28;
  --surface-elevated: #1d2331;
  --surface-muted: #212837;
  --surface-soft: #141925;
  --surface-hover: #202738;
  --ink: #f1f3f9;
  --ink-soft: #b1b8c9;
  --ink-faint: #7f889d;
  --brand: #7887ff;
  --brand-strong: #6878f2;
  --brand-soft: rgba(120, 135, 255, 0.14);
  --accent: #9a7cf8;
  --lake: #8390ff;
  --sun: #e6ae4b;
  --danger: #ef7c84;
  --sky: #66a7ea;
  --available: #45c7a3;
  --reserved: #e6ae4b;
  --occupied: #8390ff;
  --cleaning: #66a7ea;
  --maintenance: #ef7c84;
  --line: rgba(223, 228, 242, 0.1);
  --line-strong: rgba(223, 228, 242, 0.18);
  --sidebar-bg: #141925;
  --topbar-bg: rgba(15, 19, 29, 0.86);
  --overlay: rgba(2, 5, 12, 0.66);
  --scroll-thumb: #3e4659;
  --chart-grid: rgba(139, 151, 255, 0.12);
  --brand-gradient: linear-gradient(135deg, #6878ef 0%, #8b6de9 100%);
  --brand-gradient-soft: linear-gradient(145deg, rgba(104, 120, 239, 0.16) 0%, rgba(139, 109, 233, 0.07) 100%);
  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.16), 0 12px 28px rgba(0, 0, 0, 0.14);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.22), 0 18px 38px rgba(0, 0, 0, 0.24);
  --shadow-pop: 0 28px 76px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
input,
select,
textarea,
dialog {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(43, 122, 120, 0.28);
  outline-offset: 2px;
}

a {
  color: inherit;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 9px 12px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 16px 18px;
  overflow-y: auto;
  color: #fff;
  background: var(--brand);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 0 6px;
}

.brand-seal {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-family: "Noto Serif CJK SC", serif;
  font-size: 20px;
  font-weight: 600;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-copy strong {
  font-family: "Noto Serif CJK SC", serif;
  font-size: 17px;
  font-weight: 600;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.5);
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 9px;
}

.sidebar-close {
  display: none !important;
  margin-left: auto;
  color: #fff;
}

.shift-card {
  display: grid;
  gap: 5px;
  margin: 24px 6px 18px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.shift-label,
.shift-card > span:last-child {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.shift-value {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}

.shift-value i,
.sync-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78c69b;
  box-shadow: 0 0 0 3px rgba(120, 198, 155, 0.14);
}

.primary-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: grid;
  width: 100%;
  height: 44px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  text-align: left;
  transition: color 140ms ease, background 140ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
}

.nav-item.active {
  color: var(--brand);
  background: #f4f6ef;
}

.nav-item b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  color: var(--brand);
  background: var(--sun);
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 10px;
  font-weight: 700;
}

.nav-item b:empty,
.nav-item b[data-count="0"] {
  display: none;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.sidebar-scrim {
  display: none;
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 243, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-start,
.topbar-actions,
.property-switcher,
.operator-button {
  display: flex;
  align-items: center;
}

.topbar-start {
  min-width: 0;
  gap: 12px;
}

.menu-button {
  display: none !important;
}

.property-switcher {
  min-width: 0;
  gap: 10px;
}

.property-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background-color: var(--line);
  background-position: center;
  background-size: cover;
}

.property-switcher label {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.property-switcher label > span {
  color: var(--ink-faint);
  font-size: 10px;
}

.property-switcher select {
  max-width: 230px;
  padding: 0 22px 0 0;
  overflow: hidden;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
}

.topbar-actions {
  gap: 8px;
}

.icon-button,
.command-search,
.operator-button,
.button,
.segmented button,
.filter-chip,
.text-button,
.room-tile,
.product-toggle {
  border: 0;
  border-radius: var(--radius);
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease, transform 90ms ease;
}

.icon-button:active,
.button:active,
.room-tile:active,
.text-button:active {
  transform: scale(0.97);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.command-search {
  display: flex;
  width: 246px;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface);
  text-align: left;
}

.command-search span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  color: var(--ink-faint);
  background: var(--canvas);
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 10px;
}

.notification-button {
  position: relative;
}

.notification-button > i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--danger);
}

.operator-button {
  height: 42px;
  gap: 9px;
  margin-left: 4px;
  padding: 0 4px 0 0;
  background: transparent;
  text-align: left;
}

.operator-button .avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--lake);
  font-size: 12px;
  font-weight: 700;
}

.operator-button > span:nth-child(2) {
  display: grid;
  gap: 1px;
}

.operator-button strong,
.operator-button small {
  line-height: 1.2;
}

.operator-button strong {
  font-size: 12px;
}

.operator-button small {
  color: var(--ink-faint);
  font-size: 10px;
}

#mainContent {
  width: 100%;
  max-width: 1600px;
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: 28px;
}

.loading-state,
.error-state,
.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--ink-soft);
  text-align: center;
}

.loading-state p,
.error-state p,
.empty-state p {
  margin: 0;
  font-size: 13px;
}

.loader {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--lake);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--lake);
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.view-head h1,
.drawer-header h2,
.dialog-header h2,
.panel-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.view-head h1 {
  font-size: 26px;
  line-height: 1.25;
}

.view-head p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.view-actions,
.toolbar,
.toolbar-group,
.panel-head,
.inline-actions,
.legend-row,
.pagination,
.drawer-footer,
.dialog-footer {
  display: flex;
  align-items: center;
}

.view-actions,
.inline-actions {
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 650;
}

.button.primary {
  color: #fff;
  background: var(--brand);
}

.button.primary:hover {
  background: var(--brand-strong);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.button.danger {
  border-color: rgba(200, 93, 74, 0.24);
  color: var(--danger);
  background: rgba(200, 93, 74, 0.07);
}

.button svg {
  width: 16px;
  height: 16px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
}

.metric-item {
  position: relative;
  min-width: 0;
  padding: 18px 20px;
}

.metric-item + .metric-item::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--line);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.metric-label svg {
  width: 15px;
  height: 15px;
  color: var(--lake);
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 7px;
}

.metric-value {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.metric-note {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-board,
.panel,
.table-panel,
.room-floor,
.mobile-preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.flow-board {
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 15px;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.flow-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.flow-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sun);
}

.flow-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 16px 16px;
}

.flow-stage {
  --flow-color: var(--sky);
  position: relative;
  min-width: 0;
  padding: 16px 18px 0;
}

.flow-stage + .flow-stage {
  border-left: 1px solid var(--line);
}

.flow-stage--departure {
  --flow-color: var(--sun);
}

.flow-stage--arrival {
  --flow-color: var(--available);
}

.flow-stage-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding-bottom: 12px;
}

.flow-stage-marker {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--flow-color) 25%, var(--line));
  border-radius: var(--radius-control);
  color: var(--flow-color);
  background: color-mix(in srgb, var(--flow-color) 10%, var(--surface));
}

.flow-stage-marker svg {
  width: 17px;
  height: 17px;
}

.flow-stage-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.flow-stage-head > div > span {
  color: var(--flow-color);
  font-family: "DIN Alternate", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
}

.flow-stage-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.flow-stage-head small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-stage-head > b {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--flow-color);
  background: color-mix(in srgb, var(--flow-color) 10%, var(--surface));
  font-size: 12px;
}

.flow-stage-list {
  min-height: 98px;
  max-height: 244px;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 2px solid color-mix(in srgb, var(--flow-color) 35%, var(--line));
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.flow-item {
  display: grid;
  width: 100%;
  min-height: 56px;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: color 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.flow-item:hover,
.flow-item:focus-visible {
  color: var(--flow-color);
  background: color-mix(in srgb, var(--flow-color) 6%, var(--surface));
}

.flow-item > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.flow-item strong,
.flow-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-item strong {
  font-size: 13px;
  font-weight: 700;
}

.flow-item small {
  color: var(--ink-soft);
  font-size: 12px;
}

.flow-item > svg {
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
}

.flow-stage-empty {
  display: flex;
  min-height: 98px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 12px;
}

.flow-stage-empty svg {
  width: 16px;
  height: 16px;
  color: var(--available);
}

.flow-stage-connector {
  position: absolute;
  top: 32px;
  right: -11px;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-faint);
  background: var(--surface);
}

.flow-stage-connector svg {
  width: 13px;
  height: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  align-items: start;
  gap: 18px;
}

.dashboard-stack {
  display: grid;
  align-content: start;
  gap: 18px;
}

.panel-body {
  padding: 16px;
}

.arrival-list,
.task-list,
.activity-list,
.content-list {
  display: grid;
}

.arrival-row {
  display: grid;
  min-height: 64px;
  grid-template-columns: 52px minmax(130px, 1fr) minmax(120px, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.arrival-row:last-child,
.task-row:last-child,
.activity-row:last-child,
.content-row:last-child {
  border-bottom: 0;
}

.arrival-row:hover,
.data-table tbody tr:hover,
.content-row:hover {
  background: #f8faf7;
}

.time-cell {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 12px;
  font-weight: 700;
}

.primary-cell {
  min-width: 0;
}

.primary-cell strong,
.primary-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-cell strong {
  font-size: 12px;
}

.primary-cell span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.state-badge,
.category-badge,
.level-badge,
.stock-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.state-badge.available,
.state-badge.completed,
.state-badge.active,
.stock-badge.ok {
  color: #326b51;
  background: #e8f3ec;
}

.state-badge.reserved,
.state-badge.confirmed,
.state-badge.pendingPayment,
.state-badge.low,
.stock-badge.low {
  color: #826116;
  background: #fbf1d8;
}

.state-badge.occupied,
.state-badge.checkedIn,
.state-badge.cleaning {
  color: #276079;
  background: #e2eff5;
}

.state-badge.maintenance,
.state-badge.cancelled,
.state-badge.refunding,
.state-badge.refunded,
.stock-badge.out {
  color: #954838;
  background: #f8e7e3;
}

.occupancy-layout {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.occupancy-ring {
  position: relative;
  display: grid;
  width: 132px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lake) var(--occupancy), var(--surface-muted) 0);
}

.occupancy-ring::after {
  position: absolute;
  width: 84px;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: var(--surface);
}

.occupancy-ring span {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.occupancy-ring strong {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 22px;
}

.occupancy-ring small {
  color: var(--ink-faint);
  font-size: 9px;
}

.distribution {
  display: grid;
  gap: 9px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.distribution-row i,
.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--dot-color);
}

.distribution-row span {
  color: var(--ink-soft);
}

.distribution-row b {
  font-family: "Noto Sans Mono CJK SC", monospace;
}

.task-row,
.activity-row,
.content-row {
  display: grid;
  min-height: 54px;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.task-row {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.task-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--lake);
  background: #e7f1ef;
}

.task-icon.warning {
  color: var(--danger);
  background: #f8e7e3;
}

.task-icon svg {
  width: 15px;
  height: 15px;
}

.task-row strong,
.activity-row strong {
  display: block;
  font-size: 11px;
}

.task-row span,
.activity-row span {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 7px;
  color: var(--lake);
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}

.text-button svg {
  width: 13px;
  height: 13px;
}

.text-button:hover {
  background: #e7f1ef;
}

.toolbar {
  min-height: 62px;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.toolbar-group {
  min-width: 0;
  gap: 8px;
}

.search-field {
  position: relative;
  min-width: 240px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}

.search-field input,
.select-field,
.form-control {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}

.search-field input {
  padding: 0 12px 0 34px;
  font-size: 11px;
}

.select-field {
  width: auto;
  min-width: 110px;
  padding: 0 30px 0 10px;
  font-size: 11px;
}

.segmented {
  display: inline-grid;
  height: 38px;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: stretch;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
}

.segmented button {
  min-width: 58px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
}

.segmented button.active {
  color: var(--brand);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(23, 59, 54, 0.1);
}

.legend-row {
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

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

.room-board {
  display: grid;
  gap: 14px;
}

.room-floor {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  overflow: hidden;
}

.floor-label {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #f8faf7;
}

.floor-label strong {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 20px;
}

.floor-label span {
  color: var(--ink-faint);
  font-size: 9px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 8px;
  padding: 12px;
}

.room-tile {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 104px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: space-between;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--status-color);
  background: var(--surface);
  text-align: left;
}

.room-tile:hover {
  border-color: var(--status-color);
  background: #fbfcfa;
}

.room-tile strong {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 16px;
}

.room-tile .room-price {
  color: var(--ink-soft);
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 10px;
}

.room-tile .room-type {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-tile .room-status {
  grid-column: 1 / -1;
  color: var(--status-color);
  font-size: 10px;
  font-weight: 650;
}

.table-panel {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  height: 56px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table th {
  height: 42px;
  color: var(--ink-faint);
  background: #f8faf7;
  font-size: 9px;
  font-weight: 650;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td strong {
  font-size: 11px;
}

.data-table .mono {
  font-family: "Noto Sans Mono CJK SC", monospace;
}

.table-sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
}

.pagination {
  gap: 4px;
}

.pagination button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.mobile-record-list {
  display: none;
}

.member-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mini-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 700;
}

.level-badge.gold {
  color: #80600d;
  background: #fbefd0;
}

.level-badge.silver {
  color: #53635c;
  background: #e8eeea;
}

.level-badge.platinum {
  color: #276079;
  background: #e2eff5;
}

.level-badge.regular {
  color: #6b625a;
  background: #efece8;
}

.category-badge {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.product-name-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.product-image {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface-muted);
}

.product-toggle {
  position: relative;
  width: 34px;
  height: 20px;
  padding: 0;
  background: var(--line-strong);
}

.product-toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  content: "";
  background: #fff;
  transition: transform 150ms ease;
}

.product-toggle.active {
  background: var(--available);
}

.product-toggle.active::after {
  transform: translateX(14px);
}

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

.content-row {
  grid-template-columns: 70px minmax(0, 1fr) auto auto;
  padding: 12px 16px;
}

.content-thumb {
  width: 70px;
  height: 46px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface-muted);
}

.content-row .primary-cell span {
  white-space: normal;
}

.mobile-preview-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  padding: 18px;
}

.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

.phone-frame {
  width: 260px;
  height: 522px;
  margin: 0 auto;
  padding: 9px;
  overflow: hidden;
  border: 5px solid #23302d;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(23, 59, 54, 0.17);
}

.phone-screen {
  height: 100%;
  overflow: hidden;
  border-radius: 17px;
  background: #f4f6f1;
}

.phone-status {
  display: flex;
  height: 26px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #fff;
  background: var(--brand);
  font-size: 8px;
}

.phone-hero {
  position: relative;
  height: 178px;
  background-position: center;
  background-size: cover;
}

.phone-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(16, 46, 42, 0.24);
}

.phone-hero-copy {
  position: absolute;
  right: 14px;
  bottom: 16px;
  left: 14px;
  z-index: 1;
  color: #fff;
}

.phone-hero-copy strong,
.phone-hero-copy span {
  display: block;
}

.phone-hero-copy strong {
  font-family: "Noto Serif CJK SC", serif;
  font-size: 17px;
}

.phone-hero-copy span {
  margin-top: 4px;
  font-size: 8px;
}

.phone-booking {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: -10px 10px 0;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(23, 59, 54, 0.12);
}

.phone-booking div {
  display: grid;
  gap: 2px;
}

.phone-booking span {
  color: var(--ink-faint);
  font-size: 7px;
}

.phone-booking strong {
  font-size: 10px;
}

.phone-promo-title {
  margin: 15px 12px 8px;
  font-size: 11px;
}

.phone-promo {
  height: 80px;
  margin: 0 12px;
  padding: 12px;
  border-radius: 6px;
  color: #fff;
  background: var(--lake);
}

.phone-promo b,
.phone-promo span {
  display: block;
}

.phone-promo b {
  font-size: 11px;
}

.phone-promo span {
  margin-top: 5px;
  font-size: 8px;
}

.phone-nav {
  display: grid;
  height: 48px;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  background: #fff;
  font-size: 7px;
  text-align: center;
}

.side-drawer,
.form-dialog {
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.side-drawer {
  inset: 0 0 0 auto;
  width: min(460px, 100vw);
  height: 100vh;
  transform: translateX(100%);
  transition: transform 180ms ease, display 180ms allow-discrete, overlay 180ms allow-discrete;
}

.side-drawer[open] {
  transform: translateX(0);
}

.side-drawer::backdrop,
.form-dialog::backdrop {
  background: rgba(18, 31, 28, 0.42);
  backdrop-filter: blur(2px);
}

.drawer-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.drawer-header,
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2,
.dialog-header h2 {
  font-size: 19px;
}

.drawer-content {
  overflow-y: auto;
  padding: 22px 24px;
}

.drawer-footer,
.dialog-footer {
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  background: #fafbf9;
}

.detail-hero {
  display: grid;
  gap: 5px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-hero strong {
  font-size: 18px;
}

.detail-hero > span {
  color: var(--ink-soft);
  font-size: 11px;
}

.detail-section {
  margin: 22px 0;
}

.detail-section > h3 {
  margin: 0 0 11px;
  font-size: 12px;
}

.detail-copy,
.detail-empty {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.detail-empty {
  padding: 16px 0;
  color: var(--ink-faint);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-list span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 9px;
  color: var(--ink-soft);
  background: #f8faf7;
  font-size: 9px;
}

.related-record {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.related-record:hover {
  color: var(--lake);
}

.related-record > span:first-child,
.related-record strong,
.related-record small {
  display: block;
}

.related-record strong {
  font-size: 11px;
}

.related-record small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.detail-metrics > div {
  display: grid;
  gap: 4px;
  padding: 13px 10px;
  text-align: center;
}

.detail-metrics > div + div {
  border-left: 1px solid var(--line);
}

.detail-metrics span {
  color: var(--ink-faint);
  font-size: 9px;
}

.detail-metrics strong {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 17px;
}

.detail-metrics small {
  color: var(--ink-faint);
  font-family: "Noto Sans CJK SC", sans-serif;
  font-size: 9px;
  font-weight: 400;
}

.info-callout {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid #cfe0d8;
  border-radius: var(--radius);
  color: #315c4c;
  background: #edf6f1;
  font-size: 10px;
  line-height: 1.65;
}

.info-callout.warning {
  border-color: #edcfc9;
  color: #8d4638;
  background: #fcf0ed;
}

.info-callout svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.rule-list {
  display: grid;
}

.rule-list > div {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.rule-list > div:last-child {
  border-bottom: 0;
}

.rule-list b {
  font-size: 11px;
}

.rule-list span {
  color: var(--ink-soft);
  font-size: 10px;
  text-align: right;
}

.definition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.definition-item {
  min-width: 0;
}

.definition-item dt {
  margin-bottom: 4px;
  color: var(--ink-faint);
  font-size: 9px;
}

.definition-item dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.status-timeline {
  display: grid;
  gap: 0;
}

.timeline-step {
  position: relative;
  display: grid;
  min-height: 51px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
}

.timeline-step::before {
  position: absolute;
  top: 17px;
  bottom: -4px;
  left: 6px;
  width: 1px;
  content: "";
  background: var(--line-strong);
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-step i {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.timeline-step.done i {
  background: var(--lake);
  box-shadow: 0 0 0 1px var(--lake);
}

.timeline-step strong,
.timeline-step span {
  display: block;
}

.timeline-step strong {
  font-size: 10px;
}

.timeline-step span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.status-form {
  display: grid;
  gap: 9px;
}

.status-form label,
.form-field {
  display: grid;
  gap: 6px;
}

.status-form label > span,
.form-field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.form-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(600px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  transform: translate(-50%, -48%) scale(0.98);
  overflow: hidden;
  border-radius: 8px;
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease, display 160ms allow-discrete, overlay 160ms allow-discrete;
}

.form-dialog[open] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.form-dialog form {
  display: grid;
  max-height: inherit;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.login-dialog {
  width: min(420px, calc(100vw - 32px));
}

.login-header {
  align-items: center;
  justify-content: flex-start;
}

.login-brand {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--brand);
  border-radius: 4px;
  color: #fff;
  background: var(--brand);
  font-family: "Noto Serif CJK SC", serif;
  font-size: 21px;
  font-weight: 700;
}

.login-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid var(--danger);
  color: #8f372b;
  background: #fff4f1;
  font-size: 10px;
  line-height: 1.55;
}

.login-dialog .dialog-footer .button {
  width: 100%;
}

.dialog-body {
  overflow-y: auto;
  padding: 22px 24px;
}

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

.form-field.full {
  grid-column: 1 / -1;
}

.form-control {
  padding: 0 10px;
  font-size: 11px;
}

textarea.form-control {
  height: 82px;
  padding-block: 9px;
  resize: vertical;
}

.form-help {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

.form-summary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf7;
  font-size: 12px;
}

.form-summary strong {
  font-family: "Noto Sans Mono CJK SC", monospace;
  font-size: 15px;
}

.form-summary small {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand-strong);
  box-shadow: var(--shadow-pop);
  animation: toast-in 170ms ease-out;
  font-size: 11px;
}

.toast.error {
  background: #7d392f;
}

.toast button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.toast svg {
  width: 15px;
  height: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1180px) {
  .command-search {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .command-search span:nth-child(2),
  .command-search kbd,
  .operator-button > span:nth-child(2),
  .operator-button > svg {
    display: none;
  }

  .metric-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-item:nth-child(4),
  .metric-item:nth-child(5) {
    border-top: 1px solid var(--line);
  }

  .metric-item:nth-child(4)::before {
    display: none;
  }

  .dashboard-grid,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .mobile-preview-panel {
    position: static;
  }
}

@media (max-width: 840px) {
  .sidebar {
    width: min(290px, calc(100vw - 46px));
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.menu-open {
    overflow: hidden;
  }

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

  .sidebar-close,
  .menu-button {
    display: inline-grid !important;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(18, 31, 28, 0.42);
  }

  body.menu-open .sidebar-scrim {
    display: block;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    padding-inline: 16px;
  }

  #mainContent {
    padding: 20px 16px;
  }

  .property-thumb {
    display: none;
  }

  .topbar-actions .notification-button,
  .operator-button {
    display: none;
  }

  .view-head {
    align-items: flex-start;
  }

  .view-head h1 {
    font-size: 22px;
  }

  .room-floor {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .floor-label {
    padding: 10px;
  }

  .floor-label strong {
    font-size: 17px;
  }

  .content-layout .mobile-preview-panel {
    display: none;
  }
}

@media (max-width: 660px) {
  .topbar {
    min-height: 64px;
  }

  .property-switcher select {
    max-width: 164px;
    font-size: 12px;
  }

  .view-head {
    display: grid;
    gap: 12px;
  }

  .view-actions {
    width: 100%;
  }

  .view-actions .button {
    flex: 1;
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metric-item {
    padding: 15px 14px;
  }

  .metric-item:nth-child(3) {
    border-top: 1px solid var(--line);
  }

  .metric-item:nth-child(3)::before,
  .metric-item:nth-child(5)::before {
    display: none;
  }

  .metric-item:nth-child(4)::before {
    display: block;
  }

  .flow-rail {
    padding-inline: 18px;
  }

  .dashboard-grid {
    gap: 14px;
  }

  .arrival-row {
    grid-template-columns: 45px minmax(0, 1fr) auto;
  }

  .arrival-row .primary-cell:nth-child(3) {
    display: none;
  }

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

  .toolbar-group {
    width: 100%;
  }

  .toolbar-group.filters {
    overflow-x: auto;
  }

  .search-field {
    min-width: 0;
    flex: 1;
  }

  .room-floor {
    grid-template-columns: 1fr;
  }

  .floor-label {
    display: flex;
    min-height: 42px;
    justify-content: flex-start;
    gap: 7px;
    padding-inline: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .table-scroll,
  .table-footer {
    display: none;
  }

  .mobile-record-list {
    display: grid;
  }

  .mobile-record {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
  }

  .mobile-record:last-child {
    border-bottom: 0;
  }

  .mobile-record-head,
  .mobile-record-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-record-head strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-record p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 10px;
  }

  .mobile-record-foot {
    color: var(--ink-faint);
    font-size: 9px;
  }

  .content-row {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  .content-thumb {
    width: 58px;
    height: 42px;
  }

  .content-row .text-button {
    display: none;
  }

  .definition-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field.full,
  .form-summary {
    grid-column: 1;
  }

  .form-summary {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .form-summary small {
    width: 100%;
  }

  .drawer-header,
  .drawer-content,
  .dialog-header,
  .dialog-body {
    padding-inline: 18px;
  }

  .drawer-footer,
  .dialog-footer {
    padding-inline: 18px;
  }
}

@media (max-width: 390px) {
  .topbar-actions .command-search {
    display: none;
  }

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

  .occupancy-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .distribution {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Operations UI refresh */

html,
body,
.sidebar,
.topbar,
.panel,
.table-panel,
.flow-board,
.room-floor,
.mobile-preview-panel,
.side-drawer,
.form-dialog,
input,
textarea,
select {
  transition: color 220ms var(--ease-standard), background-color 220ms var(--ease-standard), border-color 220ms var(--ease-standard);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--scroll-thumb);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
  background-clip: padding-box;
}

:focus-visible {
  outline-color: color-mix(in srgb, var(--brand) 38%, transparent);
}

::selection {
  color: #ffffff;
  background: var(--brand);
}

.sidebar {
  color: var(--ink);
  background: var(--sidebar-bg);
  border-right-color: var(--line);
  box-shadow: 4px 0 24px rgba(28, 35, 66, 0.035);
}

.brand-seal,
.login-brand {
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--brand-gradient);
  box-shadow: 0 7px 16px rgba(89, 101, 232, 0.2);
}

.brand-copy strong {
  color: var(--ink);
  font-family: "MiSans", "HarmonyOS Sans SC", "Noto Sans CJK SC", sans-serif;
  font-weight: 720;
}

.brand-copy span,
.shift-label,
.shift-card > span:last-child,
.sync-state {
  color: var(--ink-faint);
}

.shift-card {
  border-color: var(--line);
  background: var(--surface-muted);
}

.shift-value {
  color: var(--ink);
}

.nav-item {
  color: var(--ink-soft);
  transition: color 180ms var(--ease-standard), background-color 180ms var(--ease-standard), transform 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard);
}

.nav-item:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.nav-item.active {
  color: #ffffff;
  background: var(--brand-gradient);
  box-shadow: 0 8px 18px rgba(89, 101, 232, 0.2);
}

.nav-item.active svg {
  filter: drop-shadow(0 1px 2px rgba(28, 34, 96, 0.22));
}

.nav-item b {
  color: #734d00;
  background: #ffd878;
}

.sidebar-close {
  color: var(--ink);
}

.sync-state i,
.shift-value i {
  background: var(--available);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--available) 15%, transparent);
}

.topbar {
  border-bottom-color: var(--line);
  background: var(--topbar-bg);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(18px) saturate(135%);
}

.property-thumb {
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(18, 24, 40, 0.08);
}

.property-switcher select,
.select-field,
select.form-control {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.icon-button,
.command-search,
.button,
.text-button,
.operator-button,
.theme-toggle {
  transition: color 180ms var(--ease-standard), background-color 180ms var(--ease-standard), border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), transform 180ms var(--ease-standard), filter 180ms var(--ease-standard);
}

.icon-button,
.command-search {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 24, 40, 0.02);
}

.icon-button:hover,
.command-search:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 26%, var(--line));
  background: var(--surface-hover);
}

.theme-toggle {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: var(--surface);
}

.theme-toggle:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-soft);
}

.theme-toggle svg {
  transition: transform 240ms var(--ease-standard), opacity 180ms ease;
}

.theme-toggle:hover svg {
  transform: rotate(12deg);
}

html[data-theme="dark"] .theme-toggle:hover svg {
  transform: rotate(-12deg);
}

.notification-button > i {
  border-color: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 13%, transparent);
}

.operator-button .avatar {
  background: var(--brand-gradient);
  box-shadow: 0 5px 12px rgba(89, 101, 232, 0.18);
}

#mainContent {
  animation: page-enter 280ms var(--ease-standard) both;
}

.section-kicker {
  color: var(--brand);
}

.view-head h1 {
  color: var(--ink);
  font-size: 25px;
  font-weight: 740;
}

.button {
  border-radius: var(--radius-control);
}

.button.primary {
  background: var(--brand-gradient);
  box-shadow: 0 5px 12px rgba(89, 101, 232, 0.16);
}

.button.primary:hover {
  background: var(--brand-gradient);
  box-shadow: 0 8px 18px rgba(89, 101, 232, 0.24);
  filter: brightness(1.04);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
}

.button.secondary:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--surface-hover);
}

.button.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}

.panel,
.table-panel,
.flow-board,
.room-floor,
.mobile-preview-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard), transform 220ms var(--ease-standard), background-color 220ms var(--ease-standard);
}

.panel-head,
.drawer-header,
.dialog-header,
.drawer-footer,
.dialog-footer,
.table-footer {
  border-color: var(--line);
}

.panel-head h2 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

@media (hover: hover) {
  .panel:hover,
  .flow-board:hover,
  .room-floor:hover,
  .mobile-preview-panel:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
    box-shadow: var(--shadow-hover);
  }

  .metric-item:hover,
  .metric-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
    box-shadow: var(--shadow-hover);
  }
}

.metric-strip,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
}

.metric-item,
.metric-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 106px;
  align-content: space-between;
  gap: 10px;
  padding: 16px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard), border-color 220ms var(--ease-standard), background-color 220ms var(--ease-standard);
}

.metric-item::after,
.metric-card::after {
  position: absolute;
  top: 0;
  right: 17px;
  left: 17px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  content: "";
  background: var(--metric-color, var(--brand));
  opacity: 0.72;
}

.metric-item + .metric-item::before {
  display: none;
}

.metric-item:nth-child(n),
.metric-card:nth-child(n) {
  border-top: 1px solid var(--line);
}

.metric-item:nth-child(2),
.metric-card:nth-child(2) {
  --metric-color: var(--available);
}

.metric-item:nth-child(3),
.metric-card:nth-child(3) {
  --metric-color: var(--sun);
}

.metric-item:nth-child(4),
.metric-card:nth-child(4) {
  --metric-color: var(--sky);
}

.metric-item:nth-child(5),
.metric-card:nth-child(5) {
  --metric-color: var(--danger);
}

.metric-card.highlight,
.metric-card[data-tone="accent"] {
  background: var(--brand-gradient-soft);
}

.metric-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.metric-label svg {
  color: var(--metric-color, var(--brand));
}

.metric-value-row {
  margin-top: 0;
}

.metric-value,
.metric-card .metric-value,
.metric-card > strong,
.count-up {
  font-family: "DIN Alternate", "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.metric-value,
.metric-card .metric-value,
.metric-card > strong {
  color: var(--ink);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 760;
  line-height: 1;
}

.count-up {
  display: inline-block;
  transform-origin: left bottom;
  animation: count-reveal 320ms var(--ease-standard) both;
}

.metric-note {
  color: var(--ink-faint);
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.operations-grid > * {
  grid-column: span 4;
  min-width: 0;
}

.operations-grid > .wide,
.operations-grid > [data-span="8"] {
  grid-column: span 8;
}

.operations-grid > .full,
.operations-grid > [data-span="12"] {
  grid-column: 1 / -1;
}

.pulse-chart {
  position: relative;
  width: 100%;
  min-height: 188px;
  overflow: hidden;
  border-radius: var(--radius);
  background-image: linear-gradient(var(--chart-grid) 1px, transparent 1px), linear-gradient(90deg, var(--chart-grid) 1px, transparent 1px);
  background-size: 100% 25%, 16.666% 100%;
}

.pulse-chart svg,
.pulse-chart canvas {
  width: 100%;
  height: 188px;
}

.pulse-chart path,
.pulse-chart polyline {
  vector-effect: non-scaling-stroke;
  animation: chart-reveal 340ms var(--ease-standard) both;
}

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

.quick-tools > button,
.quick-tools > a,
.quick-tools .quick-tool {
  display: grid;
  min-width: 0;
  min-height: 80px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
  text-decoration: none;
  transition: color 180ms var(--ease-standard), border-color 180ms var(--ease-standard), background-color 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.quick-tools > button:hover,
.quick-tools > a:hover,
.quick-tools .quick-tool:hover {
  transform: translateY(-2px);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
}

.quick-tools svg,
.quick-tool-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 8px;
  border-radius: var(--radius-control);
  color: var(--brand);
  background: var(--brand-soft);
}

.task-scroll {
  max-height: 238px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.task-scroll .task-row {
  min-height: 56px;
}

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

.log-summary-grid > * {
  min-width: 0;
  min-height: 92px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.log-timeline {
  position: relative;
  display: grid;
  gap: 0;
  padding: 4px 0;
}

.log-entry {
  position: relative;
  display: grid;
  min-height: 78px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 8px 13px 0;
  border-bottom: 1px solid var(--line);
}

.log-entry::before {
  position: absolute;
  top: 29px;
  bottom: -14px;
  left: 7px;
  width: 1px;
  content: "";
  background: var(--line-strong);
}

.log-entry:last-child::before {
  display: none;
}

.log-entry::after,
.log-entry-marker {
  width: 15px;
  height: 15px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--log-color, var(--brand));
  box-shadow: 0 0 0 1px var(--log-color, var(--brand));
}

.log-entry::after {
  grid-column: 1;
  grid-row: 1;
  margin-top: 3px;
  content: "";
}

.log-entry.success {
  --log-color: var(--available);
}

.log-entry.warning {
  --log-color: var(--sun);
}

.log-entry.danger {
  --log-color: var(--danger);
}

.log-entry time {
  color: var(--ink-faint);
  font-family: "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.log-entry strong,
.log-entry p {
  margin: 0;
}

.log-entry p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.order-progress {
  position: relative;
  display: flex;
  min-width: 520px;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 4px;
  overflow: hidden;
}

.order-progress::before {
  position: absolute;
  top: 20px;
  right: calc(10% + 4px);
  left: calc(10% + 4px);
  height: 2px;
  content: "";
  background: var(--line-strong);
}

.order-progress-step {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 82px;
  flex: 1 1 0;
  justify-items: center;
  gap: 7px;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

.order-progress-step::before {
  width: 20px;
  height: 20px;
  border: 5px solid var(--surface);
  border-radius: 50%;
  content: "";
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: background-color 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard), transform 220ms var(--ease-standard);
}

.order-progress-step.done,
.order-progress-step.completed,
.order-progress-step[data-state="done"] {
  color: var(--ink-soft);
}

.order-progress-step.done::before,
.order-progress-step.completed::before,
.order-progress-step[data-state="done"]::before {
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.order-progress-step.active,
.order-progress-step.current,
.order-progress-step[data-state="active"] {
  color: var(--brand);
  font-weight: 700;
}

.order-progress-step.active::before,
.order-progress-step.current::before,
.order-progress-step[data-state="active"]::before {
  transform: scale(1.08);
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 0 0 5px var(--brand-soft);
}

.combo-control {
  position: relative;
  min-width: 0;
}

.combo-control > input,
.combo-control .combo-input,
.combo-control .combo-trigger {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface);
  transition: border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.combo-control > input:focus,
.combo-control .combo-input:focus,
.combo-control.open .combo-trigger,
.combo-control[data-open="true"] .combo-trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 55;
  max-height: 240px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-5px) scale(0.985);
  transform-origin: top center;
  visibility: hidden;
  transition: opacity 180ms var(--ease-standard), transform 180ms var(--ease-standard), visibility 180ms;
}

.combo-control.open .combo-menu,
.combo-control[data-open="true"] .combo-menu,
.combo-menu.open,
.combo-menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.combo-menu button,
.combo-menu [role="option"] {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  text-align: left;
}

.combo-menu button:hover,
.combo-menu [role="option"]:hover,
.combo-menu [role="option"][aria-selected="true"] {
  color: var(--brand);
  background: var(--brand-soft);
}

.combo-empty,
.combo-create {
  padding: 10px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.image-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 11px;
}

.image-card,
.upload-card {
  position: relative;
  aspect-ratio: 4 / 3;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms var(--ease-standard), filter 220ms var(--ease-standard);
}

.image-card:hover img {
  transform: scale(1.025);
  filter: brightness(0.72);
}

.image-card .image-actions {
  position: absolute;
  inset: auto 7px 7px;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.image-card:hover .image-actions,
.image-card:focus-within .image-actions {
  opacity: 1;
  transform: translateY(0);
}

.image-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(18, 23, 39, 0.76);
  backdrop-filter: blur(8px);
}

.image-card .cover-badge,
.image-card[data-cover="true"]::before {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  min-height: 21px;
  padding: 4px 7px;
  border-radius: 5px;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 3px 8px rgba(23, 27, 45, 0.18);
  font-size: 9px;
  font-weight: 700;
}

.image-card[data-cover="true"]::before {
  content: "MAIN";
}

.image-card .cover-badge {
  display: inline-flex;
  align-items: center;
}

.upload-card {
  display: grid;
  min-height: 112px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 12px;
  border-style: dashed;
  color: var(--ink-faint);
  cursor: pointer;
  text-align: center;
  transition: color 180ms var(--ease-standard), border-color 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.upload-card:hover,
.upload-card:focus-within {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-card svg {
  width: 24px;
  height: 24px;
}

.search-field input,
.select-field,
.form-control {
  border-color: var(--line);
  border-radius: var(--radius-control);
  background-color: var(--surface);
  transition: border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.search-field input:focus,
.select-field:focus,
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
  opacity: 0.8;
}

.toolbar {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.segmented {
  border-color: var(--line);
  background: var(--surface-muted);
}

.segmented button.active {
  color: var(--brand);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(18, 24, 40, 0.08);
}

.arrival-row:hover,
.data-table tbody tr:hover,
.content-row:hover,
.room-tile:hover {
  background: var(--surface-hover);
}

.data-table th,
.floor-label,
.drawer-footer,
.dialog-footer,
.form-summary,
.tag-list span {
  background: var(--surface-soft);
}

.room-tile {
  border-radius: var(--radius-control);
  background: var(--surface);
  transition: transform 180ms var(--ease-standard), border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.room-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.product-image,
.content-thumb {
  border-radius: var(--radius-control);
}

.state-badge,
.category-badge,
.level-badge,
.stock-badge {
  border-radius: 6px;
  transition: filter 180ms ease, box-shadow 180ms ease;
}

.state-badge:hover,
.category-badge:hover,
.level-badge:hover,
.stock-badge:hover {
  filter: brightness(1.02);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 8%, transparent);
}

.task-icon {
  color: var(--brand);
  background: var(--brand-soft);
}

.text-button {
  color: var(--brand);
}

.text-button:hover {
  background: var(--brand-soft);
}

.occupancy-ring {
  background: conic-gradient(var(--brand) var(--occupancy), var(--surface-muted) 0);
  box-shadow: inset 0 0 0 1px var(--line);
}

.side-drawer,
.form-dialog:not(.login-dialog) {
  position: fixed;
  inset: 8px 8px 8px auto;
  width: min(520px, calc(100vw - 16px));
  height: calc(100dvh - 16px);
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  opacity: 1;
  transform: translateX(calc(100% + 16px));
  box-shadow: var(--shadow-pop);
  transition: transform 260ms var(--ease-standard), display 260ms allow-discrete, overlay 260ms allow-discrete;
}

.side-drawer[open],
.form-dialog:not(.login-dialog)[open] {
  transform: translateX(0);
}

.side-drawer::backdrop,
.form-dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(3px);
}

.form-dialog:not(.login-dialog) form,
.drawer-shell {
  height: 100%;
  max-height: 100%;
}

.drawer-content,
.dialog-body {
  overscroll-behavior: contain;
}

.form-dialog.login-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-pop);
}

.login-error {
  color: var(--danger);
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.info-callout {
  color: color-mix(in srgb, var(--available) 74%, var(--ink));
  border-color: color-mix(in srgb, var(--available) 24%, var(--line));
  background: color-mix(in srgb, var(--available) 9%, var(--surface));
}

.info-callout.warning {
  color: color-mix(in srgb, var(--danger) 78%, var(--ink));
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.toast {
  border-color: var(--line-strong);
  border-radius: var(--radius);
  background: #242a3d;
}

html[data-theme="dark"] .state-badge.available,
html[data-theme="dark"] .state-badge.completed,
html[data-theme="dark"] .state-badge.active,
html[data-theme="dark"] .stock-badge.ok {
  color: #73dbbd;
  background: rgba(69, 199, 163, 0.14);
}

html[data-theme="dark"] .state-badge.reserved,
html[data-theme="dark"] .state-badge.confirmed,
html[data-theme="dark"] .state-badge.pendingPayment,
html[data-theme="dark"] .state-badge.low,
html[data-theme="dark"] .stock-badge.low,
html[data-theme="dark"] .level-badge.gold {
  color: #f0c66c;
  background: rgba(230, 174, 75, 0.15);
}

html[data-theme="dark"] .state-badge.occupied,
html[data-theme="dark"] .state-badge.checkedIn,
html[data-theme="dark"] .state-badge.cleaning,
html[data-theme="dark"] .level-badge.platinum {
  color: #8bbcff;
  background: rgba(102, 167, 234, 0.15);
}

html[data-theme="dark"] .state-badge.maintenance,
html[data-theme="dark"] .state-badge.cancelled,
html[data-theme="dark"] .state-badge.refunding,
html[data-theme="dark"] .state-badge.refunded,
html[data-theme="dark"] .stock-badge.out {
  color: #ff9da3;
  background: rgba(239, 124, 132, 0.14);
}

html[data-theme="dark"] .level-badge.silver,
html[data-theme="dark"] .level-badge.regular,
html[data-theme="dark"] .category-badge {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

html[data-theme="dark"] .task-icon.warning {
  color: var(--danger);
  background: rgba(239, 124, 132, 0.13);
}

html[data-theme="dark"] .phone-frame {
  border-color: #070a10;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] kbd {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

@starting-style {
  .side-drawer[open],
  .form-dialog:not(.login-dialog)[open] {
    transform: translateX(calc(100% + 16px));
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes count-reveal {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chart-reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .metric-strip,
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operations-grid > *,
  .operations-grid > .wide,
  .operations-grid > [data-span="8"] {
    grid-column: span 6;
  }

  .operations-grid > .full,
  .operations-grid > [data-span="12"] {
    grid-column: 1 / -1;
  }

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

@media (max-width: 840px) {
  .sidebar {
    box-shadow: var(--shadow-pop);
  }

  .sidebar-scrim {
    background: var(--overlay);
    backdrop-filter: blur(2px);
  }

  .operations-grid {
    gap: 14px;
  }

  .operations-grid > *,
  .operations-grid > .wide,
  .operations-grid > [data-span="8"] {
    grid-column: 1 / -1;
  }

  .image-manager {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }
}

@media (max-width: 660px) {
  .metric-strip,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-item,
  .metric-card {
    min-height: 101px;
    padding: 14px;
  }

  .log-entry {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .log-entry time {
    grid-column: 2;
  }

  .order-progress {
    overflow-x: auto;
  }

  .quick-tools {
    grid-template-columns: 1fr;
  }

  .side-drawer,
  .form-dialog:not(.login-dialog) {
    inset: 6px 6px 6px auto;
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
  }
}

@media (max-width: 430px) {
  .metric-strip,
  .metric-grid,
  .log-summary-grid {
    grid-template-columns: 1fr;
  }

  .metric-item,
  .metric-card {
    min-height: 94px;
  }
}

/* Searchable selects and product media */

.combo-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.combo-control .combo-input {
  overflow: hidden;
  padding-right: 34px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-indicator {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 16px;
  height: 16px;
  z-index: 2;
  place-items: center;
  color: var(--ink-faint);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.combo-indicator svg {
  width: 14px;
  height: 14px;
}

.combo-control.open .combo-indicator {
  color: var(--brand);
  transform: translateY(-50%) rotate(180deg);
}

.combo-menu button:focus-visible {
  color: var(--brand);
  outline: 0;
  background: var(--brand-soft);
}

.combo-menu .combo-create {
  justify-content: flex-start;
  color: var(--brand);
  border-top: 1px solid var(--line);
}

.combo-menu .combo-create svg {
  width: 14px;
  height: 14px;
}

.property-switcher label .combo-control {
  width: min(230px, 28vw);
}

.property-switcher label .combo-input {
  height: 25px;
  padding: 0 24px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 650;
}

.property-switcher label .combo-control.open .combo-input,
.property-switcher label .combo-input:focus {
  border: 0;
  box-shadow: none;
}

.property-switcher label .combo-indicator {
  right: 0;
}

.product-media-editor {
  gap: 10px;
}

.product-media-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.product-media-heading > div {
  display: grid;
  gap: 3px;
}

.product-media-heading strong {
  color: var(--ink);
  font-size: 11px;
}

.product-media-heading span,
.product-media-heading b {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 500;
}

.product-media-heading b {
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--surface-muted);
  font-family: "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
}

.image-card {
  box-shadow: 0 1px 2px rgba(18, 24, 40, 0.04);
}

.image-card[data-cover="true"] {
  border-color: color-mix(in srgb, var(--brand) 46%, var(--line));
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.image-actions button:hover {
  color: #ffffff;
  background: var(--brand);
}

.upload-card strong,
.upload-card span {
  font-size: 9px;
}

.upload-card .loader {
  width: 23px;
  height: 23px;
  border-width: 2px;
}

.upload-card.is-uploading {
  cursor: wait;
}

.product-detail-image {
  position: relative;
  height: 190px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-image span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 24px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  color: #ffffff;
  background: rgba(17, 21, 32, 0.72);
  backdrop-filter: blur(8px);
  font-size: 9px;
}

@media (max-width: 660px) {
  .property-switcher label .combo-control {
    width: min(190px, 45vw);
  }

  .product-detail-image {
    height: 160px;
  }
}

/* Dashboard components */

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

.kpi-card {
  --kpi-color: var(--brand);
  --kpi-tint: var(--brand-soft);
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 112px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease-standard), border-color 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard), background-color 220ms var(--ease-standard);
}

.kpi-card::after {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  content: "";
  background: var(--kpi-color);
  opacity: 0.72;
}

.kpi-card--revenue {
  --kpi-color: var(--brand);
  --kpi-tint: var(--brand-soft);
  background: var(--brand-gradient-soft);
}

.kpi-card--occupancy {
  --kpi-color: var(--available);
  --kpi-tint: color-mix(in srgb, var(--available) 12%, transparent);
}

.kpi-card--inventory {
  --kpi-color: var(--sky);
  --kpi-tint: color-mix(in srgb, var(--sky) 12%, transparent);
}

.kpi-card--pending {
  --kpi-color: var(--sun);
  --kpi-tint: color-mix(in srgb, var(--sun) 13%, transparent);
}

.kpi-revenue {
  --kpi-color: var(--brand);
  --kpi-tint: var(--brand-soft);
  background: var(--brand-gradient-soft);
}

.kpi-occupancy {
  --kpi-color: var(--available);
  --kpi-tint: color-mix(in srgb, var(--available) 12%, transparent);
}

.kpi-inventory {
  --kpi-color: var(--sky);
  --kpi-tint: color-mix(in srgb, var(--sky) 12%, transparent);
}

.kpi-pending {
  --kpi-color: var(--sun);
  --kpi-tint: color-mix(in srgb, var(--sun) 13%, transparent);
}

.dashboard-kpis .kpi-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-kpis .kpi-card .metric-label svg {
  color: var(--kpi-color);
}

.dashboard-kpis .kpi-card .metric-value-row {
  min-width: 0;
  align-self: end;
}

.kpi-value {
  animation: count-reveal 320ms var(--ease-standard) both;
}

.kpi-card__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--kpi-color);
  background: var(--kpi-tint);
}

.kpi-card__icon svg {
  width: 18px;
  height: 18px;
}

.kpi-card__body {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.kpi-card__body > span:first-child {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card__value {
  color: var(--ink);
  font-family: "DIN Alternate", "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: clamp(22px, 2vw, 28px);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1;
}

.kpi-card__meta {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card__meta.positive,
.kpi-card__meta .positive {
  color: var(--available);
}

.kpi-card__meta.negative,
.kpi-card__meta .negative {
  color: var(--danger);
}

@media (hover: hover) {
  .kpi-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--kpi-color) 28%, var(--line));
    box-shadow: var(--shadow-hover);
  }
}

.dashboard-operations {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.dashboard-task-panel {
  min-width: 0;
}

.dashboard-task-scroll,
.dashboard-task-panel .task-scroll {
  height: 238px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dashboard-task-scroll .task-row {
  min-height: 56px;
}

.quick-tool {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.quick-tool__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--brand);
  background: var(--brand-soft);
}

.quick-tool__icon svg {
  width: 17px;
  height: 17px;
  padding: 0;
}

.quick-tool__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.quick-tool__copy strong,
.quick-tool__copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-tool__copy strong {
  font-size: 11px;
}

.quick-tool__copy span {
  color: var(--ink-faint);
  font-size: 9px;
}

.quick-tools-panel {
  margin-top: 16px;
}

.quick-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.quick-tool-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
  transition: color 180ms var(--ease-standard), border-color 180ms var(--ease-standard), background-color 180ms var(--ease-standard), transform 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard);
}

.quick-tool-card:hover {
  transform: translateY(-2px);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
  box-shadow: var(--shadow-card);
}

.quick-tool-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.quick-tool-card strong,
.quick-tool-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-tool-card strong {
  font-size: 11px;
}

.quick-tool-card small {
  color: var(--ink-faint);
  font-size: 9px;
}

.quick-tool-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--tool-color, var(--brand));
  background: color-mix(in srgb, var(--tool-color, var(--brand)) 11%, transparent);
}

.quick-tool-icon svg {
  width: 17px;
  height: 17px;
  padding: 0;
}

.quick-tool-arrow {
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  transition: transform 180ms var(--ease-standard), color 180ms var(--ease-standard);
}

.quick-tool-card:hover .quick-tool-arrow {
  transform: translateX(2px);
  color: var(--brand);
}

.quick-tool-room {
  --tool-color: var(--sky);
}

.quick-tool-stock {
  --tool-color: var(--available);
}

.quick-tool-content {
  --tool-color: var(--accent);
}

.quick-tool-refresh {
  --tool-color: var(--ink-soft);
}

/* Audit log */

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

.log-stat-card {
  display: grid;
  min-width: 0;
  min-height: 92px;
  align-content: space-between;
  gap: 8px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease-standard), border-color 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard);
}

.log-stat-card span {
  color: var(--ink-soft);
  font-size: 10px;
}

.log-stat-card strong {
  color: var(--ink);
  font-family: "DIN Alternate", "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

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

.log-filter-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.log-day-group + .log-day-group {
  margin-top: 18px;
}

.log-day-label {
  position: sticky;
  top: calc(var(--topbar-height) + 8px);
  z-index: 4;
  display: flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px 42px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface-elevated);
  box-shadow: 0 3px 10px rgba(18, 24, 40, 0.05);
  font-size: 10px;
  font-weight: 700;
}

.log-day-label span {
  color: var(--ink-faint);
  font-weight: 500;
}

.log-timeline-item {
  position: relative;
  display: grid;
  min-height: 76px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--line);
}

.log-timeline-item::before {
  position: absolute;
  top: 31px;
  bottom: -13px;
  left: 9px;
  width: 1px;
  content: "";
  background: var(--line-strong);
}

.log-timeline-item:last-child::before {
  display: none;
}

.log-timeline-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  place-items: center;
  border: 4px solid var(--surface);
  border-radius: 50%;
  color: #ffffff;
  background: var(--log-color, var(--brand));
  box-shadow: 0 0 0 1px var(--log-color, var(--brand));
}

.log-timeline-marker svg {
  width: 9px;
  height: 9px;
  stroke-width: 2.5;
}

.log-type-order {
  --log-color: var(--brand);
}

.log-type-room {
  --log-color: var(--sky);
}

.log-type-member {
  --log-color: var(--accent);
}

.log-type-product {
  --log-color: var(--available);
}

.log-type-content {
  --log-color: var(--sun);
}

.log-type-system {
  --log-color: var(--ink-soft);
}

.log-timeline-content {
  min-width: 0;
}

.log-entry-card {
  min-width: 0;
  padding: 1px 0;
}

.log-entry-card > p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.log-entry-head,
.log-entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-entry-head {
  justify-content: space-between;
}

.log-entry-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.log-entry-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-entry-head time {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-family: "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-entry-meta {
  flex-wrap: wrap;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.log-entry-meta span,
.log-entry-meta button {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  font-size: 9px;
}

.log-entry-meta button:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
}

.log-entry-meta svg {
  width: 12px;
  height: 12px;
}

.log-entry-meta b {
  color: var(--ink-soft);
  font-weight: 650;
}

.log-type-badge {
  --tag-color: var(--brand);
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 11%, transparent);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.log-type-badge.room {
  --tag-color: var(--sky);
}

.log-type-badge.member {
  --tag-color: var(--accent);
}

.log-type-badge.product {
  --tag-color: var(--available);
}

.log-type-badge.content {
  --tag-color: var(--sun);
}

.log-type-badge.system {
  --tag-color: var(--ink-soft);
}

.log-date-filter {
  display: inline-grid;
  min-width: 190px;
  gap: 5px;
}

.log-date-filter > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
}

.log-date-filter svg {
  width: 13px;
  height: 13px;
}

.log-type-tag {
  --tag-color: var(--brand);
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 11%, transparent);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.log-type-tag.order {
  --tag-color: var(--brand);
}

.log-type-tag.room {
  --tag-color: var(--sky);
}

.log-type-tag.member {
  --tag-color: var(--accent);
}

.log-type-tag.product {
  --tag-color: var(--available);
}

.log-type-tag.content {
  --tag-color: var(--sun);
}

.log-type-tag.system {
  --tag-color: var(--ink-soft);
}

/* Order workflow */

.order-progress {
  min-width: 0;
  width: 100%;
  padding-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.order-progress-step {
  min-width: 72px;
}

.order-progress-step:has(.order-progress-node)::before {
  display: none;
}

.order-progress-node {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 5px solid var(--surface);
  border-radius: 50%;
  color: var(--ink-faint);
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: color 220ms var(--ease-standard), background-color 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard), transform 220ms var(--ease-standard);
}

.order-progress-node svg {
  width: 10px;
  height: 10px;
}

.order-progress-copy {
  display: grid;
  gap: 3px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.35;
}

.order-progress-step > div:not(.order-progress-copy) {
  display: grid;
  gap: 3px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.35;
}

.order-progress-step > div:not(.order-progress-copy) strong {
  color: inherit;
  font-size: 10px;
}

.order-progress-copy strong {
  color: inherit;
  font-size: 10px;
}

.order-progress-step.complete,
.order-progress-step[data-state="complete"] {
  color: var(--ink-soft);
}

.order-progress-step.complete::before,
.order-progress-step[data-state="complete"]::before,
.order-progress-step.complete .order-progress-node,
.order-progress-step[data-state="complete"] .order-progress-node {
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.order-progress-step.current .order-progress-copy,
.order-progress-step[data-state="current"] .order-progress-copy,
.order-progress-step.current > div,
.order-progress-step[data-state="current"] > div {
  color: var(--brand);
  font-weight: 700;
}

.order-progress-step.current::before,
.order-progress-step[data-state="current"]::before,
.order-progress-step.current .order-progress-node,
.order-progress-step[data-state="current"] .order-progress-node {
  transform: scale(1.08);
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 0 0 5px var(--brand-soft);
}

.order-progress-step.pending .order-progress-copy {
  color: var(--ink-faint);
}

.order-progress-step.terminal .order-progress-copy,
.order-progress-step.terminal > div {
  color: var(--danger);
}

.order-progress-step.terminal::before,
.order-progress-step.terminal .order-progress-node {
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 0 0 1px var(--danger), 0 0 0 5px color-mix(in srgb, var(--danger) 11%, transparent);
}

.form-drawer:not(.login-dialog) {
  position: fixed;
  inset: 8px 8px 8px auto;
  width: min(520px, calc(100vw - 16px));
  height: calc(100dvh - 16px);
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-pop);
}

@media (hover: hover) {
  .log-stat-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 20%, var(--line));
    box-shadow: var(--shadow-hover);
  }
}

@media (max-width: 1180px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 840px) {
  .dashboard-operations {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  .dashboard-kpis {
    gap: 10px;
  }

  .kpi-card {
    min-height: 104px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .kpi-card__icon {
    width: 34px;
    height: 34px;
  }

  .log-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .log-entry-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-drawer:not(.login-dialog) {
    inset: 6px 6px 6px auto;
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
  }
}

@media (max-width: 430px) {
  .dashboard-kpis,
  .log-metrics {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 96px;
  }

  .quick-tool-grid {
    grid-template-columns: 1fr;
  }
}

/* Shared room and content media */

.room-tile--with-image,
.room-tile.has-image,
.room-tile.has-media {
  min-height: 112px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
}

.room-tile__media,
.room-tile-media,
.room-tile-thumb {
  position: relative;
  grid-row: 1 / span 3;
  grid-column: 1;
  width: 48px;
  height: 68px;
  align-self: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  box-shadow: 0 2px 7px rgba(18, 24, 40, 0.07);
}

img.room-tile-thumb,
.room-tile__image,
.room-tile__media img,
.room-tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms var(--ease-standard), filter 180ms var(--ease-standard);
}

.room-tile--with-image > strong,
.room-tile.has-image > strong,
.room-tile.has-media > strong {
  grid-column: 2;
}

.room-tile--with-image .room-price,
.room-tile.has-image .room-price,
.room-tile.has-media .room-price {
  grid-column: 3;
}

.room-tile--with-image .room-type,
.room-tile--with-image .room-status,
.room-tile.has-image .room-type,
.room-tile.has-image .room-status,
.room-tile.has-media .room-type,
.room-tile.has-media .room-status {
  grid-column: 2 / -1;
}

.room-image-indicator,
.room-media-count {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  border-radius: 5px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--surface-elevated) 88%, transparent);
  box-shadow: 0 2px 6px rgba(18, 24, 40, 0.08);
  backdrop-filter: blur(8px);
  font-size: 8px;
  font-weight: 700;
}

.room-tile__media .room-image-indicator,
.room-tile-media .room-image-indicator {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  min-height: 18px;
  padding: 0;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(16, 20, 32, 0.68);
}

.room-image-indicator svg,
.room-media-count svg {
  width: 10px;
  height: 10px;
}

@media (hover: hover) {
  .room-tile--with-image:hover img,
  .room-tile.has-image:hover img,
  .room-tile.has-media:hover img {
    transform: scale(1.035);
    filter: saturate(1.04);
  }
}

.media-editor,
.room-media-editor,
.content-media-editor {
  display: grid;
  gap: 11px;
}

.media-heading,
.media-editor-heading,
.room-media-heading,
.content-media-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.media-heading > div,
.media-editor-heading > div,
.room-media-heading > div,
.content-media-heading > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.media-heading strong,
.media-editor-heading strong,
.room-media-heading strong,
.content-media-heading strong {
  color: var(--ink);
  font-size: 11px;
}

.media-heading span,
.media-editor-heading span,
.room-media-heading span,
.content-media-heading span {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.media-heading > b,
.media-editor-heading > b,
.room-media-heading > b,
.content-media-heading > b,
.media-count {
  display: inline-flex;
  min-height: 23px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-faint);
  background: var(--surface-muted);
  font-family: "Roboto Mono", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.media-section {
  display: grid;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.media-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.media-section-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-section-heading strong {
  font-size: 10px;
}

.media-section-heading span {
  color: var(--ink-faint);
  font-size: 9px;
}

.media-manager,
.room-media-manager,
.content-media-manager,
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 11px;
}

.media-card,
.media-upload-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  box-shadow: 0 1px 2px rgba(18, 24, 40, 0.04);
  transition: border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.media-card--primary,
.media-primary-card {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.media-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms var(--ease-standard), filter 220ms var(--ease-standard);
}

.media-card[data-cover="true"],
.media-card.is-cover,
.media-card--primary,
.media-primary-card {
  border-color: color-mix(in srgb, var(--brand) 46%, var(--line));
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.media-actions {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
  padding: 7px;
  background: linear-gradient(to top, rgba(13, 17, 29, 0.68), rgba(13, 17, 29, 0) 62%);
  opacity: 0;
  transition: opacity 180ms var(--ease-standard);
}

.media-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(18, 23, 39, 0.74);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  transition: background-color 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.media-actions button:hover {
  transform: translateY(-1px);
  background: var(--brand);
}

.media-actions svg {
  width: 14px;
  height: 14px;
}

.media-card:hover .media-actions,
.media-card:focus-within .media-actions {
  opacity: 1;
}

.media-card:hover img {
  transform: scale(1.025);
  filter: brightness(0.75);
}

.media-cover-badge,
.media-card[data-cover="true"]::before,
.media-card.is-cover::before {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 3px 8px rgba(18, 23, 39, 0.2);
  font-size: 9px;
  font-weight: 700;
}

.media-card[data-cover="true"]::before,
.media-card.is-cover::before {
  content: "MAIN";
}

.media-upload-card {
  display: grid;
  min-height: 112px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 12px;
  border-style: dashed;
  color: var(--ink-faint);
  cursor: pointer;
  text-align: center;
}

.media-upload-card:hover,
.media-upload-card:focus-within {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.media-upload-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.media-upload-card svg {
  width: 24px;
  height: 24px;
}

.media-upload-card strong,
.media-upload-card span {
  font-size: 9px;
}

.media-upload-card.is-uploading,
.media-upload-card.is-disabled,
.media-upload-card:has(input:disabled),
.upload-card:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.58;
}

.media-upload-card.is-uploading {
  cursor: wait;
}

.media-upload-card .loader {
  width: 23px;
  height: 23px;
  border-width: 2px;
}

.media-empty {
  display: grid;
  min-height: 132px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-faint);
  background: var(--surface-soft);
  text-align: center;
}

.media-empty svg {
  width: 23px;
  height: 23px;
  color: var(--brand);
}

.media-empty strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.media-empty span {
  max-width: 280px;
  font-size: 9px;
  line-height: 1.55;
}

.room-detail-media {
  height: 210px;
  background: var(--surface-muted);
}

.room-detail-media::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 46%, transparent);
  pointer-events: none;
}

html[data-theme="dark"] .room-tile__media,
html[data-theme="dark"] .room-tile-media,
html[data-theme="dark"] .room-tile-thumb,
html[data-theme="dark"] .media-card,
html[data-theme="dark"] .media-upload-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .media-actions {
  background: linear-gradient(to top, rgba(3, 6, 13, 0.82), rgba(3, 6, 13, 0) 64%);
}

@media (hover: none) {
  .image-card .image-actions,
  .media-card .media-actions {
    opacity: 1;
    transform: none;
  }

  .image-card img,
  .media-card img {
    filter: brightness(0.9);
  }
}

@media (max-width: 660px) {
  .media-manager,
  .room-media-manager,
  .content-media-manager,
  .media-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .room-tile--with-image,
  .room-tile.has-image,
  .room-tile.has-media {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    column-gap: 8px;
  }

  .room-tile__media,
  .room-tile-media,
  .room-tile-thumb {
    width: 42px;
    height: 60px;
  }

  .media-manager,
  .room-media-manager,
  .content-media-manager,
  .media-gallery,
  .image-manager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .media-card,
  .media-upload-card,
  .image-card,
  .upload-card {
    min-height: 94px;
  }

  .media-card--primary,
  .media-primary-card {
    grid-column: 1 / -1;
  }

  .media-heading,
  .media-editor-heading,
  .room-media-heading,
  .content-media-heading {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-tile--with-image img,
  .room-tile.has-image img,
  .room-tile.has-media img,
  .image-card img,
  .media-card img,
  .image-actions,
  .media-actions,
  .media-actions button {
    transform: none !important;
  }
}

/* Entity creation and destructive actions */

.floor-add-button {
  position: relative;
  z-index: 2;
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex: 0 0 28px;
  place-items: center;
  margin-top: 6px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--radius-control);
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 2px 7px rgba(18, 24, 40, 0.05);
  transition: color 180ms var(--ease-standard), background-color 180ms var(--ease-standard), border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.floor-add-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.floor-add-button::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  width: max-content;
  max-width: 150px;
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #ffffff;
  background: #252b3d;
  box-shadow: 0 7px 18px rgba(18, 24, 40, 0.16);
  content: attr(aria-label);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity 160ms var(--ease-standard), transform 160ms var(--ease-standard), visibility 160ms;
  visibility: hidden;
  white-space: normal;
}

.floor-add-button:hover,
.floor-add-button:focus-visible {
  color: #ffffff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 22%, transparent);
  transform: translateY(-1px);
}

.floor-add-button:hover::after,
.floor-add-button:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
  visibility: visible;
}

.template-field {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 13px 14px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: var(--radius);
  background: var(--brand-gradient-soft);
  transition: border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.template-field:focus-within {
  border-color: color-mix(in srgb, var(--brand) 62%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}

.template-field > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.template-field > span svg {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

.template-field > small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.55;
}

.template-field .combo-control,
.template-field > .form-control {
  margin-top: 1px;
}

.template-field .combo-input {
  background-color: var(--surface-elevated);
}

.form-section,
.editor-section {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  gap: 14px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-section:first-child,
.editor-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.form-section-heading,
.editor-section-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-section-heading strong,
.editor-section-heading strong {
  color: var(--ink);
  font-size: 11px;
}

.form-section-heading span,
.editor-section-heading span {
  color: var(--ink-faint);
  font-size: 9px;
}

.form-grid > .media-editor {
  margin-top: 3px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-grid > .media-editor .media-editor-heading::before {
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 7px;
  border-radius: 2px;
  content: "";
  background: var(--brand);
}

.form-grid > .media-editor .media-editor-heading > div {
  margin-right: auto;
}

.entity-action-footer,
.confirm-action-footer {
  gap: 8px;
  min-width: 0;
}

.entity-action-footer {
  flex-wrap: wrap;
}

.entity-action-footer .entity-delete-button {
  margin-right: auto;
}

.entity-action-footer .button,
.confirm-action-footer .button {
  min-width: 0;
  white-space: nowrap;
}

.entity-delete-button {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  box-shadow: none;
}

.entity-delete-button:hover {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.entity-delete-button svg,
.confirm-action-footer .button.danger svg {
  width: 15px;
  height: 15px;
}

.confirm-action-footer {
  background: color-mix(in srgb, var(--danger) 5%, var(--surface-elevated));
}

.confirm-action-footer .button.danger {
  color: #ffffff;
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--danger) 20%, transparent);
}

.confirm-action-footer .button.danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  filter: brightness(1.06);
}

.destructive-confirm {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  box-shadow: var(--shadow-card);
}

.destructive-confirm:has(.has-risk) {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.destructive-confirm__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
  border-radius: var(--radius);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.destructive-confirm__icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.destructive-confirm > div:not(.info-callout) {
  min-width: 0;
}

.destructive-confirm h3 {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.destructive-confirm p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.destructive-confirm dl {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 3px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-elevated);
}

.destructive-confirm dl > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 10px;
}

.destructive-confirm dl > div + div {
  border-left: 1px solid var(--line);
}

.destructive-confirm dt {
  color: var(--ink-faint);
  font-size: 8px;
}

.destructive-confirm dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destructive-confirm dd.has-risk {
  color: var(--danger);
}

.destructive-confirm dd.has-risk::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  content: "";
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 11%, transparent);
  vertical-align: 1px;
}

.destructive-confirm > .info-callout {
  grid-column: 1 / -1;
  margin-top: 1px;
}

html[data-theme="dark"] .floor-add-button::after {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #252c3d;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .destructive-confirm,
html[data-theme="dark"] .destructive-confirm:has(.has-risk) {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

@media (max-width: 660px) {
  .floor-add-button {
    margin-top: 0;
    margin-left: auto;
  }

  .floor-add-button::after {
    top: calc(100% + 7px);
    right: 0;
    left: auto;
    transform: translateY(-4px);
  }

  .floor-add-button:hover::after,
  .floor-add-button:focus-visible::after {
    transform: translateY(0);
  }
}

@media (max-width: 390px) {
  .entity-action-footer,
  .confirm-action-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .entity-action-footer .button,
  .confirm-action-footer .button {
    width: 100%;
    min-height: 40px;
    padding-inline: 9px;
  }

  .entity-action-footer .entity-delete-button {
    grid-column: 1 / -1;
    order: 3;
    margin-right: 0;
  }

  .product-action-footer .button.primary {
    grid-column: 1 / -1;
  }

  .confirm-action-footer .button {
    grid-column: auto;
  }

  .destructive-confirm {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
    padding: 13px;
  }

  .destructive-confirm__icon {
    width: 36px;
    height: 36px;
  }

  .destructive-confirm dl {
    grid-template-columns: 1fr;
  }

  .destructive-confirm dl > div {
    grid-template-columns: minmax(70px, 0.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .destructive-confirm dl > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .destructive-confirm dd {
    text-align: right;
  }

  .template-field {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floor-add-button,
  .floor-add-button::after,
  .entity-delete-button,
  .confirm-action-footer .button.danger {
    transform: none !important;
    filter: none !important;
  }
}

/* Readable operations scale */

body {
  font-size: 15px;
  line-height: 1.5;
}

.nav-item,
.operator-button strong,
.command-search,
.button,
.search-field input,
.select-field,
.form-control,
.combo-input,
.segmented button {
  font-size: 14px;
}

.operator-button small,
.sync-state,
.section-kicker,
.metric-note,
.kpi-card__meta,
.panel-head p,
.legend-row,
.table-footer,
.form-help,
.template-field > small,
.media-editor-heading span,
.product-media-heading span,
.product-media-heading b,
.upload-card strong,
.upload-card span {
  font-size: 12px;
}

.view-head p,
.flow-status,
.metric-label,
.task-row span,
.activity-row span,
.quick-tool__copy span,
.distribution-row,
.detail-hero > span,
.detail-copy,
.detail-empty,
.definition-item dd,
.related-record small,
.info-callout,
.rule-list span,
.timeline-step span,
.toast {
  font-size: 13px;
}

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

.task-row strong,
.activity-row strong,
.primary-cell strong,
.quick-tool__copy strong,
.text-button,
.related-record strong,
.rule-list b,
.timeline-step strong,
.form-field > span,
.status-form label > span,
.detail-section > h3 {
  font-size: 14px;
}

.primary-cell span,
.table-sub,
.definition-item dt,
.detail-metrics span,
.detail-metrics small,
.tag-list span,
.product-detail-image span,
.order-progress-copy,
.order-progress-step > div:not(.order-progress-copy) {
  font-size: 12px;
}

.state-badge,
.category-badge,
.level-badge,
.stock-badge {
  min-height: 27px;
  padding-inline: 10px;
  font-size: 12px;
}

.data-table th,
.data-table td {
  height: 64px;
  font-size: 14px;
}

.data-table th {
  height: 48px;
  font-size: 12px;
}

.data-table td strong {
  font-size: 14px;
}

.product-image {
  width: 48px;
  height: 48px;
}

.room-grid {
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 10px;
  padding: 14px;
}

.floor-label span {
  font-size: 12px;
}

.room-tile--with-image,
.room-tile.has-image,
.room-tile.has-media {
  min-height: 146px;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  align-content: center;
  column-gap: 12px;
  row-gap: 7px;
  padding: 13px;
}

.room-tile__media,
.room-tile-media,
.room-tile-thumb {
  grid-row: 1 / span 4;
  width: 56px;
  height: 84px;
}

.room-tile--with-image > strong,
.room-tile.has-image > strong,
.room-tile.has-media > strong {
  grid-row: 1;
  grid-column: 2;
  justify-self: start;
  font-size: 18px;
}

.room-tile--with-image .room-price,
.room-tile.has-image .room-price,
.room-tile.has-media .room-price {
  display: inline-flex;
  min-height: 28px;
  grid-row: 2;
  grid-column: 2;
  align-items: center;
  justify-self: center;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 6px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
}

.room-tile--with-image .room-type,
.room-tile.has-image .room-type,
.room-tile.has-media .room-type {
  grid-row: 3;
  grid-column: 2;
  font-size: 13px;
}

.room-tile--with-image .room-status,
.room-tile.has-image .room-status,
.room-tile.has-media .room-status {
  grid-row: 4;
  grid-column: 2;
  font-size: 13px;
}

.room-image-indicator,
.room-media-count {
  font-size: 11px;
}

.detail-hero strong {
  font-size: 20px;
}

.detail-metrics strong {
  font-size: 20px;
}

.property-switcher label > span,
.command-search span:nth-child(2),
.operator-button small,
.sync-state,
.occupancy-ring small {
  font-size: 12px;
}

.operator-button strong {
  font-size: 14px;
}

.flow-stage-head > div > span,
.flow-stage-head small {
  font-size: 12px;
}

.flow-stage-head strong {
  font-size: 16px;
}

.flow-stage-head > b,
.flow-stage-empty {
  font-size: 13px;
}

.flow-item strong {
  font-size: 14px;
}

.flow-item small {
  font-size: 13px;
}

.mobile-record-head strong {
  font-size: 14px;
}

.mobile-record p,
.mobile-record-foot {
  font-size: 12px;
}

.form-control,
.combo-control > input,
.combo-control .combo-input,
.combo-control .combo-trigger {
  min-height: 42px;
}

@media (max-width: 840px) {
  .flow-stage-grid {
    grid-template-columns: 1fr;
    padding-inline: 14px;
  }

  .flow-stage {
    padding: 14px 4px 0;
  }

  .flow-stage + .flow-stage {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .flow-stage-connector {
    top: auto;
    right: 50%;
    bottom: -19px;
    transform: translateX(50%) rotate(90deg);
  }

  .flow-stage-list {
    max-height: 244px;
  }
}

@media (max-width: 660px) {
  .view-head p {
    font-size: 13px;
  }

  .toolbar-group:has(#productCategoryFilter) > .combo-control {
    width: 118px;
    flex: 0 0 118px;
  }

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

  .data-table th,
  .data-table td {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-item,
  .room-tile--with-image .room-price,
  .room-tile.has-image .room-price,
  .room-tile.has-media .room-price {
    transition: none !important;
  }
}

/* Room type inventory and rate calendar */

.rate-batch-intro {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: var(--brand-soft);
}

.rate-batch-intro > svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--brand);
}

.rate-batch-intro p,
.rate-batch-intro strong,
.rate-batch-intro span {
  display: block;
  margin: 0;
}

.rate-batch-intro strong {
  color: var(--ink);
  font-size: 13px;
}

.rate-batch-intro span {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.5;
}

.rate-batch-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rate-batch-field {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  transition: border-color 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.rate-batch-field:has(> label input:checked) {
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
}

.rate-batch-field.is-disabled {
  background: var(--surface-soft);
}

.rate-batch-field > label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.rate-batch-field > label input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
}

.rate-batch-field > small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-batch-field .combo-control {
  width: 100%;
}

.rate-batch-field.is-disabled .form-control,
.rate-batch-field.is-disabled .combo-input {
  opacity: 0.58;
}

.inventory-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.inventory-tabs > button {
  display: grid;
  min-width: 210px;
  min-height: 52px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.inventory-tabs > button:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.inventory-tabs > button.active {
  border-color: var(--line);
  color: var(--brand);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(18, 24, 40, 0.07);
}

.inventory-tabs svg {
  width: 20px;
  height: 20px;
  justify-self: center;
}

.inventory-tabs span,
.inventory-tabs strong,
.inventory-tabs small {
  display: block;
  min-width: 0;
}

.inventory-tabs strong {
  font-size: 14px;
}

.inventory-tabs small {
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.inventory-insights article {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 2px 14px;
  padding: 12px 18px 12px 20px;
}

.inventory-insights article + article {
  border-left: 1px solid var(--line);
}

.inventory-insights article::before {
  position: absolute;
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 2px;
  content: "";
  background: var(--brand);
}

.inventory-insights article.is-available::before {
  background: var(--available);
}

.inventory-insights article.is-warning::before {
  background: var(--sun);
}

.inventory-insights article.is-danger::before {
  background: var(--danger);
}

.inventory-insights span {
  align-self: end;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.inventory-insights strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-family: "DIN Alternate", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 27px;
  font-weight: 750;
  line-height: 1;
}

.inventory-insights small {
  align-self: start;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-type-archive,
.rate-calendar-panel {
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.room-type-archive__head,
.rate-calendar-head {
  min-height: 72px;
  padding: 14px 18px;
}

.room-type-search {
  width: min(300px, 42%);
  flex: 0 1 300px;
}

.room-type-list {
  display: grid;
}

.room-type-list__head,
.room-type-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(90px, 0.62fr) minmax(90px, 0.62fr) minmax(120px, 0.78fr) minmax(94px, 0.64fr) 92px;
  align-items: center;
}

.room-type-list__head {
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 650;
}

.room-type-row {
  min-height: 76px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.room-type-row:last-child {
  border-bottom: 0;
}

.room-type-row:hover {
  background: var(--surface-hover);
}

.room-type-row:focus-visible {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--brand);
}

.room-type-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding-right: 16px;
}

.room-type-identity > img {
  width: 58px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-muted);
}

.room-type-identity > div,
.room-type-identity > div > span {
  display: flex;
  min-width: 0;
}

.room-type-identity > div {
  flex-direction: column;
  gap: 5px;
}

.room-type-identity > div > strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-type-identity > div > span {
  gap: 4px;
  overflow: hidden;
}

.room-type-identity i {
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.room-type-identity small {
  color: var(--ink-faint);
  font-size: 12px;
}

.room-type-value,
.room-type-price {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
}

.room-type-value strong {
  font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 16px;
}

.room-type-value span,
.room-type-price span {
  color: var(--ink-faint);
  font-size: 12px;
}

.room-type-value.needs-link strong {
  color: var(--sun);
}

.room-type-price strong {
  color: var(--brand);
  font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 15px;
}

.room-type-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.room-type-actions .icon-button {
  width: 34px;
  height: 34px;
}

.inventory-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 28px;
  color: var(--ink-soft);
  text-align: center;
}

.inventory-empty > svg {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  color: var(--brand);
}

.inventory-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.inventory-empty p {
  margin: 0 0 8px;
  font-size: 13px;
}

.rate-calendar-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.rate-calendar-title img {
  width: 56px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-muted);
}

.rate-calendar-title > div {
  min-width: 0;
}

.rate-calendar-title h2,
.rate-calendar-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-calendar-controls,
.rate-type-picker,
.calendar-navigation,
.calendar-navigation label {
  display: flex;
  align-items: center;
}

.rate-calendar-controls {
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.rate-type-picker,
.calendar-navigation label {
  min-width: 0;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.rate-type-picker {
  flex: 1 1 250px;
}

.rate-type-picker .form-control {
  min-width: 130px;
  flex: 1 1 auto;
}

.calendar-navigation {
  flex: 0 0 auto;
  gap: 6px;
}

.calendar-navigation input {
  width: 142px;
}

.calendar-prev-icon {
  transform: rotate(180deg);
}

.calendar-range {
  flex: 0 0 auto;
}

.calendar-range button {
  min-width: 52px;
}

.calendar-today-button {
  flex: 0 0 auto;
}

.rate-calendar-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: var(--scroll-thumb) transparent;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.rate-calendar-scroll::-webkit-scrollbar {
  height: 7px;
}

.rate-calendar-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--scroll-thumb);
}

.rate-calendar-table {
  width: 100%;
  min-width: 1040px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}

.rate-calendar-table:has(thead th:nth-child(10)) {
  min-width: 1946px;
}

.rate-calendar-table th,
.rate-calendar-table td {
  min-width: 0;
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.rate-calendar-table thead th {
  height: 64px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  text-align: center;
}

.rate-calendar-table thead th > span,
.rate-calendar-table thead th > strong,
.rate-calendar-table thead th > small {
  display: block;
}

.rate-calendar-table thead th > span,
.rate-calendar-table thead th > small {
  font-size: 12px;
  font-weight: 500;
}

.rate-calendar-table thead th > strong {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 14px;
}

.rate-calendar-table thead th > small {
  color: var(--brand);
}

.rate-calendar-table thead th.is-weekend:not(.is-today) {
  background: color-mix(in srgb, var(--brand) 3%, var(--surface-soft));
}

.rate-calendar-table thead th.is-today {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  box-shadow: inset 0 3px var(--brand);
}

.rate-calendar-table .rate-type-column {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 190px;
  padding: 0 16px;
  text-align: left;
}

.rate-calendar-table thead .rate-type-column {
  z-index: 3;
  color: var(--ink-soft);
}

.rate-type-column > button {
  display: grid;
  width: calc(100% + 32px);
  min-height: 132px;
  align-content: center;
  gap: 4px;
  margin-inline: -16px;
  padding: 14px 16px;
  border: 0;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  transition: color 180ms ease, background-color 180ms ease;
}

.rate-type-column > button:hover {
  color: var(--brand);
  background: var(--surface-hover);
}

.rate-type-column > button strong,
.rate-type-column > button span,
.rate-type-column > button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-type-column > button strong {
  font-size: 15px;
}

.rate-type-column > button span,
.rate-type-column > button small {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 500;
}

.rate-day {
  display: grid;
  width: 100%;
  min-height: 132px;
  align-content: center;
  gap: 5px;
  padding: 10px 9px;
  border: 0;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.rate-day:hover,
.rate-day:focus-visible {
  position: relative;
  z-index: 1;
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 34%, transparent);
}

.rate-day-kind {
  justify-self: start;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-faint);
  background: var(--surface-muted);
  font-size: 11px;
  line-height: 1.5;
}

.rate-day > strong {
  color: var(--brand);
  font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.25;
}

.rate-day-stock,
.rate-day > small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-day-stock b {
  color: var(--ink);
  font-size: 13px;
}

.rate-day > small {
  color: var(--ink-faint);
}

.rate-day-meter {
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-muted);
}

.rate-day-meter i {
  display: block;
  width: var(--occupancy, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--available);
  transition: width 220ms var(--ease-standard), background-color 180ms ease;
}

.rate-day.is-low .rate-day-meter i {
  background: var(--sun);
}

.rate-day.is-empty .rate-day-meter i {
  background: var(--ink-faint);
}

.rate-day.is-sold .rate-day-meter i,
.rate-day.is-closed .rate-day-meter i {
  background: var(--danger);
}

.rate-day.is-low {
  background: color-mix(in srgb, var(--sun) 5%, var(--surface));
}

.rate-day.is-empty {
  background: var(--surface-soft);
}

.rate-day.is-empty > strong,
.rate-day.is-empty .rate-day-stock {
  color: var(--ink-faint);
}

.rate-day.is-sold,
.rate-day.is-closed {
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.rate-day.is-closed > strong,
.rate-day.is-closed .rate-day-stock {
  color: var(--danger);
}

.rate-mobile-list {
  display: none;
}

.rate-calendar-legend {
  display: flex;
  min-height: 50px;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px 18px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 12px;
}

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

.rate-calendar-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--available);
}

.rate-calendar-legend i.low {
  background: var(--sun);
}

.rate-calendar-legend i.sold,
.rate-calendar-legend i.closed {
  background: var(--danger);
}

.rate-calendar-legend i.closed {
  opacity: 0.48;
}

.rate-calendar-legend b {
  margin-left: auto;
  color: var(--ink-faint);
  font-weight: 500;
}

html[data-theme="dark"] .inventory-tabs > button.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

@media (max-width: 1080px) {
  .rate-calendar-controls {
    flex-wrap: wrap;
  }

  .rate-type-picker {
    flex-basis: calc(100% - 390px);
  }

  .calendar-today-button {
    margin-left: auto;
  }

  .room-type-list__head,
  .room-type-row {
    grid-template-columns: minmax(230px, 2fr) 86px 86px 112px 88px 82px;
  }
}

@media (max-width: 760px) {
  .inventory-tabs {
    width: 100%;
  }

  .inventory-tabs > button {
    min-width: 0;
    flex: 1 1 0;
  }

  .room-type-archive__head {
    align-items: stretch;
    flex-direction: column;
  }

  .room-type-search {
    width: 100%;
    flex-basis: auto;
  }

  .room-type-list__head {
    display: none;
  }

  .room-type-list {
    gap: 10px;
    padding: 12px;
    background: var(--surface-soft);
  }

  .room-type-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 11px 8px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
  }

  .room-type-identity {
    grid-column: 1 / -1;
    padding: 0 0 11px;
    border-bottom: 1px solid var(--line);
  }

  .room-type-row > div[role="cell"]:not(.room-type-identity, .room-type-actions) {
    position: relative;
    display: grid;
    align-content: end;
    gap: 2px;
    padding-top: 18px;
  }

  .room-type-row > div[role="cell"]:not(.room-type-identity, .room-type-actions)::before {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--ink-faint);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 500;
  }

  .room-type-actions {
    align-self: end;
  }
}

@media (max-width: 660px) {
  .rate-batch-fields {
    grid-template-columns: 1fr;
  }

  .inventory-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .inventory-tabs::-webkit-scrollbar {
    display: none;
  }

  .inventory-tabs > button {
    min-width: 156px;
    min-height: 48px;
    padding-inline: 9px;
  }

  .inventory-tabs small {
    display: none;
  }

  .inventory-insights {
    grid-template-columns: 1fr;
  }

  .inventory-insights article {
    min-height: 62px;
    padding: 9px 14px 9px 17px;
  }

  .inventory-insights article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .inventory-insights article::before {
    inset-block: 14px;
  }

  .inventory-insights strong {
    font-size: 23px;
  }

  .rate-calendar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rate-calendar-head > .button {
    width: 100%;
  }

  .rate-calendar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px 12px;
  }

  .rate-type-picker,
  .calendar-navigation {
    grid-column: 1 / -1;
    width: 100%;
  }

  .rate-type-picker > span,
  .calendar-navigation label > span {
    display: none;
  }

  .calendar-navigation label {
    flex: 1 1 auto;
  }

  .calendar-navigation input {
    width: 100%;
  }

  .calendar-range {
    justify-self: start;
  }

  .calendar-today-button {
    justify-self: end;
    margin-left: 0;
  }

  .rate-calendar-scroll {
    display: none;
  }

  .rate-mobile-list {
    display: grid;
  }

  .rate-mobile-day {
    --rate-state: var(--available);
    display: grid;
    width: 100%;
    min-height: 80px;
    grid-template-columns: 62px minmax(74px, 1fr) 58px 66px 16px;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: var(--surface);
    text-align: left;
    transition: background-color 180ms ease, box-shadow 180ms ease;
  }

  .rate-mobile-day:last-child {
    border-bottom: 0;
  }

  .rate-mobile-day:hover,
  .rate-mobile-day:focus-visible {
    background: var(--surface-hover);
    box-shadow: inset 3px 0 var(--rate-state);
  }

  .rate-mobile-day.is-low {
    --rate-state: var(--sun);
  }

  .rate-mobile-day.is-empty {
    --rate-state: var(--ink-faint);
    background: var(--surface-soft);
  }

  .rate-mobile-day.is-sold,
  .rate-mobile-day.is-closed {
    --rate-state: var(--danger);
  }

  .rate-mobile-date,
  .rate-mobile-price,
  .rate-mobile-stock,
  .rate-mobile-state {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .rate-mobile-day strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rate-mobile-price strong {
    color: var(--brand);
    font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
    font-size: 15px;
  }

  .rate-mobile-day small {
    overflow: hidden;
    color: var(--ink-faint);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rate-mobile-state i {
    width: fit-content;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--rate-state);
    background: color-mix(in srgb, var(--rate-state) 10%, var(--surface));
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
  }

  .rate-mobile-day > svg {
    width: 16px;
    height: 16px;
    color: var(--ink-faint);
  }

  .rate-calendar-legend {
    gap: 8px 12px;
    padding-inline: 12px;
  }

  .rate-calendar-legend b {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 390px) {
  .room-type-list {
    padding: 9px;
  }

  .room-type-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }

  .room-type-row > div[role="cell"]:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }

  .room-type-row > div[role="cell"]:nth-child(3) {
    grid-row: 2;
    grid-column: 2;
  }

  .room-type-row > div[role="cell"]:nth-child(4) {
    grid-row: 3;
    grid-column: 1;
  }

  .room-type-row > div[role="cell"]:nth-child(5) {
    grid-row: 3;
    grid-column: 2;
  }

  .room-type-actions {
    grid-column: 3;
    grid-row: 2 / span 2;
  }

  .rate-calendar-title img {
    width: 48px;
    height: 42px;
  }

  .rate-calendar-head,
  .room-type-archive__head {
    padding-inline: 12px;
  }

  .rate-mobile-day {
    grid-template-columns: 64px minmax(62px, 1fr) 52px 60px 14px;
    gap: 5px;
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inventory-tabs > button,
  .room-type-row,
  .rate-type-column > button,
  .rate-day,
  .rate-day-meter i,
  .rate-mobile-day {
    transition: none !important;
  }
}

/* Redemption fulfillment */

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

.redemption-stats > button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 112px;
  align-content: center;
  gap: 3px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform 200ms var(--ease-standard), border-color 200ms var(--ease-standard), box-shadow 200ms var(--ease-standard), background-color 200ms var(--ease-standard);
}

.redemption-stats > button::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  opacity: 0.72;
}

.redemption-stats > button:hover,
.redemption-stats > button.active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  box-shadow: var(--shadow-hover);
}

.redemption-stats > button.active {
  background: var(--brand-gradient-soft);
}

.redemption-stats span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}

.redemption-stats strong {
  overflow: hidden;
  font-family: "DIN Alternate", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 29px;
  font-weight: 750;
  line-height: 1.18;
  text-overflow: ellipsis;
}

.redemption-stats small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.redemption-stats > button::before {
  background: var(--sun);
}

.redemption-stats > button:nth-child(2)::before {
  background: var(--sky);
}

.redemption-stats > button:nth-child(3)::before {
  background: var(--brand);
}

.redemption-stats > button:nth-child(4)::before {
  background: var(--available);
}

.redemption-toolbar {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.redemption-toolbar .search-field {
  width: min(360px, 100%);
}

.redemption-toolbar .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.redemption-toolbar .segmented::-webkit-scrollbar {
  display: none;
}

.redemption-table {
  min-width: 980px;
}

.redemption-table tbody tr {
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.redemption-table tbody tr:focus-visible {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--brand);
}

.redemption-table td:last-child svg {
  margin-left: auto;
  color: var(--ink-faint);
}

.verification-panel {
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: var(--radius);
  background: var(--brand-gradient-soft);
}

.verification-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.verification-panel > div span,
.verification-panel > p {
  color: var(--ink-soft);
  font-size: 13px;
}

.verification-panel > div strong,
.verification-code-input {
  font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-weight: 750;
}

.verification-panel > div strong {
  color: var(--brand);
  font-size: 18px;
}

.verification-panel > p {
  margin: 9px 0 0;
  line-height: 1.6;
}

.verification-code-input {
  font-size: 17px;
}

/* In-stay operations */

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

.order-command-grid > button {
  display: grid;
  min-width: 0;
  min-height: 72px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  transition: transform 180ms var(--ease-standard), border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.order-command-grid > button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
  background: var(--surface-hover);
  box-shadow: var(--shadow-card);
}

.order-command-grid > button > svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 7px;
  color: var(--brand);
  background: var(--brand-soft);
}

.order-command-grid > button > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.order-command-grid strong,
.order-command-grid small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-command-grid strong {
  font-size: 14px;
}

.order-command-grid small {
  color: var(--ink-faint);
  font-size: 12px;
}

.assignment-list,
.guest-list,
.folio-list,
.invoice-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.assignment-list > div,
.guest-list > div,
.folio-list > div,
.invoice-list > div {
  display: flex;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
}

.assignment-list > div + div,
.guest-list > div + div,
.folio-list > div + div,
.invoice-list > div + div {
  border-top: 1px solid var(--line);
}

.assignment-list > div > span,
.guest-list > div > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--brand);
  background: var(--brand-soft);
}

.assignment-list svg,
.guest-list > div > span svg {
  width: 17px;
  height: 17px;
}

.assignment-list p,
.guest-list p,
.folio-list p,
.invoice-list p {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
  margin: 0;
}

.assignment-list strong,
.guest-list strong,
.folio-list p strong,
.invoice-list p strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-list small,
.guest-list small,
.folio-list small,
.invoice-list small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guest-list > div > button,
.invoice-list > div > button {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.guest-list > div > button:hover,
.invoice-list > div > button:hover {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.folio-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.folio-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 11px 9px;
  text-align: center;
}

.folio-summary > div + div {
  border-left: 1px solid var(--line);
}

.folio-summary span {
  color: var(--ink-faint);
  font-size: 11px;
}

.folio-summary strong {
  overflow: hidden;
  font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folio-summary strong.has-balance {
  color: var(--danger);
}

.folio-type {
  display: inline-flex;
  min-width: 66px;
  min-height: 26px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.folio-type.payment,
.folio-type.depositRefund {
  color: var(--available);
  background: color-mix(in srgb, var(--available) 11%, var(--surface));
}

.folio-type.deposit {
  color: var(--sun);
  background: color-mix(in srgb, var(--sun) 11%, var(--surface));
}

.folio-list > div > b {
  flex: 0 0 auto;
  font-family: "Noto Sans Mono CJK SC", ui-monospace, monospace;
  font-size: 13px;
  white-space: nowrap;
}

.invoice-list > div {
  flex-wrap: wrap;
}

.invoice-list .state-badge {
  margin-left: auto;
}

html[data-theme="dark"] .redemption-stats > button,
html[data-theme="dark"] .rate-calendar-panel,
html[data-theme="dark"] .redemption-toolbar,
html[data-theme="dark"] .order-command-grid > button,
html[data-theme="dark"] .assignment-list,
html[data-theme="dark"] .guest-list,
html[data-theme="dark"] .folio-list,
html[data-theme="dark"] .invoice-list {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.14), 0 10px 24px rgba(0, 0, 0, 0.1);
}

@media (max-width: 960px) {
  .redemption-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .redemption-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .redemption-toolbar .search-field {
    width: 100%;
  }
}

@media (max-width: 660px) {
  .redemption-stats {
    gap: 8px;
    margin-bottom: 14px;
  }

  .redemption-stats > button {
    min-height: 98px;
    padding: 13px 14px;
  }

  .redemption-stats span {
    font-size: 13px;
  }

  .redemption-stats strong {
    font-size: 25px;
  }

  .redemption-stats small {
    font-size: 11px;
  }

  .redemption-toolbar {
    gap: 9px;
    padding: 9px;
  }

  .redemption-toolbar .segmented {
    display: flex;
    width: 100%;
  }

  .redemption-toolbar .segmented button {
    min-height: 34px;
    flex: 0 0 auto;
    font-size: 12px;
  }

  .redemption-table {
    display: none;
  }

  .redemption-toolbar + .table-panel .mobile-record-list {
    display: grid;
  }

  .redemption-toolbar + .table-panel .mobile-record {
    min-height: 112px;
    padding: 14px;
  }

  .redemption-toolbar + .table-panel .mobile-record p,
  .redemption-toolbar + .table-panel .mobile-record-foot {
    font-size: 12px;
  }

  .redemption-toolbar + .table-panel .table-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding-block: 11px;
  }

  .order-command-grid {
    grid-template-columns: 1fr;
  }

  .order-command-grid > button {
    min-height: 68px;
  }

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

  .folio-summary > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .folio-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .folio-summary span {
    font-size: 12px;
  }

  .folio-summary strong {
    font-size: 14px;
  }

  .folio-list > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .folio-list > div > b {
    grid-column: 2;
    justify-self: end;
  }

  .verification-panel > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 390px) {
  .redemption-stats > button {
    min-height: 94px;
    padding-inline: 12px;
  }

  .redemption-stats strong {
    font-size: 23px;
  }

  .assignment-list > div,
  .guest-list > div,
  .folio-list > div,
  .invoice-list > div {
    padding-inline: 10px;
  }

  .invoice-list .state-badge {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .redemption-stats > button,
  .order-command-grid > button {
    transition: none !important;
    transform: none !important;
  }
}

#mainContent {
  display: flex;
  flex-direction: column;
}

#viewRoot {
  min-width: 0;
  flex: 1 0 auto;
}

.compliance-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  padding: 24px 12px 2px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.compliance-footer[hidden] {
  display: none;
}

.compliance-footer a {
  text-decoration: none;
  transition: color 160ms ease;
}

.compliance-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
