/*
 * A calm operating surface for the Embark desk.  The public site carries the
 * richer hotel character; the desk deliberately stays quieter for all-day use.
 */
:root {
  --desk-surface: #f6f7fa;
  --desk-panel: #ffffff;
  --desk-border: #e5e8ef;
  --desk-rail: #121b38;
  --desk-rail-border: #243058;
  --desk-rail-muted: #aeb9d7;
  --desk-title: #17233d;
  --desk-accent: #c79d4b;
  --desk-accent-soft: #f8f1e1;
}

.desk-page {
  background: linear-gradient(140deg, #f8f9fb 0%, var(--desk-surface) 54%, #f4f6f9 100%);
  color: var(--desk-title);
}

.desk-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  background: var(--desk-rail);
  border-right: 1px solid var(--desk-rail-border);
  box-shadow: none;
  padding: 20px 14px 18px;
  overflow-y: auto;
}

.sidebar::before {
  background: linear-gradient(90deg, transparent, #d7b76d, transparent);
  content: "";
  height: 1px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 12px;
}

.desk-brand {
  height: 76px;
  margin: 2px 8px 28px;
  padding: 0;
  width: 154px;
}

.desk-brand img {
  filter: none;
  opacity: 0.96;
}

.side-label {
  color: var(--desk-rail-muted);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  margin: 0 12px 10px;
}

.sidebar nav {
  gap: 3px;
}

.sidebar nav a {
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: #cbd4e9;
  font-size: 0.84rem;
  letter-spacing: 0;
  min-height: 42px;
  padding: 10px 12px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sidebar nav a::before {
  background: #8390b7;
  height: 5px;
  margin-right: 10px;
  width: 5px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgb(255 255 255 / 7%);
  border-left-color: var(--desk-accent);
  box-shadow: none;
  color: #ffffff;
  transform: none;
}

.sidebar nav a.active::before {
  background: #dfbd67;
  transform: none;
}

.sidebar nav a:focus-visible {
  outline: 2px solid #dfbd67;
  outline-offset: 3px;
}

.side-foot {
  border-top-color: rgb(225 234 255 / 16%);
  margin: 28px 8px 0;
  padding: 20px 6px 0;
}

.side-foot .side-label {
  color: #dfbd67;
  margin: 0 0 10px;
}

.side-foot p {
  color: #bbc5dd;
  font-size: 0.78rem;
  line-height: 1.45;
}

.side-foot a {
  font-size: 0.78rem;
}

.desk-main {
  max-width: 1440px;
  padding: clamp(28px, 3.5vw, 48px);
  padding-top: clamp(30px, 4vw, 50px);
}

.desk-header {
  margin-bottom: 26px;
  padding-bottom: 0;
}

.desk-header h1,
.panel-title h2 {
  color: var(--desk-title);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.desk-header h1 {
  font-size: clamp(2rem, 3.2vw, 3.15rem);
  line-height: 1.08;
}

.desk-header p,
.panel-title span {
  color: #66728a;
}

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

.text-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #344a73;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 700;
  min-height: 40px;
  padding: 0.45rem 0.55rem;
  white-space: nowrap;
}

.text-button:hover { background: #edf1f8; color: #223963; }
.text-button:focus-visible { outline: 2px solid #d4ad59; outline-offset: 2px; }

.desk-header .button,
.button {
  border-radius: 8px;
  box-shadow: none;
}

.desk-notice {
  background: #fff8e8;
  border: 1px solid #ead9a6;
  border-radius: 9px;
  color: #765713;
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.45;
  margin: -8px 0 18px;
  padding: 11px 13px;
}

.desk-notice.error { background: #fff6f6; border-color: #e7bdbd; color: #934141; }
.desk-notice.info { background: #f4f7fd; border-color: #cbd8f1; color: #3d5689; }

.desk-access-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e7d3cf;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgb(25 41 73 / 4%);
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin: 0 0 20px;
  padding: 28px 30px;
}

.desk-access-card[hidden] { display: none; }
.desk-access-card h2 { color: var(--desk-title); font-size: 1.38rem; margin: 0 0 8px; }
.desk-access-card p:not(.kicker) { color: #66728a; margin: 0; max-width: 700px; }
.desk-page.desk-blocked #overview,
.desk-page.desk-blocked #floor-board,
.desk-page.desk-blocked .desk-grid,
.desk-page.desk-blocked .inquiry-panel,
.desk-page.desk-blocked #booking,
.desk-page.desk-blocked #rooms,
.desk-page.desk-blocked .settings-layout,
.desk-page.desk-blocked #ledger { display: none; }

.metrics {
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 18px;
  scroll-margin-top: 24px;
}

.metric {
  background: var(--desk-panel);
  border: 1px solid var(--desk-border);
  border-radius: 11px;
  box-shadow: 0 5px 18px rgb(26 42 73 / 4%);
  min-height: 110px;
  padding: 18px;
}

.metric span,
.kicker,
.side-label {
  font-weight: 750;
}

.metric span {
  color: #64708a;
  font-size: 0.64rem;
}

.metric strong {
  color: var(--desk-title);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.7rem, 2.4vw, 2.25rem);
  letter-spacing: -0.04em;
}

.panel {
  background: var(--desk-panel);
  border: 1px solid var(--desk-border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgb(25 41 73 / 4%);
  padding: 22px 24px;
}

.panel-title {
  border-bottom-color: var(--desk-border);
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.panel-title h2 {
  font-size: clamp(1.38rem, 1.8vw, 1.7rem);
  line-height: 1.18;
}

.panel-title span {
  font-size: 0.78rem;
}

.kicker {
  color: #9a7939;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
}

.kicker.dark {
  color: #9a7939;
}

.desk-grid,
.settings-layout {
  gap: 16px;
}

.inquiry-panel {
  margin-bottom: 16px;
}

.booking-panel,
.property-settings,
#ledger {
  scroll-margin-top: 24px;
}

.property-settings .panel {
  padding: 24px;
}

.property-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(290px, 1fr) auto minmax(110px, auto);
}

.property-form label,
.form-group label {
  color: #33445f;
  display: grid;
  font-size: 0.7rem;
  gap: 8px;
  letter-spacing: 0.035em;
}

.property-form input {
  margin-top: 0;
  min-width: 0;
  width: 100%;
}

.property-form .button { min-width: 138px; }
.property-form .floor-plan-editor,
.property-form .floor-help,
.property-form .form-message { grid-column: 1 / -1; margin: 0; }
.property-form > .button[type="submit"] { grid-column: 1 / -1; justify-self: start; min-width: 176px; }
.property-form .floor-help { color: #6b7890; font-size: 0.76rem; line-height: 1.5; }

input,
select,
textarea,
.property-form input {
  background: #fbfcfe;
  border-color: #dfe4ed;
  border-radius: 8px;
  box-shadow: none;
  color: var(--desk-title);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6576a2;
  box-shadow: 0 0 0 3px rgb(86 109 157 / 12%);
}

.button {
  min-height: 44px;
  padding: 0.68rem 1rem;
}

.button-navy,
.inquiry-actions button:first-child {
  background: #26385f;
  border-color: #26385f;
}

.button-gold {
  background: #d4ad59;
  border-color: #d4ad59;
  color: #142442;
}

.button-gold:hover {
  background: #c7a04d;
  border-color: #c7a04d;
}

.room-form .button {
  min-height: 48px;
}

.table-wrap {
  border: 1px solid var(--desk-border);
  border-radius: 10px;
  overflow: hidden;
}

.table-wrap table {
  background: #ffffff;
}

th {
  background: #fafbfc;
  color: #596983;
  font-size: 0.66rem;
}

td,
th {
  border-bottom-color: #edf0f4;
  padding: 12px 11px;
}

.inquiry-row {
  border-bottom-color: #eceff4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px 0;
}

.inquiry-row span {
  color: #718099;
  display: block;
  line-height: 1.45;
  margin-top: 4px;
}

.inquiry-actions {
  gap: 7px;
}

.inquiry-actions button {
  border-color: #dce2ec;
  border-radius: 7px;
  color: #344a73;
  padding: 0.43rem 0.58rem;
}

.inquiry-actions button:first-child { color: #fff; }

.arrival-row span,
.task-row span {
  display: block;
  line-height: 1.4;
  margin-top: 4px;
}

.field-help {
  color: #6b7890;
  display: block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  margin-top: 7px;
}

.desk-main section:target {
  animation: desk-focus 700ms ease-out;
}

.scroll-to-top {
  align-items: center;
  background: #26385f;
  border: 1px solid #ffffff3d;
  border-radius: 999px;
  bottom: max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 10px 26px rgb(18 27 56 / 20%);
  color: #ffffff;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 750;
  gap: 6px;
  opacity: 0;
  padding: 0.7rem 0.86rem;
  pointer-events: none;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
  z-index: 55;
}

.scroll-to-top:hover { background: #172b52; }
.scroll-to-top:focus-visible { outline: 3px solid #d4ad59; outline-offset: 3px; }
.scroll-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@keyframes desk-focus {
  0% { box-shadow: 0 0 0 0 rgb(199 157 75 / 28%); }
  100% { box-shadow: 0 0 0 13px transparent; }
}

@media (max-width: 1000px) {
  .desk-shell {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }

  .sidebar {
    box-shadow: 0 7px 20px rgb(18 27 56 / 18%);
    min-width: 0;
    overflow: hidden;
    padding: 16px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 50;
  }

  .sidebar::before {
    display: none;
  }

  .desk-brand {
    flex: 0 0 auto;
    height: 58px;
    margin: 0 0 14px;
    width: 118px;
  }

  .sidebar nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .sidebar nav a {
    min-height: auto;
    padding: 9px 10px;
  }

  .sidebar nav a::before {
    display: none;
  }

  .property-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .property-form .button { justify-self: start; }

  .desk-main {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .sidebar {
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
  }

  .desk-brand {
    height: 50px;
    margin: 0;
    width: 105px;
  }

  .desk-brand img {
    height: 105px;
    width: 105px;
  }

  .sidebar nav {
    align-items: stretch;
    flex-basis: 0;
    gap: 4px;
    min-height: 52px;
    width: 0;
  }

  .sidebar nav a {
    align-items: center;
    display: flex;
    flex: 1 0 66px;
    font-size: 0.68rem;
    justify-content: center;
    line-height: 1.12;
    min-height: 52px;
    min-width: 66px;
    padding: 7px 8px;
    text-align: center;
  }

  .desk-main section[id] { scroll-margin-top: 82px; }

  .desk-main {
    padding: 24px 18px 32px;
  }

  .desk-header-actions,
  .inquiry-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .desk-header-actions { gap: 6px; width: 100%; }
  .desk-header-actions .button { flex: 1 1 100%; }
  .desk-access-card { align-items: flex-start; flex-direction: column; gap: 18px; padding: 22px; }

  .inquiry-row { display: flex; }

  .panel,
  .property-settings .panel {
    padding: 18px;
  }

  .property-form {
    align-items: stretch;
  }

  .property-form label,
  .property-form input,
  .property-form .button {
    width: 100%;
  }

  .property-form .button { justify-self: stretch; }
}
