:root {
  --bg: #f6f5f6;
  --surface: #ffffff;
  --surface-soft: #fbfafb;
  --text: #28242a;
  --muted: #817b82;
  --subtle: #aaa4aa;
  --border: #ebe7ea;
  --primary: #f45f84;
  --primary-soft: #fff0f4;
  --purple: #7663d9;
  --purple-soft: #f1efff;
  --orange: #e99641;
  --orange-soft: #fff5e9;
  --green: #31ae72;
  --green-soft: #eaf8f1;
  --danger: #d85763;
  --danger-soft: #fff0f1;
  --sidebar: #202024;
  --sidebar-muted: #96949a;
  --shadow: 0 8px 24px rgba(43, 34, 43, .06);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; cursor: pointer; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; width: 244px; flex-direction: column; color: #fff; background: var(--sidebar); }
.brand { display: flex; height: 76px; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 8px; color: #fff; background: var(--primary); box-shadow: 0 6px 16px rgba(244,95,132,.24); }
.brand-mark svg { width: 21px; height: 21px; }
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; font-size: 20px; line-height: 1.2; }
.brand small { display: block; margin-top: 4px; color: var(--sidebar-muted); font-size: 11px; }
.side-nav { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 14px 12px 24px; scrollbar-width: thin; scrollbar-color: #444349 transparent; }
.nav-group { margin-bottom: 15px; }
.nav-group-label { padding: 8px 10px 6px; color: #6f6d73; font-size: 11px; font-weight: 600; }
.nav-item { position: relative; display: flex; height: 40px; align-items: center; gap: 11px; padding: 0 11px; border-radius: 6px; color: #aaa8ae; font-size: 13px; transition: background .18s, color .18s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: #353238; }
.nav-item.active::before { position: absolute; left: 0; width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--primary); content: ""; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item b { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; margin-left: auto; padding: 0 6px; border-radius: 10px; color: #fff; background: var(--primary); font-size: 10px; }
.sidebar-foot { flex: 0 0 auto; padding: 15px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.system-state { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; background: rgba(255,255,255,.045); }
.system-state > span { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #4bd893; box-shadow: 0 0 0 4px rgba(75,216,147,.1); }
.system-state strong, .system-state small { display: block; }
.system-state strong { color: #dedce0; font-size: 11px; }
.system-state small { margin-top: 3px; color: #7f7d83; font-size: 9px; }

.main-area { min-width: 0; margin-left: 244px; }
.main-area .content-wrap { transition: opacity .14s ease; }
.main-area.pjax-loading .content-wrap { opacity: .48; pointer-events: none; }
.top-header { position: sticky; z-index: 30; top: 0; display: flex; height: 64px; align-items: center; padding: 0 26px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); }
.breadcrumb { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--subtle); font-size: 12px; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb strong { overflow: hidden; color: #514b52; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-search { display: flex; width: 250px; height: 36px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--subtle); background: #faf9fa; text-align: left; }
.header-search span { flex: 1; font-size: 11px; }
.header-search kbd { padding: 2px 5px; border: 1px solid #e1dde0; border-radius: 4px; color: #989197; background: #fff; font-size: 9px; font-family: inherit; }
.icon-control { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; color: #706970; background: #fff; }
.notification-control { position: relative; }
.notification-control span { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); }
.admin-user { position: relative; display: flex; min-width: 154px; height: 46px; align-items: center; gap: 9px; margin-left: 4px; padding: 0 8px; border-radius: 7px; cursor: pointer; }
.admin-user:hover { background: #f8f6f7; }
.admin-avatar { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; flex: none; border-radius: 7px; color: #fff; background: var(--purple); font-weight: 700; }
.admin-user div:nth-of-type(1) { flex: 1; min-width: 0; }
.admin-user strong, .admin-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user strong { font-size: 12px; }
.admin-user small { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.admin-user > svg { width: 14px; height: 14px; }
.user-menu { position: absolute; z-index: 60; top: 48px; right: 0; display: none; width: 150px; padding: 6px; border: 1px solid var(--border); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.admin-user:hover .user-menu { display: block; }
.user-menu a { display: flex; height: 36px; align-items: center; gap: 8px; padding: 0 9px; border-radius: 5px; color: #5f595f; font-size: 11px; }
.user-menu a:hover { background: #f8f6f7; }
.mobile-menu { display: none; margin-right: 10px; }
.sidebar-backdrop { display: none; }

.content-wrap { width: min(1540px, 100%); margin: 0 auto; padding: 26px 28px 44px; }
.page-heading { display: flex; min-height: 58px; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .table-action:focus-visible, .icon-control:focus-visible { outline: 3px solid rgba(118,99,217,.22); outline-offset: 2px; }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: #e95479; }
.btn-secondary { border-color: var(--border); color: #615b62; background: #fff; }
.btn-secondary:hover { border-color: #dcd5da; background: #faf8f9; }
.btn-ghost { color: #7b747b; background: transparent; }
.btn-danger-soft { color: var(--danger); background: var(--danger-soft); }
.live-pill { display: inline-flex; height: 30px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #dcefe5; border-radius: 6px; color: #36815e; background: #f5fbf8; font-size: 10px; }
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: #3dc582; }

.panel { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(43,34,43,.025); }
.panel-head { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head p { margin: 5px 0 0; color: var(--subtle); font-size: 10px; }
.panel-head > a { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--primary); font-size: 10px; font-weight: 600; }
.panel-head > a svg { width: 13px; height: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; transition: transform .18s, box-shadow .18s; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; }
.metric-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 7px; }
.metric-icon.pink { color: var(--primary); background: var(--primary-soft); }
.metric-icon.orange { color: var(--orange); background: var(--orange-soft); }
.metric-icon.purple { color: var(--purple); background: var(--purple-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-trend { color: var(--green); font-size: 10px; font-weight: 600; }
.metric-card > strong { display: block; margin-top: 15px; font-size: 24px; line-height: 1; }
.metric-card > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; gap: 14px; margin-top: 14px; }
.dashboard-main-row { grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr); }
.dashboard-rank-row { grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); }
.chart { width: 100%; height: 290px; }
.segmented { display: flex; padding: 3px; border-radius: 6px; background: #f4f2f4; }
.segmented button { height: 26px; padding: 0 10px; border-radius: 4px; color: #8a8389; background: transparent; font-size: 9px; }
.segmented button.active { color: #4c464c; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.range-label { display: inline-flex; height: 28px; align-items: center; padding: 0 10px; border-radius: 5px; color: #746d73; background: #f4f2f4; font-size: 9px; font-weight: 600; }
.todo-list { padding: 4px 16px 12px; }
.todo-item { display: flex; min-height: 61px; align-items: center; gap: 11px; border-bottom: 1px solid #f1edef; }
.todo-item:last-child { border-bottom: 0; }
.todo-icon { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; flex: none; border-radius: 7px; }
.todo-icon.warning { color: var(--orange); background: var(--orange-soft); }
.todo-icon.danger { color: var(--danger); background: var(--danger-soft); }
.todo-icon.purple { color: var(--purple); background: var(--purple-soft); }
.todo-icon.info { color: #4785c8; background: #edf5ff; }
.todo-item div { flex: 1; min-width: 0; }
.todo-item strong, .todo-item small { display: block; }
.todo-item strong { font-size: 11px; }
.todo-item small { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.todo-item b { color: var(--primary); font-size: 18px; }
.todo-item > svg { width: 15px; height: 15px; color: #bbb5ba; }
.health-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 14px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.health-strip > div { padding: 0 18px; border-right: 1px solid var(--border); }
.health-strip > div:first-child { padding-left: 0; }
.health-strip > div:last-child { padding-right: 0; border-right: 0; }
.health-strip span, .health-strip strong, .health-strip small { display: block; }
.health-strip span { color: var(--muted); font-size: 10px; }
.health-strip strong { margin-top: 7px; font-size: 18px; }
.health-strip small { margin-top: 5px; color: var(--green); font-size: 9px; }
.rank-list { padding: 10px 18px 18px; }
.rank-item { display: grid; grid-template-columns: 22px 70px minmax(80px,1fr) 45px; align-items: center; gap: 8px; min-height: 43px; }
.rank-no { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 5px; color: #8b848a; background: #f3f1f3; font-size: 9px; font-weight: 700; }
.rank-item:nth-child(-n+3) .rank-no { color: #fff; background: var(--primary); }
.rank-item strong { font-size: 11px; }
.rank-bar { height: 6px; overflow: hidden; border-radius: 3px; background: #f1edef; }
.rank-bar span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: var(--purple); }
.rank-item b { color: #625b61; font-size: 10px; text-align: right; }
.recent-panel { margin-top: 14px; }

.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--border); color: #8b858b; background: #fbfafb; font-size: 10px; font-weight: 600; text-align: left; }
.data-table td { height: 55px; padding: 8px 14px; border-bottom: 1px solid #f0edef; color: #504a50; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fdfbfc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-scroll { width: 100%; overflow-x: auto; }
.table-link { color: var(--purple); font-weight: 600; }
.money { color: #d94f73; font-weight: 700; }
.muted-cell { color: #928b91 !important; }
.status-badge { display: inline-flex; min-width: 58px; height: 28px; align-items: center; justify-content: center; padding: 0 10px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-badge.success { color: var(--green); background: var(--green-soft); }
.status-badge.warning { color: var(--orange); background: var(--orange-soft); }
.status-badge.danger { color: var(--danger); background: var(--danger-soft); }
.status-badge.info { color: #3e7dbd; background: #edf5ff; }
.status-badge.purple { color: var(--purple); background: var(--purple-soft); }
.status-badge.muted { color: #7e777d; background: #f0edef; }

.summary-strip { display: flex; min-height: 62px; align-items: center; gap: 0; margin-bottom: 14px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.summary-strip > div:not(.summary-note) { min-width: 125px; padding-right: 26px; margin-right: 26px; border-right: 1px solid var(--border); }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: var(--muted); font-size: 9px; }
.summary-strip strong { margin-top: 5px; font-size: 18px; }
.summary-note { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 10px; }
.summary-note svg { width: 14px; height: 14px; color: var(--purple); }
.table-panel { overflow: hidden; }
.filter-bar { display: flex; min-height: 64px; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.filter-search { display: flex; width: 240px; height: 36px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.filter-search svg { width: 15px; height: 15px; color: var(--subtle); }
.filter-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.filter-search input::placeholder { color: #b2acb1; }
.filter-search.compact { width: 200px; }
.select-control { position: relative; width: 130px; }
.select-control select { width: 100%; height: 36px; appearance: none; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: #5f595f; background: #fff; font-size: 11px; }
.select-control svg { position: absolute; top: 11px; right: 9px; width: 14px; height: 14px; pointer-events: none; color: #aaa3a9; }
.filter-submit { min-width: 72px; }
.filter-count { margin-left: auto; color: var(--subtle); font-size: 10px; }
.business-table { min-width: 960px; }
.identity-cell { display: flex; align-items: center; gap: 9px; }
.identity-cell img { width: 32px; height: 32px; flex: none; border-radius: 7px; object-fit: cover; }
.identity-cell strong, .identity-cell small { display: block; }
.identity-cell strong { max-width: 100px; overflow: hidden; color: #3f3940; text-overflow: ellipsis; }
.identity-cell small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.rating-cell { display: inline-flex; align-items: center; gap: 4px; color: #7f6541; font-weight: 600; }
.rating-cell svg { width: 13px; height: 13px; color: var(--orange); fill: #f7c983; }
.truncate-cell { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { min-width: 190px; text-align: right !important; white-space: nowrap; }
.table-action { display: inline-flex; min-width: 62px; height: 34px; align-items: center; justify-content: center; margin: 3px 0 3px 6px; padding: 0 11px; border: 1px solid var(--border); border-radius: 5px; color: #6f686e; background: #fff; font-size: 12px; font-weight: 600; line-height: 1; vertical-align: middle; white-space: nowrap; }
.table-action.primary { border-color: #f8bdcc; color: var(--primary); background: var(--primary-soft); }
.table-action.danger { border-color: #efc7ca; color: var(--danger); background: var(--danger-soft); }
.table-action:hover { filter: brightness(.98); }
.action-column { min-width: 190px; text-align: right !important; }
.table-footer { display: flex; height: 54px; align-items: center; justify-content: space-between; padding: 0 14px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 10px; }
.pagination { display: flex; gap: 5px; }
.pagination button, .pagination a { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 5px; color: #868086; background: #fff; font-size: 10px; font-weight: 600; }
.pagination button.active, .pagination a.active { border-color: var(--primary); color: #fff; background: var(--primary); }
.pagination a:hover { border-color: #d9a4b3; color: var(--primary); background: var(--primary-soft); }
.pagination button:disabled { opacity: .45; cursor: default; }
.pagination svg { width: 13px; height: 13px; }
.empty-table { height: 240px !important; text-align: center; }
.empty-table svg, .empty-table strong, .empty-table span { display: block; margin: 0 auto; }
.empty-table svg { width: 34px; height: 34px; color: #c9c4c8; }
.empty-table strong { margin-top: 12px; color: #635d63; }
.empty-table span { margin-top: 5px; color: var(--subtle); }
.channel-metrics { margin-bottom: 14px; }
.channel-filter-panel { margin-bottom: 14px; }
.channel-filter-bar { flex-wrap: wrap; border-bottom: 0; }
.date-filter { display: flex; height: 36px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: #fff; font-size: 10px; }
.date-filter input { border: 0; outline: 0; color: #5f595f; background: transparent; font-size: 11px; }
.date-limit-hint { display: inline-flex; height: 28px; align-items: center; padding: 0 9px; border-radius: 5px; color: #9a6c2e; background: #fff8eb; font-size: 10px; }
.channel-filter-input { width: 180px; }
.channel-source-select { width: 150px; min-width: 150px; }
.channel-list-panel, .channel-orders-panel { overflow: hidden; }
.channel-orders-panel { margin-top: 14px; }
.channel-list-panel .table-scroll { overflow-x: hidden; }
.channel-table { min-width: 0; table-layout: fixed; }
.channel-table th, .channel-table td { padding-right: 10px; padding-left: 10px; }
.channel-table th:nth-child(1), .channel-table td:nth-child(1) { width: 118px; }
.channel-table th:nth-child(2), .channel-table td:nth-child(2) { width: 92px; text-align: center; }
.channel-table th:nth-child(3), .channel-table td:nth-child(3) { width: 64px; }
.channel-table th:nth-child(4), .channel-table td:nth-child(4) { width: 70px; }
.channel-table th:nth-child(5), .channel-table td:nth-child(5) { width: 56px; }
.channel-table th:nth-child(6), .channel-table td:nth-child(6) { width: 62px; }
.channel-table th:nth-child(7), .channel-table td:nth-child(7) { width: 78px; }
.channel-table th:nth-child(8), .channel-table td:nth-child(8) { width: 68px; }
.channel-table th:nth-child(9), .channel-table td:nth-child(9) { width: 70px; }
.channel-table th:nth-child(10), .channel-table td:nth-child(10) { width: 285px; }
.channel-orders-table { min-width: 1130px; }
.channel-order-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-compact { min-height: 34px; padding: 0 12px; font-size: 12px; }
.select-col { width: 42px; min-width: 42px; text-align: center !important; }
.select-col input { width: 15px; height: 15px; accent-color: var(--primary); vertical-align: middle; }
.order-page-size-form { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.compact-select { width: 86px; height: 32px; min-width: 86px; }
.compact-select select { height: 32px; padding-left: 9px; font-size: 10px; }
.compact-select svg { top: 9px; }
.channel-orders-footer { gap: 14px; }
.channel-list-head { align-items: flex-start; }
.channel-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.channel-qr-environment { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.channel-qr-environment .segmented { flex: none; }
.channel-name-cell strong, .channel-name-cell small, .channel-name-cell span, .table-subnote { display: block; }
.channel-name-cell strong { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.channel-name-cell small { margin-top: 4px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.channel-name-cell span { max-width: 96px; margin-top: 4px; overflow: hidden; color: var(--subtle); text-overflow: ellipsis; font-size: 9px; }
.table-subnote { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.channel-qr-wrap { display: inline-flex; align-items: center; flex-direction: column; vertical-align: top; }
.channel-qr { display: flex; width: 64px; height: 64px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
.channel-qr:hover, .channel-qr:focus-visible { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); outline: 0; }
.channel-qr img, .channel-qr svg { display: block; width: 58px; height: 58px; image-rendering: pixelated; }
.qr-loading { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; color: var(--subtle); font-size: 8px; }
.qr-loading svg { width: 16px; height: 16px; animation: channel-qr-spin 1.2s linear infinite; }
.qr-tools { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 5px; }
.qr-tool { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 5px; color: #7d757d; background: #fff; }
.qr-tool:hover { border-color: #d9a4b3; color: var(--primary); background: var(--primary-soft); }
.qr-tool:focus-visible { outline: 3px solid rgba(118,99,217,.22); outline-offset: 2px; }
.qr-tool svg { width: 13px; height: 13px; }
.qr-mode-note { display: block; margin-top: 5px; color: var(--subtle); font-size: 9px; }
.qr-fallback { padding: 5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 7px; line-height: 1.3; overflow-wrap: anywhere; text-align: center; }
.channel-actions { vertical-align: middle; }
.channel-primary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.channel-primary-actions .table-action { min-width: 56px; margin: 0; padding-right: 8px; padding-left: 8px; }
.channel-export-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; width: 100%; margin-top: 9px; padding: 5px; border: 1px solid #eee9ee; border-radius: 7px; background: linear-gradient(180deg, #fff, #fbf9fb); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.channel-export-actions span, .channel-export-actions a, .channel-export-actions button { display: inline-flex; height: 25px; align-items: center; justify-content: center; border-radius: 5px; font-size: 10px; line-height: 1; white-space: nowrap; }
.channel-export-actions span { gap: 4px; padding: 0 5px 0 3px; color: #9a9299; }
.channel-export-actions span svg { width: 12px; height: 12px; }
.channel-export-actions a, .channel-export-actions button { min-width: 43px; padding: 0 8px; border: 1px solid transparent; color: #685f67; background: #fff; font-weight: 600; }
.channel-export-actions a:hover, .channel-export-actions button:hover { border-color: #f3c2cf; color: var(--primary); background: var(--primary-soft); }
.channel-export-actions button { cursor: pointer; }
.channel-export-actions a:focus-visible, .channel-export-actions button:focus-visible { outline: 3px solid rgba(118,99,217,.22); outline-offset: 2px; }
.channel-custom-export-form { display: flex; width: 100%; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.channel-custom-export-form input { width: 86px; height: 25px; padding: 0 5px; border: 1px solid #eee9ee; border-radius: 5px; outline: 0; color: #615b62; background: #fff; font-size: 10px; }
.channel-custom-export-form input:focus { border-color: #f3c2cf; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.channel-custom-export-form input::placeholder { color: #b8b1b7; }
.channel-source { display: inline-flex; max-width: 210px; overflow: hidden; padding: 5px 8px; border-radius: 5px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.channel-source.attributed { color: var(--purple); background: var(--purple-soft); }
.channel-source.natural { color: var(--muted); background: #f2f0f2; }
.channel-form-preview { display: flex; align-items: center; gap: 22px; margin: 0 24px; padding: 18px 0; border-top: 1px solid var(--border); }
.channel-preview-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 7px; }
.channel-preview-copy strong { font-size: 14px; }
.channel-preview-copy span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.channel-preview-copy code { width: fit-content; max-width: 100%; padding: 6px 8px; border-radius: 4px; color: var(--purple); background: var(--purple-soft); font-size: 10px; overflow-wrap: anywhere; }
.channel-form-qr-wrap { flex: none; }
.channel-form-qr { width: 160px; height: 160px; }
.channel-form-qr img, .channel-form-qr svg { width: 148px; height: 148px; }
@keyframes channel-qr-spin { to { transform: rotate(360deg); } }

.success-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #caebda; border-radius: 7px; color: #2d8157; background: #f2fbf6; }
.success-banner svg { width: 20px; height: 20px; }
.success-banner strong, .success-banner span { display: block; }
.success-banner strong { font-size: 11px; }
.success-banner span { margin-top: 3px; color: #6f947f; font-size: 9px; }
.error-banner { display:flex; align-items:center; gap:10px; margin-bottom:14px; padding:12px 14px; border:1px solid #f0caca; border-radius:7px; color:#a33a3a; background:#fff6f6; }
.error-banner svg { width:20px; height:20px; }
.error-banner strong,.error-banner span { display:block; }
.error-banner strong { font-size:11px; }
.error-banner span { margin-top:3px; color:#a86b6b; font-size:9px; }
.settings-layout { display: block; }
.settings-tabs { display: flex; gap: 4px; margin-bottom: 14px; padding: 6px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.settings-tabs a { display: flex; height: 42px; align-items: center; gap: 9px; padding: 0 10px; border-radius: 6px; color: #716a70; font-size: 11px; }
.settings-tabs a:hover { background: #faf8f9; }
.settings-tabs a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.settings-tabs a svg { width: 16px; height: 16px; }
.settings-tabs a svg:last-child { display: none; }
.settings-form { overflow: hidden; }
.settings-form-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.settings-form-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; flex: none; border-radius: 7px; color: var(--purple); background: var(--purple-soft); }
.settings-form-head h2 { margin: 0; font-size: 16px; }
.settings-form-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.settings-fields { padding: 5px 20px; }
.setting-field { display: grid; grid-template-columns: minmax(210px, 36%) minmax(260px, 1fr); align-items: center; gap: 28px; min-height: 82px; border-bottom: 1px solid #f0edef; }
.setting-field:last-child { border-bottom: 0; }
.setting-field-agreement-title { padding-bottom: 12px; }
.setting-field-agreement-content { align-items: start; padding-top: 12px; }
.setting-label strong, .setting-label small { display: block; }
.setting-label strong { font-size: 11px; }
.setting-label small { margin-top: 5px; color: var(--subtle); font-size: 9px; line-height: 1.5; }
.setting-control { position: relative; display: block; width: min(460px, 100%); }
.setting-control > input:not(.switch-input) { width: 100%; height: 38px; padding: 0 38px 0 11px; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: #4f494f; background: #fff; font-size: 11px; }
.setting-control > textarea { display: block; width: 100%; min-height: 124px; padding: 10px 11px; resize: vertical; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: #4f494f; background: #fff; font-size: 11px; line-height: 1.65; }
.setting-control > input:focus, .setting-control > textarea:focus { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.setting-control > select { width: 100%; height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: #4f494f; background: #fff; font-size: 11px; }
.setting-control > select:focus { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.field-icon-button { position: absolute; top: 1px; right: 1px; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; color: #999298; background: transparent; }
.field-icon-button svg { width: 15px; height: 15px; }
.switch-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-ui { position: relative; display: block; width: 42px; height: 23px; border-radius: 12px; background: #d7d2d6; cursor: pointer; transition: background .18s; }
.switch-ui::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); content: ""; transition: transform .18s; }
.switch-input:checked + .switch-ui { background: var(--primary); }
.switch-input:checked + .switch-ui::after { transform: translateX(19px); }
.settings-foot { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 20px; border-top: 1px solid var(--border); background: #fbfafb; }
.settings-foot > div { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.settings-foot > div svg { width: 15px; height: 15px; color: var(--green); }

.city-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 14px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.city-summary > div { padding: 0 20px; border-right: 1px solid var(--border); }
.city-summary > div:first-child { padding-left: 0; }
.city-summary > div:last-child { padding-right: 0; border-right: 0; }
.city-summary span, .city-summary strong, .city-summary small { display: block; }
.city-summary span { color: var(--muted); font-size: 10px; }
.city-summary strong { margin-top: 7px; font-size: 21px; }
.city-summary small { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.city-panel-head { padding-right: 14px; }
.city-cell { display: flex; align-items: center; gap: 9px; }
.city-icon { display: inline-flex; width: 31px; height: 31px; align-items: center; justify-content: center; border-radius: 6px; color: var(--primary); background: var(--primary-soft); }
.city-icon svg { width: 15px; height: 15px; }
.city-cell strong, .city-cell small { display: block; }
.city-cell small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.coverage-cell { width: 130px; }
.coverage-cell > span { color: var(--muted); font-size: 9px; }
.coverage-cell > div { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 3px; background: #f0edef; }
.coverage-cell i { display: block; height: 100%; border-radius: inherit; background: var(--purple); }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.service-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.service-card-head { display: flex; align-items: flex-start; justify-content: space-between; }
.service-icon { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 8px; color: var(--service-color); background: color-mix(in srgb, var(--service-color) 12%, white); }
.service-icon svg { width: 21px; height: 21px; }
.service-card h2 { margin: 15px 0 0; font-size: 16px; }
.service-card > p { min-height: 34px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.service-price { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 15px; padding: 11px 12px; border-radius: 6px; background: #fbf9fa; }
.service-price span { color: var(--muted); font-size: 9px; }
.service-price strong { color: var(--primary); font-size: 18px; }
.service-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0 0; }
.service-card dl div { min-width: 0; }
.service-card dt { color: var(--subtle); font-size: 9px; }
.service-card dd { margin: 5px 0 0; color: #554f55; font-size: 11px; font-weight: 600; }
.service-actions { display: flex; gap: 8px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--border); }
.service-actions .btn { flex: 1; }
.info-callout { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding: 14px 16px; border: 1px solid #ddd8f4; border-radius: 8px; color: #5f55a2; background: #f7f5ff; }
.info-callout > svg { width: 20px; height: 20px; flex: none; }
.info-callout > div { flex: 1; }
.info-callout strong, .info-callout p { display: block; margin: 0; }
.info-callout strong { font-size: 11px; }
.info-callout p { margin-top: 4px; color: #8279ad; font-size: 9px; }
.info-callout a { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; }
.info-callout a svg { width: 13px; height: 13px; }

.page-alert { margin-bottom: 14px; }
.entity-form, .city-service-form { overflow: hidden; }
.form-section-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.form-section-head h2 { margin: 0; font-size: 16px; }
.form-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.entity-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; padding: 22px 24px; }
.entity-fields label, .city-service-row > label { display: flex; flex-direction: column; gap: 7px; color: #5d565d; font-size: 11px; font-weight: 600; }
.entity-fields label.field-wide { grid-column: 1 / -1; }
.entity-fields input, .entity-fields textarea, .city-service-row input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: #4f494f; background: #fff; font-size: 11px; font-weight: 400; }
.entity-fields textarea { resize: vertical; line-height: 1.6; }
.entity-fields input:focus, .entity-fields textarea:focus, .city-service-row input:focus { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.entity-fields small { color: var(--subtle); font-size: 9px; font-weight: 400; }
.upload-field { display: flex; align-items: center; gap: 18px; min-width: 0; padding: 14px; border: 1px dashed #d9d2d7; border-radius: 7px; background: #fcfbfc; }
.upload-preview { display: flex; width: 180px; aspect-ratio: 4 / 3; flex: none; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: #f5f2f4; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-placeholder { display: flex; align-items: center; flex-direction: column; gap: 8px; padding: 12px; color: var(--subtle); text-align: center; }
.upload-placeholder svg { width: 25px; height: 25px; color: var(--primary); }
.upload-placeholder em { font-size: 9px; font-style: normal; line-height: 1.5; }
.upload-control { position: relative; display: flex; min-width: 0; align-items: flex-start; flex-direction: column; gap: 7px; }
.upload-control input[type="file"] { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.upload-control b { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid var(--primary); border-radius: 6px; color: var(--primary); background: #fff; cursor: pointer; font-size: 10px; }
.upload-control b svg { width: 15px; height: 15px; }
.avatar-upload-field .upload-preview { width: 86px; aspect-ratio: 1; border-radius: 50%; }
.form-choice-field { display: flex; flex-direction: column; gap: 9px; color: #5d565d; font-size: 11px; font-weight: 600; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.entity-fields .choice-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #fff; cursor: pointer; }
.choice-card input, .tag-choice-list input { position: absolute; width: 1px !important; height: 1px !important; margin: 0 !important; opacity: 0; }
.choice-card > span { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border: 1px solid #d9d2d7; border-radius: 5px; color: transparent; }
.choice-card > span svg { width: 14px; height: 14px; }
.choice-card b { overflow: hidden; color: #4f494f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.choice-card small { white-space: nowrap; }
.choice-card:has(input:checked) { border-color: rgba(84,45,255,.45); background: var(--purple-soft); }
.choice-card input:checked + span { border-color: var(--primary); color: #fff; background: var(--primary); }
.tag-choice-list { display: flex; flex-wrap: wrap; gap: 8px; }
.entity-fields .tag-choice-list label { display: block; cursor: pointer; }
.tag-choice-list span { display: inline-flex; min-height: 30px; align-items: center; padding: 0 11px; border: 1px solid var(--border); border-radius: 6px; color: #686168; background: #fff; font-size: 10px; font-weight: 500; }
.tag-choice-list input:checked + span { border-color: rgba(84,45,255,.38); color: var(--primary); background: var(--purple-soft); }
.color-input { display: flex; gap: 8px; }
.color-input input[type="color"] { width: 42px; padding: 3px; }
.color-input input[readonly] { flex: 1; }
.form-switch > span { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; color: #6f686f; font-weight: 400; }
.form-switch input[type="checkbox"] { width: 1px; height: 1px; opacity: 0; position: absolute; }
.form-switch i { position: relative; display: inline-block; width: 42px; height: 23px; border-radius: 12px; background: #d7d2d6; cursor: pointer; }
.form-switch i::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); content: ""; transition: transform .18s; }
.form-switch input:checked + i { background: var(--primary); }
.form-switch input:checked + i::after { transform: translateX(19px); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 72px; padding: 15px 24px; border-top: 1px solid var(--border); background: #fbfafb; }
.form-actions .btn { min-width: 112px; }
.ranking-form { overflow: hidden; }
.ranking-config-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ranking-config-head h2 { margin: 0; font-size: 16px; }
.ranking-config-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.ranking-mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ranking-mode { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 2px 9px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 7px; color: #6f686f; cursor: pointer; }
.ranking-mode input { position: absolute; opacity: 0; pointer-events: none; }
.ranking-mode > svg { grid-row: span 2; width: 28px; height: 28px; padding: 6px; border-radius: 6px; color: var(--purple); background: var(--purple-soft); }
.ranking-mode strong { font-size: 11px; }
.ranking-mode small { overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-mode.active, .ranking-mode:has(input:checked) { border-color: #f5b1c2; background: #fff8fa; box-shadow: 0 0 0 3px rgba(244,95,132,.06); }
.ranking-mode.active > svg, .ranking-mode:has(input:checked) > svg { color: var(--primary); background: var(--primary-soft); }
.ranking-table-wrap { overflow-x: auto; }
.ranking-table { min-width: 840px; }
.ranking-number { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; border-radius: 50%; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 700; }
.ranking-table tr:first-child .ranking-number { color: #a06a04; background: #fff2c8; }
.table-subline { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; }
.manual-rank-input { width: 86px; height: 31px; padding: 0 8px; border: 1px solid var(--border); border-radius: 5px; outline: 0; color: #514a50; font-size: 10px; }
.manual-rank-input:focus { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.ranking-form-note { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted); font-size: 9px; }
.ranking-form-note svg { width: 14px; height: 14px; color: var(--purple); }
.city-service-list { padding: 4px 20px; }
.city-service-row { display: grid; grid-template-columns: minmax(260px, 1fr) 110px 150px 150px; align-items: center; gap: 18px; min-height: 86px; border-bottom: 1px solid #f0edef; }
.city-service-row:last-child { border-bottom: 0; }
.city-service-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.city-service-identity .service-icon { width: 36px; height: 36px; flex: none; }
.city-service-identity strong, .city-service-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-service-identity small { margin-top: 4px; color: var(--subtle); font-size: 9px; font-weight: 400; }
.form-switch.compact { flex-direction: row; align-items: center; justify-content: space-between; }
.form-switch.compact > span { min-height: auto; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 14px; }
.detail-main { overflow: hidden; }
.detail-hero { display: flex; align-items: center; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.detail-hero > div { min-width: 0; }
.detail-hero img { width: 58px; height: 58px; flex: none; border-radius: 10px; object-fit: cover; }
.detail-hero h2 { margin: 5px 0 0; font-size: 20px; }
.detail-hero p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.detail-hero > .status-badge { margin-left: auto; }
.detail-section { padding: 20px 24px; border-bottom: 1px solid #f0edef; }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3, .detail-side h3 { margin: 0 0 14px; font-size: 13px; }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-section-title h3 { margin: 0; }
.detail-section-title a { color: var(--primary); font-size: 10px; font-weight: 600; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; margin: 0; }
.detail-grid dt { color: var(--subtle); font-size: 10px; }
.detail-grid dd { margin: 5px 0 0; color: #4f494f; font-size: 11px; font-weight: 600; word-break: break-word; }
.application-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.application-gallery a, .application-gallery img { display: block; width: 96px; height: 96px; border-radius: 8px; object-fit: cover; }
.id-card-gallery { display: flex; flex-wrap: wrap; gap: 18px; }
.id-card-gallery > div { display: flex; flex-direction: column; gap: 6px; color: var(--subtle); font-size: 10px; }
.id-card-gallery a, .id-card-gallery img { display: block; width: 220px; height: 138px; border-radius: 8px; object-fit: cover; background: #f6f2f4; }
.detail-copy { margin: 0; padding: 12px; border-radius: 6px; color: var(--muted); background: #fbf9fa; font-size: 11px; line-height: 1.7; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-list span { padding: 6px 9px; border-radius: 5px; color: var(--purple); background: var(--purple-soft); font-size: 10px; }
.chip-list em { color: var(--subtle); font-size: 10px; font-style: normal; }
.officer-tag-groups { display: grid; gap: 14px; }
.officer-tag-group { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: start; gap: 12px; }
.officer-tag-group-title { display: flex; align-items: center; gap: 7px; min-height: 27px; color: #4f494f; font-size: 11px; font-weight: 600; }
.officer-tag-group-title svg { width: 15px; height: 15px; color: var(--purple); }
.officer-profile-chips span { border: 1px solid rgba(84,45,255,.14); }
.detail-side { padding: 20px; }
.detail-side ul { margin: 0 0 20px; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.detail-side .btn { width: 100%; }
.detail-break { word-break: break-all !important; }
.compact-table { min-width: 720px; }
.compact-table th, .compact-table td { padding-top: 10px; padding-bottom: 10px; }
.compact-table .empty-table { height: 72px !important; color: var(--subtle); }
.membership-adjust-notice { display: flex; align-items: flex-start; gap: 11px; margin: 18px 24px 0; padding: 13px 14px; border: 1px solid #ddd8f4; border-radius: 7px; color: #5f55a2; background: #f7f5ff; }
.membership-adjust-notice > svg { width: 18px; height: 18px; flex: none; }
.membership-adjust-notice strong { display: block; font-size: 11px; }
.membership-adjust-notice p { margin: 4px 0 0; color: #8279ad; font-size: 9px; line-height: 1.65; }

.modal-layer { position: fixed; z-index: 100; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(26,23,27,.42); }
.modal-layer.open { display: flex; }
.modal-panel { width: min(430px, 100%); padding: 20px; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(30,25,30,.22); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 8px; color: var(--orange); background: var(--orange-soft); }
.modal-panel h2 { margin: 18px 0 0; font-size: 18px; }
.modal-panel > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.reason-field { display: none; margin-top: 16px; color: #625c62; font-size: 10px; font-weight: 600; }
.reason-field.visible { display: block; }
.reason-field textarea { width: 100%; margin-top: 7px; padding: 10px; resize: vertical; border: 1px solid var(--border); border-radius: 6px; outline: 0; font-size: 11px; line-height: 1.5; }
.reason-field textarea:focus { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.qr-preview-panel { width: min(560px, 100%); }
.qr-preview-icon { color: var(--purple); background: var(--purple-soft); }
.qr-preview-image-wrap { display: flex; min-height: 240px; align-items: center; justify-content: center; margin-top: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 7px; background: #fbfafb; }
.qr-preview-image { display: block; width: min(440px, 100%); max-height: 62vh; object-fit: contain; image-rendering: auto; }
.manual-recharge-panel { width: min(560px, 100%); padding: 24px; }
.manual-recharge-panel h2 { margin-top: 16px; font-size: 20px; }
.recharge-modal-icon { color: #542dff; background: rgba(84,45,255,.1); }
.manual-recharge-fields { display: grid; gap: 15px; margin-top: 20px; }
.manual-recharge-fields label { display: grid; gap: 7px; color: var(--text); font-size: 12px; }
.manual-recharge-fields label > strong { font-size: 12px; }
.manual-recharge-fields label > small { color: var(--muted); font-size: 10px; }
.manual-recharge-fields input, .manual-recharge-fields textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); font: inherit; outline: none; }
.manual-recharge-fields input { height: 42px; padding: 0 12px; }
.manual-recharge-fields textarea { min-height: 78px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
.manual-recharge-fields input:focus, .manual-recharge-fields textarea:focus { border-color: #8e78ff; box-shadow: 0 0 0 3px rgba(84,45,255,.09); }
.manual-recharge-money { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money-input { position: relative; display: block; }
.money-input b { position: absolute; z-index: 1; left: 12px; top: 50%; color: #542dff; font-size: 14px; transform: translateY(-50%); }
.money-input input { padding-left: 30px; font-size: 15px; font-weight: 700; }
.manual-recharge-warning { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 11px 12px; border-radius: 6px; color: #6b5cc8; background: rgba(84,45,255,.07); font-size: 10px; line-height: 1.55; }
.manual-recharge-warning svg { width: 16px; height: 16px; flex: none; }
.manual-recharge-submit { min-width: 116px; }
@media (max-width: 620px) { .manual-recharge-money { grid-template-columns: 1fr; } }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: flex; min-width: 230px; min-height: 46px; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid #c9ead9; border-radius: 7px; color: #277850; background: #f4fbf7; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #efc8cc; color: var(--danger); background: #fff5f5; }
.toast svg { width: 18px; height: 18px; }
.toast span { font-size: 11px; }

.login-body { min-height: 100vh; overflow: hidden; background: #fff; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 46%) minmax(440px, 54%); }
.login-visual { position: relative; overflow: hidden; color: #fff; background: #382e37; }
.login-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.78); }
.login-overlay { position: absolute; inset: 0; background: rgba(51,34,43,.68); }
.login-brand { position: absolute; z-index: 2; top: 34px; left: 40px; display: flex; align-items: center; gap: 12px; }
.login-brand strong { font-size: 22px; }
.login-brand small { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.4); color: rgba(255,255,255,.72); font-size: 11px; }
.login-message { position: absolute; z-index: 2; right: 42px; bottom: 150px; left: 42px; }
.login-message > span { display: inline-flex; height: 28px; align-items: center; padding: 0 10px; border: 1px solid rgba(255,255,255,.32); border-radius: 5px; color: rgba(255,255,255,.88); font-size: 10px; }
.login-message h1 { margin: 18px 0 0; font-size: clamp(32px, 3.3vw, 52px); line-height: 1.25; }
.login-message p { max-width: 560px; margin: 18px 0 0; color: rgba(255,255,255,.74); font-size: 13px; line-height: 1.8; }
.login-visual-foot { position: absolute; z-index: 2; right: 42px; bottom: 38px; left: 42px; display: flex; flex-wrap: wrap; gap: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.2); }
.login-visual-foot span { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.74); font-size: 10px; }
.login-visual-foot svg { width: 15px; height: 15px; }
.login-form-side { position: relative; display: flex; align-items: center; justify-content: center; padding: 50px; background: #fff; }
.login-form { width: min(390px, 100%); }
.login-mobile-brand { display: none; }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 700; }
.login-form h2 { margin: 14px 0 0; font-size: 30px; }
.login-subtitle { margin: 10px 0 28px; color: var(--muted); font-size: 12px; }
.form-alert { display: flex; min-height: 42px; align-items: center; gap: 8px; margin-bottom: 16px; padding: 9px 11px; border: 1px solid #efc8cc; border-radius: 6px; color: var(--danger); background: var(--danger-soft); font-size: 10px; }
.form-alert svg { width: 16px; height: 16px; }
.form-field { display: block; margin-top: 17px; color: #5f595f; font-size: 11px; font-weight: 600; }
.entity-fields input, .entity-fields select, .form-field input { width: 100%; height: 38px; margin-top: 7px; padding: 0 11px; border: 1px solid var(--border); border-radius: 6px; color: #3f3940; background: #fff; outline: none; }
.entity-fields input:focus, .entity-fields select:focus, .form-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-control { position: relative; display: flex; height: 44px; align-items: center; margin-top: 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.input-control:focus-within { border-color: #d9a4b3; box-shadow: 0 0 0 3px rgba(244,95,132,.08); }
.input-control > svg { width: 17px; height: 17px; margin-left: 12px; color: #9d969c; }
.input-control input { min-width: 0; height: 100%; flex: 1; padding: 0 10px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.password-toggle { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; color: #9d969c; background: transparent; }
.password-toggle svg { width: 16px; height: 16px; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: var(--muted); font-size: 10px; }
.login-options label { display: inline-flex; align-items: center; gap: 6px; }
.login-options input { accent-color: var(--primary); }
.login-options a { color: var(--primary); }
.login-submit { display: flex; width: 100%; height: 46px; align-items: center; justify-content: center; gap: 9px; margin-top: 24px; border-radius: 6px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 700; }
.login-submit:hover { background: #e95479; }
.login-submit svg { width: 16px; height: 16px; }
.login-demo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; color: #999298; font-size: 9px; }
.login-demo svg { width: 14px; height: 14px; }
.login-form-side footer { position: absolute; bottom: 24px; color: #aaa4aa; font-size: 9px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-main-row, .dashboard-rank-row { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .header-search { width: 190px; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { position: fixed; z-index: 40; inset: 0; display: block; background: rgba(20,18,21,.38); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .header-search, .breadcrumb span, .breadcrumb > svg { display: none; }
  .content-wrap { padding: 20px 16px 36px; }
  .settings-layout { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .settings-tabs { display: flex; overflow-x: auto; }
  .settings-tabs a { flex: 0 0 auto; }
  .settings-tabs a svg:last-child { display: none; }
  .city-summary { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 0; }
  .city-summary > div:nth-child(2) { border-right: 0; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-side { min-height: 100vh; padding: 34px 22px; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
}

@media (max-width: 620px) {
  .top-header { padding: 0 12px; }
  .admin-user { min-width: 0; }
  .admin-user div:nth-of-type(1), .admin-user > svg { display: none; }
  .page-heading { flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .heading-actions .btn { flex: 1 1 calc(50% - 5px); }
  .metric-grid, .service-grid { grid-template-columns: 1fr; }
  .health-strip, .city-summary { grid-template-columns: 1fr 1fr; }
  .health-strip > div, .city-summary > div { padding: 0 12px; }
  .health-strip > div:nth-child(2), .city-summary > div:nth-child(2) { border-right: 0; }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .filter-search { width: 100%; }
  .select-control { flex: 1; min-width: 130px; }
  .filter-count { width: 100%; margin: 4px 0 0; }
  .summary-strip { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .summary-strip > div:not(.summary-note) { min-width: 90px; margin-right: 0; padding-right: 12px; }
  .summary-note { width: 100%; margin-left: 0; }
  .channel-filter-bar .date-filter, .channel-filter-input { width: calc(50% - 4px); }
  .channel-filter-bar .filter-submit, .channel-filter-bar .btn-ghost { flex: 1 1 calc(50% - 5px); }
  .channel-form-preview { align-items: flex-start; flex-direction: column; margin: 0 18px; }
  .channel-form-qr-wrap { align-self: center; }
  .setting-field { grid-template-columns: 1fr; gap: 9px; padding: 15px 0; }
  .entity-fields { grid-template-columns: 1fr; padding: 18px; }
  .entity-fields label.field-wide { grid-column: auto; }
  .upload-field { align-items: stretch; flex-direction: column; }
  .upload-preview { width: 100%; }
  .avatar-upload-field .upload-preview { width: 86px; }
  .choice-grid { grid-template-columns: 1fr; }
  .city-service-row { grid-template-columns: 1fr 80px; gap: 10px 14px; padding: 14px 0; }
  .city-service-row > label:nth-last-child(-n+2) { display: grid; grid-template-columns: 58px 1fr; align-items: center; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-hero { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; padding: 18px; }
  .detail-hero h2 { overflow-wrap: anywhere; }
  .detail-hero p { line-height: 1.6; }
  .detail-hero > .status-badge { grid-column: 2; justify-self: start; margin-left: 0; }
  .detail-section { padding: 18px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 calc(50% - 5px); }
  .officer-tag-group { grid-template-columns: 1fr; gap: 7px; }
  .settings-foot { align-items: stretch; flex-direction: column; }
  .settings-foot .btn { width: 100%; }
  .info-callout { align-items: flex-start; flex-wrap: wrap; }
  .info-callout a { width: 100%; margin-left: 31px; }
}
