:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-synthesis: none;
  color: #203047;
  background: #f5f7fa;
  --blue: #1677db;
  --blue-dark: #075bb2;
  --blue-pale: #eaf3ff;
  --ink: #203047;
  --muted: #66788c;
  --line: #e5eaf0;
  --canvas: #f5f7fa;
  --green: #168a51;
  --red: #df503c;
  --yellow: #d99417;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
body:has(.customer-drawer) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #a6d2ff;
  outline-offset: 2px;
}
::selection { background: #cde6ff; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 206px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 12px 18px; background: #fff; border-right: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 11px; padding: 0 12px 25px;
  font-size: 18px; font-weight: 800; letter-spacing: .01em; color: #183d67;
}
.brand-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 10px; background: var(--blue); color: white; font-size: 18px;
  box-shadow: 0 4px 10px #1677db24;
}
.brand small { display: block; margin-top: 2px; color: #8b9aab; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.nav { display: grid; gap: 5px; }
.nav button {
  position: relative; width: 100%; border: 0; border-radius: 8px; padding: 12px 15px;
  background: transparent; color: #596d84; text-align: left; font-weight: 650;
}
.nav button:hover { background: #f4f8fd; color: var(--blue-dark); }
.nav button.active { background: var(--blue-pale); color: var(--blue-dark); }
.nav button.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--blue); }
.sidefoot { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid var(--line); color: #91a0af; font-size: 11px; line-height: 1.7; }
.main { min-width: 0; }
.topbar {
  height: 66px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; background: #fff; border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; color: #253a55; font-size: 17px; font-weight: 750; }
.user-chip { display: flex; align-items: center; gap: 10px; color: #8996a6; font-size: 12px; }
.user-chip strong { color: #354a62; font-size: 13px; }
.user-chip .link { padding-left: 10px; border-left: 1px solid var(--line); }
.content { width: 100%; max-width: 1680px; margin: auto; padding: 23px 28px 55px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.button {
  min-height: 38px; padding: 8px 15px; border: 1px solid #d7e0e9; border-radius: 7px;
  background: #fff; color: #425a75; font-size: 13px; font-weight: 650;
  transition: background .15s, border-color .15s, color .15s;
}
.button:hover { border-color: #9fc8ef; color: var(--blue-dark); background: #f8fbff; }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.button.ghost { background: transparent; }
.button.danger { color: #c14443; }
.button.small { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.link { border: 0; background: none; padding: 0; color: var(--blue-dark); font-weight: 650; text-align: left; }
.link:hover { text-decoration: underline; }
.link:disabled { color: #aeb9c5; cursor: not-allowed; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: #8593a3; font-size: 12px; font-weight: 400; }
.eyebrow { color: #7993b2; font-size: 11px; font-weight: 700; letter-spacing: .03em; }

/* Customer list: the selected customer type defines the whole workspace. */
.mode-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 10px 12px; margin-bottom: 14px;
}
.tabs { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.tab {
  min-height: 34px; padding: 6px 16px; border: 0; border-radius: 6px;
  background: #f1f4f7; color: #68798c; font-size: 13px; font-weight: 650;
}
.tab:hover { background: #e8f2fd; color: var(--blue-dark); }
.tab.active { background: var(--blue-pale); color: var(--blue-dark); }
.mode-actions { display: flex; align-items: center; gap: 9px; }
.search {
  width: 245px; min-height: 34px; padding: 7px 11px; border: 1px solid #dce4ec;
  border-radius: 6px; background: #fff; color: var(--ink); font-size: 12px;
}
.search::placeholder { color: #9ba9b7; }
.search:focus { border-color: var(--blue); outline: 3px solid #d7ecff; }

.metrics.six { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.metrics.six .metric { position: relative; min-height: 94px; padding: 16px 17px; }
.metrics.six button.metric { width: 100%; text-align: left; appearance: none; cursor: pointer; }
.metrics.six button.metric:hover { border-color: #9fc8ef; background: #f8fbff; }
.metrics.six button.metric.selected { box-shadow: inset 0 0 0 1px var(--blue); }
.metrics.six button.metric.blue:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.metrics.six button.metric.blue.selected { box-shadow: inset 0 0 0 1px #ffffff80; }
.metric .label { color: #66788c; font-size: 12px; white-space: nowrap; }
.metric .number { display: block; margin-top: 5px; font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.3; }
.metric.blue { border-color: var(--blue); background: var(--blue); color: #fff; }
.metric.blue .label { color: #e0efff; }
.metric.green .number { color: var(--green); }
.metric.red .number { color: var(--red); }
.metric.yellow .number { color: var(--yellow); }
.metric.green::before, .metric.red::before, .metric.yellow::before {
  content: ""; position: absolute; left: 0; top: 17px; bottom: 17px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--green);
}
.metric.red::before { background: var(--red); }
.metric.yellow::before { background: var(--yellow); }
.customer-list { overflow: hidden; }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 4px 17px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 21px; }
.filter-tab {
  position: relative; padding: 11px 1px 13px; border: 0; background: transparent;
  color: #65778b; font-size: 12px; white-space: nowrap;
}
.filter-tab:hover { color: var(--blue); }
.filter-tab.active { color: var(--blue-dark); font-weight: 750; }
.filter-tab.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; border-radius: 3px; background: var(--blue); }
.light-filter { position: relative; display: flex; }
.light-trigger .chevron { display: inline-block; margin-left: 4px; color: #8da0b4; font-size: 15px; line-height: 0; }
.light-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.light-menu { position: absolute; z-index: 5; top: calc(100% + 3px); left: -8px; width: 176px; padding: 5px; border: 1px solid #dce5ee; border-radius: 7px; background: #fff; box-shadow: 0 12px 28px #213b5726; }
.light-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 7px 9px; border: 0; border-radius: 4px; background: transparent; color: #3f5268; font-size: 12px; text-align: left; }
.light-menu button:hover, .light-menu button.selected { background: #edf5ff; color: var(--blue-dark); }
.light-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #a8b3bf; }
.light-dot.red { background: #f05a43; }
.light-dot.yellow { background: #f0a023; }
.light-dot.green { background: #21aa63; }
.light-dot.none { border: 1px solid #c9d3de; background: #fff; }
.filters > .muted { font-size: 11px; white-space: nowrap; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; }
.followup-list { overflow: hidden; }
.followup-table { min-width: 1800px; }
.followup-table th, .followup-table td { min-width: 145px; max-width: 280px; }
.followup-table .sticky-select { position: sticky; left: 0; z-index: 2; min-width: 46px; width: 46px; background: #fff; }
.followup-table th.sticky-select { background: #f1f4f7; }
.followup-table .sticky-action { position: sticky; right: 0; z-index: 2; min-width: 105px; background: #fff; box-shadow: -5px 0 10px #16365412; }
.followup-table th.sticky-action { background: #f1f4f7; }
.followup-table .cell-text { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-toolbar strong { font-size: 14px; }
.list-toolbar .muted { margin-left: 4px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 800px; border-collapse: collapse; }
.table th { padding: 12px 17px; background: #f7f9fb; color: #718398; font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
.table td { padding: 15px 17px; border-top: 1px solid #edf1f5; font-size: 12px; vertical-align: middle; }
.table tr:hover td { background: #fafcff; }
.customer-list .table td:first-child { min-width: 180px; }
.customer-table-wrap { overflow-x: scroll; scrollbar-gutter: stable; }
.customer-table-wrap:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.customer-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.customer-table th, .customer-table td { box-sizing: border-box; min-width: 170px; max-width: 220px; border-right: 1px solid #edf1f5; }
.customer-table th.sticky-name, .customer-table td.sticky-name { position: sticky; left: 0; z-index: 2; min-width: 220px; max-width: 220px; box-shadow: 1px 0 4px #dfe6ee; }
.customer-table th.sticky-action, .customer-table td.sticky-action { position: sticky; right: 0; z-index: 2; min-width: 125px; max-width: 125px; box-shadow: -1px 0 4px #dfe6ee; }
.customer-table th.sticky-name, .customer-table th.sticky-action { z-index: 3; background: #f7f9fb; }
.customer-table td.sticky-name, .customer-table td.sticky-action { background: #fff; }
.customer-table tr:hover td.sticky-name, .customer-table tr:hover td.sticky-action { background: #fafcff; }
.customer-table tbody tr[data-customer-row] { cursor: pointer; }
.customer-table tbody tr[data-customer-row]:focus-visible td { background: #eaf3ff; }
.customer-table .cell-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-table .table-empty { height: 170px; text-align: center; color: #7b8fa5; border-right: 0; }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 4px; background: #eaf3ff; color: #2468aa; font-size: 11px; font-weight: 650; white-space: nowrap; }
.pill.gray { background: #eef1f4; color: #69798b; }
.pill.green { background: #e9f6ee; color: #168252; }
.pill.orange { background: #fff2e7; color: #b56e29; }
.pill.red { background: #fff0ec; color: #d34738; }
.empty { padding: 62px 20px 72px; color: #677c91; font-size: 13px; text-align: center; }
.empty .icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border: 1px solid #dbe9f8; border-radius: 12px; background: #f4f9ff; color: #5195dc; font-size: 27px; }
.empty .muted { display: inline-block; margin-top: 8px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.hero h2 { margin: 5px 0 0; font-size: 24px; }
.hero .muted { margin: 8px 0 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 16px; }
.detail-head { padding: 23px 25px; }
.detail-head h2 { margin: 7px 0 15px; font-size: 24px; line-height: 1.35; }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; }
.section { padding: 22px 25px; }
.section + .section { border-top: 1px solid var(--line); }
.section h3 { margin: 0 0 18px; font-size: 15px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0; }
.kv dt { margin-bottom: 5px; color: #8796a6; font-size: 11px; }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 12px; line-height: 1.5; }
.timeline { margin-left: 7px; padding-left: 23px; border-left: 1px solid #dbe6f0; }
.timeline-item { position: relative; padding-bottom: 23px; }
.timeline-item::before { content: ""; position: absolute; top: 4px; left: -29px; width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #bcd8f5; }
.timeline-item small { color: #8b99a9; font-size: 11px; }
.timeline-item h4 { margin: 6px 0 8px; font-size: 13px; }
.timeline-item p { margin: 0 0 6px; color: #52677d; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }

/* Customer details stay beside the list for quick review. */
.customer-drawer-scrim { position: fixed; inset: 0; z-index: 40; background: #192b3c26; }
.customer-drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(520px, 100vw); background: #fff; border-left: 1px solid #dbe3ec; box-shadow: -14px 0 38px #102d4b22; color: #26384c; }
.drawer-top { height: 42px; min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #edf0f4; font-size: 12px; font-weight: 700; }
.drawer-close { width: 30px; height: 30px; border: 0; background: transparent; color: #758699; font-size: 22px; line-height: 1; }
.drawer-close:hover { color: #234466; background: #f1f5fa; }
.drawer-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.drawer-summary { padding: 16px 18px 12px; border-bottom: 8px solid #f2f4f7; }
.drawer-identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.drawer-avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 8px; background: #3b94f4; color: #fff; font-size: 18px; font-weight: 700; }
.drawer-identity h2 { margin: 0 0 4px; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.drawer-identity small { font-size: 12px; font-weight: 400; white-space: nowrap; }
.drawer-identity div > span { color: #63758a; font-size: 12px; }
.drawer-facts { margin: 12px 0 15px; font-size: 12px; line-height: 1.55; }
.drawer-facts p { margin: 4px 0; overflow-wrap: anywhere; }
.drawer-facts strong { color: #1578df; }
.drawer-tags, .drawer-tag-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.drawer-tags .pill { padding: 3px 7px; background: #e9f3ff; color: #1778d8; }
.drawer-tag-edit { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-left: 3px; border: 0; border-radius: 4px; background: transparent; color: #526981; font-size: 18px; cursor: pointer; }
.drawer-tag-edit:hover { background: #e9f3ff; color: #126ad0; }
.drawer-tag-edit:focus-visible { outline: 2px solid #126ad0; outline-offset: 2px; }
.customer-tags-dialog { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(540px, calc(100vw - 24px)); height: min(370px, calc(100dvh - 24px)); max-width: none; max-height: none; margin: 0; padding: 0; border: 1px solid #dce5ee; border-radius: 8px; background: #fff; color: #203246; box-shadow: 0 18px 48px #102d4b36; }
.customer-tags-dialog::backdrop { background: #17233366; }
.customer-tags-dialog form { display: flex; flex-direction: column; height: 100%; }
.customer-tags-head { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 18px; }
.customer-tags-head h2 { margin: 0; font-size: 17px; }
.customer-tags-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 24px; }
.customer-tags-search { display: flex; align-items: center; gap: 6px; height: 33px; padding: 0 10px; border: 1px solid #d9e1e9; border-radius: 5px; color: #8995a4; }
.customer-tags-search:focus-within { border-color: #288af0; box-shadow: 0 0 0 2px #e0f0ff; }
.customer-tags-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #203246; font-size: 13px; }
.customer-tags-count { margin: 19px 0 14px; font-size: 13px; }
.customer-tags-notice { margin: 0 0 12px; padding: 8px 7px; border-radius: 4px; background: #fff8ec; color: #f08519; font-size: 12px; line-height: 1.5; }
.customer-tags-body fieldset { margin: 0; padding: 0; border: 0; }
.customer-tags-body legend { margin-bottom: 9px; font-size: 13px; font-weight: 650; }
.customer-tags-body legend span { color: #1685ef; font-size: 10px; }
.customer-tags-body legend small { color: #aab2bc; font-weight: 400; }
.customer-tags-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.customer-tags-choice { position: relative; display: inline-flex; cursor: pointer; }
.customer-tags-choice[hidden] { display: none; }
.customer-tags-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.customer-tags-choice span { padding: 5px 8px; border: 1px solid #dce4ec; border-radius: 5px; background: #fff; color: #364a60; font-size: 12px; line-height: 1.3; }
.customer-tags-choice input:checked + span { border-color: #d7e9ff; background: #ecf5ff; color: #1479e8; }
.customer-tags-choice input:focus-visible + span { outline: 2px solid #1479e8; outline-offset: 2px; }
.customer-tags-error { margin: 12px 0 0; color: #d83d34; font-size: 12px; }
.customer-tags-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 10px 12px; border-top: 1px solid #e8edf2; }
.customer-tags-footer .link { font-size: 12px; }
.customer-tags-footer > div { display: flex; gap: 9px; }
@media (max-width: 480px) { .customer-tags-footer { align-items: stretch; flex-direction: column; } .customer-tags-footer > div { justify-content: flex-end; } }
.drawer-light.green { color: #19a95c; }.drawer-light.red { color: #ec523a; }.drawer-light.orange { color: #ed9917; }.drawer-light.gray { color: #8795a5; }
.drawer-stage { display: flex; width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.drawer-stage button { flex: 0 0 auto; min-width: 85px; padding: 8px 12px; border: 0; background: #f1f2f6; color: #53657a; text-align: center; font-size: 11px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); margin-right: -3px; }
.drawer-stage button:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); }
.drawer-stage button:hover:not(:disabled):not(.current) { background: #dcecff; color: #1769bd; }
.drawer-stage button:focus-visible { outline: 2px solid #102d4b; outline-offset: -3px; }
.drawer-stage button:disabled { cursor: not-allowed; }
.drawer-stage .passed, .drawer-stage .current { background: #1987f5; color: #fff; }
.drawer-stage .current { font-weight: 750; }
.status-confirm-dialog { width: min(460px, calc(100vw - 32px)); padding: 22px 24px 18px; border: 1px solid #e1e6ec; border-radius: 10px; box-shadow: 0 18px 45px #122c4933; color: #23384f; }
.status-confirm-dialog::backdrop { background: #17233366; }
.status-confirm-message { display: flex; align-items: flex-start; gap: 13px; }
.status-confirm-icon { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fa9b18; color: #fff; font-weight: 800; }
.status-confirm-message h3 { margin: 0 0 13px; font-size: 16px; }
.status-confirm-message p { margin: 0; color: #79889a; font-size: 13px; line-height: 1.6; }
.status-confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 28px; }
.drawer-contact { padding: 15px 18px 17px; border-bottom: 8px solid #f2f4f7; }
.drawer-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; font-size: 12px; }
.drawer-section-title .link { font-size: 11px; }
.drawer-contact-card { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.drawer-contact-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: #e7f2ff; color: #197cdb; font-weight: 700; }
.drawer-contact-card strong, .drawer-contact-card span { display: block; }
.drawer-contact-card div > span { margin-top: 3px; color: #8796a5; font-size: 11px; }
.drawer-tab-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; border-bottom: 1px solid #e9edf2; background: #fff; }
.drawer-tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.drawer-tabs button { position: relative; flex: 0 0 auto; min-height: 48px; padding: 11px 13px; border: 0; background: #fff; color: #617286; white-space: nowrap; font-size: 12px; }
.drawer-tabs button:hover, .drawer-tabs button.active { color: #172c42; }
.drawer-tabs button.active::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 0; height: 3px; border-radius: 3px; background: #1b2733; }
.drawer-sort { flex: none; padding: 9px 13px; border: 0; border-left: 1px solid #eef1f5; background: #fff; color: #1981e9; font-size: 11px; }
.drawer-tab-content { padding: 20px 18px 50px; }
.drawer-activity-filters { display: flex; flex-wrap: wrap; margin-bottom: 20px; }
.drawer-activity-filters button { min-height: 30px; padding: 5px 12px; border: 1px solid #dce3eb; margin-right: -1px; background: #fff; color: #53667d; font-size: 11px; }
.drawer-activity-filters button:first-child { border-radius: 5px 0 0 5px; }.drawer-activity-filters button:last-child { border-radius: 0 5px 5px 0; }
.drawer-activity-filters button.active { position: relative; z-index: 1; border-color: #1987f5; color: #1987f5; }
.drawer-timeline { border-left: 1px solid #dce7f1; margin-left: 7px; padding-left: 21px; }
.drawer-event { position: relative; padding: 0 0 24px; font-size: 12px; }
.drawer-event-icon { position: absolute; top: -2px; left: -37px; display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid #fff; border-radius: 6px; background: #fff; color: #3887d9; }
.drawer-event-icon svg { display: block; width: 19px; height: 19px; }
.drawer-event-icon.transferred { color: #20a75a; }
.drawer-event-icon.followup { color: #f09225; }
.drawer-event-icon.status { color: #806ad1; }
.drawer-event-meta { display: flex; justify-content: space-between; gap: 8px; color: #98a6b5; font-size: 11px; margin-bottom: 7px; }
.drawer-event strong { display: block; margin-bottom: 6px; }.drawer-event p { margin: 5px 0 7px; color: #596e83; line-height: 1.6; white-space: pre-wrap; }
.drawer-empty { padding: 46px 8px; color: #8392a2; font-size: 12px; text-align: center; }
.drawer-kv { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 14px; margin: 0; }
.drawer-kv dt { margin-bottom: 5px; color: #8e9cac; font-size: 11px; }.drawer-kv dd { margin: 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.drawer-actions { display: flex; gap: 7px; justify-content: flex-end; padding: 11px 18px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid #e4ebf2; background: #fff; }
.drawer-actions .button { min-height: 34px; font-size: 12px; }
.form-drawer { width: min(620px, 100vw); }
.drawer-form { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.drawer-form-body { padding: 20px 22px 34px; }
.drawer-form-body > .muted { margin: 0 0 18px; }
.drawer-form-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.form-drawer .form-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.form-drawer .field.full { grid-column: 1; }
.form-drawer .field textarea { min-height: 110px; }

.form-layout { max-width: 1080px; margin: auto; }
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.form-card { margin-bottom: 18px; padding: 25px 28px 30px; }
.form-card h3 { margin: 6px 0 23px; color: #233a56; font-size: 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 25px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: #435a73; font-size: 12px; font-weight: 650; }
.req { margin-right: 3px; color: var(--red); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #d9e2eb; border-radius: 6px;
  background: #fff; color: var(--ink); outline: none; font-size: 13px;
}
.field input::placeholder, .field textarea::placeholder { color: #a7b2be; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #e1f0ff; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.field input[type="file"] { height: auto; padding: 15px; border-style: dashed; background: #f8fbff; }
.tag-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.field .tag-choice { position: relative; display: inline-flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 500; }
.field .tag-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-choice span { padding: 7px 11px; border: 1px solid #d8e2ee; border-radius: 6px; background: #fff; color: #425871; }
.tag-choice input:checked + span { color: #1266cf; border-color: #7fb5f8; background: #edf6ff; }
.tag-choice input:focus-visible + span { outline: 2px solid #1266cf; outline-offset: 2px; }
.region-picker { display: grid; gap: 8px; }
.region-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.region-picker > input[readonly] { background: #f7faff; color: #405b78; }
.import-dialog { width: min(620px, 94vw); max-height: 85vh; overflow: auto; border: 1px solid #dce4ed; border-radius: 12px; padding: 24px; }
.import-dialog::backdrop { background: rgba(16, 34, 55, .45); }
.import-dialog .field { margin-top: 20px; }
.import-preview { margin-top: 15px; max-height: 240px; overflow: auto; }
.import-preview p { margin: 8px 0; }
.column-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-height: 45vh; overflow: auto; font-size: 13px; }
.column-choices label { display: flex; align-items: center; gap: 7px; }
.hint { color: #8d9bac; font-size: 11px; }
.form-footer { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 9px; padding: 12px 0; background: var(--canvas); border-top: 1px solid var(--line); }
.error { margin: 12px 0; padding: 11px 13px; border-radius: 7px; background: #fff1ee; color: #c74337; font-size: 13px; }
dialog.panel { color: var(--ink); box-shadow: 0 25px 70px #22374c33; }
dialog::backdrop { background: #102b4799; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #eff4f9; }
.login-card { width: min(420px, 100%); padding: 37px; border: 1px solid #e1e8f0; border-radius: 12px; background: white; box-shadow: 0 15px 45px #23486918; }
.login-card .logo { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--blue); color: white; font-size: 22px; font-weight: 750; }
.login-card h1 { margin: 24px 0 9px; font-size: 24px; }
.login-card p { margin: 0 0 23px; color: #687b8f; font-size: 13px; line-height: 1.7; }
.login-card form { display: grid; gap: 12px; }
.login-card input { min-height: 42px; padding: 10px 12px; border: 1px solid #d8e2ed; border-radius: 6px; }
.login-card .button { width: 100%; }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: none; max-width: 370px; padding: 12px 16px; border-radius: 8px; background: #263d57; color: white; font-size: 12px; box-shadow: 0 10px 30px #14283d33; }
#toast.show { display: block; }
.mobile-nav { display: none; }

@media (max-width: 1300px) {
  .metrics.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 950px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 60px; padding: 0 18px; }
  .content { padding: 18px 16px 90px; }
  .detail-grid { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: flex;
    justify-content: space-around; padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: #fff;
  }
  .mobile-nav button { min-height: 39px; padding: 6px 11px; border: 0; border-radius: 7px; background: none; color: #74869a; font-size: 12px; font-weight: 700; }
  .mobile-nav button.active { background: var(--blue-pale); color: var(--blue-dark); }
  .mode-bar { align-items: stretch; flex-direction: column; gap: 10px; }
  .mode-actions { width: 100%; }
  .mode-actions .search { flex: 1; min-width: 0; }
  .form-footer { bottom: 54px; }
}
@media (max-width: 650px) {
  .customer-drawer { width: 100vw; border-left: 0; }
  .drawer-kv { grid-template-columns: 1fr; }
  .content { padding: 13px 12px 82px; }
  .topbar h1 { font-size: 15px; }
  .user-chip { gap: 5px; font-size: 10px; }
  .user-chip strong { font-size: 11px; }
  .mode-bar { padding: 11px; margin-bottom: 10px; }
  .tab { flex: 1; }
  .mode-bar .tabs { flex-wrap: nowrap; }
  .search { width: 100%; }
  .metrics.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .metrics.six .metric { min-height: 80px; padding: 11px 13px; }
  .metric .label { font-size: 11px; }
  .metric .number { font-size: 22px; margin-top: 3px; }
  .filters { padding: 5px 12px 8px; }
  .filter-tabs { gap: 5px 15px; }
  .filter-tab { padding: 8px 0 9px; }
  .filters > .muted { white-space: normal; }
  .list-toolbar { padding: 12px; }
  .empty { padding: 43px 12px 50px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero h2 { font-size: 21px; }
  .form-head { align-items: flex-start; flex-direction: column; }
  .form-card { padding: 20px 16px; }
  .form-grid, .kv-grid { grid-template-columns: 1fr; }
  .detail-head, .section { padding: 19px 17px; }
  .form-footer .button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
