/* public/styles.css */
*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root, [data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #222638;
  --border: #2e3248;
  --text: #e8eaf0;
  --text2: #8b90a8;
  --accent: #4f7cff;
  --accent2: #6b93ff;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --radius: 8px;
  --sidebar-w: 220px;
}

[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #fff;
  --bg3: #e4e7f0;
  --border: #c8cde0;
  --text: #1a1d2e;
  --text2: #5a6080;
  --accent: #3b6ef0;
  --accent2: #5580ff;
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --radius: 8px;
  --sidebar-w: 220px;
}

[data-theme="special"] {
  --bg: #070d1a;
  --bg2: #0d1628;
  --bg3: #152035;
  --border: #1e3050;
  --text: #cdd8f0;
  --text2: #6a85b0;
  --accent: #38bdf8;
  --accent2: #60caff;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --radius: 8px;
  --sidebar-w: 220px;
}

[data-theme="retro"] {
  --bg: #0c0900;
  --bg2: #160e00;
  --bg3: #211500;
  --border: #3d2900;
  --text: #e8a000;
  --text2: #7a5200;
  --accent: #ffb800;
  --accent2: #ffc933;
  --green: #e8a000;
  --yellow: #fc0;
  --red: #c40;
  --radius: 0px;
  --sidebar-w: 220px;
}

[data-theme="retro"] body {
  background-image: repeating-linear-gradient(#0000 0 3px, #00000040 3px 4px);
}

[data-theme="retro"] #sidebar, [data-theme="retro"] #topbar, [data-theme="retro"] .card, [data-theme="retro"] .billing-card, [data-theme="retro"] .data-table th, [data-theme="retro"] .gantt-bar {
  text-shadow: 0 0 6px #e8a00099;
}

[data-theme="retro"] h1, [data-theme="retro"] h2, [data-theme="retro"] .billing-card-num, [data-theme="retro"] .stat-card .value {
  text-shadow: 0 0 12px #ffb800cc;
  letter-spacing: .05em;
}

[data-theme="retro"] .btn-primary {
  color: #0c0900;
  background: #e8a000;
  box-shadow: 0 0 10px #e8a00080;
}

[data-theme="retro"] nav a.active {
  box-shadow: inset 0 0 8px #e8a0004d;
}

[data-theme="forest"] {
  --bg: #111a12;
  --bg2: #192b1b;
  --bg3: #223824;
  --border: #2e4e32;
  --text: #c8dfc0;
  --text2: #6e9470;
  --accent: #5aaa3e;
  --accent2: #74c456;
  --green: #4db86a;
  --yellow: #c49a20;
  --red: #c05050;
  --radius: 10px;
  --sidebar-w: 220px;
}

[data-theme="hotdog"] {
  --bg: #8b1a00;
  --bg2: #c49000;
  --bg3: #a02200;
  --border: #6b1200;
  --text: #fff8e0;
  --text2: #ffe090;
  --accent: #fff8e0;
  --accent2: #fff;
  --green: #a8d060;
  --yellow: #ffe44d;
  --red: #fff8e0;
  --radius: 0px;
  --sidebar-w: 220px;
}

[data-theme="hotdog"] .sidebar-logo:after, [data-theme="hotdog"] #topbar h1:after {
  content: " 🌭";
}

body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

#root {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  position: fixed;
  z-index: 100;
  flex-direction: column;
  top: 0;
  bottom: 0;
  left: 0;
}

.sidebar-logo {
  color: var(--accent2);
  border-bottom: 1px solid var(--border);
  letter-spacing: -.3px;
  padding: 20px 16px 16px;
  font-size: 16px;
  font-weight: 700;
}

.sidebar-logo span {
  color: var(--text2);
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
}

nav {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
}

nav a {
  display: flex;
  border-radius: var(--radius);
  color: var(--text2);
  text-decoration: none;
  cursor: pointer;
  align-items:  center;
  gap: 10px;
  padding: 9px 12px;
  transition: background .12s, color .12s;
  font-size: 13.5px;
}

nav a:hover {
  background: var(--bg3);
  color: var(--text);
}

nav a.active {
  background: var(--bg3);
  color: var(--accent2);
  font-weight: 500;
}

nav a .icon {
  text-align: center;
  width: 20px;
  font-size: 16px;
}

nav .nav-section {
  letter-spacing: .8px;
  color: var(--text2);
  text-transform: uppercase;
  padding: 16px 12px 4px;
  font-size: 10px;
  font-weight: 600;
}

.sidebar-settings-btn {
  display: flex;
  color: var(--text2);
  text-decoration: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  transition: color .15s, background .15s;
  font-size: 18px;
}

.sidebar-settings-btn:hover {
  color: var(--text);
  background: var(--bg3);
}

.sidebar-settings-btn.active {
  color: var(--accent);
}

#main {
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

#topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  position: sticky;
  z-index: 50;
  align-items:  center;
  gap: 12px;
  height: 52px;
  padding: 0 24px;
  top: 0;
}

#topbar h1 {
  font-size: 16px;
  font-weight: 600;
}

.topbar-date {
  color: var(--text2);
  font-size: 13px;
}

.af-root {
  position: relative;
  flex-shrink: 0;
}

.af-trigger {
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  position: relative;
  background: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 32px;
  height: 32px;
  transition: background .15s, color .15s, border-color .15s;
  font-size: 15px;
}

.af-trigger:hover, .af-trigger-open {
  background: var(--bg3);
  color: var(--accent);
  border-color: var(--accent);
}

.af-badge {
  position: absolute;
  background: var(--accent);
  color: #fff;
  display: flex;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 16px;
  height: 16px;
  font-size: 9px;
  top: -4px;
  right: -4px;
}

.af-panel {
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--border);
  z-index: 400;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform-origin: top right;
  border-radius: 14px;
  flex-direction: column;
  width: 360px;
  max-height: 520px;
  transition: transform .18s, opacity .18s;
  top: calc(100% + 10px);
  right: 0;
  transform: scale(.94)translateY(-8px);
  box-shadow: 0 8px 40px #00000073;
}

.af-panel-open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1)translateY(0);
}

.af-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: space-between;
  align-items:  center;
  padding: 11px 14px 10px;
}

.af-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.af-icon-btn {
  color: var(--text2);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  transition: color .12s;
  font-size: 13px;
}

.af-icon-btn:hover {
  color: var(--text);
}

.af-messages {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  min-height: 0;
  padding: 10px 12px 4px;
}

.af-empty {
  display: flex;
  color: var(--text2);
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items:  center;
  gap: 10px;
  padding: 24px 8px;
}

.af-empty p {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.af-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.af-suggestion {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  padding: 6px 12px;
  transition: border-color .12s, color .12s;
  font-family: inherit;
  font-size: 11px;
}

.af-suggestion:hover {
  border-color: var(--accent);
  color: var(--text);
}

.af-msg {
  display: flex;
}

.af-msg-user {
  justify-content: flex-end;
}

.af-msg-assistant {
  justify-content: flex-start;
}

.af-bubble {
  border-radius: 12px;
  max-width: 84%;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

.af-msg-user .af-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.af-msg-assistant .af-bubble {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.af-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12.5px;
}

.af-thinking {
  display: flex;
  align-items:  center;
  gap: 4px;
  padding: 10px 14px;
}

.af-dot {
  background: var(--text2);
  animation: af-bounce 1.2s infinite ease-in-out;
  border-radius: 50%;
  width: 6px;
  height: 6px;
}

.af-dot:nth-child(2) {
  animation-delay: .2s;
}

.af-dot:nth-child(3) {
  animation-delay: .4s;
}

@keyframes af-bounce {
  0%, 80%, 100% {
    transform: scale(.7);
    opacity: .4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.af-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}

.af-action-detail summary {
  color: var(--text2);
  cursor: pointer;
  list-style: none;
  padding: 1px 0;
  font-size: 10px;
}

.af-action-detail summary:before {
  content: "▸ ";
}

.af-action-detail[open] summary:before {
  content: "▾ ";
}

.af-action-json {
  color: var(--text2);
  background: var(--bg2);
  overflow-x: auto;
  white-space: pre;
  border-radius: 5px;
  margin-top: 3px;
  padding: 5px 7px;
  font-size: 9px;
}

.af-input-row {
  display: flex;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items:  flex-end;
  gap: 6px;
  padding: 8px 12px 12px;
}

.af-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  resize: none;
  overflow-y: auto;
  border-radius: 8px;
  flex: 1;
  max-height: 100px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
}

.af-input:focus {
  outline: none;
  border-color: var(--accent);
}

.af-send {
  display: flex;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
}

#gsearch-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 16px;
}

.gsearch-icon {
  position: absolute;
  color: var(--text2);
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}

#gsearch-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  border-radius: 20px;
  width: 100%;
  padding: 6px 12px 6px 32px;
  transition: border-color .15s, background .15s;
  font-size: 13px;
}

#gsearch-input:focus {
  border-color: var(--accent);
  background: var(--bg2);
}

#gsearch-input::-webkit-search-cancel-button {
  display: none;
}

#gsearch-dropdown {
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  overflow: hidden;
  overflow-y: auto;
  max-height: 420px;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  box-shadow: 0 8px 24px #00000073;
}

.gsearch-item {
  display: flex;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  align-items:  center;
  gap: 10px;
  padding: 9px 14px;
  transition: background .1s;
}

.gsearch-item:last-child {
  border-bottom: none;
}

.gsearch-item:hover, .gsearch-item.focused {
  background: var(--bg3);
}

.gsearch-room {
  color: var(--accent2);
  text-align: center;
  background: var(--bg3);
  border-radius: 5px;
  min-width: 36px;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 700;
}

.gsearch-guest {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.gsearch-meta {
  color: var(--text2);
  white-space: nowrap;
  font-size: 11px;
}

.gsearch-status {
  border-radius: 10px;
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
}

.gsearch-empty {
  text-align: center;
  color: var(--text2);
  padding: 14px;
  font-size: 13px;
}

.gsearch-loading {
  color: var(--text2);
  padding: 10px 14px;
  font-size: 12px;
}

#content {
  flex: 1;
  padding: 24px;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-bar input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  flex: 1;
  padding: 8px 12px;
  font-size: 13.5px;
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  outline: none;
  padding: 8px 12px;
  font-size: 13.5px;
}

.btn {
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  padding: 7px 14px;
  transition: opacity .12s;
  font-size: 13px;
  font-weight: 500;
}

.btn:hover {
  opacity: .85;
}

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

.btn-secondary {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--text);
}

.btn-ghost {
  background: var(--bg3);
  color: var(--text);
}

.btn-green {
  background: var(--green);
  color: #fff;
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.btn-yellow {
  background: var(--yellow);
  color: #000;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-card .label {
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 12px;
}

.stat-card .value {
  margin: 4px 0 2px;
  font-size: 32px;
  font-weight: 700;
}

.stat-card .sub {
  color: var(--text2);
  font-size: 12px;
}

.stat-card.green {
  border-color: var(--green);
}

.stat-card.yellow {
  border-color: var(--yellow);
}

.stat-card.blue {
  border-color: var(--accent);
}

.stat-card.red {
  border-color: var(--red);
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding: 14px 18px;
}

.card-header h2 {
  font-size: 14px;
  font-weight: 600;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th {
  text-align: left;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
}

td {
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  padding: 11px 16px;
  font-size: 13.5px;
}

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

tr:hover td {
  background: var(--bg3);
}

tbody tr {
  cursor: pointer;
}

.badge {
  display: inline-block;
  letter-spacing: .3px;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.badge-confirmed {
  color: #60a5fa;
  background: #1e3a5f;
}

.badge-tentative {
  color: #fdba74;
  background: #451a03;
}

.badge-checked_in {
  color: #4ade80;
  background: #14532d;
}

.badge-checking_out {
  color: #fb923c;
  background: #431407;
}

.badge-checked-in {
  color: #4ade80;
  background: #14532d;
}

.badge-checking-out {
  color: #fb923c;
  background: #431407;
}

.badge-checked_out, .badge-checked-out {
  color: #a8a29e;
  background: #292524;
}

.badge-cancelled {
  color: #f87171;
  background: #450a0a;
}

.badge-no_show, .badge-no-show {
  color: #c084fc;
  background: #3b1f6e;
}

.status-chip.tentative {
  color: #fdba74;
  background: #451a03;
}

.status-chip.checking_out {
  color: #fb923c;
  background: #431407;
}

.badge-tentative {
  color: #fbbf24;
  background: #3b2f00;
}

.modal-backdrop {
  position: fixed;
  z-index: 200;
  display: flex;
  background: #000000a6;
  justify-content: center;
  align-items:  center;
  padding: 24px;
  inset: 0;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  overflow-y: auto;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
}

.modal-wide {
  max-width: 860px;
}

.modal-header {
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items:  center;
  padding: 18px 22px 14px;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

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

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  padding: 8px 11px;
  font-family: inherit;
  font-size: 13.5px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 72px;
}

.view-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.view-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.view-subtitle {
  color: var(--text2);
  margin-top: 2px;
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.detail-section h3 {
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text2);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
}

.detail-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  padding: 5px 0;
}

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

.detail-row .k {
  color: var(--text2);
  font-size: 12.5px;
}

.detail-row .v {
  font-size: 13px;
  font-weight: 500;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.empty {
  text-align: center;
  color: var(--text2);
  padding: 48px 24px;
}

.empty .icon {
  margin-bottom: 12px;
  font-size: 40px;
}

.empty p {
  font-size: 14px;
}

.loading {
  text-align: center;
  color: var(--text2);
  padding: 40px;
}

.planning-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 16px;
  margin-bottom: 16px;
}

.plan-date-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  padding: 5px 10px;
  font-size: 13px;
}

.plan-date-input:focus {
  border-color: var(--accent);
}

.gantt-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  height: calc(100vh - 310px);
}

.gantt-header {
  display: flex;
  position: sticky;
  z-index: 20;
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  top: 0;
}

.gantt-corner {
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text2);
  border-right: 1px solid var(--border);
  position: sticky;
  z-index: 30;
  background: var(--bg2);
  display: flex;
  align-items:  center;
  width: 120px;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  left: 0;
}

.gantt-header-dates {
  display: flex;
}

.gantt-day-head {
  text-align: center;
  border-right: 1px solid var(--border);
  padding: 3px 1px;
}

.gantt-day-head.today {
  background: #4f7cff1f;
}

.gantt-dow {
  display: block;
  color: var(--text2);
  text-transform: capitalize;
  font-size: .65em;
}

.gantt-daynum {
  display: block;
  font-size: .8em;
  font-weight: 600;
}

.gantt-day-head.today .gantt-daynum {
  color: var(--accent2);
}

.gantt-day-head.weekend .gantt-daynum {
  color: var(--yellow);
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

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

.gantt-row:hover .gantt-cells-col {
  background: #ffffff03;
}

.gantt-row-room-header {
  border-bottom: none;
  min-height: 20px !important;
}

.gantt-label-room-header {
  background: color-mix(in srgb, var(--room-color, #4f7cff) 18%, var(--bg2)) !important;
  border-right-color: color-mix(in srgb, var(--room-color, #4f7cff) 40%, var(--border)) !important;
  flex-direction: row !important;
  align-items:  center !important;
  gap: 5px !important;
  min-height: 20px !important;
}

.gantt-room-code-hdr {
  color: var(--text1);
  font-size: .8em;
  font-weight: 700;
}

.gantt-room-type-hdr {
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .7em;
}

.gantt-cell-hdr {
  pointer-events: none;
  background: color-mix(in srgb, var(--room-color, #4f7cff) 8%, transparent) !important;
  cursor: default !important;
}

.gantt-cell-hdr.weekend {
  background: color-mix(in srgb, var(--room-color, #4f7cff) 12%, transparent) !important;
}

.gantt-cell-hdr.today {
  background: color-mix(in srgb, var(--room-color, #4f7cff) 16%, transparent) !important;
}

.gantt-label-plaza {
  padding-left: 16px !important;
}

.gantt-bed-label {
  color: var(--text2);
  font-size: .7em;
}

.gantt-row-bed .gantt-label-col {
  background: var(--bg1);
}

.gantt-row-bed .gantt-cell {
  background: #00000008;
}

.gantt-row-bed .gantt-cell.weekend {
  background: #0000000d;
}

.gantt-row-room-last {
  border-bottom: 2px solid var(--border);
}

.gantt-label-col {
  border-right: 1px solid var(--border);
  position: sticky;
  z-index: 10;
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  width: 120px;
  min-width: 120px;
  min-height: 32px;
  padding: 0 8px;
  left: 0;
}

.gantt-room-code {
  font-size: .85em;
  font-weight: 600;
}

.gantt-room-type {
  color: var(--text2);
  font-size: .7em;
}

.gantt-cells-col {
  position: relative;
  display: flex;
  flex-shrink: 0;
}

.gantt-cell {
  border-right: 1px solid var(--border);
  cursor: crosshair;
  flex-shrink: 0;
  min-height: 32px;
}

.gantt-cell:hover {
  background: #4f7cff14 !important;
}

.gantt-cell.weekend {
  background: #ffffff05;
}

.gantt-cell.today {
  background: #4f7cff12;
}

.gantt-bar {
  position: absolute;
  cursor: pointer;
  display: flex;
  overflow: hidden;
  white-space: nowrap;
  z-index: 5;
  border-radius: 3px;
  align-items:  center;
  gap: 4px;
  min-width: 0;
  height: calc(100% - 6px);
  padding: 0 5px;
  transition: filter .1s;
  top: 3px;
}

.gantt-bar:hover {
  filter: brightness(1.25);
}

.gantt-bar-noshow {
  background-image: repeating-linear-gradient(45deg, #0000, #0000 4px, #00000026 4px 8px) !important;
}

.gantt-cell-blocked {
  cursor: not-allowed;
  background-image: repeating-linear-gradient(45deg, #0000, #0000 4px, #ef44441f 4px 8px) !important;
}

.gantt-cell-blocked:hover {
  background-image: repeating-linear-gradient(45deg, #0000, #0000 4px, #ef444433 4px 8px) !important;
}

.drawer-backdrop {
  position: fixed;
  z-index: 1100;
  background: #00000073;
  inset: 0;
}

.drawer-panel {
  position: fixed;
  background: var(--bg2);
  z-index: 1101;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  width: min(680px, 100vw);
  height: 100dvh;
  top: 0;
  right: 0;
  box-shadow: -8px 0 32px #0006;
}

.ctx-menu {
  position: fixed;
  z-index: 9999;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 190px;
  padding: 4px;
  box-shadow: 0 8px 24px #00000059;
}

.ctx-item {
  display: flex;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  align-items:  center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
}

.ctx-item:hover {
  background: #ffffff12;
}

.ctx-item-warn {
  color: var(--red);
}

.ctx-item-warn:hover {
  background: #ef44441a;
}

.ctx-item-ok {
  color: var(--green);
}

.ctx-item-ok:hover {
  background: #22c55e1a;
}

.ctx-icon {
  text-align: center;
  width: 18px;
  font-size: 14px;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

.gantt-bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  flex: 1;
  min-width: 0;
  font-size: .75em;
  font-weight: 600;
}

.gantt-bar-due {
  color: #fff;
  letter-spacing: 0;
  background: #ef4444;
  border-radius: 3px;
  flex-shrink: 0;
  padding: 0 3px;
  font-size: .7em;
  font-weight: 700;
  line-height: 1.5;
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.gantt-legend-item {
  display: flex;
  color: var(--text2);
  align-items:  center;
  gap: 5px;
  font-size: 12px;
}

.gantt-legend-dot {
  border-radius: 3px;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.occ-banner {
  display: flex;
  border-radius: var(--radius);
  border: 1px solid;
  flex-wrap: wrap;
  align-items:  center;
  gap: 20px;
  margin-bottom: 12px;
  padding: 10px 16px;
}

.occ-left {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 10px;
  min-width: 180px;
}

.occ-pct {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.occ-label {
  color: var(--text2);
  font-size: 12px;
}

.occ-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.occ-rate-item {
  display: flex;
  align-items:  center;
  gap: 6px;
}

.occ-rate-item label {
  color: var(--text2);
  white-space: nowrap;
  font-size: 12px;
}

.occ-rate-input-wrap {
  position: relative;
  display: flex;
  align-items:  center;
}

.occ-price-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  width: 80px;
  padding: 4px 22px 4px 8px;
  font-family: inherit;
  font-size: 13px;
}

.occ-price-input:focus {
  outline: none;
  border-color: var(--accent);
}

.occ-currency {
  position: absolute;
  color: var(--text2);
  pointer-events: none;
  font-size: 12px;
  right: 7px;
}

.checkin-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkin-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.checkin-section-title {
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text2);
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
}

.guest-search-wrap {
  position: relative;
}

.guest-search-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  width: 100%;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
}

.guest-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.guest-results {
  position: absolute;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  overflow-y: auto;
  max-height: 200px;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
}

.guest-result-item {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
}

.guest-result-item[data-id]:hover {
  color: var(--accent2);
  background: #4f7cff1f;
}

.guest-selected {
  display: flex;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: #4f7cff1a;
  align-items:  center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.guest-selected span {
  flex: 1;
}

.status-chip {
  display: inline-block;
  white-space: nowrap;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.status-chip.confirmed {
  color: #60a5fa;
  background: #1e3a5f;
}

.status-chip.checked_in {
  color: #4ade80;
  background: #14532d;
}

.status-chip.checked_out {
  color: #a8a29e;
  background: #292524;
}

.status-chip.cancelled {
  color: #f87171;
  background: #450a0a;
}

.status-chip.no_show {
  color: #c084fc;
  background: #3b1f6e;
}

.status-chip.tentative {
  color: #fbbf24;
  background: #3b2f00;
}

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

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

.data-table th {
  background: var(--bg3);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
}

.data-table td {
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  padding: 8px 12px;
}

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

.data-table tr:hover td {
  background: #ffffff05;
}

.data-table a {
  color: var(--accent2);
  text-decoration: none;
}

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

.day-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 12px;
  padding: 10px 0 14px;
}

.day-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.day-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  min-width: 120px;
  padding: 14px 18px;
}

.day-stat.checked {
  border-color: #22c55e44;
}

.day-stat.total {
  border-color: #4f7cff44;
}

.day-stat-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.day-stat-label {
  color: var(--text2);
  font-size: 12px;
}

.billing-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.billing-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  min-width: 150px;
  padding: 14px 18px;
}

.billing-card.green {
  border-color: #22c55e44;
}

.billing-card.red {
  border-color: #ef444444;
}

.billing-card-label {
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text2);
  font-size: 11px;
}

.billing-card-num {
  font-size: 22px;
  font-weight: 700;
}

.billing-card-sub {
  color: var(--text2);
  font-size: 11px;
}

.tab-bar {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius);
  gap: 4px;
  padding: 3px;
}

.tab-btn {
  color: var(--text2);
  border-radius: calc(var(--radius)  - 2px);
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 5px 14px;
  transition: background .15s, color .15s;
  font-family: inherit;
  font-size: 13px;
}

.tab-btn:hover {
  color: var(--text);
  background: #ffffff0d;
}

.tab-btn.active {
  background: var(--bg2);
  color: var(--text);
  font-weight: 600;
}

#agent-fab {
  position: fixed;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  z-index: 300;
  display: flex;
  border: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 52px;
  height: 52px;
  transition: transform .15s, box-shadow .15s;
  font-size: 22px;
  bottom: 28px;
  right: 28px;
  box-shadow: 0 4px 20px #4f7cff80;
}

#agent-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px #4f7cffb3;
}

#agent-panel {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  z-index: 300;
  display: flex;
  opacity: 0;
  pointer-events: none;
  border-radius: 16px;
  flex-direction: column;
  width: 380px;
  max-height: 600px;
  transition: transform .2s, opacity .2s;
  bottom: 90px;
  right: 28px;
  transform: scale(.92)translateY(20px);
  box-shadow: 0 8px 40px #00000080;
}

#agent-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1)translateY(0);
}

#agent-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: space-between;
  align-items:  center;
  padding: 14px 16px 12px;
}

#agent-messages {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  min-height: 0;
  padding: 14px;
}

.agent-msg {
  border-radius: 14px;
  max-width: 88%;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.5;
}

.agent-msg-user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self:  flex-end;
}

.agent-msg-assistant {
  background: var(--bg3);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self:  flex-start;
}

.agent-thinking {
  opacity: .5;
  font-style: italic;
}

.agent-li {
  display: block;
  margin-left: 4px;
}

.agent-action {
  color: var(--text2);
  border: 1px solid var(--border);
  background: #ffffff0a;
  border-radius: 20px;
  align-self:  flex-start;
  padding: 3px 10px;
  font-size: 11px;
}

#agent-quick {
  display: flex;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 6px;
  padding: 8px 14px;
}

.agent-quick-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  border-radius: 20px;
  padding: 4px 10px;
  transition: border-color .15s, color .15s;
  font-family: inherit;
  font-size: 11px;
}

.agent-quick-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

#agent-input-row {
  display: flex;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items:  flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
}

#agent-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  resize: none;
  overflow-y: auto;
  border-radius: 10px;
  flex: 1;
  max-height: 120px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
}

#agent-input:focus {
  outline: none;
  border-color: var(--accent);
}

#agent-send {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  transition: background .15s;
  font-size: 16px;
}

#agent-send:hover {
  background: var(--accent2);
}

#agent-send:disabled {
  background: var(--bg3);
  color: var(--text2);
  cursor: default;
}

.rates-table-header {
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text2);
  border-bottom: 2px solid var(--border);
  background: none;
  margin-bottom: 4px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
}

.rate-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr 1fr 180px;
  border-radius: var(--radius);
  align-items:  center;
  gap: 10px;
  padding: 8px 14px;
  transition: background .1s;
}

.rate-row:hover {
  background: var(--bg2);
}

.rate-row-base {
  border-left: 3px solid var(--accent);
  margin-bottom: 2px;
}

.rate-row-child {
  border-left: 3px solid var(--border);
  margin-left: 18px;
}

.rate-row-locked {
  opacity: .75;
}

.rate-row-locked:hover {
  opacity: 1;
}

@keyframes flash-green {
  0%, 100% {
    background: none;
  }

  30% {
    background: #0d2e1c;
  }
}

.rate-saved {
  animation: flash-green .8s ease;
}

.rate-indent {
  color: var(--text2);
  margin-right: 4px;
  font-family: monospace;
}

.rate-title {
  font-size: 13.5px;
  font-weight: 500;
}

.rate-code {
  color: var(--text2);
  background: var(--bg3);
  border-radius: 4px;
  margin-left: 6px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 10px;
}

.rate-rule-badge {
  background: var(--bg3);
  color: var(--text2);
  white-space: nowrap;
  display: inline-block;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
}

.rate-rule-base {
  color: var(--accent2);
  background: #0d2140;
}

.rate-op-badge {
  white-space: nowrap;
  display: inline-block;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.rate-adj {
  color: var(--accent2);
  font-size: 13px;
  font-weight: 600;
}

.rate-price-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: right;
  outline: none;
  border-radius: 6px;
  width: 90px;
  padding: 4px 8px;
  font-size: 13px;
}

.rate-price-input:focus {
  border-color: var(--accent);
  background: var(--bg2);
}

.rate-price-input:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.rate-col-controls {
  display: flex;
  align-items:  center;
  gap: 6px;
}

.rate-toggle {
  display: flex;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  align-items:  center;
  gap: 4px;
  font-size: 11px;
}

.rate-toggle input {
  accent-color: var(--accent);
  cursor: pointer;
}

.rate-toggle-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.rate-toggle-disabled input {
  cursor: not-allowed;
}

.rate-lock-btn {
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background .1s;
  font-size: 15px;
}

.rate-lock-btn:hover {
  background: var(--bg3);
}

.rate-lock-btn.locked {
  opacity: 1;
}

.rate-lock-btn.unlocked {
  opacity: .5;
}

.rate-delete-btn {
  opacity: .6;
  color: var(--red) !important;
}

.rate-delete-btn:hover {
  opacity: 1;
  background: #ef44441a !important;
}

.rate-section-label {
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 12px 14px 4px;
  font-size: 11px;
}

.rates-operators-panel {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 28px;
  padding: 16px;
}

.rates-operators-panel h3 {
  color: var(--text2);
  margin-bottom: 10px;
  font-size: 13px;
}

.op-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.op-chip {
  white-space: nowrap;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.op-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  align-items:  center;
  gap: 10px;
  padding: 6px 0;
}

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

#pcal-wrap {
  display: flex;
  overflow: hidden;
  background: var(--bg);
  flex-direction: column;
  height: calc(100vh - 100px);
  margin: -24px;
}

#pcal-toolbar {
  display: flex;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items:  center;
  gap: 8px;
  padding: 8px 16px;
}

#pcal-range {
  text-align: center;
  min-width: 160px;
  font-size: 13px;
  font-weight: 500;
}

.pcal-toolbar-sep {
  background: var(--border);
  width: 1px;
  height: 18px;
  margin: 0 4px;
}

.pcal-legend-item {
  white-space: nowrap;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
}

#pcal-rate-selector {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 300;
  overflow-y: auto;
  min-width: 200px;
  max-height: 60vh;
  padding: 12px 14px;
  top: 110px;
  right: 24px;
  box-shadow: 0 8px 24px #0006;
}

#pcal-scroll-outer {
  overflow: auto;
  position: relative;
  flex: 1;
}

#pcal-grid {
  position: relative;
}

.pcal-header-row {
  display: flex;
  position: sticky;
  z-index: 10;
}

.pcal-month-row {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  top: 0;
}

.pcal-day-row {
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  top: 28px;
}

.pcal-month-cell {
  display: flex;
  color: var(--text2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  height: 28px;
  font-size: 11px;
  font-weight: 600;
}

.pcal-day-cell {
  display: flex;
  border-right: 1px solid var(--border);
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  height: 36px;
  font-size: 11px;
}

.pcal-dow {
  color: var(--text2);
  text-transform: uppercase;
  font-size: 9px;
}

.pcal-dn {
  font-size: 12px;
  font-weight: 600;
}

.pcal-day-cell.pcal-weekend {
  background: #4f7cff0f;
}

.pcal-day-cell.pcal-today .pcal-dn {
  background: var(--accent);
  color: #fff;
  display: flex;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 18px;
  height: 18px;
}

.pcal-label-cell {
  position: relative;
  background: var(--bg2);
  border-right: 2px solid var(--border);
  display: flex;
  z-index: 5;
  flex-shrink: 0;
  align-items:  center;
  gap: 6px;
  padding: 0 10px;
}

.pcal-rate-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  font-size: 12.5px;
  font-weight: 500;
}

.pcal-rate-code {
  color: var(--text2);
  font-family: monospace;
  font-size: 10px;
}

.pcal-indent {
  color: var(--text2);
  font-family: monospace;
}

.pcal-readonly-badge {
  color: var(--yellow);
  background: #f59e0b26;
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 9px;
}

.pcal-rate-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.pcal-base-row {
  background: #4f7cff0a;
}

.pcal-derived-row {
  background: none;
}

.pcal-noedit-row {
  opacity: .45;
  filter: grayscale(.4);
}

.pcal-cell {
  display: flex;
  position: relative;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  gap: 2px;
  transition: background .1s;
  font-size: 12px;
}

.pcal-cell.pcal-weekend {
  background: #4f7cff0a;
}

.pcal-cell.pcal-today {
  background: #4f7cff1a !important;
}

.pcal-cell.pcal-editable:hover {
  cursor: pointer;
  background: var(--bg3) !important;
}

.pcal-cell.pcal-readonly {
  cursor: not-allowed;
}

.pcal-cell.pcal-override {
  color: #f59e0b;
  font-weight: 600;
}

.pcal-cell.pcal-base-price {
  color: var(--text);
}

.pcal-cell.pcal-derived-price {
  color: var(--text2);
  font-size: 11px;
}

.pcal-dot {
  color: #f59e0b;
  position: absolute;
  font-size: 6px;
  top: 4px;
  right: 4px;
}

.pcal-legend-item.pcal-override {
  color: #f59e0b;
  background: #f59e0b26;
}

.pcal-legend-item.pcal-base-price {
  color: var(--accent2);
  background: #4f7cff26;
}

.pcal-legend-item.pcal-derived-price {
  background: var(--bg3);
  color: var(--text2);
}

.pcal-legend-item.pcal-locked {
  background: var(--bg3);
  color: var(--text2);
  opacity: .5;
}

#pcal-sel-bar {
  position: sticky;
  display: flex;
  background: var(--bg2);
  border-top: 2px solid var(--accent);
  z-index: 200;
  flex-wrap: wrap;
  align-items:  center;
  gap: 16px;
  padding: 10px 16px;
  bottom: 0;
  left: 0;
  right: 0;
  box-shadow: 0 -4px 16px #00000059;
}

.pcal-sel-count {
  color: var(--accent);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

#pcal-editor {
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  z-index: 1000;
  min-width: 210px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px #00000080;
}

.pcal-editor-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.pcal-editor-date {
  color: var(--text2);
  font-weight: 400;
}

.pcal-editor-body {
  display: flex;
  align-items:  center;
  gap: 6px;
  margin-bottom: 8px;
}

.pcal-editor-body input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  border-radius: 6px;
  flex: 1;
  padding: 6px 8px;
  font-size: 14px;
}

.pcal-editor-body input:focus {
  border-color: var(--accent);
}

.pcal-editor-unit {
  color: var(--text2);
  font-size: 13px;
}

.pcal-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pcal-cell.pcal-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 1;
  background: #4f7cff2e !important;
}

.pcal-cell {
  user-select: none;
  cursor: default;
}

.pcal-cell.pcal-editable {
  cursor: pointer;
}

.pcal-cell.pcal-closed {
  color: #ef4444;
  font-size: 10px;
  font-weight: 700;
  background: #ef44442e !important;
}

.pcal-cell.pcal-closed.pcal-weekend {
  background: #ef444440 !important;
}

.pcal-legend-item.pcal-loverride {
  color: #f59e0b;
  background: #f59e0b26;
}

.pcal-legend-item.pcal-lclosed {
  color: #ef4444;
  background: #ef44442e;
}

.pcal-legend-item.pcal-lderived {
  background: var(--bg3);
  color: var(--text2);
}

.pcal-close-label {
  display: flex;
  cursor: pointer;
  align-items:  center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}

.pcal-close-label input {
  accent-color: #ef4444;
}

.pcal-rule-tag {
  color: var(--text2);
  background: var(--bg3);
  white-space: nowrap;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
}

.btn-danger {
  color: #ef4444;
  background: #ef444433;
  border: 1px solid #ef44444d;
}

.btn-danger:hover {
  background: #ef444459;
}

.rate-row-flat {
  border-left: 3px solid var(--border);
}

.gantt-bar[draggable] {
  cursor: grab;
}

.gantt-bar[draggable]:active {
  cursor: grabbing;
}

.gantt-bar-dragging {
  opacity: .4;
}

@keyframes gantt-highlight-pulse {
  0% {
    box-shadow: 0 0 0 3px #f59e0b, 0 0 16px #f59e0b99;
    z-index: 20;
  }

  60% {
    box-shadow: 0 0 0 2px #f59e0b, 0 0 8px #f59e0b4d;
  }

  100% {
    box-shadow: none;
  }
}

.gantt-bar-highlight {
  animation: gantt-highlight-pulse 2.5s ease-out forwards;
  position: relative;
  z-index: 10;
}

.gantt-cell-drop-zone {
  outline: 1px dashed #4f7cffb3;
  outline-offset: -1px;
  background: #4f7cff38 !important;
}

.plan-current-date {
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  min-width: 130px;
  font-size: 13px;
  font-weight: 600;
}

.plan-goto-wrap {
  position: relative;
}

.plan-goto-menu {
  display: flex;
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--border);
  z-index: 200;
  overflow: hidden;
  border-radius: 8px;
  flex-direction: column;
  min-width: 130px;
  margin-top: 4px;
  top: 100%;
  left: 0;
  box-shadow: 0 8px 24px #00000059;
}

.plan-goto-item {
  color: var(--text);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
}

.plan-goto-item:hover {
  background: var(--bg3);
  color: var(--accent);
}

.analytics-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.analytics-toolbar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.chart-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.chart-box-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 12px;
}

.chart-box-title {
  color: var(--text);
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (width <= 720px) {
  .chart-grid-2 {
    grid-template-columns: 1fr;
  }
}

.chart-legend-row {
  display: flex;
  color: var(--text2);
  align-items:  center;
  gap: 6px;
  font-size: 12px;
}

.chart-legend-dot {
  display: inline-block;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

@media (width <= 640px) {
  #sidebar {
    display: none !important;
  }

  #main {
    margin-left: 0 !important;
  }

  #topbar .topbar-search {
    display: none;
  }

  .gantt-corner, .gantt-label-col {
    width: 60px !important;
    min-width: 60px !important;
    padding: 0 4px !important;
  }

  .gantt-room-type, .gantt-room-type-hdr, .gantt-dow, .gantt-bed-label {
    display: none !important;
  }

  .gantt-scroll {
    height: calc(100vh - 160px);
  }

  .occ-rates {
    display: none !important;
  }

  .planning-toolbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .plan-current-date {
    font-size: 13px;
  }

  .modal-overlay {
    align-items:  flex-end;
  }

  .modal {
    overflow-y: auto;
    max-height: 92vh;
    border-radius: 12px 12px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .card {
    overflow-x: auto;
  }

  table {
    min-width: 500px;
  }

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

[data-font="system"] {
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

[data-font="inter"] {
  font-family: Inter, Segoe UI, sans-serif;
}

[data-font="georgia"] {
  font-family: Georgia, Times New Roman, serif;
}

[data-font="mono"] {
  font-family: JetBrains Mono, Fira Code, Courier New, monospace;
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.theme-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.theme-card {
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  border-radius: 10px;
  width: 120px;
  transition: border-color .15s, transform .12s;
}

.theme-card:hover {
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: var(--accent);
}

.theme-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 64px;
  padding: 8px;
}

.theme-preview-bar {
  border-radius: 4px;
  height: 8px;
}

.theme-label {
  background: var(--bg2);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
}

.font-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.font-card {
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--bg2);
  border-radius: 8px;
  padding: 10px 16px;
  transition: border-color .15s;
  font-size: 15px;
}

.font-card:hover {
  border-color: var(--text2);
}

.font-card.active {
  border-color: var(--accent);
}

.font-card small {
  display: block;
  color: var(--text2);
  margin-top: 2px;
  font-size: 10px;
}

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

.size-card {
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--bg2);
  border-radius: 8px;
  padding: 8px 18px;
  transition: border-color .15s;
}

.size-card:hover {
  border-color: var(--text2);
}

.size-card.active {
  border-color: var(--accent);
}

.agent-wrap {
  display: flex;
  height: calc(100vh - var(--topbar-h, 54px)  - 32px);
  flex-direction: column;
  max-width: 760px;
}

.agent-messages {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  min-height: 0;
  padding: 8px 0 16px;
}

.agent-empty {
  display: flex;
  color: var(--text2);
  text-align: center;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  padding: 40px 0;
}

.agent-empty-icon {
  opacity: .4;
  margin-bottom: 4px;
  font-size: 32px;
}

.agent-empty p {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.agent-empty-sub {
  max-width: 320px;
  font-size: 12px;
  line-height: 1.5;
}

.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.agent-suggestion {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  border-radius: 20px;
  padding: 6px 14px;
  transition: border-color .15s, color .15s;
  font-family: inherit;
  font-size: 12px;
}

.agent-suggestion:hover {
  border-color: var(--accent);
  color: var(--text);
}

.agent-msg {
  display: flex;
}

.agent-msg-user {
  justify-content: flex-end;
}

.agent-msg-assistant {
  justify-content: flex-start;
}

.agent-bubble {
  border-radius: 14px;
  max-width: 82%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.agent-msg-user .agent-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.agent-msg-assistant .agent-bubble {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.agent-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
}

.agent-thinking {
  display: flex;
  align-items:  center;
  gap: 5px;
  padding: 12px 16px;
}

.agent-dot {
  background: var(--text2);
  animation: agent-bounce 1.2s infinite ease-in-out;
  border-radius: 50%;
  width: 7px;
  height: 7px;
}

.agent-dot:nth-child(2) {
  animation-delay: .2s;
}

.agent-dot:nth-child(3) {
  animation-delay: .4s;
}

@keyframes agent-bounce {
  0%, 80%, 100% {
    transform: scale(.7);
    opacity: .4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.agent-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.agent-action-detail summary {
  color: var(--text2);
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
  font-size: 11px;
}

.agent-action-detail summary:before {
  content: "▸ ";
}

.agent-action-detail[open] summary:before {
  content: "▾ ";
}

.agent-action-json {
  color: var(--text2);
  background: var(--bg3);
  overflow-x: auto;
  white-space: pre;
  border-radius: 6px;
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 10px;
}

.agent-input-row {
  display: flex;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items:  flex-end;
  gap: 8px;
  padding: 12px 0 0;
}

.agent-clear {
  display: flex;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.agent-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  resize: none;
  overflow-y: auto;
  border-radius: 10px;
  flex: 1;
  max-height: 120px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.agent-input:focus {
  outline: none;
  border-color: var(--accent);
}

.agent-send {
  display: flex;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 16px;
}

.detail-section-guest {
  grid-column: span 2;
}

.payment-method-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payment-method-btn {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 14px;
  transition: border-color .12s, color .12s, background .12s;
  font-family: inherit;
  font-size: 12px;
}

.payment-method-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.payment-method-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: #4f7cff1f;
  font-weight: 600;
}

tfoot td {
  padding: 8px 12px;
  font-size: 13px;
}

.res-detail-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 16px 0 12px;
}

.res-detail-meta {
  display: flex;
  color: var(--text2);
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
}

.res-tab-content {
  padding: 18px 0;
}

.tab-count {
  display: inline-flex;
  background: var(--accent);
  color: var(--bg);
  border-radius: 10px;
  justify-content: center;
  align-items:  center;
  min-width: 16px;
  height: 16px;
  margin-left: 5px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
}

.badge-blacklist {
  display: inline-flex;
  color: var(--red);
  background: #ff00001f;
  border: 1px solid #ff505066;
  border-radius: 6px;
  align-items:  center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
}

.blacklist-banner {
  display: flex;
  color: var(--red);
  background: #ff282814;
  border: 1px solid #ff505059;
  border-radius: 6px;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 12px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 640px;
}

.timeline-item {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  padding: 14px 0;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-icon {
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.timeline-body {
  flex: 1;
  min-width: 0;
}

.timeline-label {
  font-size: 14px;
  font-weight: 600;
}

.timeline-detail {
  color: var(--text2);
  white-space: pre-wrap;
  margin-top: 3px;
  font-size: 12.5px;
}

.timeline-ts {
  color: var(--text2);
  margin-top: 6px;
  font-size: 11px;
}

.hk-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hk-date-nav {
  display: flex;
  align-items:  center;
  gap: 4px;
}

.hk-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  align-items:  center;
  gap: 4px;
  margin-bottom: 12px;
}

.hk-tab {
  cursor: pointer;
  color: var(--text2);
  background: none;
  border: none;
  border-bottom: 2px solid #0000;
  margin-bottom: -2px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
}

.hk-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hk-tab-count {
  display: inline-block;
  background: var(--bg3);
  color: var(--text2);
  border-radius: 10px;
  margin-left: 5px;
  padding: 1px 7px;
  font-size: 11px;
}

.hk-tab.active .hk-tab-count {
  background: var(--accent);
  color: #fff;
}

.hk-progress {
  display: flex;
  color: var(--text2);
  align-items:  center;
  gap: 8px;
  margin-left: auto;
  padding: 4px 0;
  font-size: 12px;
}

.hk-progress-bar {
  display: inline-block;
  background: var(--bg3);
  overflow: hidden;
  border-radius: 3px;
  width: 80px;
  height: 6px;
}

.hk-progress-bar span {
  display: block;
  background: #22c55e;
  border-radius: 3px;
  height: 100%;
  transition: width .3s;
}

.hk-assign-bar {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  flex-wrap: wrap;
  align-items:  center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 14px;
  font-size: 13px;
}

.hk-assign-bar select {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

.hk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hk-row {
  display: grid;
  grid-template-columns: 110px 130px 1fr auto;
  grid-template-rows: auto auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  align-items:  center;
  gap: 8px 12px;
  padding: 10px 14px;
  transition: background .15s, opacity .15s;
}

.hk-row-done {
  opacity: .55;
  background: var(--bg);
}

.hk-row-dnd {
  background: #ef44440d;
  border-color: #ef4444;
}

.hk-row-selected {
  border-color: var(--accent);
  background: #4f7cff0f;
}

.hk-room {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.hk-select {
  cursor: pointer;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.hk-room-num {
  color: var(--text1);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  font-size: 22px;
  font-weight: 800;
}

.hk-tag-salida {
  letter-spacing: .5px;
  color: #fff;
  background: #fb923c;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
}

.hk-cleaner-select {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text1);
  border-radius: 6px;
  max-width: 130px;
  padding: 4px 6px;
  font-size: 12px;
}

.hk-cleaner-name {
  color: var(--text2);
  font-size: 12px;
}

.hk-linen {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 4px;
}

.hk-linen-chip {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 12px;
  padding: 2px 8px;
  transition: all .1s;
  font-size: 11px;
}

.hk-linen-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.hk-actions {
  display: flex;
  align-items:  center;
  gap: 6px;
}

.hk-btn-dnd, .hk-btn-note, .hk-btn-done {
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  transition: background .1s;
  font-size: 16px;
  line-height: 1;
}

.hk-btn-dnd:hover, .hk-btn-note:hover {
  background: var(--bg3);
}

.hk-btn-dnd.active {
  background: #ef444426;
}

.hk-btn-note.has-note {
  position: relative;
}

.hk-btn-note.has-note:after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 50%;
  width: 6px;
  height: 6px;
  top: 4px;
  right: 4px;
}

.hk-btn-done {
  text-align: center;
  color: var(--text2);
  border: 2px solid var(--border);
  background: var(--bg3);
  min-width: 36px;
  font-size: 20px;
  font-weight: 700;
}

.hk-btn-done.done {
  color: #22c55e;
  background: #22c55e1a;
  border-color: #22c55e;
}

.hk-btn-done:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.hk-notes-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hk-notes-panel textarea {
  resize: none;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text1);
  border-radius: 6px;
  width: 100%;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
}

.hk-notes-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

@media (width <= 640px) {
  .hk-row {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
  }

  .hk-linen, .hk-notes-panel {
    grid-column: 1 / -1;
  }
}
