:root {
  --bg: #f2f0eb;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #5c6773;
  --line: #d8d1c8;
  --primary: #2f4f4f;
  --primary-strong: #253f3f;
  --secondary: #ede8df;
  --ok: #2f4f4f;
  --warn: #8c3b2f;
  --dirty: #9a6425;
  --shadow: 0 2px 10px rgba(31, 41, 51, 0.06);
  --btn-shadow: none;
  --btn-shadow-strong: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.bg-orb {
  display: none;
}

.shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  animation: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.workspace-header {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
}

.workspace-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.workspace-brand-text {
  min-width: 0;
}

.workspace-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.workspace-side,
.admin-profile-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.workspace-actions {
  display: grid;
  gap: 14px;
}

.profile-menu {
  position: relative;
}

.action-cluster {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 10px;
  background: #fbfaf7;
  border: 1px solid var(--line);
  box-shadow: none;
}

.profile-trigger:hover {
  background: #f4f1eb;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.08);
  display: grid;
  gap: 2px;
  z-index: 30;
}

.profile-dropdown-item {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  box-shadow: none;
  justify-content: flex-start;
}

.profile-dropdown-item:hover {
  background: #f3efe8;
  transform: none;
  box-shadow: none;
}

.profile-dropdown-item.danger {
  color: #b42318;
}

.profile-dropdown-item.danger:hover {
  background: #fff1f1;
}

.profile-dropdown a.profile-dropdown-item {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2f4f4f;
  color: #f9f8f5;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.profile-meta {
  display: grid;
  text-align: left;
  line-height: 1.15;
}

.profile-meta strong {
  font-size: 14px;
  color: var(--ink);
}

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

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  line-height: 1.15;
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.tenant-logo {
  display: block;
  max-width: 300px;
  max-height: 84px;
  width: auto;
  height: auto;
  margin: 0;
  object-fit: contain;
}

.brand-logo {
  display: block;
  max-width: 220px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0;
}

.brand-subtitle {
  display: none;
}

.login-shell {
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.login-card {
  display: grid;
  gap: 18px;
  padding: 32px;
  align-content: start;
  width: 100%;
}

.login-brand {
  display: grid;
  justify-items: start;
  gap: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.login-brand-logo {
  max-width: 280px;
  max-height: 84px;
}

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

.login-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.45rem);
  line-height: 1.05;
}

.login-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  gap: 18px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-form label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  padding: 12px 14px;
  background: #fcfbf8;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-password-wrap {
  position: relative;
}

.login-password-wrap input {
  padding-right: 72px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  min-width: 56px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3eee5;
  color: #37424d;
  box-sizing: border-box;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.login-password-toggle:hover {
  background: #efe9e0;
  border-color: #cfc6bb;
  transform: translateY(-50%);
  box-shadow: none;
}

.login-password-toggle:focus-visible {
  transform: translateY(-50%);
  box-shadow: none;
}

.login-form input:focus {
  outline: none;
  border-color: #7b847c;
  box-shadow: 0 0 0 3px rgba(47, 79, 79, 0.12);
  background: #fff;
}

.login-field.has-error input {
  border-color: #d14b40;
  background: #fff8f7;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.login-submit {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-size: 14px;
  position: relative;
  gap: 10px;
  margin-top: 4px;
}

.login-form.is-pending .login-submit {
  cursor: wait;
  opacity: 0.92;
}

.login-submit:disabled {
  opacity: 0.92;
}

.login-submit-label {
  transition: opacity 0.18s ease;
}

.login-submit-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  animation: spin 0.72s linear infinite;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.login-form.is-pending .login-submit-label {
  opacity: 0.9;
}

.login-form.is-pending .login-submit-spinner {
  opacity: 1;
  transform: scale(1);
}

.login-progress {
  position: relative;
  overflow: hidden;
  height: 3px;
  border-radius: 3px;
  background: rgba(47, 79, 79, 0.12);
  opacity: 0;
  transform: scaleX(0.96);
  transform-origin: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.login-progress.is-visible {
  opacity: 1;
  transform: scaleX(1);
}

.login-progress-bar {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(47, 79, 79, 0.15) 0%, rgba(47, 79, 79, 0.92) 48%, rgba(47, 79, 79, 0.15) 100%);
  animation: login-progress-slide 1.1s ease-in-out infinite;
}

.login-status {
  margin: 2px 0 0;
  min-height: 22px;
  padding: 0;
}

.login-status.status-visible {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(47, 79, 79, 0.18);
  background: #f7f5f0;
}

.login-status.status-error {
  border-color: rgba(180, 35, 24, 0.2);
  background: linear-gradient(180deg, rgba(255, 244, 242, 0.95) 0%, rgba(255, 248, 247, 0.98) 100%);
}

.login-status.status-success {
  color: #2f4f4f;
  border-color: rgba(47, 79, 79, 0.18);
  background: #f4f5f1;
}

.login-form.is-pending .login-password-toggle {
  opacity: 0.65;
}

@keyframes spin {
  from {
    transform: scale(1) rotate(0deg);
  }

  to {
    transform: scale(1) rotate(360deg);
  }
}

@keyframes login-progress-slide {
  0% {
    transform: translateX(-130%);
  }

  100% {
    transform: translateX(280%);
  }
}

@media (max-width: 820px) {
  .login-card {
    padding: 24px;
  }
}

.docs-shell {
  max-width: 1100px;
}

.docs-hero {
  display: grid;
  gap: 12px;
}

.docs-url-note {
  margin: 0;
  color: var(--muted);
}

.docs-section {
  margin-bottom: 16px;
  overflow: hidden;
}

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

.docs-mini-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #faf8f4;
}

.docs-mini-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.docs-mini-card p {
  margin: 0;
  color: var(--muted);
}

.docs-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.docs-list li + li {
  margin-top: 8px;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.docs-table th,
.docs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.docs-table thead th {
  background: #f6f2eb;
  color: var(--ink);
}

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

.docs-code {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #28323b;
  background: #202831;
  color: #f2f1ee;
  overflow-x: auto;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .docs-table th,
  .docs-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

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

.stat-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #faf8f4;
}

.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stat-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink);
}

.layout {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.chart-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-kpi-grid,
.hotel-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.kpi-card strong {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  color: var(--ink);
}

.kpi-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chart-card {
  padding: 18px;
}

.chart-shell {
  min-height: 200px;
}

.chart-empty {
  color: var(--muted);
  font-size: 13px;
  padding-top: 18px;
}

.chart-legend {
  display: grid;
  gap: 10px;
}

.chart-legend-row {
  display: grid;
  grid-template-columns: auto minmax(92px, 140px) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.chart-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.chart-track {
  position: relative;
  height: 8px;
  border-radius: 3px;
  overflow: hidden;
  background: #ece5db;
}

.chart-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.chart-value {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
}

.chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}

.chart-metric {
  display: grid;
  gap: 2px;
}

.chart-metric strong {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--ink);
}

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

.chart-list-row {
  display: grid;
  grid-template-columns: minmax(92px, 150px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.chart-list-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.chart-note {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.chart-summary {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
}

.chart-summary-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
}

.chart-summary-label {
  font-size: 12px;
  color: var(--muted);
}

.left-col,
.right-col {
  display: grid;
  gap: 14px;
}

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

.modal-panel .stack-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.modal-panel .stack-form > button,
.modal-panel .stack-form > div,
.modal-panel .stack-form > .tenant-assign-list,
.modal-panel .stack-form > .filters,
.modal-panel .stack-form > .table-wrap,
.modal-panel .stack-form > p {
  grid-column: 1 / -1;
}

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

input,
select,
button,
.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

input,
select {
  background: #fff;
  color: var(--ink);
  min-height: 38px;
}

button,
.btn {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-shadow: var(--btn-shadow);
  white-space: nowrap;
}

button:hover,
.btn:hover {
  transform: none;
  box-shadow: none;
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  background: #f1ece4;
  color: #8f877a;
  border-color: #d9d1c6;
  box-shadow: none;
}

button:active,
.btn:active {
  transform: translateY(0);
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 0;
  border-color: #7b847c;
  box-shadow: 0 0 0 3px rgba(47, 79, 79, 0.12);
}

.btn-primary {
  background: var(--primary);
  color: #f7f5f0;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.btn-secondary {
  background: #f3eee5;
  color: #37424d;
  border-color: var(--line);
}

.btn-secondary:hover {
  background: #ece4d8;
}

.btn-ghost {
  background: #fcfbf8;
  color: #37424d;
  border-color: var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  background: #f3eee6;
  box-shadow: none;
}

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

.section-head-spaced {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.admin-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-header-actions {
  gap: 12px;
}

.pill {
  border: 1px solid var(--line);
  background: #f7f3ec;
  color: #48525c;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 3px 8px;
  border-radius: 4px;
  min-height: 24px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--line);
  background: #f8f5ef;
  color: #4a545d;
  text-align: center;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.badge::before {
  content: none;
}

.badge.occupied {
  background: #edf2eb;
  border-color: #c8d4c1;
  color: #48604a;
}

.badge.free {
  background: #f5f1ea;
  border-color: #d8d0c5;
  color: #655c50;
}

.badge.clean {
  background: #eef2ec;
  border-color: #cbd6c5;
  color: #4f634d;
}

.badge.pending {
  background: #f5eee6;
  border-color: #dccdbb;
  color: #786652;
}

.room-actions:not(td) {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

td.room-actions {
  display: table-cell;
  text-align: center;
  white-space: nowrap;
  width: 214px;
  min-width: 214px;
}

td.room-actions > * {
  margin: 0;
  vertical-align: middle;
}

.room-actions .ok {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.room-actions .warn {
  background: #8c3b2f;
  color: #fff;
  border-color: #8c3b2f;
}

.room-actions .secondary {
  background: #f5f1e9;
  color: #37424d;
  border-color: var(--line);
}

.small {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  min-width: 32px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-btn > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  transform: none;
}

.icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.room-actions .icon-glyph {
  width: 16px;
  height: 16px;
}

.icon-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.filters {
  display: grid;
  grid-template-columns: minmax(160px, 1.35fr) minmax(150px, 0.9fr) minmax(150px, 0.9fr) auto auto;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf8f4;
  align-items: center;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) auto auto auto auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf8f4;
}

.rooms-table-tools {
  grid-template-columns: minmax(170px, 1.35fr) auto auto auto auto auto auto;
}

.filters input,
.filters select,
.table-tools input,
.table-tools select {
  height: 34px;
}

.filters input[type="search"],
.table-tools input[type="search"] {
  min-width: 0;
  background: #fff;
  border-color: #d5cec3;
  padding: 7px 10px;
}

.filters input[type="datetime-local"] {
  min-width: 0;
  padding: 7px 10px;
}

.filters select,
.table-tools select {
  min-width: 78px;
  width: 78px;
  max-width: 100%;
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #5c6773 50%), linear-gradient(135deg, #5c6773 50%, transparent 50%);
  background-position: calc(100% - 13px) calc(50% - 2px), calc(100% - 8px) calc(50% - 2px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.filters .btn,
.table-tools .btn {
  min-width: 74px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.table-tools .btn[aria-label] {
  min-width: 34px;
  width: 34px;
  padding: 0;
}

.table-tools .muted,
.filters .muted {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  font-size: 11px;
  white-space: nowrap;
}

.filter-summary {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 10px;
}

.filter-summary.active {
  display: flex;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f7f3ec;
  border: 1px solid var(--line);
  color: #4b5560;
  font-size: 11px;
  line-height: 1.2;
}

.filter-chip strong {
  color: var(--ink);
  font-weight: 600;
}

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

.table-wrap td[colspan] {
  padding: 18px 14px;
  text-align: center;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  overflow: hidden;
}

thead th {
  text-align: left;
  padding: 13px 14px;
  background: #f6f2eb;
  border-bottom: 1px solid var(--line);
  color: #5c6773;
  font-size: 12px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: "↕";
  margin-left: 6px;
  font-size: 11px;
  color: #93a4b8;
}

th.sortable.sorted {
  color: #21466f;
}

th.sortable.sorted[data-direction="asc"]::after {
  content: "↑";
  color: #21466f;
}

th.sortable.sorted[data-direction="desc"]::after {
  content: "↓";
  color: #21466f;
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #ece5db;
  white-space: nowrap;
  vertical-align: middle;
  color: #2b3640;
  background: var(--row-bg, transparent);
}

tbody tr:hover td {
  --row-bg: #faf7f1;
}

tbody tr.row-soft td {
  --row-bg: rgba(244, 248, 252, 0.92);
}

tbody tr.row-focus td {
  --row-bg: rgba(230, 241, 255, 0.92);
}

tbody tr.row-warning td {
  --row-bg: rgba(255, 246, 224, 0.95);
}

tbody tr.row-danger td {
  --row-bg: rgba(255, 236, 233, 0.95);
}

tbody tr.row-accent td {
  --row-bg: rgba(238, 247, 233, 0.95);
}

tbody tr.row-focus td:first-child {
  box-shadow: inset 3px 0 0 #2f4f4f;
}

tbody tr.row-warning td:first-child {
  box-shadow: inset 3px 0 0 #9a6425;
}

tbody tr.row-danger td:first-child {
  box-shadow: inset 3px 0 0 #8c3b2f;
}

tbody tr.row-accent td:first-child {
  box-shadow: inset 3px 0 0 #587057;
}

tbody tr.row-soft td:first-child {
  box-shadow: inset 3px 0 0 #9a958d;
}

tbody tr.row-soft:hover td,
tbody tr.row-focus:hover td,
tbody tr.row-warning:hover td,
tbody tr.row-danger:hover td,
tbody tr.row-accent:hover td {
  filter: brightness(0.99);
}

tbody tr.room-occupied td {
  --row-bg: rgba(232, 241, 251, 0.82);
}

tbody tr.room-free td {
  --row-bg: rgba(249, 251, 253, 0.94);
}

tbody tr.room-occupied td:first-child {
  box-shadow: inset 3px 0 0 #2f4f4f;
}

tbody tr.room-free td:first-child {
  box-shadow: inset 3px 0 0 #9a958d;
}

.rooms-table tbody td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.rooms-table th,
.rooms-table td {
  text-align: center;
  vertical-align: middle;
}

.rooms-table th:first-child,
.rooms-table td:first-child,
.hotels-table th:first-child,
.hotels-table td:first-child,
.users-table th:first-child,
.users-table td:first-child,
.pbx-table th:first-child,
.pbx-table td:first-child {
  position: sticky;
  left: 0;
}

.rooms-table thead th:first-child,
.hotels-table thead th:first-child,
.users-table thead th:first-child,
.pbx-table thead th:first-child {
  z-index: 3;
}

.rooms-table tbody td:first-child,
.hotels-table tbody td:first-child,
.users-table tbody td:first-child,
.pbx-table tbody td:first-child {
  z-index: 2;
  background: var(--row-bg, transparent);
}

pre {
  margin: 0 0 10px;
  background: #0f172a;
  color: #e2edf8;
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cell-left {
  align-items: flex-start;
  text-align: left;
}

.cell-center {
  align-items: center;
  text-align: center;
}

.cell-stack strong {
  font-size: 12px;
  line-height: 1.15;
  color: var(--ink);
  white-space: nowrap;
}

.cell-meta {
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  white-space: normal;
}

.status-bar {
  margin: 12px 2px 0;
  min-height: 22px;
  color: #4a5d4e;
  font-weight: 500;
  opacity: 0;
  transform: none;
  transition: opacity 0.18s ease;
}

.status-bar.status-visible {
  opacity: 1;
  padding: 10px 12px;
  border: 1px solid rgba(47, 79, 79, 0.16);
  border-radius: 8px;
  background: #f7f5f0;
}

.status-bar.status-error {
  color: #8c3b2f;
  border-color: rgba(140, 59, 47, 0.16);
  background: #faf3f1;
}

.status-bar.status-success {
  color: #4a5d4e;
}

.status-bar.status-info {
  color: #5e5548;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 60vh;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  background: #faf8f4;
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.history-calls {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e6edf5;
}

.history-call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f6f2eb;
}

.history-call-meta {
  display: grid;
  gap: 2px;
}

.history-call-meta span {
  color: #60758e;
  font-size: 11px;
}

.wakeup-list-wrap {
  margin-top: 14px;
}

.wakeup-table td:last-child,
.wakeup-table th:last-child {
  text-align: center;
}

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

.tenant-assign-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #faf8f4;
}

.tenant-assign-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 51, 0.34);
}

.modal-panel {
  position: relative;
  width: min(760px, calc(100vw - 24px));
  margin: 6vh auto 0;
  max-height: 84vh;
  overflow: auto;
}

.modal-panel-wide {
  width: min(1180px, calc(100vw - 24px));
}

.admin-table th,
.admin-table td {
  vertical-align: middle;
  text-align: center;
}

.admin-table tbody td {
  padding-top: 7px;
  padding-bottom: 7px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table .cell-stack {
  gap: 1px;
}

.admin-table .cell-stack strong {
  font-size: 12px;
  line-height: 1.15;
}

.admin-table .cell-meta {
  font-size: 10px;
  line-height: 1.2;
}

.admin-table tbody td:nth-child(2),
.admin-table tbody td:nth-child(6),
.admin-table tbody td:nth-child(7) {
  max-width: 280px;
}

.admin-table td.room-actions {
  width: 188px;
  min-width: 188px;
}

.admin-table .room-actions:not(td) {
  gap: 8px;
}

.admin-table .icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
}

.admin-table .small {
  min-height: 32px;
  min-width: 32px;
  padding: 6px 8px;
}

#systemEventsTbody td,
#sftpLogsTbody td {
  max-width: none;
}

#systemEventsTbody td:last-child,
#sftpLogsTbody td:last-child {
  min-width: 380px;
}

.admin-table tbody td pre {
  margin: 0;
  padding: 8px 10px;
  max-width: 100%;
  max-height: 120px;
  overflow: auto;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 8px;
  background: #122033;
  color: #e8f0fb;
  font-size: 11px;
  line-height: 1.35;
}

#systemEventsTbody td pre,
#sftpLogsTbody td pre {
  min-width: 340px;
  max-height: 220px;
  font-size: 12px;
}

.admin-table tbody td:first-child,
.rooms-table tbody td:first-child,
table tbody td:first-child {
  font-weight: 600;
  color: var(--ink);
}

.admin-table th:last-child,
.admin-table td:last-child {
  text-align: center;
}

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

.table-wrap table {
  min-width: 100%;
}

.hotels-table,
.users-table,
.pbx-table {
  min-width: 980px;
}

.card > h2 + .table-tools,
.section-head + .table-tools,
.section-head + .filters {
  margin-top: 4px;
}

@media (min-width: 960px) {
  .chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .chart-donut-layout {
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  }

  .layout {
    grid-template-columns: 330px minmax(0, 1fr);
    align-items: start;
  }

}

@media (max-width: 820px) {
  .workspace-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-side,
  .admin-profile-box,
  .workspace-brand {
    justify-content: space-between;
  }

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

  .workspace-side {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .action-cluster,
  .admin-toolbar,
  .hotel-toolbar {
    width: 100%;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .modal-panel .stack-form {
    grid-template-columns: 1fr;
  }

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

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

  .table-tools {
    grid-template-columns: 1fr 1fr;
    padding: 8px;
  }

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

  .table-tools .muted,
  .filters .muted {
    grid-column: 1 / -1;
    min-height: auto;
    padding: 0;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}
