:root {
  color-scheme: light;
  --bg: #f5f7fd;
  --surface: #ffffff;
  --surface-soft: #f5f7fd;
  --ink: #111111;
  --muted: #666666;
  --line: #e8edf6;
  --primary: #1677ff;
  --primary-dark: #0f63d9;
  --blue: #6898fc;
  --red: #ff4d4f;
  --shadow: 0 8px 24px rgba(30, 55, 92, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

body.is-locked .app-shell {
  display: none;
}

body.is-locked dialog:not(#registerDialog),
body.is-locked .toast {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body:not(.is-locked) .login-screen {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(245, 247, 253, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='720' viewBox='0 0 1200 720'%3E%3Crect width='1200' height='720' fill='%23f5f7fd'/%3E%3Cg fill='none' stroke='%236898fc' stroke-width='2' opacity='.48'%3E%3Cpath d='M170 510V185h220v325M270 510V250h210v260M540 510V145h260v365M860 510V230h185v280'/%3E%3Cpath d='M205 225h145M205 280h145M205 335h145M205 390h145M575 190h190M575 250h190M575 310h190M575 370h190M895 270h115M895 325h115M895 380h115'/%3E%3C/g%3E%3Cg fill='%231677ff' opacity='.10'%3E%3Crect x='0' y='512' width='1200' height='208'/%3E%3Crect x='424' y='285' width='88' height='225'/%3E%3Crect x='820' y='365' width='54' height='145'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(31, 72, 130, 0.14);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 2px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span,
.login-meta {
  margin-top: 4px;
  color: var(--muted);
}

.login-copy {
  display: grid;
  gap: 5px;
}

.login-copy h1 {
  font-size: 26px;
}

.login-submit {
  width: 100%;
  min-height: 42px;
}

.login-register {
  width: 100%;
  justify-content: center;
  color: var(--primary);
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.login-meta {
  text-align: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  background: #f2f2f2;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 14px;
  border-right: 0;
  border-radius: 0 28px 28px 0;
  background: #ffffff;
  color: var(--ink);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 132px;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
}

.brand strong {
  font-size: 25px;
}

.brand strong,
.brand span,
.side-status strong,
.side-status span {
  display: block;
}

.brand span,
.side-status span {
  margin-top: 3px;
  color: #666666;
  font-size: 12px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111111;
  text-align: left;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item.active,
.nav-item:hover {
  background: #6898fc;
  color: #ffffff;
}

.nav-item:not(.active):hover {
  background: #eaf2ff;
  color: var(--primary);
}

.side-status {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13);
}

.workspace {
  min-width: 0;
  padding: 12px 22px 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  margin-bottom: 18px;
  padding: 0 20px;
  border-radius: 999px;
  background: #ffffff;
}

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

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
}

.toolbar,
.section-actions,
.control-band,
.tabs,
menu,
.inline-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar {
  margin-left: auto;
}

.top-search-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.top-icon {
  border: 0;
  background: transparent;
  color: var(--primary);
}

.top-icon svg {
  width: 22px;
  height: 22px;
}

.notify-icon {
  position: relative;
}

.notify-icon span {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px 0 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #666666;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 34%, #ffffff 0 14px, transparent 15px),
    radial-gradient(circle at 50% 78%, #ffffff 0 24px, transparent 25px),
    linear-gradient(#8f8f8f, #b7b7b7);
  box-shadow: inset 0 0 0 3px #e8e8e8;
}

.user-chip strong {
  font-size: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(390px, 36vw);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-box svg {
  width: 18px;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.tabs button,
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.primary-button {
  padding: 0 12px;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(22, 119, 255, 0.16);
}

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

.secondary-button,
.tabs button,
.segmented button {
  padding: 0 12px;
  background: var(--surface);
  border-color: #d9e7ff;
  color: var(--primary);
}

.ghost-button {
  padding: 0 9px;
  background: transparent;
  color: var(--primary);
}

.icon-button {
  width: 34px;
  padding: 0;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

button svg {
  width: 18px;
  height: 18px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.room-card,
.meter-card,
.bill-card,
.repair-card,
.contract-card,
.message-item,
.template-item,
.health-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(30, 55, 92, 0.04);
}

.metric,
.panel,
.room-card,
.meter-card,
.bill-card,
.repair-card,
.contract-card,
.message-item,
.template-item,
.health-item {
  padding: 16px;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 28px;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.compact-row {
  margin-top: 16px;
}

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

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 30px;
  border: 0;
  background: transparent;
}

.segmented .selected,
.tabs .active {
  border-color: #b7d4ff;
  background: #eaf2ff;
  color: var(--primary);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 16px;
  height: 280px;
  padding-top: 18px;
}

.bar-chart div,
.cashflow div {
  position: relative;
  height: var(--h);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #1677ff, #6898fc);
}

.bar-chart span,
.cashflow span {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
}

.cashflow {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  height: 180px;
}

.cashflow div {
  background: linear-gradient(180deg, #6898fc, #1677ff);
}

.task-list,
.data-grid,
.meter-layout,
.bill-board,
.repair-board,
.contract-grid,
.template-list,
.message-list,
.health-grid {
  display: grid;
  gap: 12px;
}

.task {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.task svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--primary);
  font-size: 12px;
}

.badge.warn {
  background: #fff2d8;
  color: #9a5600;
}

.badge.danger {
  background: #ffe4e6;
  color: #b91c1c;
}

.section-actions {
  justify-content: space-between;
  margin-bottom: 14px;
}

.filter-stack {
  display: grid;
  gap: 8px;
}

.inline-actions,
.card-actions,
.control-band {
  flex-wrap: wrap;
}

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

#rooms {
  min-height: calc(100vh - 135px);
}

.room-state-panel {
  min-height: calc(100vh - 118px);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.room-state-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid #edf0f6;
}

.room-state-tabs .tabs {
  align-self: stretch;
  gap: 0;
}

.room-state-tabs .tabs button {
  min-width: 126px;
  min-height: 58px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  border-color: #edf0f6;
  background: #ffffff;
  color: #333333;
  font-size: 16px;
}

.room-state-tabs .tabs button.active {
  background: #f5f7fd;
  color: #333333;
}

.room-tab-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 22px;
}

.room-check-card {
  min-width: 108px;
  border-color: #8cb5ff;
  color: #6898fc;
  font-size: 14px;
}

.room-export-button {
  min-width: 116px;
  border-color: #dce6f8;
  color: #606266;
  font-size: 14px;
}

.room-state-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 68px;
  padding: 16px 22px 10px;
}

.room-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.room-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 148px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #dddddd;
  border-radius: 8px;
  background: #ffffff;
  color: #bbbbbb;
  font-size: 14px;
}

select.room-select,
input.room-select {
  appearance: none;
  color: #606266;
}

.mini-filter {
  width: 96px;
  min-width: 96px;
}

.room-select svg,
.room-search svg {
  width: 20px;
  height: 20px;
}

.room-help {
  border: 0;
  background: transparent;
  color: #999999;
}

.room-status-filter {
  position: relative;
}

.room-status-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #999999;
}

.room-status-trigger svg {
  width: 16px;
  height: 16px;
}

.room-status-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 112px);
  gap: 0;
  width: max-content;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(32, 48, 85, 0.14);
}

.room-status-menu[hidden] {
  display: none;
}

.room-status-menu-col {
  display: grid;
  gap: 4px;
}

.room-status-menu button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #333333;
  font-size: 14px;
  text-align: center;
}

.room-status-menu button:hover,
.room-status-menu button.active {
  background: #f2f2f2;
}

.room-search {
  display: flex;
  align-items: center;
  width: min(340px, 30vw);
  min-height: 38px;
  padding-left: 12px;
  border: 1px solid #dddddd;
  border-radius: 24px;
  background: #ffffff;
}

.room-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #333333;
  font-size: 14px;
}

.room-search input::placeholder {
  color: #c9c9c9;
}

.room-search svg {
  display: grid;
  place-items: center;
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 9px;
  border-left: 1px solid #dddddd;
  color: #888888;
}

.room-count {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  white-space: nowrap;
  color: #111111;
  font-size: 14px;
}

.room-count strong {
  margin: 0 6px;
  font-size: 20px;
}

.room-add-whole {
  flex: 0 0 auto;
  min-width: 128px;
  min-height: 38px;
  font-size: 14px;
}

.room-status-tabs {
  display: none;
}

.room-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 0 22px 48px;
}

.data-grid.room-groups {
  grid-template-columns: 1fr;
  align-items: start;
}

.room-group-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 10px 0 4px;
  overflow-x: auto;
  background: #ffffff;
}

.room-group-nav button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #e4ebff;
  border-radius: 6px;
  background: #f7f9ff;
  color: #4b5568;
  font-size: 13px;
}

.room-group-nav button:hover {
  border-color: #8db6ff;
  color: #1677ff;
}

.room-group-nav strong {
  color: #1677ff;
  font-size: 14px;
}

.room-group {
  display: grid;
  gap: 12px;
  scroll-margin-top: 78px;
}

.room-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 0;
}

.room-group-head > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.room-group-head strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 900;
}

.room-group-head strong::before {
  content: "";
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: #6898fc;
}

.room-add-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #1677ff;
  font-size: 14px;
}

.room-add-link svg {
  width: 20px;
  height: 20px;
}

.room-group-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #777777;
  font-size: 13px;
}

.room-group-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f3f6ff;
}

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

.room-group-more {
  justify-self: center;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid #d7e3ff;
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.room-group-more:hover {
  background: #f2f6ff;
}

.room-card header,
.meter-card header,
.bill-card header,
.repair-card header,
.contract-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.room-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.room-meta span {
  padding: 9px;
  border-radius: 8px;
  background: #f5f7fd;
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  margin-top: 14px;
}

.room-card .card-actions {
  gap: 6px;
}

.room-state-card {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 92px;
  padding: 10px;
  border-color: #9bc2ff;
  background: #e7f1ff;
  box-shadow: none;
  overflow: visible;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  z-index: 0;
}

.room-state-card:hover,
.room-state-card:focus-within {
  border-color: #6ea2ff;
  box-shadow: 0 12px 30px rgba(70, 116, 190, 0.16);
  transform: translateY(-1px);
  z-index: 8;
}

.room-state-card.is-vacant {
  background: #ffffff;
}

.room-state-card h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  word-break: break-word;
}

.room-card-bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
}

.room-card-bottom strong {
  color: #999999;
  font-size: 12px;
}

.room-card-bottom .vacant-days,
.room-card-bottom .arrears-days {
  color: #ff7a1a;
}

.vacant-days {
  color: #ff7a1a !important;
}

.room-card-flags {
  display: flex;
  gap: 5px;
}

.room-flag {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 4px;
  background: #ff6b1a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.room-hover-panel {
  position: absolute;
  left: calc(100% + 14px);
  top: -92px;
  display: grid;
  gap: 10px;
  width: 340px;
  min-height: 355px;
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(42, 70, 118, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.room-hover-panel.is-vacant-panel {
  min-height: 167px;
}

.room-hover-panel::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 178px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: -7px 7px 12px rgba(42, 70, 118, 0.05);
}

.room-group-grid .room-state-card:nth-child(6n+4) .room-hover-panel,
.room-group-grid .room-state-card:nth-child(6n+5) .room-hover-panel,
.room-group-grid .room-state-card:nth-child(6n) .room-hover-panel {
  left: auto;
  right: calc(100% + 14px);
}

.room-group-grid .room-state-card:nth-child(6n+4) .room-hover-panel::before,
.room-group-grid .room-state-card:nth-child(6n+5) .room-hover-panel::before,
.room-group-grid .room-state-card:nth-child(6n) .room-hover-panel::before {
  left: auto;
  right: -8px;
  box-shadow: 7px -7px 12px rgba(42, 70, 118, 0.05);
}

.room-state-card:hover .room-hover-panel,
.room-state-card:focus-within .room-hover-panel,
.room-state-card.is-open .room-hover-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.room-state-card.is-open {
  z-index: 4;
}

.room-hover-panel h3 {
  position: relative;
  z-index: 1;
  margin: 4px 0 0;
  color: #111111;
  font-size: 16px;
}

.room-hover-detail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  min-height: 68px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: #f4f7ff;
  color: #111111;
  text-align: left;
}

.room-hover-detail span {
  display: flex;
  gap: 14px;
  align-items: center;
}

.room-hover-detail strong,
.room-hover-detail em {
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
}

.room-hover-detail small {
  grid-column: 1 / -1;
  color: #333333;
  font-size: 13px;
}

.room-hover-detail b {
  color: var(--primary);
  font-size: 14px;
}

.room-hover-vacant {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-height: 56px;
  padding: 8px 0;
}

.room-hover-vacant strong {
  color: #111111;
  font-size: 14px;
}

.room-hover-vacant span {
  justify-self: end;
  color: #ff7a1a;
  font-size: 13px;
}

.room-hover-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.room-hover-actions .secondary-button {
  min-height: 36px;
  color: #5b85ff;
  font-size: 14px;
}

.room-hover-actions.is-vacant-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-hover-alert {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  color: #222222;
  font-size: 13px;
}

.room-hover-alert::before {
  content: "欠";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #ff5b16;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.room-hover-tools {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 6px 4px 4px;
}

.room-hover-tools.is-vacant-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-hover-tools button {
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #222222;
  font-size: 13px;
}

.room-hover-tools i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3f5fb;
  color: #ffffff;
}

.room-hover-tools svg {
  width: 20px;
  height: 20px;
  padding: 4px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
}

.room-detail-dialog {
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.room-detail-body {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}

.room-detail-dialog .dialog-body {
  width: 100%;
  min-height: 100vh;
  border-radius: 0;
}

.room-detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: -6px -6px 8px;
  border-bottom: 1px solid #edf0f7;
}

.room-detail-tabs button {
  min-height: 48px;
  border: 0;
  border-right: 1px solid #edf0f7;
  background: #ffffff;
  color: #222222;
  font-size: 14px;
}

.room-detail-tabs button.active {
  background: #f2f5ff;
  color: #2f75ff;
}

.room-delete-action {
  justify-self: end;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #ff4d4f;
  font-size: 14px;
}

.room-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.room-detail-summary article {
  padding: 12px;
  border-radius: 8px;
  background: #f5f7fd;
}

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

.room-detail-summary span {
  color: var(--muted);
}

.room-detail-summary strong {
  margin-top: 6px;
  font-size: 16px;
}

.room-editor-dialog {
  width: min(820px, calc(100vw - 28px));
}

.room-editor-dialog .dialog-body {
  gap: 18px;
}

.room-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  align-items: end;
}

.room-editor-grid label,
.room-editor-more label,
.room-door-list label {
  display: grid;
  gap: 8px;
  color: #666666;
  font-size: 14px;
}

.required-mark {
  color: #ff4d4f;
}

.room-editor-create {
  grid-column: span 2;
}

.room-editor-tip {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #ffd76a;
  border-radius: 8px;
  background: #fff9df;
  color: #333333;
  font-size: 14px;
}

.room-door-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: #f5f7fd;
}

.room-door-list:empty {
  display: none;
}

.room-door-list label {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.room-door-list label span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #5d8cff;
  font-weight: 700;
}

.room-editor-more {
  border: 1px solid #edf0f7;
  border-radius: 10px;
  background: #ffffff;
}

.room-editor-more summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #2f75ff;
  font-size: 14px;
}

.room-editor-more .form-grid {
  padding: 0 14px 14px;
}

.checkin-page {
  min-height: calc(100vh - 112px);
  padding: 18px;
  border-radius: 10px;
  background: #ffffff;
}

.checkin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-bottom: 1px solid #eeeeee;
  color: #888888;
  font-size: 14px;
}

.checkin-breadcrumb button {
  border: 0;
  background: transparent;
  color: #888888;
  font-size: 14px;
}

.checkin-page > h2 {
  margin: 18px 0 12px;
  font-size: 18px;
}

.checkin-card {
  width: min(980px, 100%);
  min-height: 340px;
  padding: 18px;
  border-radius: 8px;
  background: #f4f7ff;
}

.checkin-card h3 {
  margin: 0 0 18px;
  color: #111111;
  font-size: 18px;
}

.checkin-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #666666;
  font-size: 14px;
}

.switch-pill {
  position: relative;
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #c3c4ca;
}

.switch-pill span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: left 0.16s ease;
}

.switch-pill[aria-pressed="true"] {
  background: #5d8cff;
}

.switch-pill[aria-pressed="true"] span {
  left: 21px;
}

.switch-pill.mini {
  width: 38px;
  height: 22px;
}

.checkin-form-grid {
  display: grid;
  grid-template-columns: 86px minmax(180px, 280px) 1fr minmax(180px, 240px);
  gap: 14px 18px;
  align-items: center;
}

.checkin-form-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666666;
  font-size: 14px;
}

.checkin-form-grid input,
.checkin-form-grid select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d9dce5;
  border-radius: 6px;
  background: #ffffff;
  color: #222222;
  font-size: 14px;
}

.checkin-form-grid input {
  padding: 0 12px;
}

.required-field span::before {
  content: "*";
  margin-right: 4px;
  color: #ff4d4f;
}

.checkin-period-buttons {
  display: grid;
  grid-template-columns: repeat(4, 68px);
  gap: 10px;
}

.checkin-period-buttons button,
.checkin-extra-actions button {
  min-height: 36px;
  border: 1px dashed #d8dce8;
  border-radius: 6px;
  background: #ffffff;
  color: #333333;
  font-size: 14px;
}

.checkin-source {
  grid-column: 1 / span 3;
}

.checkin-extra-actions {
  display: flex;
  gap: 14px;
  margin: 18px 0 30px 96px;
}

.checkin-extra-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}

.checkin-extra-actions svg {
  width: 16px;
  height: 16px;
  color: #5d8cff;
}

.checkin-next {
  display: flex;
  min-width: 90px;
  margin: 0 auto;
}

.control-band {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(30, 55, 92, 0.04);
}

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

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

th {
  background: #f5f7fd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

tbody tr:hover {
  background: #f8fbff;
}

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

.bill-summary article,
.contract-summary article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(30, 55, 92, 0.04);
}

.bill-summary span,
.contract-summary span,
td small {
  display: block;
  color: var(--muted);
}

.bill-summary strong,
.contract-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.money.income {
  color: var(--primary);
}

.money.expense {
  color: var(--red);
}

.meter-layout,
.repair-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bill-board,
.contract-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  width: 100%;
}

.bill-board > .table-wrap,
.contract-grid > .table-wrap,
.bill-board > .table-pagination,
.contract-grid > .table-pagination {
  min-width: 0;
  width: 100%;
}

.progress {
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: #eef3ff;
  overflow: hidden;
}

.progress span {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--primary);
}

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

.health-item,
.message-item,
.template-item {
  box-shadow: none;
}

.health-item strong,
.contract-card strong,
.meter-card strong,
.bill-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.message-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.message-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-item small,
.template-item small {
  display: block;
  margin-top: 5px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

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

.contract-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(1028px, calc(100vw - 220px));
  height: 100vh;
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(30, 55, 92, 0.18);
  transform: translateX(104%);
  transition: transform 0.18s ease;
}

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

.drawer-head,
.drawer-room-line,
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 20px;
}

.drawer-room-line {
  justify-content: flex-start;
  background: #ffffff;
}

.drawer-room-line strong {
  margin-right: auto;
}

.drawer-tabs {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #f5f7fd;
}

.drawer-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink);
}

.drawer-tabs button.active {
  border-bottom-color: var(--blue);
  color: var(--primary);
}

.drawer-content {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.detail-section {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-section-head::before {
  content: "";
  width: 6px;
  height: 24px;
  border-radius: 999px;
  background: var(--blue);
}

.detail-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.detail-edit {
  border: 0;
  background: transparent;
  color: #f97316;
}

.detail-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #f5f7fd;
}

.detail-panel.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-field {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
}

.detail-field span {
  min-width: 72px;
  color: var(--muted);
}

.detail-field strong {
  font-size: 15px;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
  width: 100%;
}

.media-thumb,
.media-upload-tile,
.media-empty {
  display: grid;
  place-items: center;
  min-height: 104px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1d4ed8;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
}

.media-thumb {
  position: relative;
  padding: 0;
  background: #f5f7fd;
}

.media-thumb-wrap {
  position: relative;
  min-width: 0;
}

.media-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  cursor: pointer;
}

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

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 104px;
  object-fit: cover;
}

.media-thumb small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #333333;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-upload-tile {
  border-style: dashed;
  background: #f7f9ff;
  color: var(--primary);
}

.media-upload-tile span,
.media-empty {
  color: var(--muted);
  font-size: 13px;
}

.drawer-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.drawer-stat-row article {
  min-width: 180px;
  padding: 14px;
  border-radius: 8px;
  background: #f5f7fd;
}

.drawer-stat-row span {
  display: block;
  color: var(--muted);
}

.drawer-stat-row strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

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

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

.text-area {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

dialog {
  width: min(480px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.code-display {
  padding: 20px;
  border-radius: 8px;
  background: #10212f;
  color: #ffffff;
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 4px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

select,
.field {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
}

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

.form-stack {
  display: grid;
  gap: 12px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff1f2;
  color: #be123c;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.dialog-copy {
  line-height: 1.7;
  color: var(--muted);
}

.action-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.permission-editor {
  display: grid;
  gap: 10px;
}

.permission-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}

.permission-check.all {
  border-color: rgba(22, 119, 255, 0.35);
  background: #eef5ff;
  font-weight: 700;
}

.permission-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.permission-save {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.role-template-manager {
  display: grid;
  gap: 14px;
}

.role-template-list,
.role-template-form {
  display: grid;
  gap: 10px;
}

.role-template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.role-template-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.role-template-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.preview-row strong {
  color: var(--ink);
  text-align: right;
}

.room-card-check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.room-card-check-grid button {
  min-height: 76px;
  border: 1px solid #e6ecf7;
  border-radius: 8px;
  background: #f6f9ff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.room-card-check-grid button strong,
.room-card-check-grid button span {
  display: block;
}

.room-card-check-grid button strong {
  margin-bottom: 6px;
  color: #1f7bff;
  font-size: 22px;
  line-height: 1;
}

.room-card-check-grid button span {
  color: var(--muted);
  font-size: 13px;
}

.mini-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #edf0f6;
  border-radius: 8px;
}

.mini-table-head,
.mini-table-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) repeat(3, minmax(52px, 0.6fr)) minmax(58px, 0.5fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.mini-table-head {
  background: #f5f7fd;
  color: #606266;
}

.mini-table-row {
  border-top: 1px solid #edf0f6;
  color: var(--muted);
}

.mini-table-row span:first-child {
  color: var(--ink);
  font-weight: 600;
}

.room-check-problems h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #10212f;
  color: white;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

menu {
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.nav-bottom {
  margin-top: auto;
}

.side-status {
  display: none;
}

.workbench-panel,
.module-panel {
  display: grid;
  gap: 12px;
  min-height: calc(100vh - 118px);
  padding: 0 0 20px;
  border-radius: 8px;
}

.workbench-device-tabs,
.module-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  min-height: 56px;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.workbench-device-tabs button,
.module-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #555555;
  font-size: 14px;
}

.workbench-device-tabs button:hover,
.module-tabs button.active,
.module-tabs button:hover {
  background: #f2f6ff;
  color: var(--primary);
}

.workbench-device-tabs svg {
  width: 20px;
  height: 20px;
}

.workbench-row,
.help-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 12px;
}

.workbench-card {
  padding: 20px;
  border-radius: 8px;
  background: #ffffff;
}

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

.text-link-button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
}

.workbench-mini-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-mini-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #111111;
  font-size: 13px;
}

.workbench-mini-search svg {
  width: 16px;
  height: 16px;
  color: #9aa2b2;
}

.mini-module-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mini-module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: #f3f6ff;
  color: #111111;
  text-align: left;
}

.mini-module-row:hover {
  background: #edf4ff;
}

.mini-module-row span {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.mini-module-row strong {
  overflow: hidden;
  color: #111111;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-module-row small {
  overflow: hidden;
  color: #666666;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-module-row em {
  flex: 0 0 auto;
  font-style: normal;
}

.mini-module-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.mini-module-actions .ghost-button {
  min-height: 28px;
  padding: 0 10px;
  border-color: #d7e3ff;
  background: #ffffff;
  color: var(--primary);
  font-size: 13px;
}

.mini-empty {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 18px;
  border-radius: 8px;
  background: #f3f6ff;
  color: #777777;
}

.mini-empty strong {
  color: #222222;
}

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

.finance-card {
  display: grid;
  gap: 12px;
  min-height: 132px;
  padding: 18px 20px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  text-align: left;
}

.finance-card:hover,
.todo-item:hover,
.apartment-data-grid button:hover,
.device-data-grid button:hover {
  background: #f7f9ff;
}

.finance-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.finance-card h2 small {
  color: #666666;
  font-size: 14px;
  font-weight: 400;
}

.finance-card div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
}

.finance-card strong {
  color: #333333;
  font-size: 14px;
}

.finance-card span {
  color: #111111;
  font-size: 18px;
  font-weight: 800;
}

.integration-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.integration-summary article,
.integration-card {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.integration-summary article {
  padding: 18px 20px;
}

.integration-summary span {
  color: #6b7280;
  font-size: 13px;
}

.integration-summary strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 24px;
}

.integration-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.integration-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.integration-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-card header p {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.integration-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-meta .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.integration-provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-provider-list span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

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

.integration-form-grid label {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 13px;
}

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

.integration-form-grid .field,
.integration-form-grid textarea {
  width: 100%;
  min-width: 0;
}

.integration-form-grid textarea {
  min-height: 104px;
  resize: vertical;
}

.integration-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.integration-test-result {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  background: #f8fafc;
}

.integration-test-result strong {
  color: #0f172a;
}

.integration-test-result small {
  color: #64748b;
  line-height: 1.6;
}

.integration-payload {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
}

.workbench-summary-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.45fr) minmax(260px, 0.8fr) minmax(300px, 1fr);
  gap: 12px;
}

.todo-card {
  min-height: 196px;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.todo-item,
.apartment-data-grid button,
.device-data-grid button {
  display: grid;
  place-items: center;
  min-height: 68px;
  border: 0;
  border-radius: 8px;
  background: #f5f7fd;
  color: #111111;
}

.todo-item strong,
.apartment-data-grid strong,
.device-data-grid strong {
  font-size: 22px;
  line-height: 1.1;
}

.todo-item span,
.apartment-data-grid span,
.device-data-grid span {
  color: #555555;
  font-size: 14px;
}

.apartment-data-grid,
.device-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.apartment-data-grid {
  grid-template-columns: repeat(3, minmax(82px, 1fr));
}

.section-title {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 24px;
  padding-left: 16px;
  color: #000000;
  font-size: 18px;
  font-weight: 800;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  width: 5px;
  height: 22px;
  border-radius: 999px;
  background: #6898fc;
}

.promotion-list {
  display: grid;
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: 8px;
  background: #f3f6ff;
}

.promotion-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #111111;
  text-align: left;
}

.promotion-row strong,
.promotion-row span,
.promo-circle span {
  font-size: 18px;
  font-weight: 800;
}

.promotion-row svg,
.arrow-link svg {
  color: var(--primary);
}

.promotion-card {
  position: relative;
  min-height: 198px;
}

.promo-circle {
  position: absolute;
  left: 50%;
  top: 58%;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #6898fc;
  color: #ffffff;
  transform: translate(-50%, -50%);
}

.arrow-link {
  position: absolute;
  right: 22%;
  top: 50%;
  border: 0;
  background: transparent;
}

.status-visual {
  display: grid;
  grid-template-columns: 360px minmax(420px, 1fr);
  gap: 44px;
  align-items: center;
  min-height: 230px;
  margin-top: 14px;
}

.donut-card {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-right: 1px solid var(--line);
}

.donut-ring {
  display: grid;
  place-items: center;
  position: relative;
  width: 174px;
  height: 174px;
  border-radius: 50%;
  background: conic-gradient(#7c96f8 var(--rate, 74%), #eeeeee 0);
}

.donut-ring::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #ffffff;
}

.donut-ring span,
.donut-ring small {
  position: relative;
  z-index: 1;
}

.donut-ring span {
  align-self: end;
  font-size: 20px;
  color: #666666;
}

.donut-ring small {
  align-self: start;
  margin-top: 4px;
  font-size: 14px;
}

.vacancy-bars {
  display: grid;
  gap: 17px;
}

.vacancy-bars h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.vacancy-bar {
  display: grid;
  grid-template-columns: 58px minmax(160px, 1fr) 36px;
  align-items: center;
  gap: 16px;
  color: #666666;
  font-size: 15px;
}

.vacancy-bar div {
  height: 10px;
  border-radius: 999px;
  background: #e8e8e8;
  overflow: hidden;
}

.vacancy-bar em {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: #ff3460;
}

.vacancy-bar strong {
  color: #000000;
}

.daily-card {
  min-height: 310px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin: 28px 0 0 42px;
  color: #666666;
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: -1px;
}

.chart-legend .in::before {
  background: #f6b800;
}

.chart-legend .out::before {
  background: #d8d8d8;
}

.line-chart svg {
  width: 100%;
  height: 260px;
  margin-top: 4px;
}

.line-chart line {
  stroke: #eeeeee;
  stroke-width: 1;
}

.line-chart polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-in {
  stroke: #f6b800;
}

.line-out {
  stroke: #d8d8d8;
}

.dot-in {
  fill: #f6b800;
}

.dot-out {
  fill: #d8d8d8;
}

.line-chart text {
  fill: #666666;
  font-size: 16px;
}

.module-panel {
  gap: 0;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
}

.module-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px;
  border-top: 1px solid var(--line);
}

.bill-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 24px 0;
}

.compact-filter {
  width: 190px;
  min-width: 190px;
  flex: 0 0 190px;
}

.filter-select,
.module-search {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 172px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid #d8dce5;
  border-radius: 8px;
  background: #ffffff;
  color: #b6b6b6;
}

.filter-select svg {
  width: 18px;
  height: 18px;
}

.module-search {
  min-width: min(380px, 100%);
  flex: 1;
  color: #999999;
}

.module-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #111111;
}

.tenant-search {
  min-width: min(360px, 100%);
}

.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 16px;
}

.module-table-wrap {
  margin: 0 20px 20px;
  border-radius: 0;
}

.page-table {
  min-width: 980px;
  font-size: 14px;
}

.page-table th {
  background: #f7f8fb;
  color: #555555;
  font-size: 14px;
  text-align: left;
}

.page-table th,
.page-table td {
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.page-table td small {
  display: block;
  margin-top: 4px;
}

.table-pagination-wrap {
  margin: -4px 20px 20px;
}

.module-table-wrap + .table-pagination-wrap,
.table-wrap + .table-pagination-wrap {
  width: calc(100% - 40px);
}

.compact-pagination {
  margin: 6px 0 0;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 12px 4px;
  color: #555555;
  font-size: 14px;
}

.compact-pagination .table-pagination {
  justify-content: flex-start;
  padding: 8px 0 0;
  font-size: 12px;
}

.bill-board > .table-pagination,
.contract-grid > .table-pagination {
  justify-content: flex-end;
  padding: 14px 4px 0;
}

.compact-pagination .table-pagination button {
  min-width: 30px;
  height: 30px;
}

.compact-pagination .table-pagination input {
  width: 48px;
  height: 30px;
}

.table-pagination button {
  min-width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #333333;
  cursor: pointer;
}

.table-pagination button.active {
  border-color: #6f9bff;
  color: #1677ff;
}

.table-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.table-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.table-pagination input {
  width: 58px;
  height: 34px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  text-align: center;
  outline: 0;
}

.pagination-ellipsis {
  padding: 0 2px;
  color: #999999;
}

.help-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.help-item,
.support-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9ff;
  text-align: left;
}

.help-item {
  grid-template-columns: 1fr auto;
}

.help-item small {
  grid-column: 1 / -1;
  line-height: 1.6;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.support-card {
  border: 0;
}

.support-card svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.room-detail-dialog {
  width: min(560px, 100vw);
}

@media (max-width: 1120px) {
  .metrics-grid,
  .data-grid,
  .workbench-finance-grid,
  .workbench-summary-grid,
  .workbench-row,
  .help-layout,
  .bill-summary,
  .contract-summary,
  .contract-form-grid,
  .meter-layout,
  .bill-board,
  .repair-board,
  .contract-grid,
  .overview-layout,
  .message-layout {
    grid-template-columns: 1fr 1fr;
  }

  .overview-layout,
  .message-layout,
  .workbench-summary-grid,
  .status-visual {
    grid-template-columns: 1fr;
  }

  .donut-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bill-board,
  .contract-grid {
    grid-template-columns: 1fr;
  }
}

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

  .brand div:not(.brand-mark),
  .nav-item span,
  .side-status div {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .sidebar {
    gap: 12px;
    padding: 18px 10px;
    border-radius: 0 20px 20px 0;
  }

  .brand {
    min-height: 104px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand span,
  .side-status span {
    font-size: 11px;
  }

  .nav-list {
    gap: 5px;
  }

  .nav-item {
    min-height: 42px;
    gap: 7px;
    padding: 0 10px;
    font-size: 13px;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .workspace {
    max-width: 100%;
    padding: 10px 14px 18px;
    overflow-x: hidden;
  }

  .topbar {
    min-height: 54px;
    margin-bottom: 12px;
    padding: 0 14px;
    gap: 10px;
  }

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

  .toolbar {
    gap: 8px;
  }

  .top-icon svg {
    width: 19px;
    height: 19px;
  }

  .user-chip {
    min-height: 42px;
    padding: 0 10px;
  }

  .avatar {
    width: 36px;
    height: 36px;
  }

  .workbench-panel,
  .module-panel,
  .room-state-panel {
    min-height: calc(100vh - 92px);
  }

  .workbench-row,
  .overview-layout,
  .help-layout,
  .message-layout {
    grid-template-columns: 1fr;
  }

  .workbench-finance-grid,
  .workbench-summary-grid,
  .bill-summary,
  .contract-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workbench-device-tabs,
  .module-tabs {
    min-height: 48px;
  }

  .workbench-device-tabs button,
  .module-tabs button {
    min-width: 100px;
    font-size: 13px;
  }

  .room-state-tabs,
  .module-tabs,
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .room-state-toolbar,
  .module-toolbar,
  .bill-filter-row {
    gap: 10px;
    padding: 12px 14px;
  }

  .room-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
  }

  .room-select,
  .mini-filter,
  .filter-select,
  .compact-filter {
    width: 150px;
    min-width: 150px;
    flex: 0 0 150px;
  }

  .room-search,
  .module-search {
    min-width: 260px;
    flex: 1 1 260px;
  }

  .room-count {
    margin-left: auto;
    white-space: nowrap;
  }

  .room-groups {
    gap: 16px;
    padding: 0 14px 34px;
  }

  .room-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .room-group-grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 8px 10px;
  }

  .room-state-card {
    min-height: 86px;
  }

  .room-state-card h2 {
    font-size: 14px;
  }

  .room-hover-panel {
    width: min(430px, calc(100vw - 170px));
  }

  .table-wrap,
  .module-table-wrap {
    width: calc(100% - 28px);
    max-width: calc(100vw - 154px);
    margin-left: 14px;
    margin-right: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .module-table-wrap + .table-pagination-wrap,
  .table-wrap + .table-pagination-wrap {
    width: calc(100% - 28px);
    margin-left: 14px;
    margin-right: 14px;
  }

  .contract-grid .table-wrap,
  .bill-board .table-wrap {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .contract-grid,
  .bill-board {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .contract-grid > .table-pagination,
  .bill-board > .table-pagination {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 0 0;
  }

  table,
  .page-table {
    min-width: 860px;
    font-size: 13px;
  }

  .contract-grid table,
  .bill-board table {
    min-width: 1160px;
  }

  th,
  td,
  .page-table th,
  .page-table td {
    padding: 9px 10px;
  }

  .contract-drawer {
    width: min(680px, 76vw);
  }

  .drawer-content {
    padding: 16px;
  }

  .drawer-actions {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
  }

  .detail-panel.two-cols,
  .drawer-stat-row {
    grid-template-columns: 1fr 1fr;
  }

  .table-pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-direction: row;
    align-items: center;
    overflow: auto;
    padding: 10px;
  }

  .brand,
  .side-status {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 6px;
  }

  .nav-item {
    width: 44px;
  }

  .workspace {
    padding: 16px;
  }

  .contract-drawer {
    width: 100vw;
  }

  .drawer-head,
  .drawer-room-line,
  .drawer-footer,
  .drawer-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-panel.two-cols,
  .contract-form-grid,
  .integration-form-grid {
    grid-template-columns: 1fr;
  }

  .integration-board,
  .integration-summary {
    grid-template-columns: 1fr;
  }

  .detail-section-head,
  .drawer-room-line,
  .drawer-stat-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .toolbar,
  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .metrics-grid,
  .data-grid,
  .workbench-device-tabs,
  .module-tabs,
  .workbench-row,
  .help-layout,
  .bill-summary,
  .contract-summary,
  .meter-layout,
  .bill-board,
  .repair-board,
  .contract-grid,
  .health-grid,
  .form-grid,
  .room-meta {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    gap: 8px;
  }

  .workbench-card {
    padding: 18px;
  }

  .module-toolbar,
  .device-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .module-table-wrap {
    margin-left: 16px;
    margin-right: 16px;
  }

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

  .room-hover-panel {
    left: 0 !important;
    right: auto !important;
    top: calc(100% + 10px);
    width: min(520px, calc(100vw - 48px));
  }

  .room-status-menu {
    grid-template-columns: repeat(3, minmax(86px, 1fr));
    max-width: calc(100vw - 48px);
  }

  .room-hover-panel::before {
    left: 32px !important;
    right: auto !important;
    top: -9px;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-size: 13px;
    background: #f5f7fd;
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100dvh;
    background: #f5f7fd;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px 8px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 18px rgba(30, 55, 92, 0.08);
    overflow: hidden;
  }

  .brand {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    min-height: auto;
    gap: 9px;
    text-align: left;
  }

  .brand div:not(.brand-mark) {
    display: block;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 18px;
  }

  .brand strong {
    font-size: 17px;
    line-height: 1.2;
  }

  .brand span {
    max-width: 280px;
    margin-top: 1px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 1px 0 3px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-bottom,
  .side-status {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-width: 72px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f5f7fd;
    font-size: 13px;
    white-space: nowrap;
  }

  .nav-item span {
    display: inline;
  }

  .nav-item svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
  }

  .workspace {
    width: 100%;
    max-width: 100vw;
    padding: 12px 10px 28px;
    overflow-x: hidden;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 10px;
  }

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

  .toolbar {
    display: grid;
    grid-template-columns: repeat(4, 38px) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin-left: 0;
    align-items: center;
  }

  .top-icon,
  .icon-button {
    min-width: 36px;
    min-height: 36px;
  }

  .user-chip {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f2f4f8;
  }

  .avatar {
    display: none;
  }

  .user-chip strong {
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .workbench-panel,
  .module-panel,
  .room-state-panel {
    min-height: auto;
    gap: 10px;
    padding-bottom: 14px;
    overflow-x: hidden;
  }

  .workbench-device-tabs,
  .module-tabs {
    display: flex;
    min-height: 40px;
    gap: 8px;
    padding: 4px;
    border-radius: 10px;
    background: #ffffff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .workbench-device-tabs button,
  .module-tabs button {
    flex: 0 0 auto;
    min-width: 88px;
    min-height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: #f5f7fd;
    font-size: 13px;
  }

  .workbench-device-tabs svg {
    display: none;
  }

  .workbench-row,
  .status-visual,
  .overview-layout,
  .help-layout,
  .room-state-toolbar,
  .room-filters,
  .module-toolbar,
  .section-actions,
  .bill-summary,
  .contract-summary,
  .meter-layout,
  .bill-board,
  .repair-board,
  .contract-grid,
  .health-grid,
  .form-grid,
  .room-meta {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .workbench-card,
  .panel,
  .room-card,
  .meter-card,
  .bill-card,
  .repair-card,
  .contract-card,
  .message-item,
  .template-item,
  .health-item {
    width: 100%;
    max-width: 100%;
    padding: 14px;
    border-radius: 10px;
  }

  .section-title {
    min-height: 22px;
    font-size: 17px;
  }

  .promotion-list {
    padding: 10px 12px;
  }

  .promotion-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: 34px;
  }

  .promotion-row strong,
  .promotion-row span {
    min-width: 0;
  }

  .promo-circle {
    width: 120px;
    height: 120px;
  }

  .donut-card {
    min-height: auto;
    padding: 10px 0;
  }

  .donut-ring {
    width: 168px;
    height: 168px;
  }

  .line-chart {
    overflow-x: auto;
  }

  .line-chart svg {
    min-width: 520px;
  }

  .room-state-tabs,
  .room-state-toolbar,
  .module-toolbar {
    padding: 10px;
  }

  .tabs,
  .room-status-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tabs button,
  .secondary-button,
  .primary-button {
    min-height: 36px;
    white-space: nowrap;
  }

  .room-select,
  .mini-filter,
  .room-search,
  .search-box,
  .field,
  select,
  input {
    width: 100%;
    max-width: 100%;
  }

  .data-grid,
  .room-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

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

  .module-table-wrap,
  .table-wrap {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  dialog {
    max-width: calc(100vw - 20px);
  }

  .dialog-body {
    width: min(100%, calc(100vw - 20px));
    padding: 14px;
  }

  .contract-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .drawer-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .room-hover-panel {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none;
    max-height: 78vh;
    overflow-y: auto;
  }

  .room-status-filter,
  .room-status-trigger {
    width: 100%;
  }

  .room-status-menu {
    left: 0;
    right: auto;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    width: min(290px, calc(100vw - 32px));
  }
}

@media (max-width: 420px) {
  .login-screen {
    padding: 16px;
  }

  .login-card {
    padding: 22px 18px;
  }

  .login-copy h1 {
    font-size: 24px;
  }

  .toolbar {
    grid-template-columns: repeat(4, 34px) minmax(0, 1fr);
  }

  .nav-item {
    min-width: 66px;
    padding: 0 9px;
    font-size: 12px;
  }

  .workbench-device-tabs button,
  .module-tabs button {
    min-width: 78px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  .workbench-finance-grid,
  .workbench-summary-grid,
  .todo-grid,
  .apartment-data-grid,
  .device-data-grid {
    grid-template-columns: 1fr;
  }

  .finance-card {
    min-height: 118px;
    padding: 16px;
  }

  .finance-card span {
    font-size: 16px;
  }

  .todo-item,
  .apartment-data-grid button,
  .device-data-grid button {
    min-height: 56px;
  }

  .mini-module-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .mini-module-row span {
    flex: 1 1 180px;
  }

  .mini-module-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .view,
  .view.active,
  #overview,
  #rooms,
  #locks,
  #tenants,
  #contracts,
  #bills,
  #repairs,
  #employees,
  #logs,
  #help,
  #messages {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .room-state-panel,
  .module-panel,
  .workbench-panel,
  .panel {
    border-radius: 10px;
    overflow: visible;
  }

  .room-state-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 50px;
    overflow: hidden;
  }

  .room-state-tabs .tabs {
    min-width: 0;
    overflow-x: auto;
  }

  .room-state-tabs .tabs button {
    min-width: 86px;
    min-height: 44px;
    font-size: 14px;
  }

  .room-check-card {
    min-width: 76px;
  }

  .room-tab-actions {
    gap: 6px;
    margin-right: 8px;
  }

  .room-export-button {
    min-width: 88px;
    padding-inline: 8px;
  }

  .room-state-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
  }

  .room-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .room-search,
  .room-help {
    grid-column: 1 / -1;
  }

  .room-count {
    justify-content: flex-start;
    width: 100%;
    padding: 0;
  }

  .room-add-whole {
    width: 100%;
    margin-left: 0;
  }

  .room-groups {
    gap: 14px;
    padding: 0 10px 28px;
  }

  .room-group-nav {
    margin: 0 -4px;
    padding: 8px 0;
  }

  .room-group-nav button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .room-group-head,
  .room-group-head > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .room-group-head strong {
    font-size: 18px;
  }

  .room-add-link {
    min-height: 32px;
  }

  .room-group-stats {
    gap: 6px;
    font-size: 12px;
  }

  .room-group-grid {
    grid-template-columns: repeat(2, minmax(138px, 1fr));
    gap: 8px;
  }

  .room-state-card {
    min-height: 88px;
    padding: 10px;
  }

  .room-state-card h2 {
    font-size: 14px;
    line-height: 1.3;
    word-break: break-word;
  }

  .room-card-bottom {
    align-items: end;
  }

  .room-card-bottom strong {
    font-size: 13px;
  }

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

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

  .mini-table-head,
  .mini-table-row {
    min-width: 520px;
  }

  .module-tabs,
  .workbench-device-tabs,
  .device-actions,
  .bill-filter-row,
  .control-band,
  .section-actions,
  .drawer-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .module-tabs::-webkit-scrollbar,
  .workbench-device-tabs::-webkit-scrollbar,
  .device-actions::-webkit-scrollbar,
  .bill-filter-row::-webkit-scrollbar,
  .control-band::-webkit-scrollbar,
  .section-actions::-webkit-scrollbar,
  .drawer-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-toolbar,
  .bill-filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .filter-select,
  .compact-filter,
  .module-search {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  .device-actions {
    display: flex;
    padding: 0 10px 10px;
  }

  .device-actions button {
    flex: 0 0 auto;
  }

  .module-table-wrap,
  .table-wrap {
    margin: 0 10px 12px;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .module-table-wrap + .table-pagination-wrap,
  .table-wrap + .table-pagination-wrap {
    width: calc(100% - 20px);
    margin: -2px 10px 14px;
  }

  table,
  .page-table {
    min-width: 620px;
    font-size: 12px;
  }

  .page-table th,
  .page-table td,
  th,
  td {
    height: auto;
    min-height: 42px;
    padding: 8px;
    white-space: nowrap;
  }

  td small {
    white-space: normal;
  }

  .table-pagination-wrap {
    margin: -4px 10px 14px;
  }

  .table-pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 4px 0;
    font-size: 12px;
  }

  .bill-board,
  .contract-grid {
    grid-template-columns: 1fr;
  }

  .bill-board > .table-pagination,
  .contract-grid > .table-pagination {
    width: 100%;
    padding: 10px 0 0;
  }

  .table-pagination button {
    min-width: 32px;
    height: 32px;
  }

  .table-pagination input {
    width: 52px;
    height: 32px;
  }

  .ghost-button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .bill-summary,
  .contract-summary {
    gap: 8px;
    margin: 0 10px 10px;
  }

  .bill-summary article,
  .contract-summary article {
    padding: 12px;
  }

  .bill-board,
  .repair-board,
  .contract-grid,
  .message-layout {
    gap: 10px;
  }

  .bill-card,
  .repair-card,
  .contract-card,
  .message-item {
    overflow: hidden;
  }

  .bill-card header,
  .repair-card header,
  .contract-card header,
  .message-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .bill-card strong,
  .contract-card strong,
  .repair-card strong {
    font-size: 14px;
    word-break: break-word;
  }

  .contract-drawer {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    border-radius: 0;
  }

  .drawer-head,
  .drawer-room-line,
  .drawer-footer {
    align-items: stretch;
    padding: 12px;
  }

  .drawer-head {
    grid-template-columns: 1fr auto;
  }

  .drawer-head h2 {
    font-size: 18px;
  }

  .drawer-tabs {
    gap: 14px;
    padding: 0 12px;
  }

  .drawer-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    font-size: 13px;
  }

  .drawer-content {
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .drawer-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .drawer-action {
    min-height: 72px;
    padding: 8px;
    font-size: 12px;
  }

  .detail-panel {
    padding: 12px;
  }

  .detail-panel.two-cols,
  .drawer-stat-row,
  .media-grid,
  .contract-form-grid,
  .room-editor-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .room-editor-create {
    grid-column: auto;
  }

  .room-door-list {
    padding: 12px;
  }

  .room-door-list label {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .drawer-stat-row article {
    min-width: 0;
  }

  .wide-dialog,
  dialog,
  .room-detail-dialog {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    overflow: auto;
  }

  .room-detail-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .room-detail-dialog .dialog-body {
    min-height: 100dvh;
    border-radius: 0;
  }

  .room-detail-body {
    max-height: calc(100dvh - 116px);
  }

  .dialog-body {
    padding: 12px;
  }

  .record-preview,
  .action-preview,
  .preview-row {
    min-width: 0;
  }

  .preview-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .room-group-grid {
    grid-template-columns: 1fr;
  }

  table,
  .page-table {
    min-width: 560px;
  }

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