* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #6B84A3;
  --primary-dark: #56708F;
  --primary-soft: #EEF2F7;
  --side: #253041;
  --side-soft: #303D52;
  --gold: #B8935A;
  --green: #27AE60;
  --blue: #2F80ED;
  --orange: #F2994A;
  --red: #EB5757;
  --purple: #9B51E0;
  --gray: #9aa2ad;
  --bg: #F4F5F7;
  --line: #E5E7EB;
  --text: #2d3440;
  --muted: #7d8695;
  --radius: 12px;
}
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: var(--side); color: #c9d2de; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 20px 20px 14px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: 1px; }
.sidebar .brand small { display: block; font-weight: 400; font-size: 12px; color: #93a1b5; letter-spacing: 0; margin-top: 3px; }
.nav-group { padding: 2px 0; }
.nav-group .nav-title { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 18px 6px 20px; font-size: 11.5px; color: #7f8da3; letter-spacing: 1px; background: none; border: none; font-family: inherit; text-align: left; cursor: pointer; }
.nav-group .nav-title:hover { color: #c9d2de; }
.nav-group .nav-title:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 6px; }
.nav-group .nav-title .grow { flex: 1; min-width: 0; }
.nav-caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; flex-shrink: 0; margin-right: 2px; }
.nav-title[aria-expanded=true] .nav-caret { transform: rotate(45deg); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.nav-items { padding-bottom: 4px; }
.js .nav-title[aria-expanded=false] + .nav-items { display: none; }
.nav-group a { display: block; padding: 8px 20px 8px 24px; color: #c9d2de; font-size: 14px; border-left: 3px solid transparent; }
.nav-group a:hover { background: var(--side-soft); color: #fff; text-decoration: none; }
.nav-group a.active { background: var(--side-soft); color: #fff; border-left-color: var(--gold); font-weight: 600; }
.sidebar .side-foot { margin-top: auto; padding: 14px 20px; font-size: 12px; color: #7f8da3; border-top: 1px solid #34425a; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 26px; height: 56px; position: sticky; top: 0; z-index: 40; }
.topbar .page-title { font-size: 16px; font-weight: 700; color: #3a4657; }
.topbar .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-menu { position: relative; flex-shrink: 0; }
.user-menu-btn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent; border-radius: 22px; padding: 4px 12px 4px 4px; cursor: pointer; font-family: inherit; font-size: 14px; color: var(--text); }
.user-menu-btn:hover, .user-menu-btn[aria-expanded=true] { background: var(--primary-soft); border-color: #dbe3ee; }
.user-menu-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-menu-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #3a4657; }
.user-menu-caret { width: 0; height: 0; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 5.5px solid #8794a6; transition: transform .15s ease; }
.user-menu-btn[aria-expanded=true] .user-menu-caret { transform: rotate(180deg); }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 268px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(30,40,55,.16); padding: 6px; z-index: 70; }
.user-menu-head { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu-head strong { font-size: 15px; color: #3a4657; overflow-wrap: anywhere; }
.user-menu-head span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.user-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; background: none; border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; line-height: 1.4; }
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--primary-soft); text-decoration: none; outline: none; }
.user-menu-item:disabled { color: #b4bbc6; cursor: not-allowed; background: none; }
.user-menu-item small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.user-menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.user-menu-logout { color: var(--red); }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.switch { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 11px; background: #cfd5de; position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s ease; border: none; padding: 0; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .6; cursor: wait; }
.driver-popover.crm-guide { border-radius: 14px; padding: 18px 18px 14px; min-width: 270px; max-width: 350px; box-shadow: 0 14px 40px rgba(20,30,45,.3); color: var(--text); }
.driver-popover.crm-guide, .driver-popover.crm-guide * { font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
.driver-popover.crm-guide .driver-popover-title { font-size: 16px; font-weight: 700; line-height: 1.4; color: #2d3a4d; padding-right: 24px; }
.driver-popover.crm-guide .driver-popover-description { font-size: 14px; line-height: 1.7; color: #4a5565; }
.driver-popover.crm-guide .driver-popover-title[style*=block] + .driver-popover-description { margin-top: 6px; }
.driver-popover.crm-guide .driver-popover-footer { margin-top: 14px; gap: 10px; flex-wrap: wrap; }
.driver-popover.crm-guide .driver-popover-progress-text { font-size: 12.5px; color: var(--muted); }
.driver-popover.crm-guide .driver-popover-footer button { font-size: 13px; line-height: 1.4; text-shadow: none; border-radius: 8px; padding: 6px 13px; border: 1px solid var(--primary); background: #fff; color: var(--primary-dark); }
.driver-popover.crm-guide .driver-popover-footer button:hover, .driver-popover.crm-guide .driver-popover-footer button:focus { background: var(--primary-soft); }
.driver-popover.crm-guide .driver-popover-footer button.driver-popover-next-btn { background: var(--primary); color: #fff; }
.driver-popover.crm-guide .driver-popover-footer button.driver-popover-next-btn:hover, .driver-popover.crm-guide .driver-popover-footer button.driver-popover-next-btn:focus { background: var(--primary-dark); }
.driver-popover.crm-guide .driver-popover-navigation-btns button + button { margin-left: 6px; }
.driver-popover.crm-guide .driver-popover-close-btn { width: 34px; height: 34px; font-size: 20px; color: #9aa2ad; top: 6px; right: 6px; }
.driver-popover.crm-guide .driver-popover-close-btn:hover, .driver-popover.crm-guide .driver-popover-close-btn:focus { color: #2d3a4d; }
.driver-popover.crm-guide .driver-popover-footer button.crm-guide-off { border: none; background: none; padding: 6px 0; color: var(--muted); text-decoration: underline; flex-basis: 100%; text-align: left; }
.driver-popover.crm-guide .driver-popover-footer button.crm-guide-off:hover, .driver-popover.crm-guide .driver-popover-footer button.crm-guide-off:focus { background: none; color: var(--text); }
.guide-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #2d3a4d; color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; box-shadow: 0 8px 24px rgba(20,30,45,.3); z-index: 200; max-width: calc(100vw - 32px); }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 26px 60px; }

.card { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin-bottom: 14px; color: #3a4657; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h2 .sub { font-weight: 400; font-size: 13px; color: var(--muted); }
.card h3 { font-size: 14.5px; margin: 14px 0 8px; color: #3a4657; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h1 { font-size: 20px; color: #3a4657; }
.toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); font-size: 13px; }
.struck { text-decoration: line-through; color: var(--gray); }
.row-actions { min-width: 176px; }
table.table .col-main { min-width: 140px; }
.table-fit .progress { width: 96px; }
.row-actions .btn { margin: 2px 0; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.hide { display: none !important; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #8fb2dd, #5B87BE); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }

.pill { display: inline-block; color: #fff; border-radius: 20px; padding: 2px 11px; font-size: 12.5px; line-height: 20px; white-space: nowrap; background: var(--gray); }
.pill-green { background: var(--green); }
.pill-blue { background: var(--blue); }
.pill-orange { background: var(--orange); }
.pill-red { background: var(--red); }
.pill-purple { background: var(--purple); }
.pill-gold { background: var(--gold); }
.pill-gray { background: #B9BEC7; }
.pill-dark { background: #4a5568; }
.pill-outline { background: #fff; color: var(--primary-dark); border: 1px solid var(--primary); }
.pill-line { background: #06C755; }

.status-flow { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; flex-wrap: wrap; }
.status-flow .step { color: #b8bec8; }
.status-flow .step.done { color: var(--red); font-weight: 600; }
.status-flow .arrow { color: #ccd1d8; font-size: 12px; }

.progress { background: #ecedf1; border-radius: 8px; height: 8px; overflow: hidden; width: 140px; display: inline-block; vertical-align: middle; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #63b3ed, var(--blue)); border-radius: 8px; transition: width .25s ease; }
.progress.gold > i { background: linear-gradient(90deg, #dcc08b, var(--gold)); }
.progress.wide { width: 100%; }

.btn { display: inline-block; border: none; cursor: pointer; border-radius: 9px; padding: 9px 18px; font-size: 14px; background: var(--primary); color: #fff; font-family: inherit; line-height: 1.4; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #219653; }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #a07f4b; }
.btn-line { background: #06C755; }
.btn-line:hover { background: #05a648; }
.btn-light { background: #fff; border: 1px solid var(--primary); color: var(--primary-dark); }
.btn-light:hover { background: var(--primary-soft); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #d64545; }
.btn-block { display: block; width: 100%; text-align: center; }
.inline-form { display: inline; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
label.f { display: block; font-size: 13px; color: #66707e; margin-bottom: 5px; }
label.f .req { color: var(--red); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d7dbe2; border-radius: 9px; font-size: 14.5px; background: #fff; font-family: inherit; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(107,132,163,.15); }
input[readonly] { background: #fafbfc; }
input.js-timepicker { width: 104px; min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: #6B84A3; }
input[type=color] { width: 52px; height: 40px; border: 1px solid #d7dbe2; border-radius: 8px; padding: 2px; background: #fff; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: #6B84A3; }
.check-list { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-fields > div { flex: 1; min-width: 150px; }
.inline-fields > .checkout-pick { flex: 2 1 220px; min-width: 220px; }
.preview-sub { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type=text], .filters input[type=search], .filters select { width: auto; min-width: 150px; }
.quick-add { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-add input[type=text] { flex: 1; min-width: 200px; }

.alert { background: #FDECEC; color: #C0392B; border-radius: 9px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.alert-ok { background: #E8F8EF; color: #1E8449; }
.alert-info { background: #EAF2FD; color: #1F5FA8; }
.alert-warn { background: #FFF6E5; color: #9A6700; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 9px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }

.tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 9px 16px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--primary-dark); text-decoration: none; }
.tabs a.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tabs a .count { font-weight: 400; font-size: 12px; color: var(--gray); margin-left: 4px; }
.tabs.member-tabs { flex-wrap: wrap; row-gap: 2px; border-bottom: 0; box-shadow: inset 0 -2px 0 var(--line); }
.tabs.member-tabs a { flex-shrink: 0; margin-bottom: 0; padding: 8px 13px; }
.insights { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.insight { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid; font-size: 13.5px; line-height: 1.5; }
.insight-tag { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; color: #fff; margin-top: 1px; }
.insight-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.insight-body strong { margin-right: 6px; }
.insight-text { color: inherit; opacity: .9; }
.insight-link { flex-shrink: 0; font-weight: 600; white-space: nowrap; }
.insight-danger { background: #FDECEC; border-color: #F5C6C2; color: #A93226; }
.insight-danger .insight-tag { background: var(--red); }
.insight-warn { background: #FFF6E5; border-color: #F5DDB0; color: #8A5A00; }
.insight-warn .insight-tag { background: var(--orange); }
.insight-info { background: #EAF2FD; border-color: #C9DBF5; color: #1F5FA8; }
.insight-info .insight-tag { background: var(--blue); }
.insight-ok { background: #E8F8EF; border-color: #BFE6CF; color: #1E8449; }
.insight-ok .insight-tag { background: var(--green); }
.insight-danger .insight-link, .insight-warn .insight-link, .insight-info .insight-link, .insight-ok .insight-link { color: inherit; text-decoration: underline; }
.insights-more > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 4px; user-select: none; }
.insights-more > summary::-webkit-details-marker { display: none; }
.insights-more > summary::before { content: '▸'; display: inline-block; margin-right: 6px; transition: transform .15s; }
.insights-more[open] > summary::before { transform: rotate(90deg); }
.insights-more > summary:hover { color: var(--text); }
.insights-more-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.insights-compact { margin: 12px 0 0; }
.insights-compact .insight { padding: 7px 12px; }
.feature-head { font-size: 14px; color: #3a4657; margin-bottom: 8px; }
.feature-head .sub { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.feature-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: #fff; }
.feature-item:hover { border-color: #cfd6e0; }
.feature-item input { margin-top: 4px; flex-shrink: 0; }
.feature-item strong { display: block; font-size: 14px; font-weight: 600; }
.feature-item small { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; color: #3a4657; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.stat .delta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.gold .value { color: var(--gold); }
.stat.green .value { color: var(--green); }
.stat.red .value { color: var(--red); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 8px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { word-break: break-word; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.name-lg { font-size: 19px; color: #3a4657; }
.head-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 26px; align-items: start; }
.head-stats strong { font-size: 17px; color: #3a4657; font-variant-numeric: tabular-nums; }
.section-title { font-size: 15px; font-weight: 700; color: #3a4657; margin: 4px 0 12px; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 10px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #F4F5F7; border: 1px dashed #c9d0da; border-radius: 9px; padding: 10px 14px; font-size: 20px; letter-spacing: 4px; text-align: center; color: #3a4657; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gray); margin-right: 6px; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.orange { background: var(--orange); }
.rm-preview { position: relative; width: 100%; max-width: 500px; background: #dfe3ea center / 100% 100% no-repeat; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.rm-preview .cell { position: absolute; border: 1.5px dashed rgba(255,255,255,.9); outline: 1px dashed rgba(60,70,90,.55); outline-offset: -3px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); font-weight: 700; text-align: center; padding: 4px; }
.rm-area { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.rm-area .idx { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 8px; }
.sim-phone { max-width: 380px; background: #8cabd9; border-radius: 22px; padding: 14px; min-height: 420px; display: flex; flex-direction: column; gap: 10px; }
.sim-bubble { background: #fff; border-radius: 14px; padding: 10px 13px; font-size: 13.5px; max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.sim-bubble.me { background: #85e249; align-self: flex-end; }
.sim-bubble .t { font-weight: 700; margin-bottom: 4px; }
.sim-bubble .a { display: block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-dark); text-align: center; font-size: 13px; }
.tier-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--gold); letter-spacing: .5px; white-space: nowrap; }
.card-imgs { display: flex; gap: 14px; flex-wrap: wrap; }
.card-imgs figure { text-align: center; }
.card-imgs img { width: 260px; height: 156px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.card-imgs figcaption { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.task-add { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: none; }
.task-row .task-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-row.is-done .task-title .t { text-decoration: line-through; color: var(--gray); font-weight: 500; }
.task-meta { font-size: 12.5px; margin-top: 3px; }
.task-progress-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.task-bar { width: 160px; }
.task-pct { font-size: 12.5px; color: #66707e; min-width: 34px; }
.task-quick { display: inline-flex; gap: 4px; }
.chip { border: 1px solid #d7dbe2; background: #fff; color: #66707e; border-radius: 14px; padding: 2px 9px; font-size: 12px; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.task-edit { background: #F7F8FA; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 8px 0 12px; }

.modal-mask { position: fixed; inset: 0; background: rgba(30,40,55,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; max-height: 86vh; overflow: auto; padding: 22px 24px; }
.modal h3 { margin-bottom: 6px; color: #3a4657; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.ocr-zone { border: 2px dashed #c9d2de; border-radius: 12px; padding: 16px; text-align: center; }
.ocr-filled { background: #FFFBE8 !important; }
.ocr-zone img { max-width: 240px; max-height: 150px; border-radius: 8px; margin-top: 8px; }
.spin { display: inline-block; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

#network-graph { width: 100%; height: 640px; background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.legend { display: flex; gap: 14px; font-size: 13px; color: #66707e; margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; font-size: 13.5px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .disabled { color: #c3c8d0; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row .track { background: #ecedf1; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: #66707e; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #253041 0%, #3d5068 60%, #F4F5F7 60.1%); padding: 16px; }
.auth-card { background: #fff; width: 420px; max-width: 100%; border-radius: 16px; padding: 34px 36px; box-shadow: 0 12px 40px rgba(40,60,90,.25); }
.auth-card h1 { font-size: 21px; color: var(--side); margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .row { margin-bottom: 14px; }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--line); }
.auth-tabs a { flex: 1; text-align: center; padding: 10px; color: var(--gray); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tabs a:hover { text-decoration: none; }
.auth-tabs a.on { color: var(--side); border-color: var(--gold); }

.select2-container .select2-selection--single { height: 41px; border: 1px solid #d7dbe2; border-radius: 9px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 39px; padding-left: 12px; color: var(--text); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 39px; }
.select2-container--default .select2-selection--multiple { border: 1px solid #d7dbe2; border-radius: 9px; min-height: 41px; }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(107,132,163,.15); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--primary); border: none; color: #fff; border-radius: 14px; padding: 2px 10px; margin-top: 6px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #fff; margin-right: 6px; border: none; background: transparent; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { background: transparent; color: #ffe; }
.select2-dropdown { border: 1px solid #d7dbe2; border-radius: 9px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--primary); }
.air-datepicker { --adp-accent-color: #6B84A3; --adp-day-cell-background-color-selected: #6B84A3; font-family: inherit; }
.air-datepicker-cell.-selected- { background: var(--primary) !important; }
.air-datepicker-button { color: var(--primary-dark); }

@media (max-width: 1100px) {
  .head-stats { grid-template-columns: repeat(2, auto); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -240px; z-index: 60; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 9999px rgba(30,40,55,.4); }
  .menu-toggle { display: block; }
  .topbar { padding: 0 14px; }
  .user-menu-name { display: none; }
  .user-menu-btn { padding: 4px 8px 4px 4px; }
  .user-menu-panel { max-width: calc(100vw - 28px); }
  .container { padding: 16px 14px 60px; }
  .bar-row { grid-template-columns: 80px 1fr 56px; }
  .tabs.member-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .tabs.member-tabs a { flex-shrink: 0; padding: 9px 12px; }
  .topbar-right { gap: 6px; }
  .insight { flex-wrap: wrap; }
}
