:root {
  --ink: #1B2A2E;
  --navy: #16232B;
  --navy-2: #1E313B;
  --navy-3: #2A4350;
  --brass: #B8874A;
  --brass-light: #D9AE72;
  --brass-hover: #A07238;
  --parchment: #F6F3EC;
  --card: #FFFFFF;
  --line: #E4DFD2;
  --sage: #5E7F5E;
  --sage-bg: #E9EFE6;
  --rust: #A9532F;
  --rust-bg: #F3E4DA;
  --muted: #7A8580;
  --shadow: 0 1px 2px rgba(22,35,43,0.06), 0 8px 24px -12px rgba(22,35,43,0.12);
  --shadow-lg: 0 10px 30px rgba(22,35,43,0.15);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Fraunces', Georgia, serif;
}

/* ---------- Layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Mobile Header (Hidden on Desktop) */
.mobile-topbar {
  display: none;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-brand {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-menu {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar */
.side {
  background: var(--navy);
  color: #EDEAE1;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand .mark {
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .2px;
  color: #fff;
}

.brand .sub {
  font-size: 11.5px;
  color: #9FB0AE;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #C7CFC9;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--navy-2);
  color: #fff;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  opacity: .85;
  flex-shrink: 0;
}

.nav-item.active {
  background: var(--navy-2);
  color: #fff;
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--brass-light);
}

.user-badge {
  background: var(--navy-2);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-info-name {
  font-weight: 600;
  font-size: 12.5px;
  color: #EDEAE1;
}

.user-info-role {
  font-size: 11px;
  color: var(--brass-light);
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #A9B7B4;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  margin-top: 4px;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.side-foot {
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11.5px;
  color: #8D9B97;
  line-height: 1.6;
}

/* Main Content */
main {
  padding: 26px 36px 60px;
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.range-pill {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.range-pill button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.range-pill button:hover {
  color: var(--ink);
}

.range-pill button.on {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.btn-primary {
  background: var(--brass);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--brass-hover);
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  text-decoration: none;
}

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

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

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

.kpi .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.kpi .value {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.kpi .value small {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.kpi .delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.delta.up {
  color: var(--sage);
  background: var(--sage-bg);
}

.delta.down {
  color: var(--rust);
  background: var(--rust-bg);
}

/* Panels */
.grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 0;
}

.panel-head .hint {
  font-size: 11.5px;
  color: var(--muted);
}

/* Calendar heatmap — rooms available to sell */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cal-legend .sw {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sw i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.cal-cell {
  border-radius: 7px;
  padding: 8px 6px;
  text-align: center;
  position: relative;
  border: 1px solid rgba(0,0,0,0.03);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cal-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.cal-cell .d {
  font-size: 10.5px;
  color: var(--muted);
}

.cal-cell .n {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
}

.cal-cell .lbl {
  font-size: 8.5px;
  text-transform: none;
  color: var(--muted);
  margin-top: 1px;
}

.lvl-0 { background: var(--rust-bg); border-color: #E0BCA9; }
.lvl-0 .n { color: #8A3E22; }

.lvl-1 { background: #F7E9C9; border-color: #E4D3A8; }
.lvl-1 .n { color: #8A6417; }

.lvl-2 { background: var(--sage-bg); border-color: #D2DFCD; }
.lvl-2 .n { color: #3F5B40; }

.lvl-3 { background: #DCE8DC; border-color: #C6DAC6; }
.lvl-3 .n { color: #3F5B40; }

/* Bars — booking pace */
.pace-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 6px;
}

.pace-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.pace-bars {
  width: 100%;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 100%;
  justify-content: center;
}

.bar {
  width: 9px;
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
}

.bar.actual {
  background: var(--navy);
}

.bar.forecast {
  background: var(--brass-light);
}

.pace-col .wk {
  font-size: 10.5px;
  color: var(--muted);
}

/* Room type table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
}

tr:last-child td {
  border-bottom: none;
}

.room-name {
  font-weight: 600;
}

.room-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.occ-bar-bg {
  background: #EDEAE0;
  border-radius: 20px;
  height: 6px;
  width: 100%;
  overflow: hidden;
}

.occ-bar-fill {
  background: var(--brass);
  height: 100%;
  border-radius: 20px;
  transition: width 0.4s ease;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Source of business donut-ish list */
.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.source-row:last-child {
  border-bottom: none;
}

.source-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-name {
  flex: 1;
  font-size: 13px;
}

.source-pct {
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.source-track {
  width: 70px;
  height: 5px;
  background: #EDEAE0;
  border-radius: 10px;
  overflow: hidden;
}

.source-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* Modal Popup */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(22, 35, 43, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #fff;
  border-radius: 14px;
  width: 90%;
  max-width: 580px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

/* Status indicator badge */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-success { background: var(--sage-bg); color: var(--sage); }
.badge-warning { background: #F7E9C9; color: #8A6417; }
.badge-danger { background: var(--rust-bg); color: var(--rust); }

footer.note {
  margin-top: 26px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    top: 0;
    left: -260px;
    z-index: 200;
    width: 250px;
    transition: left 0.25s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.25);
  }
  .side.open { left: 0; }
  .mobile-topbar { display: flex; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: repeat(5, 1fr); }
  main { padding: 18px 20px 50px; }
}

@media (max-width: 640px) {
  .kpi-row { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: repeat(4, 1fr); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .controls { width: 100%; justify-content: space-between; }
}

@media (max-width: 480px) {
  .cal-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Global Top Sync Notification Banner ---------- */
.global-sync-top-banner {
  background: linear-gradient(90deg, #EDF7EE 0%, #F5FAF5 100%);
  border: 1px solid #C5E1A5;
  border-left: 4px solid #2E7D32;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.sync-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #1B5E20;
}
.sync-banner-sub {
  color: #388E3C;
  font-size: 12px;
  margin-left: 4px;
}
.sync-text-highlight {
  color: #2E7D32;
  font-weight: 700;
}

