/*
 * Native parity v4
 * Mirrors the SwiftUI NavigationSplitView/List/Form hierarchy and spacing.
 */

:root {
  --native-canvas: #ffffff;
  --native-sidebar: #f7f7f8;
  --native-group: #efedf0;
  --native-group-hover: #e8e6e9;
  --native-toolbar: rgba(255, 255, 255, 0.9);
  --native-selection: #0a7df0;
  --native-separator: rgba(60, 60, 67, 0.18);
  --native-control: #e9e7e9;
  --native-control-hover: #dedcdf;
  --native-orange: #f09a55;
  --native-purple: #bf42b6;
  --native-green: #5ac878;
  --native-blue: #0a84ff;
  --native-content-max: 1100px;
  --native-sidebar-width: 228px;
  --native-button-height: 34px;
}

body[data-theme="dark"] {
  --native-canvas: #1c1c1e;
  --native-sidebar: #242426;
  --native-group: #2c2c2e;
  --native-group-hover: #3a3a3c;
  --native-toolbar: rgba(28, 28, 30, 0.9);
  --native-selection: #0a84ff;
  --native-separator: rgba(84, 84, 88, 0.65);
  --native-control: #3a3a3c;
  --native-control-hover: #48484a;
}

.sf-symbol {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--sf-symbol) center / contain no-repeat;
  mask: var(--sf-symbol) center / contain no-repeat;
}

.ui-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: none;
}

body {
  font-size: 13px;
  line-height: 1.25;
}

.login-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background: var(--native-group);
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.login-card,
.tenant-unavailable {
  width: min(100%, 520px);
  border: 0;
  border-radius: 14px;
  background: var(--native-canvas);
  padding: 24px 28px 28px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
}

.login-card > h1 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
}

.login-intro {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 -8px 22px;
  padding: 18px 8px 22px;
  border-bottom: 1px solid var(--native-separator);
  text-align: center;
}

.login-logo {
  display: block;
  width: 72px;
  height: 88px;
  margin: 0;
  border-radius: 0;
}

.login-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-intro h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.login-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.login-card label {
  margin-top: 12px;
}

.login-card .primary {
  width: 100%;
  min-height: 34px;
  margin-top: 18px;
}

.login-secondary-actions {
  display: flex;
  width: min(100%, 520px);
  justify-content: center;
  gap: 2px;
  margin-top: 8px;
}

.login-secondary-actions button {
  position: static;
  inset: auto;
  width: auto;
  min-width: 0;
  min-height: 32px;
  height: auto;
  margin: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: none;
}

.login-secondary-actions button:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

#iosAppGateStatus:empty {
  display: none;
}

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

.login-support-actions {
  display: grid;
  gap: 8px;
  padding: 20px;
}

button,
.button-link,
.file-picker-button {
  display: inline-flex;
  min-height: var(--native-button-height);
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: var(--native-control);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
}

button:hover,
.button-link:hover,
.file-picker-button:hover {
  border-color: transparent;
  background: var(--native-control-hover);
}

button.icon-only {
  width: var(--native-button-height);
  min-width: var(--native-button-height);
  min-height: var(--native-button-height);
  border-radius: 8px;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.button-link:focus-visible,
[role="tab"]:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--native-blue) 42%, transparent);
  outline-offset: 2px;
}

button.primary,
.button-link.primary,
.file-picker-button {
  background: var(--native-selection);
  color: #fff;
}

input,
select,
textarea {
  min-height: 28px;
  border: 1px solid rgba(60, 60, 67, 0.28);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

textarea {
  min-height: 74px;
  padding: 7px 8px;
  line-height: 1.35;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--native-sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
  overflow: hidden;
  background: var(--native-canvas);
}

.app-sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-width: 0;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--native-separator);
  background: color-mix(in srgb, var(--native-sidebar) 94%, transparent);
  backdrop-filter: saturate(160%) blur(26px);
  -webkit-backdrop-filter: saturate(160%) blur(26px);
}

.brand-lockup {
  display: flex;
  min-height: 118px;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--native-separator) 42%, transparent);
  padding: 20px 22px 14px;
}

.app-logo {
  width: 42px;
  height: 52px;
  border-radius: 0;
  object-fit: contain;
}

.app-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-lockup > div {
  display: grid;
  gap: 1px;
}

.brand-lockup strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.08;
}

.brand-lockup span {
  color: var(--muted);
  font-size: 10px;
}

.tabs {
  position: static;
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 11px;
  box-shadow: none;
  backdrop-filter: none;
}

.tab {
  display: flex;
  min-height: 32px;
  flex: 0 0 32px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.tab .ui-icon {
  width: 16px;
  height: 16px;
}

.tab:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.tab.active {
  background: var(--native-selection);
  color: #fff;
  font-weight: 500;
}

.user-box {
  display: grid;
  gap: 2px;
  min-height: 62px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--native-separator) 42%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 13px 18px 15px;
}

.user-box #todayLabel,
.user-box .sync-status {
  display: none;
}

.user-box .tenant-label {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-box #currentUserLabel {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.user-actions {
  display: none;
}

.app-detail {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 51px minmax(0, 1fr);
  background: var(--native-canvas);
}

.app-detail > .topbar,
.app-detail > main {
  grid-column: 1;
}

.topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  min-height: 51px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--native-separator);
  background: var(--native-toolbar);
  padding: 0 14px 0 16px;
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
}

.topbar h1 {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.native-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

#toolbarSettingsButton {
  display: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--native-canvas) 80%, transparent);
}

#toolbarWorkReportButton {
  display: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--native-canvas) 80%, transparent);
}

#toolbarRevisionButton {
  display: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--native-canvas) 80%, transparent);
}

body[data-role="housekeeping"][data-view="revision"] #toolbarRevisionButton {
  display: inline-grid;
}

body[data-role="housekeeping"][data-view="housekeeping"] #toolbarWorkReportButton {
  display: inline-grid;
}

body[data-role="housekeeping"] #toolbarSettingsButton {
  display: inline-grid;
}

#refreshAppButton {
  border-radius: 50%;
  background: color-mix(in srgb, var(--native-canvas) 80%, transparent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

#refreshAppButton.refreshing .sf-symbol {
  animation: native-spin 700ms linear infinite;
}

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

.topbar-menu-button {
  display: none;
}

main {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: calc(100dvh - 51px);
  overflow: auto;
  background: var(--native-canvas);
  margin: 0;
  padding: 16px;
}

.view {
  width: min(100%, var(--native-content-max));
  min-height: calc(100dvh - 83px);
  margin: 0 auto;
}

.view > .section-heading:first-child {
  margin: 0;
}

#dashboardView > .native-page-heading,
#receptionView > .native-page-heading,
#historyView > .section-heading,
#minibarView > .section-heading,
#settingsView > .section-heading {
  height: 0;
  margin: 0;
}

#scheduleView > .section-heading > div:first-child,
#performanceView > .section-heading > div:first-child {
  display: none;
}

#scheduleView > .section-heading,
#performanceView > .section-heading {
  min-height: 38px;
  justify-content: flex-end;
  margin: 0 0 12px;
}

#dashboardView > .native-page-heading > div,
#dashboardView > .native-page-heading #dashboardUpdated,
#receptionView > .native-page-heading > div,
#historyView > .section-heading > div:first-child,
#minibarView > .section-heading > div:first-child,
#settingsView > .section-heading > div:first-child,
#settingsView > .section-heading > .hint {
  display: none;
}

#receptionView #openAssignmentDialog {
  position: fixed;
  z-index: 50;
  top: 10px;
  right: 14px;
  width: var(--native-button-height);
  min-width: var(--native-button-height);
  min-height: var(--native-button-height);
  border-radius: 50%;
  background: color-mix(in srgb, var(--native-canvas) 80%, transparent);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

body:not([data-view="reception"]) #openAssignmentDialog {
  display: none;
}

body[data-view="reception"] .native-toolbar-actions {
  padding-right: 36px;
}

.dashboard-metrics.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  overflow: visible;
  margin: 0 0 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-metrics.metrics > div {
  display: grid;
  min-height: 126px;
  align-content: start;
  gap: 7px;
  border: 0;
  border-radius: 15px;
  background: var(--native-group);
  padding: 15px 16px;
}

.dashboard-metrics.metrics > div:first-child,
.dashboard-metrics.metrics > div:last-child {
  border: 0;
}

.dashboard-metrics .metric-symbol {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--native-blue);
  font-size: 20px;
}

.dashboard-metrics > div:nth-child(1) .metric-symbol { color: var(--native-orange); }
.dashboard-metrics > div:nth-child(3) .metric-symbol { color: var(--native-green); }
.dashboard-metrics > div:nth-child(4) .metric-symbol { color: var(--native-purple); }

.dashboard-metrics strong {
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-metrics span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.native-list-section {
  margin-top: 24px;
}

.native-list-section > h3,
.dashboard-rooms-section .compact-heading h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
}

.native-list,
.dashboard-rooms-section .native-assignment-list {
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background: var(--native-group);
}

.native-status-row,
.native-action-row,
.native-navigation-row,
.reception-card,
.room-card {
  border-bottom: 1px solid var(--native-separator);
}

.native-status-row:last-child,
.native-action-row:last-child,
.native-navigation-row:last-child,
.reception-card:last-child,
.room-card:last-child {
  border-bottom: 0;
}

.dashboard-rooms-section .compact-heading {
  align-items: center;
  margin: 0 0 10px;
}

.dashboard-rooms-section .compact-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dashboard-rooms-section .compact-heading h3 {
  margin: 0;
}

.dashboard-rooms-section .filters {
  display: none;
}

#openDashboardAssignmentDialog,
#checkAllFinishedRooms {
  min-height: var(--native-button-height);
}

#checkAllFinishedRooms {
  background: var(--native-control);
  color: var(--ink);
}

.native-assignment-list .room-card,
.native-assignment-list .reception-card {
  border: 0;
  border-bottom: 1px solid var(--native-separator);
  border-radius: 0;
  background: transparent;
  padding: 12px 14px;
}

.native-assignment-list .room-card:last-child,
.native-assignment-list .reception-card:last-child {
  border-bottom: 0;
}

.dashboard-rooms-section .native-assignment-list {
  display: grid;
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-rooms-section .native-assignment-list .room-card,
.dashboard-rooms-section .native-assignment-list .reception-card,
.dashboard-rooms-section .native-assignment-list .room-card:last-child,
.dashboard-rooms-section .native-assignment-list .reception-card:last-child {
  border: 1px solid var(--native-separator);
  border-radius: 15px;
  background: var(--native-group);
  padding: 14px 16px;
}

@media (min-width: 56rem) {
  .dashboard-rooms-section .native-assignment-list .reception-card {
    grid-template-columns: minmax(170px, 0.7fr) minmax(240px, 1.25fr);
  }

  .dashboard-rooms-section .reception-card .room-card-head {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .dashboard-rooms-section .reception-card > .note {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    text-align: right;
  }

  .dashboard-rooms-section .reception-card > .requirements {
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch;
    text-align: right;
  }

  .dashboard-rooms-section .reception-card > .requirements .requirement-list {
    justify-content: flex-end;
  }

  .dashboard-rooms-section .reception-card > .card-meta {
    grid-column: 1 / -1;
    grid-row: 3;
    border-top: 0;
    padding-top: 0;
  }

  .dashboard-rooms-section .reception-card > .actions {
    grid-column: 1 / -1;
    grid-row: 4;
    align-self: stretch;
    margin-top: 0;
    border-top: 1px solid var(--native-separator);
    padding-top: 12px;
  }

  .dashboard-rooms-section .reception-card .action-row {
    display: flex;
    justify-content: flex-end;
  }
}

.native-reception-list {
  width: 100%;
}

#receptionView .native-list-section {
  margin-top: 0;
  padding-top: 10px;
}

#receptionView .native-list-section + .native-list-section {
  margin-top: 14px;
}

#receptionView .native-list-section > h3 {
  margin: 0;
  border-bottom: 1px solid var(--native-separator);
  padding: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

#receptionView .native-list {
  border-radius: 0;
  background: transparent;
}

#receptionView .native-action-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 6px 0;
}

#receptionView .native-action-row > div:first-child {
  display: none;
}

#receptionView .native-action-row .tools {
  width: 100%;
  justify-content: flex-start;
}

#receptionView .quick-contact .native-inline-field {
  flex: 1 1 260px;
  margin: 0;
}

#receptionView .quick-contact {
  flex-wrap: wrap;
}

#receptionView .quick-contact .tools {
  width: auto;
}

#receptionView .native-navigation-row {
  width: 100%;
  min-height: 43px;
  border-bottom: 1px solid var(--native-separator);
  border-radius: 0;
  background: transparent;
  padding: 6px 0;
}

#receptionView .native-navigation-row:hover {
  background: transparent;
}

#receptionView .native-row-icon {
  display: none;
}

#receptionView .native-navigation-row small {
  display: none;
}

#receptionView .native-chevron {
  display: none;
}

#receptionView #departureRooms {
  border-radius: 0;
}

#receptionView .departure-echo-button,
#receptionView .departure-echo-button .button-label {
  color: #fff;
}

#receptionView .native-empty-row {
  border-bottom: 1px solid var(--native-separator);
  padding: 9px 0;
  text-align: left;
}

#historyRooms.table-wrap,
#minibarView > .table-wrap {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.history-day-list,
.minibar-table tbody {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.history-day-row {
  min-height: 68px;
  border-bottom: 1px solid var(--native-separator);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
}

.history-day-row:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.history-day-row strong {
  font-size: 13px;
}

.history-day-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

#historyView .tools.inline,
#minibarView > .section-heading .tools.inline {
  position: fixed;
  z-index: 49;
  top: 10px;
  right: 52px;
  margin: 0;
}

#historyView .month-picker,
#minibarView .month-picker {
  display: none !important;
}

#minibarView #clearMinibar {
  display: none;
}

.minibar-table tbody tr:not(.minibar-day-separator):not(.minibar-empty-row) {
  min-height: 64px;
  border-bottom: 1px solid var(--native-separator);
  padding: 9px 0;
}

.minibar-table tr.minibar-day-separator,
.minibar-table .minibar-day-separator td {
  border-bottom: 1px solid var(--native-separator);
  background: transparent;
  padding: 18px 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.minibar-table tbody tr:not(.minibar-day-separator) td:first-child {
  font-size: 13px;
  font-weight: 700;
}

.minibar-table tbody tr:not(.minibar-day-separator) td:nth-child(2),
.minibar-table tbody tr:not(.minibar-day-separator) td:nth-child(3) {
  color: var(--muted);
  font-size: 11px;
}

.panel,
.settings-layout .panel,
.admin-forms .panel,
.admin-lists .panel,
.performance-panel,
.schedule-form {
  border: 0;
  border-radius: 12px;
  background: var(--native-group);
  box-shadow: none;
}

.admin-schedule-settings .native-switch-row {
  margin-top: 8px;
  border-radius: 11px;
  background: var(--native-canvas);
}

.schedule-day {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.schedule-day:hover {
  background: var(--native-group-hover);
}

.schedule-day:has(.schedule-shift-delete:hover) {
  cursor: default;
}

.schedule-day.selected {
  background: color-mix(in srgb, var(--native-selection) 5%, var(--native-canvas));
  box-shadow: inset 0 0 0 1px var(--native-selection);
}

.schedule-day.today {
  box-shadow: none;
}

.schedule-day-number {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  margin: -4px 0 0 -4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: var(--data-font);
  font-size: 13px;
  font-weight: 700;
}

.schedule-day-number:hover {
  background: var(--native-control-hover);
}

.schedule-day.today:not(.selected) .schedule-day-number {
  box-shadow: inset 0 0 0 1px var(--native-selection);
  color: var(--native-selection);
}

.schedule-day.selected .schedule-day-number {
  background: var(--native-selection);
  color: #fff;
}

.schedule-time-field.hidden {
  display: none;
}

.schedule-form {
  scroll-margin-top: 64px;
}

.settings-layout,
.admin-forms,
.admin-lists,
.performance-grid {
  gap: 14px;
}

.settings-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
}

#settingsView {
  margin-inline: auto;
}

.settings-layout .panel {
  padding: 16px;
}

.native-labeled-content {
  margin: 0;
}

.native-labeled-content > div,
.native-settings-links a {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--native-separator);
}

.native-labeled-content > div:first-child,
.native-settings-links a:first-child {
  border-top: 0;
}

.native-labeled-content dd {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.native-settings-links {
  display: grid;
  margin-top: 12px;
}

.native-settings-links a {
  color: var(--native-blue);
  text-decoration: none;
}

body[data-role="admin"] #historyView .tools.inline,
body[data-role="reception"] #historyView .tools.inline,
body[data-role="admin"] #minibarView > .section-heading .tools.inline,
body[data-role="reception"] #minibarView > .section-heading .tools.inline {
  display: none;
}

.panel-heading {
  margin-bottom: 12px;
}

.panel-heading h2 {
  font-size: 15px;
  font-weight: 700;
}

.detail-modal,
.superadmin-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  border: 1px solid var(--native-separator);
  border-radius: 18px;
  background: var(--native-canvas);
  padding: 0;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
}

.detail-modal::backdrop,
.superadmin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(2px);
}

.detail-modal .modal-head,
.superadmin-dialog .modal-head {
  position: sticky;
  top: 0;
  min-height: 69px;
  margin: 0;
  border-bottom: 1px solid var(--native-separator);
  background: var(--native-toolbar);
  padding: 19px 32px 16px;
}

.detail-modal .modal-head h2 {
  font-size: 17px;
  font-weight: 700;
}

.detail-modal .modal-head .eyebrow {
  display: none;
}

.detail-modal .modal-head > button {
  position: static;
  width: var(--native-button-height);
  min-width: var(--native-button-height);
  min-height: var(--native-button-height);
  border-radius: 50%;
}

.detail-modal #detailBody,
.revision-dialog #revisionTaskForm {
  padding: 24px 32px 28px;
}

.revision-dialog #revisionTaskForm {
  display: grid;
  gap: 14px;
}

.superadmin-dialog {
  width: min(480px, calc(100% - 32px));
}

.superadmin-dialog .superadmin-gate,
.superadmin-dialog .superadmin-login-card {
  display: grid;
  gap: 14px;
  padding: 24px 28px 28px;
}

.superadmin-dialog .superadmin-gate h2,
.superadmin-dialog .superadmin-login-card h2,
.superadmin-dialog .superadmin-gate p,
.superadmin-dialog .superadmin-login-card p {
  margin: 0;
}

.superadmin-dialog .superadmin-gate .tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.superadmin-dialog .superadmin-login-card .login-back {
  justify-self: start;
}

.superadmin-dialog .superadmin-login-card > button[type="submit"] {
  justify-self: end;
  margin-top: 6px;
  background: var(--native-selection);
  color: #fff;
}

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

.assignment-dialog #assignmentForm {
  display: grid;
  gap: 22px;
  padding: 24px 32px 0;
}

.assignment-dialog .modal-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 -32px;
  border-top: 1px solid var(--native-separator);
  background: var(--native-toolbar);
  padding: 17px 32px;
}

.assignment-dialog .modal-footer > button {
  width: 100%;
  min-width: 0;
  min-height: var(--native-button-height);
  margin: 0;
}

#assignmentDialog #cancelAssignmentEdit,
#assignmentDialog #assignmentSubmit {
  height: var(--native-button-height);
  min-height: var(--native-button-height);
  margin: 0;
}

.assignment-dialog .room-check-grid {
  overflow: hidden;
  border: 1px solid var(--native-separator);
  border-radius: 10px;
}

.assignment-dialog .room-check-grid > * {
  min-height: 48px;
}

.assignment-type-tabs,
.revision-tabs,
.filters {
  min-height: 28px;
  border-radius: 7px;
  background: var(--native-control);
  padding: 2px;
}

.assignment-type-tab,
.revision-filter,
.filter {
  min-height: 24px;
  border-radius: 5px;
  background: transparent;
  padding: 0 12px;
}

.assignment-type-tab.active,
.revision-filter.active,
.filter.active {
  background: var(--native-canvas);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

body[data-role="housekeeping"] .app-shell {
  display: block;
  background: var(--bg);
}

body[data-role="housekeeping"] .app-sidebar {
  position: fixed;
  z-index: 60;
  top: auto;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  display: block;
  width: auto;
  height: 62px;
  overflow: visible;
  border: 1px solid var(--native-separator);
  border-radius: 22px;
  background: color-mix(in srgb, var(--native-sidebar) 90%, transparent);
  box-shadow: 0 9px 34px rgba(0, 0, 0, 0.14);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

body[data-role="housekeeping"] .brand-lockup,
body[data-role="housekeeping"] .user-box {
  display: none;
}

body[data-role="housekeeping"] .tabs {
  display: grid;
  height: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
  padding: 4px;
}

body[data-role="housekeeping"] .tab {
  display: flex;
  min-height: 52px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border-radius: 18px;
  color: var(--muted);
  padding: 4px;
  font-size: 10px;
  text-align: center;
}

body[data-role="housekeeping"] .tab .ui-icon {
  width: 20px;
  height: 20px;
}

body[data-role="housekeeping"] .tab.active {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--native-blue);
  font-weight: 600;
}

body[data-role="housekeeping"] .app-detail {
  min-height: 100dvh;
  background: var(--bg);
}

body[data-role="housekeeping"] .topbar {
  background: color-mix(in srgb, var(--panel) 90%, transparent);
}

body[data-role="housekeeping"] .topbar h1 {
  font-size: 17px;
  text-align: center;
}

body[data-role="housekeeping"] main {
  height: calc(100dvh - 51px);
  background: var(--bg);
  padding: 16px 16px calc(88px + env(safe-area-inset-bottom));
}

body[data-role="housekeeping"] .view {
  width: min(100%, 760px);
  margin: 0 auto;
}

body[data-role="housekeeping"] #housekeepingView > .section-heading {
  display: none;
}

body[data-role="housekeeping"] #historyView > .section-heading .tools.inline,
body[data-role="housekeeping"] #minibarView > .section-heading .tools.inline {
  display: none;
}

body[data-role="housekeeping"] #revisionView > .revision-hero {
  display: none;
}

body[data-role="housekeeping"] #revisionView .revision-toolbar {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

body[data-role="housekeeping"] #revisionView .revision-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-role="housekeeping"] .housekeeping-segment {
  width: 100%;
  margin: 0 0 18px;
}

body[data-role="housekeeping"] .native-list-section > h3 {
  margin-left: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

body[data-role="housekeeping"] .housekeeping-alert-section:has(#dutyStartControl:not(.hidden)) {
  display: block !important;
}

body[data-role="housekeeping"] .housekeeping-live-alerts:has(#dutyStartControl:not(.hidden)) {
  display: grid !important;
  gap: 10px;
}

.native-duty-control {
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
}

.native-switch-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 10px 14px;
}

.native-switch-row > span {
  display: grid;
  gap: 3px;
}

.native-switch-row small {
  color: var(--muted);
  font-size: 11px;
}

.native-switch-row input[role="switch"] {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  min-width: 42px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 28%, transparent);
  padding: 0;
  transition: background-color 160ms ease;
}

.native-switch-row input[role="switch"]::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 160ms ease;
}

.native-switch-row input[role="switch"]:checked {
  background: var(--native-green);
}

.native-switch-row input[role="switch"]:checked::after {
  transform: translateX(18px);
}

body[data-role="housekeeping"] .native-list-section {
  margin-top: 18px;
}

body[data-role="housekeeping"] .housekeeping-extra-work {
  width: min(560px, calc(100% - 32px));
  border-radius: 12px;
  background: var(--native-canvas);
}

.housekeeping-extra-work .additional-work-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

@media (max-width: 520px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .login-screen {
    min-height: 100svh;
    align-content: start;
    place-items: initial;
    overflow-y: auto;
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  }

  .login-card,
  .tenant-unavailable {
    width: 100%;
    border-radius: 16px;
    padding: 18px 18px 20px;
  }

  .login-card > h1 {
    margin-bottom: 10px;
    font-size: 19px;
  }

  .login-intro {
    gap: 5px;
    margin: 0 0 14px;
    padding: 6px 4px 14px;
  }

  .login-logo {
    width: 50px;
    height: 62px;
  }

  .login-intro h2 {
    font-size: 20px;
  }

  .login-intro p {
    font-size: 12px;
    line-height: 1.35;
  }

  .login-card label {
    margin-top: 9px;
    font-size: 14px;
  }

  .login-card input,
  .login-card select,
  input,
  select,
  textarea {
    max-width: 100%;
    font-size: 16px;
  }

  .remember-login-control {
    margin-top: 12px;
  }

  .remember-login-hint {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.35;
  }

  .login-card .primary {
    min-height: 48px;
    margin-top: 14px;
  }

  .login-secondary-actions {
    width: 100%;
    margin-top: 5px;
  }

  .app-shell {
    display: block;
    max-width: 100%;
    overflow: visible;
  }

  .app-sidebar {
    position: fixed;
    z-index: 60;
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    display: block;
    width: auto;
    height: 62px;
    overflow: visible;
    border: 1px solid var(--native-separator);
    border-radius: 22px;
    background: color-mix(in srgb, var(--native-sidebar) 90%, transparent);
    box-shadow: 0 9px 34px rgba(0, 0, 0, 0.14);
  }

  .brand-lockup,
  .user-box {
    display: none;
  }

  .tabs {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    overflow: hidden;
    padding: 4px;
  }

  .tab {
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 18px;
    padding: 4px;
    font-size: 9px;
    text-align: center;
  }

  .tab.active {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
    color: var(--native-blue);
  }

  .app-detail {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
  }

  .topbar {
    gap: 4px;
    background: var(--native-canvas);
    padding-right: 10px;
    padding-left: 14px;
  }

  .native-toolbar-actions {
    min-width: 0;
    flex: 0 0 auto;
    gap: 2px;
  }

  .topbar-menu-button {
    display: none;
  }

  main {
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 51px);
    overflow-x: hidden;
    padding: 14px 14px calc(88px + env(safe-area-inset-bottom));
  }

  button,
  .button-link,
  .file-picker-button {
    min-height: 44px;
  }

  button.icon-only {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
  }

  .view {
    width: 100%;
    max-width: 100%;
    min-height: calc(100dvh - 153px);
  }

  body[data-role="housekeeping"] .housekeeping-segment {
    position: sticky;
    z-index: 12;
    top: 0;
    margin-bottom: 18px;
  }

  body[data-role="housekeeping"] #housekeepingRooms {
    display: grid;
    gap: 12px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body[data-role="housekeeping"] #housekeepingRooms > .room-card,
  body[data-role="housekeeping"] #housekeepingRooms > .room-card:last-child {
    overflow: hidden;
    border: 1px solid var(--native-separator);
    border-radius: 16px;
    background: var(--native-canvas);
  }

  .tools,
  .row-actions,
  .action-row {
    max-width: 100%;
  }

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

  .dashboard-metrics > div {
    min-height: 112px;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #receptionView #openAssignmentDialog {
    right: 14px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  body[data-view="reception"] .native-toolbar-actions {
    padding-right: 48px;
  }

  .detail-modal,
  .superadmin-dialog,
  .assignment-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 10px);
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .detail-modal .modal-head,
  .assignment-dialog .modal-head {
    padding: 16px 18px;
  }

  .assignment-dialog #assignmentForm {
    padding: 18px 18px 0;
  }

  .assignment-dialog .modal-footer {
    margin: 0 -18px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  }
}

@media (pointer: coarse) {
  :root {
    --native-button-height: 44px;
  }

  button,
  .button-link,
  .file-picker-button,
  [role="tab"] {
    min-height: 44px;
  }

  button.icon-only {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --native-separator: rgba(60, 60, 67, 0.45);
  }

  body[data-theme="dark"] {
    --native-separator: rgba(235, 235, 245, 0.48);
  }
}
