:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #fff;
  --panel-soft: #fafbfc;
  --line: #dde2e8;
  --line-strong: #c7ced8;
  --text: #17202a;
  --muted: #687586;
  --accent: #ce003d;
  --accent-dark: #a90032;
  --accent-soft: #fff0f4;
  --accent-ring: rgba(206, 0, 61, .22);
  --ok: #007c72;
  --ok-soft: #e8f6f4;
  --warn: #b25a00;
  --bad: #b42318;
  --shadow: 0 18px 42px rgba(23, 32, 42, .10);
  --shadow-soft: 0 8px 22px rgba(23, 32, 42, .08);
  --map-zoom-factor: 1;
  --room-popup-left: 50%;
  --room-popup-top: 50%;
  --room-popup-right: auto;
  --room-popup-bottom: auto;
  --room-popup-translate-x: -50%;
  --room-popup-translate-y: -50%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 8% 0%, rgba(206, 0, 61, .08), transparent 28%),
    linear-gradient(180deg, #fff 0%, var(--bg) 180px);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.login-landing {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(22px, 5vw, 64px);
  background:
    url("/uploads/foi-zgrada-cb.png") center / cover no-repeat,
    #9aa1a9;
  background-blend-mode: multiply, normal;
}

.login-landing::before {
  display: none;
}

.login-landing::after {
  display: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  display: grid;
  gap: 22px;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .78)),
    rgba(255, 255, 255, .82);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px) saturate(140%);
}

.login-eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.login-card h1 {
  max-width: 12ch;
  color: #101822;
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 950;
  letter-spacing: -.055em;
  line-height: .92;
}

.login-card p {
  max-width: 34rem;
  color: #314153;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 760;
  line-height: 1.28;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.login-card .button-link {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 22px;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(16, 24, 34, .12);
}

.login-card .button-link.primary {
  border-color: #ce003d;
  background: linear-gradient(135deg, #ce003d, #a90032);
}

.login-card .button-link:not(.primary) {
  border-color: rgba(16, 24, 34, .16);
  background: rgba(255, 255, 255, .74);
}

@media (max-width: 620px) {
  .login-landing {
    align-items: end;
    padding: 18px;
  }

  .login-card {
    border-radius: 22px;
  }

  .login-card h1 {
    max-width: 8ch;
  }

  .login-actions,
  .login-card .button-link {
    width: 100%;
  }

  .login-card .button-link {
    justify-content: center;
  }
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 760;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

button:hover,
.button-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.button-link.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-link.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

button:active,
.button-link:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.button-link.disabled,
.button-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
  pointer-events: none;
}

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

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

button.danger {
  color: var(--bad);
}

.button-link.compact,
button.compact {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

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

.crud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.edit-mode-banner {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(206, 0, 61, .13), rgba(255, 255, 255, .94) 52%),
    #fff;
  box-shadow: 0 6px 18px rgba(23, 32, 42, .18);
}

.edit-mode-banner > div {
  display: grid;
  gap: 0;
}

.edit-mode-banner strong {
  font-size: 11px;
  font-weight: 900;
}

.edit-mode-banner [data-room-editing-status] {
  color: var(--bad);
  font-size: 9px;
  font-weight: 800;
}

.room-editing-enabled .edit-mode-banner {
  border-color: var(--ok);
  background:
    linear-gradient(135deg, rgba(0, 124, 114, .15), rgba(255, 255, 255, .96) 52%),
    #fff;
  box-shadow: 0 6px 18px rgba(0, 124, 114, .18);
}

.room-editing-enabled .edit-mode-banner [data-room-editing-status] {
  color: var(--ok);
}

.edit-mode-toggle {
  position: relative;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.edit-mode-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.edit-mode-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 3px rgba(23, 32, 42, .22);
  transition: background .18s ease, box-shadow .18s ease;
}

.edit-mode-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 32, 42, .24);
  transition: transform .18s ease;
}

.edit-mode-toggle input:checked + .edit-mode-switch {
  background: var(--ok);
}

.edit-mode-toggle input:checked + .edit-mode-switch span {
  transform: translateX(16px);
}

.edit-mode-toggle-text {
  display: none;
}

.edit-mode-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edit-mode-undo {
  min-height: 26px;
  padding: 0 8px;
}

.edit-mode-undo[hidden] {
  display: none !important;
}

.header-menu {
  position: relative;
  flex: 0 0 auto;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  padding: 9px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-color: var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  color: var(--text);
}

.menu-toggle span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform .18s ease, opacity .18s ease, width .18s ease;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  color: var(--accent);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  width: 8px;
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.crud-actions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.crud-actions[hidden],
.searchable-select-menu[hidden],
.app-modal-backdrop[hidden],
.employee-row[hidden],
.room-area[hidden],
.room-table tr[hidden],
[data-add-employee-section][hidden],
.capacity-message[hidden] {
  display: none !important;
}

.crud-actions form,
.action-submenu,
.action-submenu-items {
  display: grid;
  gap: 8px;
}

.crud-actions button,
.crud-actions .button-link {
  width: 100%;
  justify-content: center;
}

.menu-lock-link {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}

.menu-lock-link:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.lock-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cog-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.action-submenu {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.action-submenu-nested {
  background: #fff;
}

.action-submenu summary {
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  list-style-position: inside;
}

.action-submenu-nested summary {
  font-size: 14px;
}

.action-submenu-items {
  margin-top: 8px;
}

.flash {
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.flash-close {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  font-size: 20px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}

.flash-close:hover {
  background: rgba(0, 0, 0, .08);
}

.flash.success {
  background: var(--ok-soft);
  color: var(--ok);
}

.flash.error {
  background: #fff4f2;
  color: var(--bad);
}

.crud-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(320px, 380px);
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.crud-panel {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.left-sidebar,
.office-editor-column,
.office-editor-panel,
.rooms-panel {
  max-height: 100%;
  overflow: auto;
}

.office-editor-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  overflow: hidden;
}

.office-editor-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.office-editor-panel.room-editing-locked {
  position: relative;
}

.office-editor-panel.room-editing-locked::before {
  content: "Uređivanje je zaključano";
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -4px -4px 0;
  padding: 9px 10px;
  border: 1px solid rgba(180, 35, 24, .22);
  border-radius: 8px;
  background: #fff4f2;
  color: var(--bad);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.office-editor-panel.room-editing-locked form,
.office-editor-panel.room-editing-locked .crud-section {
  opacity: .58;
}

.rooms-panel.room-editing-locked .room-area,
.rooms-panel.room-editing-locked [data-room-edit-link] {
  cursor: not-allowed;
}

.office-editor-panel > .panel-header {
  margin: -12px -12px 0;
  border-radius: 10px 10px 0 0;
}

.office-editor-panel > .crud-form,
.office-editor-panel > .crud-section,
.office-editor-panel > .empty-message {
  margin: 0;
}

.office-editor-panel > .crud-section {
  padding-top: 14px;
}

.office-editor-panel > .crud-section h3 {
  margin-bottom: 10px;
}

.office-editor-panel > [data-add-employee-section] {
  display: grid;
  gap: 12px;
}

.office-editor-panel > .capacity-message {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.editor-flash-region .flash {
  margin: 0;
}

.office-editor-panel > .crud-section:last-child .danger {
  width: 100%;
  justify-content: center;
}

.left-sidebar {
  overscroll-behavior: contain;
}

.rooms-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.panel-header {
  min-height: 52px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--panel-soft));
}

.panel-header h2 {
  font-weight: 750;
}

.counter {
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.crud-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.empty-message {
  padding: 14px;
  color: var(--muted);
  font-size: 14px;
}

.form-note,
.employee-search-count {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.floor-dropdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.floor-dropdown summary {
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  list-style: none;
}

.floor-dropdown summary::-webkit-details-marker {
  display: none;
}

.floor-dropdown summary::after,
.searchable-select-caret {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.floor-dropdown[open] summary {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.floor-dropdown[open] summary::after {
  transform: rotate(225deg);
}

.floor-dropdown summary > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.floor-dropdown summary small,
.floor-dropdown summary span:last-child {
  font-size: 11px;
  font-weight: 700;
  opacity: .82;
}

.floor-dropdown summary span:last-child {
  margin-left: auto;
  white-space: nowrap;
}

.floor-dropdown summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.floor-list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.floor-list a {
  min-height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.floor-list a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.floor-list span {
  color: inherit;
  font-size: 12px;
  opacity: .75;
}

.available-filter,
.employee-unassigned-filter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 32, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .85);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.available-filter {
  min-height: 44px;
  margin: 8px 0 0;
  padding: 8px 10px 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.employee-unassigned-filter {
  min-height: 40px;
  margin: 8px 0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
}

.available-filter:hover,
.employee-unassigned-filter:hover {
  border-color: rgba(206, 0, 61, .35);
  box-shadow: 0 0 0 3px var(--accent-ring), 0 1px 2px rgba(23, 32, 42, .06);
}

.available-filter input,
.employee-unassigned-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.available-filter-text {
  min-width: 0;
  line-height: 1.2;
  white-space: normal;
}

.available-switch,
.mini-switch {
  position: relative;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 3px rgba(23, 32, 42, .22);
  transition: background .18s ease, box-shadow .18s ease;
}

.available-switch {
  width: 48px;
  height: 26px;
}

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

.available-switch-knob,
.mini-switch span {
  position: absolute;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 32, 42, .24);
  transition: transform .18s ease;
}

.available-switch-knob {
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
}

.mini-switch span {
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
}

.available-filter input:checked + .available-switch,
.employee-unassigned-filter input:checked + .mini-switch {
  background: var(--accent);
}

.available-filter input:checked + .available-switch .available-switch-knob {
  transform: translateX(22px);
}

.employee-unassigned-filter input:checked + .mini-switch span {
  transform: translateX(16px);
}

.room-availability-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.room-availability-counts span {
  min-height: 48px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  box-shadow: 0 1px 2px rgba(23, 32, 42, .05);
}

.room-availability-counts strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.room-availability-counts span:first-child strong {
  color: var(--ok);
}

.room-availability-counts span:last-child strong {
  color: var(--warn);
}

.employee-search-box,
.crud-form {
  display: grid;
  gap: 10px;
}

.employee-search-box {
  width: 100%;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.crud-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.crud-search,
.crud-form input,
.crud-form select,
.searchable-select-search {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.crud-search {
  min-height: 40px;
  margin: 0;
  border-radius: 8px;
  padding: 0 12px;
  box-shadow: 0 1px 2px rgba(23, 32, 42, .05);
}

.employee-search-box .search {
  width: 100%;
  margin: 0;
}

.crud-search:focus,
.crud-form input:focus,
.crud-form select:focus,
.searchable-select-search:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.employee-search-count {
  margin: 0 0 10px;
  font-size: 11px;
}

.employee-directory,
.assigned-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.employee-row {
  padding: 9px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-row.is-clickable {
  cursor: pointer;
}

.employee-row.is-clickable:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.assigned-row {
  grid-template-columns: 36px 1fr auto;
}

.employee-row-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

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

.employee-row span,
.room-table small,
.assigned-row small {
  color: var(--muted);
  font-size: 12px;
}

.room-table small,
.assigned-row small {
  display: block;
}

.employee-row-avatar,
.employee-mini-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(23, 32, 42, .18);
}

.employee-row-avatar span,
.employee-mini-avatar {
  color: #fff;
}

.employee-row-avatar img,
img.employee-mini-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

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

.assigned-row > span:not(.employee-row-avatar) {
  min-width: 0;
}

.assigned-row button {
  min-width: 34px;
  padding: 0 8px;
}

.searchable-select {
  position: relative;
  display: block;
}

.searchable-native-select {
  position: absolute;
  inset: auto auto 0 0;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.searchable-select-button {
  width: 100%;
  min-height: 38px;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(23, 32, 42, .05);
}

.searchable-select-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-button:hover,
.searchable-select.open .searchable-select-button {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.searchable-select-caret {
  width: 8px;
  height: 8px;
  opacity: .72;
  transform: rotate(45deg) translateY(-2px);
}

.searchable-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.searchable-select-options {
  display: grid;
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.searchable-select-option {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.searchable-select-option:last-child {
  border-bottom: 0;
}

.searchable-select-option:hover,
.searchable-select-option.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.searchable-select-option .employee-mini-avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.searchable-select-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchable-select-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.floor-header-actions,
.editor-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.floor-canvas {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  cursor: grab;
  overscroll-behavior: contain;
  background:
    linear-gradient(90deg, rgba(23, 32, 42, .035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 32, 42, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  touch-action: none;
}

.crud-floor-canvas {
  min-height: 430px;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--panel-soft);
}

.floor-canvas.panning {
  cursor: grabbing;
  user-select: none;
}

.plan-wrap {
  position: relative;
  min-width: 1323px;
  width: 135%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.plan-wrap img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

.plan-wrap.drawing-enabled {
  cursor: crosshair;
}

.map-zoom-controls {
  display: inline-flex;
  align-items: center;
}

.map-zoom-controls button,
.map-zoom-controls .map-login-lock {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 0;
  font-size: 17px;
  line-height: 1;
}

.map-zoom-controls button:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.map-zoom-controls > :not(:first-child) {
  margin-left: -1px;
}

.map-zoom-controls > :last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}


.map-zoom-controls button:disabled {
  cursor: not-allowed;
  opacity: .45;
}


.room-area,
.room-draft {
  position: absolute;
  z-index: 2;
  padding: 0;
}

.map-360-ping {
  position: absolute;
  z-index: 12;
  width: clamp(2em, calc(2.625em * var(--map-zoom-factor, 1)), 3.625em);
  height: clamp(2em, calc(2.625em * var(--map-zoom-factor, 1)), 3.625em);
  min-height: 0;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  box-shadow: 0 3px 12px rgba(23, 32, 42, .38);
  cursor: pointer;
}

.map-360-ping img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.map-360-ping:hover,
.map-360-ping:focus-visible,
.map-360-ping.active {
  z-index: 14;
  transform: translate(-50%, -50%) scale(1.1);
}

.map-page-canvas.is-zoomed-out .map-360-ping {
  width: clamp(1.125em, calc(1.25em * var(--map-zoom-factor, 1)), 1.875em);
  height: clamp(1.125em, calc(1.25em * var(--map-zoom-factor, 1)), 1.875em);
  border-width: 1px;
  box-shadow: 0 1px 4px rgba(23, 32, 42, .24);
}

@media (max-width: 720px) {
  .map-360-ping {
    width: clamp(1.5em, calc(1.875em * var(--map-zoom-factor, 1)), 2.375em);
    height: clamp(1.5em, calc(1.875em * var(--map-zoom-factor, 1)), 2.375em);
    border-width: 1px;
    box-shadow: 0 2px 8px rgba(23, 32, 42, .28);
  }

  .map-360-ping:hover,
  .map-360-ping:focus-visible,
  .map-360-ping.active {
    transform: translate(-50%, -50%) scale(1.06);
  }

  .map-page-canvas.is-zoomed-out .map-360-ping {
    width: clamp(.9375em, calc(1.0625em * var(--map-zoom-factor, 1)), 1.5625em);
    height: clamp(.9375em, calc(1.0625em * var(--map-zoom-factor, 1)), 1.5625em);
  }
}

@media (min-width: 1180px) {
  .map-page-canvas.is-zoomed-out .map-360-ping {
    width: clamp(1.75em, calc(2em * var(--map-zoom-factor, 1)), 2.5em);
    height: clamp(1.75em, calc(2em * var(--map-zoom-factor, 1)), 2.5em);
  }
}

.placing-map-ping [data-map-root] {
  cursor: crosshair;
}

.ping-editor-list,
.office-editor-panel.room-editing-locked .ping-editor-list {
  opacity: 1;
}

.ping-editor-list .panel-header {
  margin-bottom: 10px;
}

.ping-editor-list-items {
  display: grid;
  gap: 8px;
}

.ping-editor-list-items button {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}

.ping-editor-list-items button:hover,
.ping-editor-list-items button:focus-visible {
  border-color: #1769aa;
  background: rgba(23, 105, 170, .08);
}

.ping-editor-list-items small {
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-modal-backdrop.map-360-modal-backdrop {
  z-index: 300;
  padding: 0;
  background: rgba(23, 32, 42, .42);
}

.app-modal.map-360-modal {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.map-360-modal-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.map-360-frame {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: var(--panel-soft);
}

.map-360-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
}

.map-360-modal-close {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
}

.map-360-modal-close span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .app-modal-backdrop.map-360-modal-backdrop {
    place-items: center;
    padding: 0;
  }
}


.room-area {
  container-type: size;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  border: 2px solid rgba(0, 124, 114, .30);
  border-radius: 2px;
  background: rgba(0, 124, 114, .065);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.plan-wrap:not(.has-active-room) .room-area:not(.active):hover {
  z-index: 7;
  overflow: visible;
  border-color: var(--accent);
  background: rgba(206, 0, 61, .10);
}

.room-area.full {
  border-color: rgba(178, 77, 0, .65);
  background: rgba(178, 77, 0, .10);
}

.room-area.lecture-hall {
  border-color: rgba(126, 58, 242, .58);
  background: rgba(126, 58, 242, .14);
}

.room-area.active,
.room-draft.active {
  border-color: var(--accent);
  background: rgba(206, 0, 61, .14);
  outline: 3px solid var(--accent-ring);
  z-index: 8;
  cursor: move;
}

.map-page .room-area.search-highlight {
  z-index: 13;
  overflow: visible;
  border-width: max(5px, calc(6px * var(--map-zoom-factor, 1))) !important;
  border-style: solid !important;
}

.room-area.moving,
.room-draft.moving {
  z-index: 10;
  cursor: grabbing;
  user-select: none;
  box-shadow: 0 12px 26px rgba(23, 32, 42, .22);
}

.room-draft {
  border: 2px dashed var(--accent);
  background: rgba(206, 0, 61, .12);
  cursor: move;
}

.polygon-draft-overlay {
  position: absolute;
  inset: 0;
  z-index: 11;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.polygon-draft-overlay polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 7 5;
  vector-effect: non-scaling-stroke;
}

.polygon-draft-point {
  position: absolute;
  z-index: 14;
  width: 14px;
  height: 14px;
  min-height: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(23, 32, 42, .34);
  transform: translate(-50%, -50%);
}

.polygon-draft-point.can-close {
  width: 20px;
  height: 20px;
  border-color: #fff;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(0, 124, 114, .25), 0 2px 8px rgba(23, 32, 42, .34);
}

.room-label {
  pointer-events: none;
  position: absolute;
  inset: 0;
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform-origin: top left;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.room-label b,
.room-label small {
  flex: 0 0 auto;
  display: block;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .9), 0 0 4px rgba(255, 255, 255, .8);
}

.room-label b {
  min-width: 0;
  order: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: calc(12px * var(--map-zoom-factor, 1));
  line-height: 1.05;
}

.room-label small {
  order: 3;
  color: #657286;
  font-size: calc(11px * var(--map-zoom-factor, 1));
}

.room-avatars {
  order: 2;
  max-width: 100%;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding-left: 0;
}

.room-avatars img,
.room-avatars span {
  width: calc(18px * var(--map-zoom-factor, 1));
  height: calc(18px * var(--map-zoom-factor, 1));
  margin-left: -6px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  object-fit: cover;
  font-size: calc(9px * var(--map-zoom-factor, 1));
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(23, 32, 42, .24);
}

.plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label {
  pointer-events: auto;
  z-index: 6;
  inset: auto;
  left: var(--room-popup-left, 50%);
  top: var(--room-popup-top, 50%);
  right: var(--room-popup-right, auto);
  bottom: var(--room-popup-bottom, auto);
  min-width: max(100%, 210px);
  min-height: max(100%, 104px);
  max-width: 320px;
  align-content: center;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 10px;
  border: 1px solid rgba(24, 32, 44, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 32px rgba(23, 32, 42, .18);
  transform: translate(var(--room-popup-translate-x, -50%), var(--room-popup-translate-y, -50%));
}

.plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label b {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: calc(15px * var(--map-zoom-factor, 1));
  line-height: 1.15;
  text-shadow: none;
}

.plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label small {
  color: var(--muted);
  font-size: calc(12px * var(--map-zoom-factor, 1));
  text-shadow: none;
}

.plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars {
  overflow: visible;
  padding-left: 0;
  pointer-events: auto;
}

.plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars img,
.plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars span {
  width: calc(24px * var(--map-zoom-factor, 1));
  height: calc(24px * var(--map-zoom-factor, 1));
  margin-left: 0;
  font-size: calc(11px * var(--map-zoom-factor, 1));
  pointer-events: auto;
  cursor: help;
}

.employee-avatar-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(24, 32, 44, .94);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(23, 32, 42, .24);
  transform: translate(10px, 10px);
}

.employee-avatar-tooltip[hidden] {
  display: none;
}

.resize-handle {
  position: absolute;
  z-index: 9;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(23, 32, 42, .24);
}

.resize-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.resize-n { top: -7px; left: calc(50% - 6px); cursor: ns-resize; }
.resize-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.resize-e { top: calc(50% - 6px); right: -7px; cursor: ew-resize; }
.resize-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.resize-s { bottom: -7px; left: calc(50% - 6px); cursor: ns-resize; }
.resize-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.resize-w { top: calc(50% - 6px); left: -7px; cursor: ew-resize; }

.polygon-handle {
  position: absolute;
  z-index: 12;
  width: 14px;
  height: 14px;
  min-height: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(23, 32, 42, .32);
  transform: translate(-50%, -50%);
  cursor: move;
}

.polygon-midpoint {
  width: 11px;
  height: 11px;
  border-width: 1px;
  background: #fff;
  border-color: var(--accent);
  cursor: copy;
}

.room-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.room-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.room-table th,
.room-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.room-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.room-table tr.selected td {
  background: var(--accent-soft);
}

.room-name-link {
  max-width: 100%;
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.room-name-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.editor-close {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  flex: 0 0 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 42, .42);
}

.app-modal {
  width: min(460px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.app-modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-modal-header {
  justify-content: space-between;
  margin-bottom: 12px;
  min-width: 0;
}

.app-modal-header h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.location-reorder {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.location-reorder.is-saving {
  opacity: .72;
  pointer-events: none;
}

.location-reorder-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.location-reorder-header span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.location-reorder-header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.location-reorder-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.location-reorder-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 2px rgba(23, 32, 42, .05);
}

.location-reorder-item:hover {
  border-color: rgba(206, 0, 61, .35);
  box-shadow: 0 0 0 3px var(--accent-ring), 0 1px 2px rgba(23, 32, 42, .06);
}

.location-reorder-item.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgba(23, 32, 42, .05);
}

.location-reorder-item.is-dragging {
  opacity: .45;
  cursor: grabbing;
}

.location-reorder-handle {
  color: var(--muted);
  font-weight: 950;
  letter-spacing: -.08em;
}

.modal-actions {
  justify-content: flex-end;
  gap: 8px;
}

.admin-users-modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.admin-users-modal-content {
  min-height: 0;
  display: grid;
  gap: 18px;
  overflow: auto;
  padding-right: 2px;
}

.admin-user-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

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

.admin-user-form-grid label:last-child {
  grid-column: 1 / -1;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user-list h3 {
  font-size: 15px;
  font-weight: 900;
}

.admin-user-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.admin-user-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-user-table tr:last-child td {
  border-bottom: 0;
}

.admin-user-table strong,
.admin-user-table small {
  display: block;
}

.admin-user-table small {
  color: var(--muted);
  font-size: 12px;
}

.admin-user-table a {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}

.admin-user-table a:hover {
  text-decoration: underline;
}

.admin-user-role-select {
  width: 100%;
  min-width: 180px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(23, 32, 42, .05);
}

.admin-user-role-select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.admin-user-role-select:disabled {
  cursor: not-allowed;
  opacity: .58;
}

@media (max-width: 1180px) {
  .crud-shell {
    height: auto;
  }

  .crud-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    overflow: visible;
  }

  .crud-layout > .crud-panel:last-child {
    grid-column: 1 / -1;
  }

  .left-sidebar,
  .office-editor-panel,
  .rooms-panel {
    max-height: none;
  }
}

@media (max-width: 780px) {
  .crud-header,
  .crud-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .crud-layout {
    grid-template-columns: 1fr;
  }

  .plan-wrap {
    min-width: 760px;
  }
}

.map-page {
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 32, 42, .035) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 42, .035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}

.map-page,
.map-page body {
  overscroll-behavior: none;
}

.map-page-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: block;
  background: transparent;
}

.map-page-stage {
  position: absolute;
  inset: 0;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.map-page-stage > .panel-header {
  display: none;
}

.map-page-canvas {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  padding: 96px 28px 28px;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  overflow: auto;
  scrollbar-width: none;
  touch-action: none;
  user-select: none;
  background: transparent;
}

.map-page-canvas::-webkit-scrollbar {
  display: none;
}

.map-page-canvas.is-fit-width {
  overflow-x: auto;
}

.map-page-canvas.is-zoomed-out {
  padding-top: 96px;
}

.map-page-canvas .plan-wrap {
  margin: 0 auto;
  will-change: width;
}

.map-page-canvas .plan-wrap.is-zooming {
  transition: width .16s cubic-bezier(.2, .8, .2, 1);
}

.map-page-menu {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 80;
  width: min(860px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  align-items: center;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .96);
}

.map-page-zoom-controls {
  height: 52px;
  align-self: center;
}

.map-page-zoom-controls button,
.map-page-zoom-controls .map-login-lock {
  width: 44px;
  height: 52px;
  min-height: 52px;
  font-size: 20px;
}

.map-language-link {
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.map-language-link:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}


.map-page-search {
  position: relative;
  min-width: 0;
  height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.map-free-room-toggle {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.map-free-room-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.map-free-room-toggle input:checked + .mini-switch {
  background: var(--ok);
}

.map-free-room-toggle input:checked + .mini-switch span {
  transform: translateX(16px);
}

.map-free-room-toggle:hover {
  border-color: rgba(0, 124, 114, .35);
  box-shadow: 0 0 0 3px rgba(0, 124, 114, .14);
}

.map-page-menu-toggle {
  display: none;
}

.map-page-floor-dropdown {
  position: relative;
  margin: 0;
}

.map-page-floor-dropdown summary,
.map-page-search .crud-search {
  min-height: 52px;
}

.map-page-floor-dropdown .floor-list {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(420px, calc(100vh - 120px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.map-page-floor-dropdown[open] summary {
  border-radius: 7px;
}

.map-page-search .employee-search-box {
  margin: 0;
}

.map-page-search .employee-search-box {
  min-width: 0;
}

.map-page-results {
  display: grid;
  max-height: min(420px, calc(100vh - 120px));
  overflow: auto;
}

.map-page-result {
  display: grid;
  align-content: center;
  gap: 2px;
}

.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):not(.office-room):hover {
  z-index: 2;
  overflow: hidden;
  border-color: rgba(0, 124, 114, .3);
  background: rgba(0, 124, 114, .067);
}

.map-page .plan-wrap:not(.has-active-room) .room-area.full:not(.active):hover {
  border-color: rgba(178, 77, 0, .65);
  background: rgba(178, 77, 0, .102);
}

.map-page .room-area.full:not(.lecture-hall) {
  border-color: rgba(0, 124, 114, .3);
  background: rgba(0, 124, 114, .067);
}

.map-page .room-area.office-room,
.map-page .room-area.office-room.full,
.map-page .plan-wrap:not(.has-active-room) .room-area.office-room:not(.active):hover,
.map-page .plan-wrap:not(.has-active-room) .room-area.office-room.full:not(.active):hover {
  border-color: rgba(126, 58, 242, .58);
  background: rgba(126, 58, 242, .14);
}

.map-page .plan-wrap:not(.has-active-room) .room-area.full:not(.lecture-hall):not(.office-room):not(.active):hover {
  border-color: rgba(0, 124, 114, .3);
  background: rgba(0, 124, 114, .067);
}

.map-page .plan-wrap:not(.has-active-room) .room-area.lecture-hall:not(.active):hover {
  border-color: rgba(24, 32, 44, .34);
  background: transparent;
}

.map-page .room-area.lecture-hall {
  border-color: rgba(24, 32, 44, .24);
  background: transparent;
}

.map-page .room-area.schedule-free,
.map-page .room-area.lecture-hall.schedule-free,
.map-page .plan-wrap:not(.has-active-room) .room-area.schedule-free:not(.active):hover,
.map-page .plan-wrap:not(.has-active-room) .room-area.lecture-hall.schedule-free:not(.active):hover {
  border-color: rgba(0, 124, 114, .72);
  background: rgba(0, 124, 114, .14);
}

.map-page .room-area.schedule-busy,
.map-page .room-area.lecture-hall.schedule-busy,
.map-page .plan-wrap:not(.has-active-room) .room-area.schedule-busy:not(.active):hover,
.map-page .plan-wrap:not(.has-active-room) .room-area.lecture-hall.schedule-busy:not(.active):hover {
  border-color: rgba(180, 35, 24, .74);
  background: rgba(180, 35, 24, .14);
}

.map-page .room-area.schedule-loading {
  opacity: .72;
}

.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label {
  pointer-events: none;
  z-index: auto;
  inset: 0;
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: clamp(8px, calc(10px * var(--map-zoom-factor, 1)), 14px);
  line-height: 1.05;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .9), 0 0 4px rgba(255, 255, 255, .8);
}

.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label small {
  color: #657286;
  font-size: clamp(7px, calc(9px * var(--map-zoom-factor, 1)), 12px);
  text-shadow: 0 1px 2px rgba(255, 255, 255, .9), 0 0 4px rgba(255, 255, 255, .8);
}

.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars {
  pointer-events: none;
}

.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars img,
.map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars span {
  width: clamp(13px, calc(15px * var(--map-zoom-factor, 1)), 22px);
  height: clamp(13px, calc(15px * var(--map-zoom-factor, 1)), 22px);
  margin-left: -4px;
  font-size: clamp(7px, calc(8px * var(--map-zoom-factor, 1)), 11px);
  pointer-events: none;
  cursor: pointer;
}

.map-page .room-label b {
  font-size: clamp(8px, calc(10px * var(--map-zoom-factor, 1)), 14px);
}

.map-page .room-label small {
  font-size: clamp(7px, calc(9px * var(--map-zoom-factor, 1)), 12px);
}

.map-page .room-avatars img,
.map-page .room-avatars span {
  width: clamp(15px, calc(17px * var(--map-zoom-factor, 1)), 25px);
  height: clamp(15px, calc(17px * var(--map-zoom-factor, 1)), 25px);
  margin-left: -4px;
  font-size: clamp(8px, calc(9px * var(--map-zoom-factor, 1)), 12px);
}

@media (min-width: 721px) {
  .map-page .room-label b,
  .map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label b {
    font-size: clamp(10px, calc(12px * var(--map-zoom-factor, 1)), 17px);
  }

  .map-page .room-label small,
  .map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-label small {
    font-size: clamp(8px, calc(10px * var(--map-zoom-factor, 1)), 13px);
  }

  .map-page .room-avatars img,
  .map-page .room-avatars span,
  .map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars img,
  .map-page .plan-wrap:not(.has-active-room) .room-area:not(.active):hover .room-avatars span {
    width: clamp(18px, calc(20px * var(--map-zoom-factor, 1)), 30px);
    height: clamp(18px, calc(20px * var(--map-zoom-factor, 1)), 30px);
    font-size: clamp(9px, calc(10px * var(--map-zoom-factor, 1)), 13px);
  }
}

.map-room-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.map-room-modal-body {
  display: grid;
  min-height: 0;
  gap: 14px;
  overflow: auto;
  padding-right: 2px;
}

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

.map-room-meta span {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-room-meta strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
}

.map-room-schedule {
  display: grid;
  min-height: 0;
  gap: 8px;
}

.map-room-schedule-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.map-room-schedule-item {
  display: grid;
  gap: 3px;
}

.map-room-schedule-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.map-room-schedule-item strong {
  color: var(--text);
  font-size: 14px;
}

.map-room-schedule-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-room-schedule-item.free {
  border-color: rgba(0, 124, 114, .24);
  background: rgba(0, 124, 114, .08);
}

.map-room-schedule-item.free strong {
  color: var(--accent);
}

.map-room-employees {
  display: grid;
  min-height: 0;
  gap: 8px;
}

.map-room-employee {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.map-room-employee.highlighted {
  border-color: var(--accent);
  background: var(--accent-ring);
  box-shadow:3px var(--accent-ring);
}

.map-room-employee-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.map-room-employee-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.map-page .room-avatars span {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

@container (max-width: 72px) {
  .map-page .room-area.office-room .room-label {
    align-content: center;
    justify-content: center;
    padding: 2px;
  }

  .map-page .room-area.office-room .room-label b,
  .map-page .room-area.office-room .room-label small {
    display: none;
  }

  .map-page .room-area.office-room .room-avatars {
    justify-content: center;
    padding-left: 0;
    overflow: visible;
  }

  .map-page .room-area.office-room .room-avatars img,
  .map-page .room-area.office-room .room-avatars span {
    margin-left: -2px;
  }
}

@container (max-height: 42px) {
  .map-page .room-area.office-room .room-label {
    align-content: center;
    justify-content: center;
    padding: 2px;
  }

  .map-page .room-area.office-room .room-label b,
  .map-page .room-area.office-room .room-label small {
    display: none;
  }

  .map-page .room-area.office-room .room-avatars {
    justify-content: center;
    padding-left: 0;
    overflow: visible;
  }

  .map-page .room-area.office-room .room-avatars img,
  .map-page .room-area.office-room .room-avatars span {
    margin-left: -2px;
  }
}

.map-room-employee-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.schedule-loader {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent-soft);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.map-room-employee-actions {
  display: inline-flex;
  justify-self: end;
  gap: 6px;
}

.map-room-employee-link {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(23, 32, 42, .08);
}

.map-room-employee-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.map-room-employee-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 720px) {
  .app-modal-backdrop {
    place-items: start center;
    align-items: start;
    overflow: auto;
    padding: 72px 10px 44px;
  }

  .map-page-menu {
    top: 0;
    width: 100%;
    border-radius: 0 0 12px 12px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .map-page-menu.is-collapsed {
    padding-bottom: 8px;
  }

  .map-page-menu.is-collapsed .map-page-floor-dropdown,
  .map-page-menu.is-collapsed .map-page-zoom-controls,
  .map-page-menu.is-collapsed .map-free-room-toggle {
    display: none;
  }

  .map-page-search {
    order: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    height: auto;
  }

  .map-page-search .employee-search-box {
    min-width: 0;
  }

  .map-page-search .crud-search {
    min-height: 48px;
  }

  .map-page-results {
    grid-column: 1 / -1;
  }

  .map-free-room-toggle {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 12px;
  }

  .map-free-room-toggle > span:first-child {
    display: inline;
  }

  .map-page-menu-toggle {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .map-page-menu-toggle span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
    transform-origin: center;
    transition: transform .16s ease, opacity .16s ease;
  }

  .map-page-menu-toggle span:nth-child(1) {
    transform: translate(-50%, calc(-50% - 6px));
  }

  .map-page-menu-toggle span:nth-child(3) {
    transform: translate(-50%, calc(-50% + 6px));
  }

  .map-page-menu.is-expanded .map-page-menu-toggle span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .map-page-menu.is-expanded .map-page-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .map-page-menu.is-expanded .map-page-menu-toggle span:nth-child(3) {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .map-page-floor-dropdown {
    order: 2;
  }

  .map-page-zoom-controls {
    order: 3;
    justify-self: stretch;
  }

  .map-page-zoom-controls button,
  .map-page-zoom-controls .map-login-lock,
  .map-page-zoom-controls .map-language-link {
    width: 25%;
  }

  .map-page-canvas {
    padding: 0 14px;
  }

  .map-page-canvas.is-zoomed-out {
    padding-top: 0;
  }

  .map-page.map-menu-expanded .map-page-canvas {
    padding-top: 0;
  }

  .map-page.map-menu-expanded .map-page-canvas.is-zoomed-out {
    padding-top: 0;
  }

  .map-page-canvas .plan-wrap {
    margin-top: 96px !important;
    margin-bottom: 96px !important;
  }

  .map-page.map-menu-expanded .map-page-canvas .plan-wrap {
    margin-top: 258px !important;
  }

  .map-page .room-area.label-overflows .room-label {
    align-content: center;
    justify-content: center;
    padding: 2px;
  }

  .map-page .room-area.label-overflows .room-label b,
  .map-page .room-area.label-overflows .room-label small {
    display: none;
  }

  .map-page .room-area.label-overflows .room-avatars {
    justify-content: center;
    padding-left: 0;
    overflow: visible;
  }

  .map-page .room-area.label-overflows .room-avatars img,
  .map-page .room-area.label-overflows .room-avatars span {
    margin-left: -2px;
  }

  .map-room-modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 116px);
    margin: 0 auto;
  }

  .map-room-employee {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 8px 10px;
  }

  .map-room-employee-avatar {
    width: 42px;
    height: 42px;
  }

  .map-room-employee-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 8px;
  }

  .map-room-employee-link {
    width: 100%;
    height: 38px;
    justify-self: stretch;
  }

  .admin-users-modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 116px);
  }

  .admin-user-form-grid {
    grid-template-columns: 1fr;
  }
}
