:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #17233b;
  background: #f3f6fa;
  --navy: #183d5d;
  --blue: #176ca4;
  --ice: #e8f4fb;
  --line: #dbe3ec;
  --muted: #66758a;
  --danger: #b83a3a;
  --success: #1c7a5a;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 560px);
  background: linear-gradient(135deg, #102f4a 0 52%, #f3f6fa 52%);
}
.brand-panel { color: white; padding: clamp(40px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; }
.brand-panel h1 { max-width: 640px; margin: 0 0 18px; font-size: clamp(32px, 4.2vw, 58px); line-height: 1.15; }
.brand-panel p { max-width: 580px; line-height: 1.8; color: #d5e9f5; }
.phase-pill { display: inline-flex; width: max-content; padding: 8px 12px; border-radius: 999px; background: #ffffff1f; margin-bottom: 24px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: min(420px, 100%); background: white; padding: 34px; border-radius: 18px; box-shadow: 0 20px 50px #11263f20; }
.login-card h2 { margin: 0 0 8px; }
.login-card .hint { color: var(--muted); margin: 0 0 24px; line-height: 1.65; }

.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { font-size: 14px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: white; font: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid #55a9d628; border-color: var(--blue); }
.btn { border: 0; border-radius: 9px; padding: 10px 15px; background: var(--navy); color: white; font-weight: 700; }
.btn:hover { filter: brightness(1.07); }
.btn.secondary { background: #eef3f7; color: #23415d; }
.btn.danger { background: #fff0f0; color: var(--danger); }
.btn.small { padding: 7px 10px; font-size: 13px; }
.full { width: 100%; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--navy); color: white; padding: 24px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sidebar h1 { font-size: 18px; margin: 0 8px 28px; }
.sidebar .phase { font-size: 12px; color: #b9d8e9; display: block; margin-top: 7px; font-weight: 400; }
.sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #ffffff4d transparent; }
.nav-button { width: 100%; text-align: left; border: 0; border-radius: 9px; padding: 11px 12px; background: transparent; color: #dcebf3; margin: 3px 0; }
.nav-button.active, .nav-button:hover { background: #ffffff18; color: white; }
.sidebar-footer { flex: 0 0 auto; border-top: 1px solid #ffffff20; padding-top: 16px; margin-top: 12px; font-size: 13px; }
.sidebar-footer strong, .sidebar-footer span { display: block; margin-bottom: 5px; }

.main { min-width: 0; }
.topbar { height: 70px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.topbar .scope { color: var(--muted); font-size: 14px; }
.content { padding: 28px 30px 50px; max-width: 1440px; margin: 0 auto; }
.page-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title h2 { margin: 0 0 4px; }
.page-title p { color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 20px; box-shadow: 0 4px 14px #1d385808; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.metric { font-size: 28px; font-weight: 800; color: var(--navy); }
.muted { color: var(--muted); }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; background: var(--ice); color: var(--blue); }
.status.disabled { background: #fff0f0; color: var(--danger); }
.status.active { background: #e9f7f1; color: var(--success); }
.notice { padding: 13px 15px; border-radius: 9px; background: #fff8df; color: #755b0a; margin: 15px 0; }
.success-notice { background: #e9f7f1; color: var(--success); }
.error-notice { background: #fff0f0; color: var(--danger); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.table-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
th { background: #f7f9fb; color: #45566d; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-backdrop { position: fixed; inset: 0; background: #10243c88; display: grid; place-items: center; padding: 24px; z-index: 20; }
.modal { background: white; width: min(560px, 100%); max-height: 90vh; overflow: auto; border-radius: 15px; padding: 25px; box-shadow: 0 24px 80px #10243c45; }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.credentials { font-family: ui-monospace, Consolas, monospace; padding: 12px; background: #f4f6f8; border-radius: 8px; word-break: break-all; }

.month-tabs { display: flex; gap: 10px; overflow: auto; padding: 2px 0 14px; }
.month-tab { min-width: 145px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; background: white; color: var(--navy); text-align: left; font-weight: 700; }
.month-tab small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
.month-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.month-tab.active small { color: #cfe6f2; }
.filter-card, .upload-card { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; margin-bottom: 18px; }
.filter-card .field, .upload-card .field { min-width: 150px; flex: 1; margin: 0; }
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }
.tour-list { display: grid; gap: 14px; }
.tour-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 4px 14px #1d385808; }
.tour-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.tour-head h3 { margin: 3px 0 8px; font-size: 21px; }
.eyebrow { color: var(--blue); font-size: 13px; font-weight: 700; }
.inventory-number { display: grid; justify-items: end; }
.inventory-number strong { font-size: 30px; color: var(--navy); line-height: 1; }
.inventory-number span { color: var(--muted); font-size: 12px; }
.tour-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.route-list { display: grid; }
.route-row { display: grid; grid-template-columns: minmax(220px,1fr) 180px auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.route-row:last-child { border-bottom: 0; }
.route-row > div:first-child span, .route-price small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.route-price { font-weight: 800; color: var(--success); text-align: right; }
.route-price.pending-price { color: #a66b00; }
.card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.empty-state { background: white; border: 1px dashed #b9c6d4; border-radius: 13px; padding: 38px; display: grid; justify-items: center; gap: 7px; color: var(--muted); }
.empty-state strong { color: var(--navy); }
.preview-card { border: 1px solid #aacde1; background: #f7fcff; border-radius: 14px; padding: 18px; margin: 16px 0; }
.summary-grid { display: grid; grid-template-columns: repeat(6,minmax(80px,1fr)); gap: 8px; margin: 14px 0; }
.summary-grid > div { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.summary-grid strong, .summary-grid span { display: block; }
.summary-grid strong { font-size: 24px; color: var(--navy); }
.summary-grid span { color: var(--muted); font-size: 12px; }
.subsection { margin-top: 24px; }
.compact { margin-top: 14px; max-height: 420px; }
.select-inline { max-width: 420px; }
.form-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0 14px; }
.traveler-editor { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 14px 0; }
.section-title { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.section-title h2, .section-title h3, .section-title p { margin-top: 0; }
.section-title p, .section-title span { color: var(--muted); }
.section-title small { color: var(--muted); font-weight: 400; }
.order-summary { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; }
.check-field label { display: flex; gap: 7px; align-items: center; }
.check-field label input, .checkbox-list input { width: auto; }
.traveler-cards, .flight-list { display: grid; gap: 14px; }
.project-groups { display: grid; gap: 20px; }
.project-groups > section { display: grid; gap: 10px; }
.project-groups > section > h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.project-card { border-left: 4px solid #3f7f78; }
.project-card .detail-grid { margin-top: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin: 14px 0; }
.detail-grid label, .detail-grid strong { display: block; }
.detail-grid label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.small-metric { font-size: 20px; }
.inline-assign { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 12px 0; }
.inline-assign select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 8px 0 15px; }
.checkbox-list label { display: flex; align-items: center; gap: 6px; }
.wide-modal { width: min(820px,100%); }
.room-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.room-card ul { padding-left: 18px; color: var(--muted); }
.file-button { display: inline-flex; align-items: center; cursor: pointer; }
.payment-summary { grid-template-columns: repeat(6,minmax(110px,1fr)); }
.payment-summary strong { font-size: 18px; }
.settlement-card { margin: 14px 0; border-left: 4px solid var(--blue); }
.danger-text { color: var(--danger); }
.report-grid { display: grid; grid-template-columns: repeat(6,minmax(150px,1fr)); gap: 12px; }
.report-metric { min-height: 132px; }
.report-metric .metric { font-size: 24px; overflow-wrap: anywhere; }
.report-metric p { margin: 8px 0 0; font-size: 12px; }
.report-section { margin-top: 18px; }
.report-wide { grid-column: span 3; }
.report-meta { color: var(--muted); font-size: 12px; text-align: right; margin-top: 18px; }
.report-hint { align-self: center; max-width: 360px; }
.source-bars { display: grid; gap: 10px; }
.source-bars span { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.source-bars span:last-child { border-bottom: 0; }
.ops-progress-grid { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); gap: 8px; margin: 14px 0; }
.ops-progress-grid span { padding: 10px; background: #f7f9fb; border-radius: 8px; display: flex; justify-content: space-between; gap: 8px; }
.task-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.task-list .card { box-shadow: none; }
.alert-list { display: grid; gap: 9px; }
.alert-item { border-left: 4px solid #d9a72e; background: #fffaf0; padding: 11px 12px; border-radius: 8px; display: grid; gap: 4px; }
.alert-item.high { border-color: var(--danger); background: #fff4f4; }
.alert-item span { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; background: #f3f6fa; }
  .brand-panel { background: var(--navy); padding: 40px 28px; }
  .login-panel { padding: 25px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; }
  .sidebar-footer { position: static; margin-top: 20px; }
  .grid { grid-template-columns: 1fr; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .route-row { grid-template-columns: 1fr; }
  .route-price { text-align: left; }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .payment-summary { grid-template-columns: repeat(2,1fr); }
  .form-grid, .detail-grid, .room-grid { grid-template-columns: 1fr; }
  .inline-assign { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-wide { grid-column: span 1; }
  .ops-progress-grid, .task-list { grid-template-columns: 1fr; }
}
