:root {
  --bg: #f5f1e8;
  --bg-soft: #fcfaf5;
  --panel: rgba(255, 250, 241, 0.9);
  --panel-strong: #fffaf1;
  --ink: #1e2f2b;
  --muted: #5f6e68;
  --line: rgba(30, 47, 43, 0.12);
  --line-strong: rgba(30, 47, 43, 0.22);
  --accent: #0a8a73;
  --accent-strong: #0b6a59;
  --accent-soft: rgba(10, 138, 115, 0.12);
  --warn: #d25d3d;
  --warn-soft: rgba(210, 93, 61, 0.12);
  --shadow: 0 18px 45px rgba(45, 54, 49, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-sans: "Aptos", "Trebuchet MS", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(10, 138, 115, 0.14), transparent 30%),
    radial-gradient(circle at left 20%, rgba(210, 93, 61, 0.12), transparent 26%),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 54%, #efe8da 100%);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 30px;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(10, 138, 115, 0.94), rgba(14, 93, 88, 0.82)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 70%);
  color: #f6fbf9;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -40% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(12px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.84;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 14ch;
}

.hero p {
  margin: 12px 0 0;
  max-width: 70ch;
  color: rgba(246, 251, 249, 0.9);
}

.lang-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
}

.lang-switch button,
.chip-button,
.hotel-card,
.floor-pill,
.room-card,
.action-button,
.ghost-button,
.tiny-button {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.lang-switch button {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  color: #f6fbf9;
  background: transparent;
  font-weight: 700;
}

.lang-switch button.active {
  color: var(--ink);
  background: #f7f6ef;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ticker-wrap {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255, 250, 241, 0.88);
  border: 1px solid var(--line);
}

.ticker-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

.ticker-track {
  overflow: hidden;
  position: relative;
  min-height: 28px;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-slide 22s linear infinite;
  color: var(--muted);
  font-weight: 700;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #f2faf7;
  font-size: 0.94rem;
}

.guidance-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.9);
  color: var(--ink);
}

.guidance-card.compact {
  margin-top: 0;
  margin-bottom: 16px;
}

.guidance-card h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.guidance-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.guidance-card ol {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.guidance-card li {
  color: var(--ink);
  line-height: 1.45;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

.status.success {
  background: rgba(255, 255, 255, 0.18);
}

.status.error {
  background: rgba(210, 93, 61, 0.18);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 32px rgba(37, 47, 42, 0.06);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.section-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hotel-strip {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.hotel-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
}

.hotel-card.active {
  border-color: rgba(10, 138, 115, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(10, 138, 115, 0.09));
  box-shadow: 0 16px 30px rgba(10, 138, 115, 0.14);
  transform: translateY(-2px);
}

.hotel-card:hover,
.hotel-card:focus-visible,
.floor-pill:hover,
.floor-pill:focus-visible,
.room-card:hover:not(:disabled),
.room-card:focus-visible:not(:disabled),
.action-button:hover,
.ghost-button:hover,
.tiny-button:hover {
  transform: translateY(-2px);
}

.hotel-card small,
.metric-label,
.muted {
  color: var(--muted);
}

.hotel-card h3 {
  margin: 0;
  font-size: 1.18rem;
}

.hotel-role {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.workspace {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.main-stack,
.side-stack {
  display: grid;
  gap: 18px;
}

.main-stack > .filters-panel {
  display: none;
}

.main-stack > .floor-panel:not(.floor-panel-primary) {
  display: none;
}

.filters-panel,
.floor-panel,
.booking-panel,
.admin-panel {
  padding: 24px;
}

.inline-filter-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

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

.field.span-2 {
  grid-column: span 2;
}

.field label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field select,
.password-row input,
.org-name-input,
.org-key-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.password-row input:focus,
.org-name-input:focus,
.org-key-input:focus {
  outline: 2px solid rgba(10, 138, 115, 0.22);
  border-color: rgba(10, 138, 115, 0.34);
}

.building-row,
.floor-row,
.metric-row,
.quick-row,
.booking-actions,
.password-row,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-button,
.floor-pill,
.tiny-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 600;
}

.chip-button.active,
.floor-pill.active {
  border-color: rgba(10, 138, 115, 0.38);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

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

.metric {
  min-width: 120px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.metric-value {
  display: block;
  margin-top: 4px;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.floor-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.floor-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--muted);
}

.plan-details {
  margin-top: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
}

.plan-details summary {
  list-style: none;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 700;
}

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

.plan-content {
  padding: 0 18px 18px;
}

.plan-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.plan-frame.has-north-arrow::before {
  content: none !important;
  display: none !important;
}

.plan-frame.has-north-arrow::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 28px;
  height: 62px;
  background: #0b63ce;
  clip-path: polygon(50% 0, 100% 34%, 67% 34%, 67% 100%, 33% 100%, 33% 34%, 0 34%);
  box-shadow: 0 8px 16px rgba(11, 99, 206, 0.18);
}

.plan-frame img {
  width: 100%;
  height: auto;
}

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

.room-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.room-card.selected {
  border-color: rgba(10, 138, 115, 0.44);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(10, 138, 115, 0.08));
  box-shadow: 0 14px 26px rgba(10, 138, 115, 0.12);
}

.room-card.locked,
.room-card:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(228, 223, 216, 0.9);
  border-color: rgba(210, 93, 61, 0.18);
  transform: none;
}

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

.room-number {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.room-number-prefix {
  color: var(--ink);
}

.room-number-suffix {
  color: #66cc99;
}

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

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(210, 93, 61, 0.22);
}

.room-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  margin-top: 18px;
  padding: 22px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.58);
}

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

.selection-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

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

.selection-item h4 {
  margin: 0;
  font-size: 1rem;
}

.selection-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.action-button,
.ghost-button {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 0;
  font-weight: 800;
}

.action-button {
  color: #f7fbfa;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 22px rgba(10, 138, 115, 0.22);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.tiny-button {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.84);
}

.tiny-button.danger {
  color: var(--warn);
  border-color: rgba(210, 93, 61, 0.2);
  background: var(--warn-soft);
}

.helper {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.admin-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.table-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.table-card header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  overflow: auto;
  max-height: 460px;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  z-index: 1;
}

.table-note {
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

@keyframes ticker-slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.panel,
.hotel-card,
.room-card,
.selection-item,
.metric,
.table-card {
  animation: rise 260ms ease;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 780px) {
  .shell {
    width: min(100% - 18px, 100%);
    padding-top: 14px;
  }

  .hero,
  .filters-panel,
  .floor-panel,
  .booking-panel,
  .admin-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-top {
    flex-direction: column;
  }

  .filters-grid,
  .inline-filter-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .ticker-wrap {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: span 1;
  }

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

  table {
    min-width: 560px;
  }
}
