/* ============================================================
   酒店 AI 操作系统 · 样式表
   设计语言：暗色专业面板，克制、信息密度高
   ============================================================ */

:root {
  --bg: #0b0f19;
  --bg-2: #111726;
  --panel: #151c2e;
  --panel-2: #1a2237;
  --panel-3: #212b42;
  --border: #263049;
  --border-2: #323d59;
  --text: #e8ecf5;
  --text-2: #9aa8c4;
  --text-3: #6b7a99;
  --brand: #4f7cff;
  --brand-2: #6d92ff;
  --brand-dim: rgba(79,124,255,.14);
  --up: #f04b4b;      /* 中国习惯：涨/正向用红 */
  --down: #21c07a;    /* 跌/负向用绿 */
  --warn: #f0a93b;
  --danger: #f04b4b;
  --ok: #21c07a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,.32);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c3752; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4767; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand-2); text-decoration: none; }

/* ---------- 布局 ---------- */

#app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 650; letter-spacing: .2px;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  display: grid; place-items: center;
  font-size: 14px; flex-shrink: 0;
}
.brand-sub {
  margin-top: 6px; font-size: 11.5px; color: var(--text-3);
  display: flex; align-items: center; gap: 5px;
}
.brand-sub .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }

.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .8px;
  padding: 6px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px;
  transition: background .12s, color .12s;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--brand-dim); color: var(--brand-2); font-weight: 550; }
.nav-item .ico { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; }
.nav-badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px;
  border-radius: 20px; background: var(--panel-3); color: var(--text-2);
}
.nav-item.active .nav-badge { background: var(--brand); color: #fff; }

.sidebar-foot {
  padding: 10px 14px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-3);
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 54px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
}
.topbar h1 { font-size: 15.5px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 16px; align-items: center; }
.topbar-meta b { color: var(--text-2); font-weight: 550; }

.content { flex: 1; overflow-y: auto; padding: 20px; }

/* ---------- 通用组件 ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1400px) { .g6 { grid-template-columns: repeat(3, 1fr); } .g5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .g4, .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .g2, .g3, .g4, .g5, .g6 { grid-template-columns: 1fr; } }

/* 指标卡 */
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand); opacity: .85;
}
.stat.up::before { background: var(--up); }
.stat.down::before { background: var(--down); }
.stat.warn::before { background: var(--warn); }
.stat-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.stat-value {
  font-size: 22px; font-weight: 680; letter-spacing: -.4px;
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.stat-value .unit { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.stat-foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.stat-foot .chg-up { color: var(--up); }
.stat-foot .chg-down { color: var(--down); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--panel-3); color: var(--text);
  border: 1px solid var(--border-2);
  font-size: 13px; font-weight: 500;
  transition: all .13s; white-space: nowrap;
}
.btn:hover { background: #2a3550; border-color: #3d4a6b; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #05281a; font-weight: 600; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.input, .select, .textarea {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 7px 10px;
  color: var(--text); width: 100%; transition: border-color .13s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,124,255,.13);
}
.textarea { resize: vertical; min-height: 64px; }
select.select { appearance: none; background-image: none; cursor: pointer; }

/* 表格 */
.table-wrap { overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  background: var(--panel-2); color: var(--text-2);
  font-weight: 600; text-align: left;
  padding: 9px 11px; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--border-2);
  font-size: 11.5px; letter-spacing: .2px;
}
tbody td {
  padding: 8px 11px; border-bottom: 1px solid var(--border);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(79,124,255,.05); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 徽标 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 550; white-space: nowrap;
}
.tag.gray { background: #232c42; color: var(--text-2); }
.tag.blue { background: rgba(79,124,255,.17); color: #7ba0ff; }
.tag.green { background: rgba(33,192,122,.15); color: #35d492; }
.tag.red { background: rgba(240,75,75,.15); color: #ff6b6b; }
.tag.amber { background: rgba(240,169,59,.15); color: #ffbe57; }
.tag.purple { background: rgba(139,92,246,.16); color: #a78bfa; }

/* 房态日历 */
.cal-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cal { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; }
.cal th, .cal td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-2); padding: 7px 8px;
  text-align: center; font-size: 11px; min-width: 62px;
  border-bottom: 1px solid var(--border-2);
}
.cal thead th .dow { color: var(--text-3); font-size: 10px; display: block; }
.cal thead th.wknd { color: #ffbe57; }
.cal .rowhead {
  position: sticky; left: 0; z-index: 3;
  background: var(--panel-2); text-align: left;
  padding: 8px 11px; min-width: 132px; font-weight: 550;
  border-right: 1px solid var(--border-2);
}
.cal .rowhead .sub { font-size: 10.5px; color: var(--text-3); font-weight: 400; display: block; }
.cal td.cell {
  text-align: center; padding: 6px 5px; cursor: pointer;
  transition: filter .12s; position: relative;
}
.cal td.cell:hover { filter: brightness(1.35); outline: 1px solid var(--brand); outline-offset: -2px; }
.cal td.cell .av { font-weight: 650; font-size: 13px; }
.cal td.cell .oc { font-size: 10px; opacity: .72; }
/* 热力：可售充足=绿，紧张=黄，售罄=红，关房=灰 */
.cal td.open     { background: rgba(33,192,122,.14); color: #4fdda5; }
.cal td.tight    { background: rgba(240,169,59,.18); color: #ffc76a; }
.cal td.soldout  { background: rgba(240,75,75,.20); color: #ff8888; }
.cal td.closed   { background: #1c2334; color: var(--text-3); }
.cal tfoot td { background: var(--panel-2); font-weight: 600; text-align: center; padding: 7px 6px; }

/* 房间网格 */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.room-cell {
  border-radius: var(--radius-sm); padding: 8px 9px;
  border: 1px solid var(--border-2); background: var(--panel-2);
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  position: relative;
}
.room-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.room-cell .no { font-weight: 680; font-size: 13.5px; letter-spacing: .3px; }
.room-cell .rt { font-size: 10px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-cell .gs { font-size: 10.5px; margin-top: 3px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.room-cell.occupied { background: rgba(79,124,255,.16); border-color: rgba(79,124,255,.45); }
.room-cell.idle { background: rgba(33,192,122,.11); border-color: rgba(33,192,122,.32); }
.room-cell.dirty { background: rgba(240,169,59,.13); border-color: rgba(240,169,59,.35); }
.room-cell.maintenance { background: rgba(240,75,75,.13); border-color: rgba(240,75,75,.35); }
.room-cell.blocked { background: #1c2334; border-color: var(--border-2); }
.room-cell .dotarr {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--warn);
}

/* 图例 */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Agent 对话 ---------- */

.agent-layout { display: flex; height: 100%; gap: 14px; }
.agent-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.agent-side { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 4px 2px 14px; }

.msg { display: flex; gap: 11px; margin-bottom: 18px; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px;
}
.msg.user .msg-avatar { background: var(--panel-3); }
.msg.agent .msg-avatar { background: linear-gradient(135deg, var(--brand), #8b5cf6); }
.msg-body { flex: 1; min-width: 0; }
.msg-name { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }

.bubble {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px;
}
.msg.user .bubble { background: var(--panel-3); border-color: var(--border-2); display: inline-block; }

.summary { font-size: 14px; font-weight: 550; margin-bottom: 12px; color: #fff; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; margin: 11px 0; }
.kv {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.kv-k { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.kv-v { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }

.findings { margin: 10px 0; display: flex; flex-direction: column; gap: 7px; }
.finding {
  display: flex; gap: 8px; font-size: 13px; line-height: 1.62;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--bg-2); border-left: 3px solid var(--border-2);
}
.finding.warn { border-left-color: var(--warn); background: rgba(240,169,59,.07); }
.finding.danger { border-left-color: var(--danger); background: rgba(240,75,75,.07); }
.finding.info { border-left-color: var(--brand); background: rgba(79,124,255,.07); }

.suggestions { margin-top: 12px; }
.suggestions-title { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; font-weight: 600; letter-spacing: .3px; }
.suggestions ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.suggestions li {
  font-size: 13px; padding: 8px 11px; border-radius: var(--radius-sm);
  background: rgba(33,192,122,.07); border-left: 3px solid var(--ok);
  line-height: 1.6;
}

/* 已落地的变更清单 */
.applied {
  margin: 12px 0; padding: 11px 13px; border-radius: 8px;
  background: rgba(33, 192, 122, 0.07);
  border: 1px solid rgba(33, 192, 122, 0.32);
}
.applied-title { font-size: 12px; font-weight: 600; color: var(--down); margin-bottom: 8px; }
.applied-item {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12.5px; padding: 5px 0; border-top: 1px solid rgba(33, 192, 122, 0.16);
}
.applied-item:first-of-type { border-top: none; }
.applied-item .mono {
  font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px;
  padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06);
  color: var(--brand);
}

/* 步骤时间线 */
.steps { margin: 12px 0; display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 10px; font-size: 12.5px; position: relative; padding-bottom: 11px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ''; position: absolute; left: 7px; top: 17px; bottom: 0; width: 1px;
  background: var(--border-2);
}
.step:last-child::before { display: none; }
.step-dot {
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 9px; margin-top: 2px;
  border: 1.5px solid var(--border-2); background: var(--bg-2); z-index: 1;
}
.step.succeeded .step-dot { border-color: var(--ok); background: rgba(33,192,122,.2); color: var(--ok); }
.step.failed .step-dot { border-color: var(--danger); background: rgba(240,75,75,.2); color: var(--danger); }
.step.awaiting_approval .step-dot { border-color: var(--warn); background: rgba(240,169,59,.2); color: var(--warn); }
.step.skipped .step-dot { opacity: .4; }
.step-info { flex: 1; min-width: 0; }
.step-title { color: var(--text); }
.step-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 9px; }

/* 审批卡 */
.approval {
  margin: 12px 0; padding: 13px;
  border: 1px solid rgba(240,169,59,.42); border-radius: var(--radius);
  background: rgba(240,169,59,.08);
}
.approval-title { display: flex; align-items: center; gap: 7px; font-weight: 620; font-size: 13.5px; margin-bottom: 7px; color: #ffc76a; }
.approval-desc { font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; line-height: 1.6; }
.approval-args {
  font-family: var(--mono); font-size: 11.5px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; margin-bottom: 11px; overflow-x: auto; color: var(--text-2);
}
.approval-actions { display: flex; gap: 9px; }

/* 输入区 */
.composer { flex-shrink: 0; padding-top: 14px; }
.composer-box {
  display: flex; gap: 10px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 10px 10px 10px 14px;
  transition: border-color .13s;
}
.composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,124,255,.11); }
.composer-input {
  flex: 1; background: none; border: none; resize: none;
  color: var(--text); max-height: 128px; min-height: 24px;
  font-size: 14px; line-height: 1.55;
}
.composer-input:focus { outline: none; }
.composer-input::placeholder { color: var(--text-3); }

.quick-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  font-size: 12px; padding: 4px 11px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--border-2);
  color: var(--text-2); transition: all .13s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-2); background: var(--brand-dim); }

/* 思考中 */
.thinking { display: flex; align-items: center; gap: 9px; color: var(--text-3); font-size: 13px; padding: 10px 0; }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--border-2);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 空态 */
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty-ico { font-size: 32px; margin-bottom: 10px; opacity: .55; }
.empty-title { font-size: 14px; color: var(--text-2); margin-bottom: 5px; }
.empty-desc { font-size: 12.5px; }

/* 提示条 */
.notice {
  padding: 9px 13px; border-radius: var(--radius-sm);
  font-size: 12.5px; margin-bottom: 14px;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text-2);
}
.notice.warn { border-color: rgba(240,169,59,.4); background: rgba(240,169,59,.09); color: #ffc76a; }
.notice.danger { border-color: rgba(240,75,75,.4); background: rgba(240,75,75,.09); color: #ff8b8b; }
.notice.info { border-color: rgba(79,124,255,.4); background: rgba(79,124,255,.09); color: #93b0ff; }

/* Toast */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.toast {
  padding: 11px 15px; border-radius: var(--radius-sm);
  background: var(--panel-3); border: 1px solid var(--border-2);
  box-shadow: var(--shadow); font-size: 13px; min-width: 220px; max-width: 400px;
  animation: slideIn .2s ease;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.warn { border-left: 3px solid var(--warn); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4,7,14,.72);
  display: grid; place-items: center; z-index: 900; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: 12px; box-shadow: var(--shadow);
  width: 100%; max-width: 620px; max-height: 88vh;
  display: flex; flex-direction: column;
}
.modal.wide { max-width: 900px; }
.modal-head {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.modal-title { font-size: 15px; font-weight: 620; }
.modal-head .spacer { flex: 1; }
.modal-close { color: var(--text-3); font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 13px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 9px; justify-content: flex-end;
}

/* 工具卡 */
.tool-item {
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border);
  margin-bottom: 7px; font-size: 12.5px;
}
.tool-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.tool-name { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.tool-desc { color: var(--text-2); font-size: 12px; line-height: 1.55; }

/* 条形图 */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { width: 96px; flex-shrink: 0; color: var(--text-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 17px; background: var(--bg-2); border-radius: 4px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .35s ease; }
.bar-val { width: 76px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--text); }

/* 迷你折线（内联 SVG） */
.spark { display: block; width: 100%; height: 40px; }

/* 分栏 */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
@media (max-width: 1150px) { .split { grid-template-columns: 1fr; } }

.hr { height: 1px; background: var(--border); margin: 14px 0; }

.mono { font-family: var(--mono); font-size: 11.5px; }
.muted { color: var(--text-3); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb14 { margin-bottom: 14px; }
.gap8 { gap: 8px; } .gap14 { gap: 14px; }

/* ============================================================
   门锁 / 门卡（制卡）组件
   ============================================================ */

.lock-panel { display: flex; flex-direction: column; }

.lock-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--bg-2);
}

.lock-actions { display: flex; gap: 8px; margin-top: 9px; }
.lock-actions .btn { flex: 1; }

.checkline {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--text-2); line-height: 1.5; cursor: pointer;
}
.checkline input { margin-top: 2px; flex: none; }

.card-list { display: flex; flex-direction: column; gap: 7px; }

.card-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-2);
}

.ci-main { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.ci-no { font-family: var(--mono); font-size: 12px; font-weight: 650; letter-spacing: .3px; }
.ci-actions { display: flex; gap: 5px; flex: none; }

.btn.danger-ghost {
  color: var(--danger);
  border-color: rgba(240,75,75,.35);
  background: transparent;
}
.btn.danger-ghost:hover { background: rgba(240,75,75,.12); }

/* ============================================================
   租户切换器（顶栏 pill）
   ============================================================ */

.tenant-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-2);
  font-size: 12px; font-weight: 600; color: var(--text-1);
  transition: border-color .15s, background .15s;
}
.tenant-pill:hover { border-color: var(--brand); background: var(--brand-dim); }
.tenant-pill.warn { color: var(--warn); border-color: rgba(240,169,59,.4); }
.tenant-pill .tag { font-size: 10px; padding: 1px 6px; }

.card-item.current { border-color: var(--brand); background: var(--brand-dim); }

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

/* ============================================================
   会员与客史（CRM）
   ============================================================ */

/* ---- 通用小组件：分段控件 / 工具条 / 复选 ---- */

.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); }
.seg-item {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 12px; font-weight: 600; padding: 5px 11px;
  border-radius: 6px; cursor: pointer; transition: background .15s, color .15s;
  font-family: inherit; white-space: nowrap;
}
.seg-item:hover { color: var(--text-1); background: var(--panel); }
.seg-item.active { background: var(--brand); color: #fff; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.chk {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
}
.chk input { accent-color: var(--brand); cursor: pointer; }

.mb8 { margin-bottom: 8px; }
.mb10 { margin-bottom: 10px; }
.mb14 { margin-bottom: 14px; }
.mt8 { margin-top: 8px; }
.mt10 { margin-top: 10px; }

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

/* ---- 等级阶梯 ---- */

.lv-ladder { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }

.lv-row {
  display: grid;
  grid-template-columns: 128px 1fr 130px 168px;
  align-items: center; gap: 10px;
  font-size: 12.5px;
}
.lv-name { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-1); }
.lv-name .small { font-weight: 400; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

.lv-bar-track { height: 9px; background: var(--bg-2); border-radius: 5px; overflow: hidden; }
.lv-bar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }

.lv-count { font-variant-numeric: tabular-nums; color: var(--text-2); }
.lv-count b { color: var(--text-1); }
.lv-benefit { font-size: 11.5px; color: var(--text-3); text-align: right; }

/* ---- 待唤回列表 ---- */

.dorm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.dorm-row:hover { background: var(--bg-2); border-color: var(--border); }
.dorm-row + .dorm-row { margin-top: 2px; }
.dorm-main { flex: 1; min-width: 0; }
.dorm-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dorm-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.dorm-meta b { color: var(--warn); }
.dorm-act { flex: none; }

/* ---- 客人表格 ---- */

.guest-table td { vertical-align: middle; }
.guest-table tbody tr { cursor: pointer; }
.guest-table tbody tr.row-danger { background: rgba(240,75,75,.055); }

.guest-cell { display: flex; align-items: center; gap: 9px; }
.guest-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-2); background: var(--bg-2);
  font-size: 13px; font-weight: 700; color: var(--text-1);
}
.guest-avatar.big { width: 48px; height: 48px; font-size: 20px; border-width: 2.5px; }
.guest-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; }

/* ---- 画像弹窗 ---- */

.prof-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.prof-head-main { flex: 1; min-width: 0; }
.prof-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prof-benefit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.prof-loyalty { text-align: right; flex: none; }
.prof-loyalty-v { font-size: 24px; font-weight: 750; color: var(--brand-2); font-variant-numeric: tabular-nums; line-height: 1.1; }

.prof-progress {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 13px; margin-bottom: 14px;
}
.prof-progress-text { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.prof-progress-text b { color: var(--brand-2); }
.prof-progress-track { height: 8px; background: var(--grid-track, #0e1420); border-radius: 5px; overflow: hidden; }
.prof-progress-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }

.prof-block { margin-top: 16px; }
.prof-block-title {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  letter-spacing: .4px; margin-bottom: 9px;
  text-transform: uppercase;
}
.prof-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.prof-hint {
  font-size: 12.5px; color: var(--text-2); line-height: 1.65;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.prof-hint:last-child { border-bottom: 0; }

/* ---- 迷你条形（房型 / 渠道偏好） ---- */

.mini-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.mini-bar-label { width: 88px; flex: none; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bar-track { flex: 1; height: 14px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 4px; transition: width .35s ease; }
.mini-bar-val { width: 82px; flex: none; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---- 入住时间线 ---- */

.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 5px; bottom: 5px;
  width: 1px; background: var(--border-2);
}
.tl-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
}
.tl-dot {
  position: absolute; left: -18px; width: 9px; height: 9px;
  border-radius: 50%; border: 2px solid var(--bg);
}
.tl-main { flex: 1; min-width: 0; }
.tl-title { font-size: 12.5px; font-weight: 600; }
.tl-status { flex: none; }

/* 窄屏时等级阶梯降级为两行，避免条形被压扁 */
@media (max-width: 1180px) {
  .lv-row { grid-template-columns: 116px 1fr 110px; }
  .lv-benefit { grid-column: 2 / -1; text-align: left; font-size: 11px; }
  .split2 { grid-template-columns: 1fr; }
}
