:root {
    --bg: #f5f7f6;
    --surface: #ffffff;
    --surface-2: #f7faf8;
    --border: #e6e9ea;
    --border-strong: #d3dbd6;
    --text: #14181a;
    --text-2: #3c4347;
    --text-3: #798185;
    --primary: #2e7d55;
    --primary-2: #1f5b3c;
    --accent: #2e7d55;
    --ok: #2e7d55;
    --warn: #c08a2e;
    --danger: #c4453b;
    --shadow-sm: 0 1px 2px rgba(20, 24, 26, .04);
    --shadow-md: 0 10px 30px -18px rgba(20, 24, 26, .18);
    --shadow-lg: 0 30px 80px -40px rgba(20, 60, 40, .35);
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.app { display: flex; height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width .28s cubic-bezier(.4, 0, .2, 1);
}
.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px 18px;
}
.brand-logo {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #2b3340, #5b6b84);
    color: #fff; font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
}
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-weight: 700; font-size: 15px; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: var(--text-2); text-decoration: none; font-size: 14px;
    cursor: pointer; transition: all .2s ease;
    position: relative;
}
.nav-item svg { width: 19px; height: 19px; fill: currentColor; flex-shrink: 0; transition: transform .2s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { transform: translateX(2px); }
.nav-item.active {
    background: linear-gradient(135deg, #2b3340, #3c4656);
    color: #fff; box-shadow: var(--shadow-md);
}
.nav-item.active svg { fill: #fff; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.sync-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.sync-status .dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
    box-shadow: 0 0 0 3px rgba(61, 154, 107, .18);
    animation: pulse 2s infinite;
}
.sync-status.off .dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(192, 86, 79, .18); }
.sync-status.off { color: var(--danger); }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: 62px; background: rgba(255,255,255,.82);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; flex-shrink: 0;
}
.topbar-title { font-size: 17px; font-weight: 700; }
.clock { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.content { flex: 1; overflow-y: auto; padding: 26px 28px 40px; }

/* ---------- 统计卡片 ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1 { grid-template-columns: 1fr; }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-2); }

.stat { position: relative; overflow: hidden; }
.stat::after {
    content: ""; position: absolute; right: -30px; top: -30px;
    width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(91,107,132,.10), transparent 70%);
}
.stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--accent);
}
.stat-icon svg { width: 21px; height: 21px; fill: currentColor; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-top: 8px; }
.stat-label { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.stat-value .unit { font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 2px; }

/* ---------- 数据概览：6 个 KPI 一排 ---------- */
.dash-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dash-kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; min-height: 104px; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; justify-content: space-between;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dash-kpi:hover { transform: translateY(-2px); border-color: #cfe3d7; box-shadow: var(--shadow-md); }
.dash-kpi-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dash-kpi-icon {
    width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
    display: flex; align-items: center; justify-content: center;
    background: #eef6f1; color: var(--primary);
}
.dash-kpi-icon svg { width: 17px; height: 17px; fill: currentColor; }
.dash-kpi-label { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-kpi-value {
    margin-top: 10px; font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: clamp(21px, 1.75vw, 28px); font-weight: 700; letter-spacing: -.6px;
    line-height: 1.1; white-space: nowrap; color: var(--text);
}
.dash-kpi-value .unit { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.dash-kpi.tone-teal .dash-kpi-icon { background: #eaf6f4; color: #1f7a6a; }
.dash-kpi.tone-amber .dash-kpi-icon { background: #fbf5e6; color: #b07a12; }
.dash-kpi.tone-gold .dash-kpi-icon { background: #f7f2e4; color: #9a7416; }
.dash-kpi.tone-slate .dash-kpi-icon { background: #f0f3f6; color: #55657a; }
.dash-kpi.tone-blue .dash-kpi-icon { background: #edf3fa; color: #3f6fa0; }
@media (max-width: 1280px) { .dash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 数据概览：实时配送 ETA ---------- */
.live-card .card-head { margin-bottom: 12px; }
.live-head-right { display: flex; align-items: center; gap: 10px; }
.live-head-right .btn { height: 30px; padding: 0 12px; }
.live-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--text-3); font-size: 13px; text-align: center; }
.live-empty-err { color: #b33b3b; }
.live-empty-icon { width: 44px; height: 44px; border-radius: 12px; background: #f2f8f4; display: grid; place-items: center; }
.live-empty-icon svg { width: 22px; height: 22px; fill: var(--primary); }
.live-empty b { color: var(--text-2); font-size: 14px; }
.live-driver-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.live-driver-tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px;
    border: 1px solid var(--border); border-radius: 10px; background: #fff;
    color: var(--text-2); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s;
}
.live-driver-tab:hover { border-color: #bcd8c8; }
.live-driver-tab.on { border-color: var(--primary); background: #f2f9f5; color: var(--primary-2); font-weight: 600; }
.live-tab-count { font-size: 11px; color: var(--text-3); background: #eff4f1; border-radius: 999px; padding: 1px 6px; }
.live-driver-tab.on .live-tab-count { background: #e3f2e9; color: var(--primary-2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #c7cfca; flex: 0 0 7px; }
.live-dot.online { background: var(--primary); box-shadow: 0 0 0 2px rgba(46,125,85,.14); }
.live-dot.stale { background: #d29a2a; }
.live-dot.off { background: #c7cfca; }
.live-driver-summary { border: 1px solid #dcebe2; background: #f7fbf9; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.live-driver-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.live-area { font-size: 11px; font-weight: 600; color: var(--text-3); background: #eff4f1; border-radius: 6px; padding: 2px 7px; }
.live-online { font-size: 11px; font-weight: 600; color: var(--primary-2); background: #e6f3eb; border-radius: 999px; padding: 2px 8px; }
.live-driver-kpis { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 5px; font-size: 13px; color: var(--text-2); }
.live-driver-kpis b { color: var(--primary-2); font-family: ui-monospace, Menlo, Consolas, monospace; }
.live-gps-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.live-gps-warn { color: #946615; background: #fbf5e6; border: 1px solid #f0e2bf; border-radius: 8px; padding: 6px 9px; }
.live-map-link { color: var(--primary); font-weight: 600; text-decoration: none; }
.live-map-link:hover { text-decoration: underline; }
.live-route-list { padding-left: 1px; }
.live-stop { display: flex; gap: 11px; padding: 8px 0; }
.live-stop-rail { width: 26px; flex: 0 0 26px; display: flex; justify-content: center; position: relative; }
.live-stop-rail::after { content: ""; position: absolute; top: 28px; bottom: -8px; width: 1px; background: #dce5df; }
.live-stop:last-child .live-stop-rail::after { display: none; }
.live-stop-seq {
    width: 24px; height: 24px; border-radius: 50%; z-index: 1;
    background: #fff; border: 1px solid #cddbd2; color: var(--text-2);
    font-size: 12px; font-weight: 600; display: grid; place-items: center;
}
.live-stop.current .live-stop-seq { background: var(--primary); border-color: var(--primary); color: #fff; }
.live-stop-body { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.live-stop.current .live-stop-body { border-color: #bcdcc9; background: #f7fbf9; }
.live-stop-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-stop-name { font-size: 14px; font-weight: 600; color: var(--text); }
.live-order-count { font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; }
.live-stop-eta { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--primary-2); white-space: nowrap; }
.live-stop-eta small { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.live-stop-addr { margin-top: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-stop-meta { margin-top: 5px; font-size: 11.5px; color: #7a8781; }
.live-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 11.5px; color: var(--text-3); }
.live-edit-param { border: 0; background: none; padding: 0; color: var(--primary); font-size: 11.5px; cursor: pointer; text-decoration: underline; }

/* ---------- 数据概览：配送进度概览（只显示大概） ---------- */
.live-empty-compact { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; padding: 18px 4px; gap: 12px; }
.live-empty-compact .live-empty-icon { flex: 0 0 42px; width: 42px; height: 42px; }
.live-empty-compact b { flex: 0 0 auto; }
.dash-live-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.dash-live-topline b { color: var(--primary-2); font-family: ui-monospace, Menlo, Consolas, monospace; }
.dash-live-drivers { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.dash-live-driver {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
    background: #fff; border-radius: 9px; padding: 6px 9px; cursor: pointer;
    font-size: 13px; color: var(--text-2); transition: border-color .15s, background .15s;
}
.dash-live-driver:hover { border-color: #bcd8c8; }
.dash-live-driver.on { border-color: var(--primary); background: #f2f9f5; color: var(--primary-2); font-weight: 600; }
.dash-live-driver-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-live-driver-count { font-size: 11px; color: var(--text-3); background: #eff4f1; border-radius: 999px; padding: 1px 6px; }
.dash-live-driver.on .dash-live-driver-count { background: #e3f2e9; color: var(--primary-2); }
.dash-live-focus { border: 1px solid #dcebe2; background: #f7fbf9; border-radius: 10px; padding: 10px 12px; }
.dash-live-focus-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
.dash-live-focus-top b { font-weight: 700; }
.dash-live-focus-line { margin-top: 5px; font-size: 12.5px; color: var(--text-2); }
.dash-live-focus-line b { color: var(--primary-2); font-family: ui-monospace, Menlo, Consolas, monospace; }
.dash-live-next { margin-top: 5px; font-size: 12.5px; color: var(--text-3); }
.dash-live-next b { color: var(--text-2); }
.dash-live-next em { margin-left: 8px; font-style: normal; font-weight: 600; color: var(--primary-2); }

/* ---------- 配送进度独立页 ---------- */
.track-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.track-side { position: sticky; top: 16px; max-height: calc(100vh - 120px); overflow: auto; }
.track-main { min-width: 0; }
.track-driver {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: 1px solid var(--border); background: #fff; border-radius: 10px;
    padding: 9px 10px; margin-bottom: 8px; text-align: left; cursor: pointer; font: inherit;
    transition: border-color .15s, background .15s;
}
.track-driver:hover { border-color: #bcd8c8; }
.track-driver.on { border-color: var(--primary); background: #f2f9f5; }
.track-driver-main { flex: 1; min-width: 0; }
.track-driver-main b { display: block; font-size: 13px; color: var(--text); font-weight: 600; }
.track-driver-main small { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-driver-right { flex: 0 0 auto; text-align: right; }
.track-driver-right b { display: block; font-size: 13px; color: var(--primary-2); font-weight: 700; }
.track-driver-right em { display: block; margin-top: 2px; font-style: normal; font-size: 10.5px; color: var(--text-3); }
.track-summary .live-driver-title { row-gap: 6px; }
.track-current { margin-left: auto; font-size: 11.5px; font-weight: 600; color: #8a6a16; background: #fbf5e6; border-radius: 999px; padding: 2px 8px; }
.track-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.track-stat { background: #fff; border: 1px solid #e4efe8; border-radius: 9px; padding: 8px 10px; min-width: 0; }
.track-stat span { display: block; font-size: 11px; color: var(--text-3); }
.track-stat b { display: block; margin-top: 3px; font-size: 16px; line-height: 1.15; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-stat em { margin-left: 2px; font-style: normal; font-size: 10.5px; color: var(--text-3); }
.track-route-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.track-route-title { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.track-route-title span { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.track-search { width: 260px; max-width: 100%; height: 32px; padding: 0 10px; font-size: 12.5px; }
@media (max-width: 1000px) {
    .track-layout { grid-template-columns: 1fr; }
    .track-side { position: static; max-height: none; }
    .track-driver { width: calc(50% - 4px); display: inline-flex; margin-right: 4px; }
}
@media (max-width: 640px) {
    .track-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .track-search { width: 100%; }
    .track-driver { width: 100%; margin-right: 0; }
}

/* ---------- 改派记录 ---------- */
.reassign-filter-card { padding: 16px 18px; margin-bottom: 16px; }
.reassign-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.reassign-stat { border: 1px solid #e4efe8; background: #f7fbf9; border-radius: 10px; padding: 9px 12px; min-width: 0; }
.reassign-stat span { display: block; font-size: 11px; color: var(--text-3); }
.reassign-stat b { display: inline-block; margin-top: 2px; font-size: 20px; line-height: 1.15; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; }
.reassign-stat em { margin-left: 3px; font-style: normal; font-size: 11px; color: var(--text-3); }
.reassign-filter-bar { margin-bottom: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.reassign-kw input { width: 210px; }
.exception-kw input { width: 210px; }
.reassign-table-wrap { margin-top: 0; }
.reassign-table { min-width: 880px; }
.reassign-time { white-space: nowrap; font-size: 12px !important; }
.reassign-customer { max-width: 240px; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reassign-sub { margin-top: 2px; max-width: 240px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reassign-drivers { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.reassign-drivers span { color: var(--text-3); }
.reassign-drivers i { font-style: normal; color: var(--primary); font-weight: 700; }
.reassign-drivers b { color: var(--text); font-weight: 600; }
.reassign-reason { max-width: 180px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reassign-items { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef7f2; color: var(--primary-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) {
    .reassign-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .reassign-kw { width: 100%; }
    .reassign-kw input { width: 100%; }
}

/* ---------- 搜索栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.search {
    flex: 1; max-width: 420px; position: relative;
}
.search input {
    width: 100%; padding: 11px 16px 11px 40px;
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 14px; background: var(--surface); color: var(--text);
    outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,107,132,.12); }
.search svg {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; fill: var(--text-3);
}

.btn {
    padding: 10px 18px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer;
    transition: all .18s ease; font-weight: 500;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { color: var(--danger); border-color: #f0d3d1; }
.btn-danger:hover { background: #fdf3f2; border-color: #e8b9b5; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* ---------- 客户卡片 ---------- */
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.customer-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.customer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.customer-thumb {
    height: 140px; background: var(--surface-2);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.customer-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.customer-card:hover .customer-thumb img { transform: scale(1.05); }
.customer-thumb .placeholder {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #e7e9ee, #d5d9e0);
    color: var(--text-3); display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
}
.customer-body { padding: 14px; }
.customer-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.customer-addr { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; min-height: 18px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.customer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--text-3); }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
    white-space: nowrap;
}
.badge-gray { background: var(--surface-2); color: var(--text-2); }
.badge-ok { background: #eaf6ef; color: var(--ok); }
.badge-warn { background: #faf3e2; color: var(--warn); }
.badge-info { background: #eef2f7; color: #4a5568; }

/* ---------- 表格 ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    text-align: left; padding: 13px 16px; background: var(--surface-2);
    color: var(--text-2); font-weight: 600; font-size: 12px; letter-spacing: .3px;
    border-bottom: 1px solid var(--border);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty svg { width: 52px; height: 52px; fill: var(--border-strong); margin-bottom: 14px; }
.load-more { text-align: center; padding: 22px; color: var(--text-3); font-size: 13px; }
.spinner {
    width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; margin: 0 auto; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
    display: none; align-items: center; justify-content: center; z-index: 100;
    backdrop-filter: blur(3px);
}
.modal-mask.show { display: flex; }
.modal {
    width: 92%; max-width: 620px; max-height: 88vh; overflow: hidden;
    background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: modalIn .24s cubic-bezier(.4, 0, .2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.icon-btn {
    width: 32px; height: 32px; border-radius: 9px; border: none;
    background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 14px;
    transition: all .15s ease;
}
.icon-btn:hover { background: var(--border); }
.modal-body { padding: 22px; overflow-y: auto; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%; padding: 10px 13px; border: 1px solid var(--border);
    border-radius: 10px; font-size: 14px; color: var(--text); outline: none;
    transition: border-color .2s ease, box-shadow .2s ease; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,107,132,.12); }
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 相册缩略图 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.photo-item {
    position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1;
    background: var(--surface-2); cursor: pointer; border: 1px solid var(--border);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photo-item:hover img { transform: scale(1.06); }

/* Toast */
.toast {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--primary); color: #fff; padding: 12px 22px; border-radius: 12px;
    font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 200;
    box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 37%, #eef0f3 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d7dd; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #bcc1c9; }
::-webkit-scrollbar-track { background: transparent; }

/* 统计条状图 */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #5b6b84, #2b3340); transition: height .6s cubic-bezier(.4,0,.2,1); }
.bar-label { font-size: 11px; color: var(--text-3); }

/* ---------- 配送 / 导入 / 司机 扩展 ---------- */
.muted { color: var(--text-3); font-size: 13px; }
.req { color: var(--danger); }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.sum-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0; font-size: 13px; color: var(--text-2);
    border-bottom: 1px dashed var(--border);
}
.sum-row:last-child { border-bottom: none; }
.sum-row b { color: var(--text); font-size: 14px; }

.progress {
    height: 8px; border-radius: 20px; background: var(--surface-2);
    overflow: hidden; border: 1px solid var(--border);
}
.progress span {
    display: block; height: 100%; border-radius: 20px;
    background: linear-gradient(90deg, #3d9a6b, #5fbf8e);
    transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.order-sum {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-bottom: 14px; font-size: 13px; color: var(--text-2);
}
.order-sum b { color: var(--text); }

/* 分段选择 */
.seg {
    display: inline-flex; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 10px; padding: 3px;
}
.seg span {
    padding: 6px 14px; border-radius: 8px; font-size: 13px; color: var(--text-2);
    cursor: pointer; transition: all .18s ease; user-select: none;
}
.seg span:hover { color: var(--text); }
.seg span.on {
    background: var(--surface); color: var(--text); font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* 拖拽上传 */
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 34px 20px; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-2); transition: all .2s ease;
}
.dropzone:hover, .dropzone.drag {
    border-color: var(--accent); background: #f4f7fb;
    box-shadow: 0 0 0 3px rgba(91, 107, 132, .08);
}
.dropzone svg { width: 34px; height: 34px; fill: var(--text-3); }
.dz-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dz-sub { font-size: 12px; color: var(--text-3); }

.import-help { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.import-help p { margin-bottom: 6px; }
.import-result { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 16px; }
.ir-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13px; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.ir-row:last-child { border-bottom: none; }
.ir-row b { color: var(--text); font-size: 14px; }

/* 订单导入：客户名称确认列表 */
.cand-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.cand-list {
    max-height: 320px; overflow: auto;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-2, #fafbfc);
}
.cand-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    font-size: 13px; cursor: pointer;
}
.cand-item:last-child { border-bottom: none; }
.cand-item:hover { background: rgba(91, 107, 132, .05); }
.cand-item input { margin-top: 3px; accent-color: #2b3340; }
.cand-main { display: flex; flex-direction: column; gap: 3px; }
.cand-name { font-weight: 600; color: var(--text); }
.cand-note { font-weight: 400; font-size: 12px; color: var(--text-3); }
.cand-merged { font-size: 12px; color: var(--text-3); }
.cand-merged b { color: var(--text-2); font-weight: 600; }
.cand-section-title { margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.cand-item.sim-item input { accent-color: var(--primary); }
.sim-warn { font-size: 12px; color: #b0791f; }

/* 照片时间浮层 */
.photo-item .photo-meta {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 20px 10px 8px; display: flex; flex-direction: column; gap: 2px;
    background: linear-gradient(180deg, transparent, rgba(16, 24, 40, .72));
    color: #fff; opacity: 0; transition: opacity .2s ease;
}
.photo-item:hover .photo-meta { opacity: 1; }
.photo-time { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.photo-sub { font-size: 11px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-info { margin-top: 14px; padding: 4px 14px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* 淡入动画 */
.content > * { animation: fadeUp .32s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 司机配送概览 ---------- */
.driver-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: 13px;
}
.driver-table thead th {
    text-align: left; padding: 10px 12px; font-weight: 600;
    color: var(--text-3); background: var(--surface-2);
    border-bottom: 1px solid var(--border); font-size: 12px;
    letter-spacing: .3px; text-transform: uppercase;
}
.driver-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.driver-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.driver-table tbody td {
    padding: 12px; border-bottom: 1px solid var(--border);
    color: var(--text-2); vertical-align: middle;
}
.driver-table tbody tr:last-child td { border-bottom: none; }
.driver-table tbody tr:hover td { background: #f7f9fc; }
.driver-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.driver-table td.driver-name { font-weight: 600; color: var(--text); white-space: nowrap; }
.driver-table td.amount { color: var(--text); font-weight: 600; }
.driver-table .prog-cell { min-width: 160px; }
.driver-table .prog-wrap {
    display: flex; align-items: center; gap: 10px;
}
.driver-table .mini-progress {
    flex: 1; height: 6px; background: var(--surface-2);
    border-radius: 20px; overflow: hidden; border: 1px solid var(--border);
}
.driver-table .mini-progress span {
    display: block; height: 100%; border-radius: 20px;
    background: linear-gradient(90deg, #e0b44a, #f2c94c);
    transition: width .8s cubic-bezier(.4, 0, .2, 1);
}
.driver-table .mini-progress.done span {
    background: linear-gradient(90deg, #3d9a6b, #5fbf8e);
}
.driver-table .mini-progress.zero span {
    background: #d5d8dd;
}
.driver-table .prog-pct {
    font-variant-numeric: tabular-nums; font-size: 12px;
    color: var(--text-2); min-width: 40px; text-align: right;
}
.driver-table .row-sum td {
    font-weight: 600; color: var(--text); background: #f5f7fb;
}
.driver-table .row-sum td:first-child { border-radius: 0 0 0 var(--radius-sm); }
.driver-table .row-sum td:last-child { border-radius: 0 0 var(--radius-sm) 0; }
.driver-empty {
    padding: 40px 0; text-align: center; color: var(--text-3);
    font-size: 13px;
}

/* ---------- 顶栏管理员信息 ---------- */
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.admin-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 4px 4px 6px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.admin-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #2b3340, #5b6b84);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.admin-meta { display: flex; flex-direction: column; line-height: 1.2; padding-right: 4px; }
.admin-name {
    font-size: 13px; font-weight: 600; color: var(--text);
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-role { font-size: 11px; color: var(--text-3); }
.admin-chip .btn { padding: 6px 13px; font-size: 12px; border-radius: 999px; }

/* ---------- 登录页 ---------- */
.login-screen {
    position: fixed; inset: 0; z-index: 300;
    display: none; align-items: center; justify-content: center;
    padding: 24px; overflow: hidden;
    background:
        radial-gradient(900px 520px at 10% 6%, rgba(91, 107, 132, .18), transparent 60%),
        radial-gradient(760px 500px at 92% 96%, rgba(43, 51, 64, .16), transparent 62%),
        linear-gradient(135deg, #f7f8fa 0%, #eceef2 100%);
}
.login-screen.show { display: flex; }
.login-screen::before,
.login-screen::after {
    content: ""; position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 107, 132, .16), transparent 68%);
    filter: blur(4px); pointer-events: none;
}
.login-screen::before {
    width: 460px; height: 460px; top: -140px; left: -110px;
    animation: orbA 14s ease-in-out infinite;
}
.login-screen::after {
    width: 420px; height: 420px; bottom: -150px; right: -100px;
    animation: orbB 16s ease-in-out infinite;
}
@keyframes orbA {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(36px, 26px); }
}
@keyframes orbB {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -22px); }
}
.login-card {
    position: relative; z-index: 1; width: 100%; max-width: 390px;
    padding: 36px 34px 30px;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .95); border-radius: 20px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .15);
    animation: loginIn .45s cubic-bezier(.4, 0, .2, 1);
}
@keyframes loginIn {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.login-logo {
    width: 52px; height: 52px; border-radius: 15px;
    background: linear-gradient(135deg, #2b3340, #5b6b84);
    color: #fff; font-weight: 700; font-size: 17px; letter-spacing: 1px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); margin-bottom: 18px;
}
.login-title { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.login-sub { font-size: 12.5px; color: var(--text-3); margin: 7px 0 24px; line-height: 1.6; }
.login-card .field { margin-bottom: 14px; }
.login-card .field input { padding: 11px 13px; }
.login-tip { min-height: 18px; font-size: 12.5px; color: var(--danger); margin: -2px 0 10px; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; letter-spacing: 4px; border-radius: 12px; }
.login-btn:disabled { opacity: .7; cursor: default; }

/* ---------- 片区 / 设置 / 导入结果 ---------- */
.btn:disabled { opacity: .62; cursor: default; }
.field input:disabled, .field select:disabled { background: var(--surface-2); color: var(--text-3); }
.form-tip { margin: -6px 0 16px; font-size: 12px; line-height: 1.7; color: var(--text-3); }
.field .form-tip { margin: 7px 0 0; }
.toolbar-note { font-size: 12px; color: var(--text-3); line-height: 1.6; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin: 2px 0; }
.area-drivers { display: flex; flex-direction: column; gap: 7px; min-width: 145px; }
.area-driver { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.sub-list { display: flex; flex-direction: column; gap: 7px; min-width: 205px; }
.sub-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.sub-item > span { display: flex; align-items: center; gap: 6px; }
.settings-grid { align-items: start; }
.settings-card { min-height: 100%; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.import-actions { justify-content: flex-start; }
.import-message { margin-top: 14px; }
.import-preview-notice { margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.import-preview-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; line-height: 1.65; }
.import-preview-row:last-child { border-bottom: none; }
.import-preview-row b { flex-shrink: 0; color: var(--text-2); }
.import-preview-row span { color: var(--text-3); }
.import-result-card { margin-top: 18px; }
.import-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.import-stat { padding: 14px 10px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.import-stat b { display: block; font-size: 23px; line-height: 1.2; color: var(--text); }
.import-stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.import-detail { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.import-detail-title { padding: 10px 13px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 600; }
.import-detail ul { max-height: 190px; overflow-y: auto; padding: 6px 14px; list-style: none; }
.import-detail li { padding: 7px 0; border-bottom: 1px dashed var(--border); color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.import-detail li:last-child { border-bottom: none; }
.import-result-actions { justify-content: flex-start; margin-top: 16px; }
/* ---------- 舟谱插件对接 ---------- */
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; inset: 0; border-radius: 999px; background: #d5d8dd;
    transition: background .22s ease; cursor: pointer;
}
.switch-slider::before {
    content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
.switch input:checked + .switch-slider { background: var(--ok); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.plugin-endpoints {
    margin: 4px 0 16px; padding: 12px 14px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    display: flex; flex-direction: column; gap: 9px; font-size: 12px;
}
.plugin-endpoints > div { display: flex; flex-direction: column; gap: 3px; }
.plugin-endpoints span { color: var(--text-3); }
.plugin-endpoints code { color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.plugin-batch-title { margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.plugin-batches .table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.plugin-batches table { font-size: 12.5px; }
.plugin-batches th, .plugin-batches td { padding: 9px 10px; }
/* ---------- 客户画像 ---------- */
.badge-danger { background: #faecea; color: var(--danger); }
.badge-accent { background: #faf3d9; color: #a77b12; }
.analytics-filters {
    display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px 14px;
    padding: 18px; margin-bottom: 18px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.analytics-filters .field { margin: 0; min-width: 0; }
.analytics-filter-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 9px; }
.analytics-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.analytics-summary > div {
    padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.analytics-summary span { display: block; margin-bottom: 6px; color: var(--text-3); font-size: 12px; }
.analytics-summary b { font-size: 23px; line-height: 1.25; }
.analytics-summary small { margin-left: 5px; color: var(--text-3); }
.analytics-table table { min-width: 1500px; }
.analytics-table td { vertical-align: middle; }
.analytics-customer { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.analytics-customer > img, .analytics-customer > span {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; object-fit: cover;
    background: var(--surface-2); border: 1px solid var(--border);
}
.analytics-customer > span { display: flex; align-items: center; justify-content: center; color: var(--text-3); font-weight: 700; }
.analytics-customer b { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-customer small { display: block; margin-top: 3px; color: var(--text-3); font-size: 11px; }
.analytics-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 80px; }
.analytics-grade {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2);
    border: 1px solid var(--border); color: var(--text-2); font-size: 14px; font-weight: 800;
}
.analytics-grade.grade-A { background: #faf3d9; border-color: #ead9a1; color: #9b7110; }
.analytics-grade.grade-B { background: #f0f2f5; color: var(--text); }
.modal.modal-wide { width: 96%; max-width: 1180px; }
.analytics-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.analytics-profile-photo {
    width: 82px; height: 82px; flex-shrink: 0; overflow: hidden; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); font-size: 28px; font-weight: 700;
}
.analytics-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.analytics-profile-main { flex: 1; min-width: 0; }
.analytics-profile-name { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.analytics-profile-name h2 { font-size: 21px; }
.analytics-profile-main p { margin-top: 8px; color: var(--text-3); font-size: 13px; }
.analytics-detail-period { width: 150px; flex-shrink: 0; margin: 0; }
.analytics-detail-grid { align-items: start; margin-bottom: 18px; }
.analytics-detail-grid .card { min-width: 0; }
.analytics-detail-grid .card:hover { transform: none; }
.analytics-detail-grid .sum-row b { max-width: 68%; text-align: right; overflow-wrap: anywhere; }
.analytics-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.analytics-stat-grid > div { padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.analytics-stat-grid span { display: block; min-height: 32px; color: var(--text-3); font-size: 12px; line-height: 1.4; }
.analytics-stat-grid b { display: block; margin-top: 6px; font-size: 18px; overflow-wrap: anywhere; }
.analytics-stat-grid small { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; }
.analytics-delivery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.analytics-section-title { margin: 24px 0 12px; font-size: 15px; color: var(--text); }
.analytics-section-title .muted { margin-left: 8px; font-weight: 400; }
.analytics-pref-scroll { max-height: 360px; }
.analytics-pref-scroll thead { position: sticky; top: 0; z-index: 1; }
.analytics-orders { display: flex; flex-direction: column; gap: 10px; }
.analytics-order { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.analytics-order summary {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
    padding: 13px 42px 13px 16px; cursor: pointer; list-style: none; background: var(--surface-2);
}
.analytics-order summary::-webkit-details-marker { display: none; }
.analytics-order summary::after { content: '＋'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; }
.analytics-order[open] summary::after { content: '－'; }
.analytics-order-title b, .analytics-order-title small { display: block; }
.analytics-order-title small { margin-top: 4px; color: var(--text-3); }
.analytics-order-numbers { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.analytics-order-state { white-space: nowrap; }
.analytics-order-body { padding: 14px; }
.analytics-order-body .order-sum { margin-bottom: 12px; }
.analytics-order-body .table-wrap { max-height: 390px; }
@media (max-width: 1280px) {
    .analytics-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .analytics-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .analytics-summary { grid-template-columns: repeat(2, 1fr); }
    .analytics-detail-grid { grid-template-columns: 1fr; }
    .analytics-order summary { grid-template-columns: minmax(0, 1fr) auto; }
    .analytics-order-state { grid-column: 1; }
}
@media (max-width: 640px) {
    .analytics-filters { grid-template-columns: 1fr; }
    .analytics-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-profile-head { align-items: flex-start; flex-wrap: wrap; }
    .analytics-detail-period { width: 100%; }
    .analytics-order summary { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 1280px) {
    .import-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
    .settings-grid, .import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .import-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .import-preview-row { flex-direction: column; gap: 3px; }
}

/* ---------- 侧边栏分组（同一类功能用卡片框在一起） ---------- */
.nav-group {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 7px 7px 3px;
    margin-bottom: 10px;
}
.nav-group-title {
    font-size: 11px; font-weight: 600; letter-spacing: .8px;
    color: var(--text-3); padding: 2px 9px 6px;
}
.nav-group .nav-item { padding: 9px 12px; margin-bottom: 4px; }
.nav-group .nav-item:last-child { margin-bottom: 4px; }
.nav-group .nav-item.active { box-shadow: var(--shadow-sm); }

/* ---------- 配送单批量操作条（选中后出现） ---------- */
.batch-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin-bottom: 14px;
    background: #f3f9f5; border: 1px solid #dcebe2; border-radius: 12px;
    font-size: 13px; color: var(--text-2);
}
.batch-bar b { color: var(--text); }
.batch-sep { width: 1px; height: 18px; background: #d3e4da; }
.seg-count { font-size: 12px; color: var(--text-3); margin-left: 3px; font-weight: 600; }
.seg span.on .seg-count { color: var(--accent); }

/* ---------- 配送单：勾选与选中行 ---------- */
.orders-table .check-col { width: 44px; padding: 10px 6px 10px 14px; }
.orders-table input[type="checkbox"], #ordCheckAll {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; margin: 0;
    border: 1.5px solid #c9d6ce; border-radius: 4px;
    background: #fff; cursor: pointer; vertical-align: middle;
    position: relative; transition: background .15s, border-color .15s, box-shadow .15s;
}
.orders-table input[type="checkbox"]:hover, #ordCheckAll:hover { border-color: var(--primary); }
.orders-table input[type="checkbox"]:checked, #ordCheckAll:checked,
.orders-table input[type="checkbox"]:indeterminate, #ordCheckAll:indeterminate {
    background: var(--primary); border-color: var(--primary);
}
.orders-table input[type="checkbox"]:checked::after, #ordCheckAll:checked::after {
    content: ""; position: absolute; left: 4px; top: 1px; width: 6px; height: 9px;
    border: 1.5px solid #fff; border-top: 0; border-left: 0;
    transform: rotate(40deg);
}
.orders-table input[type="checkbox"]:indeterminate::after, #ordCheckAll:indeterminate::after {
    content: ""; position: absolute; left: 4px; top: 5px; width: 6px; height: 2px;
    background: #fff; border-radius: 1px;
}
.orders-table input[type="checkbox"]:focus-visible, #ordCheckAll:focus-visible {
    outline: 2px solid rgba(46, 125, 85, .3); outline-offset: 2px;
}
.orders-table tbody tr { cursor: pointer; }
.orders-table tbody tr.selected td {
    background: #f4faf6; color: var(--text);
    border-top: 0; border-bottom: 1px solid var(--border);
}
.orders-table tbody tr.selected:hover td { background: #edf7f1; }
.orders-table tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.orders-table tbody tr.selected:last-child td { border-bottom: 0; }
.orders-table tbody tr.selected td .badge { box-shadow: none; }

/* ---------- 订单导入：单列布局 ---------- */
/* 导入流程直接排在弹窗里，不再套卡片 */
.modal-body .import-drop { padding: 40px 20px; }
.modal-body .import-result-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}
.modal-body .import-result-card::before { display: none; }
.import-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.import-form .field { margin: 0; }
.import-form #impDriverField { grid-column: 1 / -1; }
.import-actions { justify-content: flex-end; }
.batch-count b { font-size: 14px; }
.import-done {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-bottom: 14px;
    background: #eef6f1; border: 1px solid rgba(46, 125, 85, .25);
    border-radius: 10px; color: var(--primary-2); font-size: 13px; font-weight: 600;
}
.import-done svg { width: 16px; height: 16px; fill: var(--primary); }

@media (max-width: 900px) {
    .import-form { grid-template-columns: 1fr; gap: 0; }
}

/* ============================================================
   千禾稻夫主题（对齐 qhgw 官网后台：白底 + 稻绿点缀 + 卡片悬浮）
   ============================================================ */
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    letter-spacing: .1px;
}

/* ---------- 侧边栏 ---------- */
.sidebar { background: #fff; border-right: 1px solid var(--border); }
.brand { padding: 22px 20px 16px; gap: 11px; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px; padding: 3px;
    background: #eef6f1; border: 1px solid rgba(46, 125, 85, .16);
    box-shadow: none; overflow: hidden; transition: .3s ease;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand:hover .brand-logo { background: #e3f1e8; transform: translateY(-1px); }
.brand-title { font-size: 15.5px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: #a6adb1; letter-spacing: 2px; margin-top: 3px; }

.nav { padding: 10px 14px 4px; gap: 0; }
.nav-group {
    background: transparent; border: none; border-radius: 0;
    padding: 0 0 2px; margin: 0 0 8px;
    border-bottom: 1px solid #f0f2f1;
}
.nav-group:last-child { border-bottom: none; }
.nav-group-title {
    font-size: 11px; letter-spacing: 2px; color: #a6adb1;
    padding: 4px 12px 6px; font-weight: 600;
}
.nav-group .nav-item, .nav-item {
    padding: 9px 12px; margin-bottom: 2px; border-radius: 9px;
    color: var(--text-2); font-size: 13.5px; transition: background .2s ease, color .2s ease;
}
.nav-item svg { width: 18px; height: 18px; transition: transform .25s ease; }
.nav-item:hover { background: #f7faf8; color: var(--text); }
.nav-item:hover svg { transform: translateX(2px); }
.nav-item.active {
    background: #eef6f1; color: var(--primary-2); font-weight: 600;
    box-shadow: none;
}
.nav-item.active svg { fill: var(--primary); }
.nav-item.active::before {
    content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
    border-radius: 3px; background: var(--primary);
}
.sidebar-footer { border-top: 1px solid #f0f2f1; }
.sync-status .dot { box-shadow: 0 0 0 3px rgba(46, 125, 85, .14); }

/* ---------- 顶栏 ---------- */
.topbar { background: rgba(255, 255, 255, .82); border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.content { padding: 24px 26px 40px; }

/* ---------- 卡片：悬浮上浮 + 顶部绿线 ---------- */
.card {
    position: relative;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(20, 24, 26, .04), 0 10px 30px -22px rgba(20, 24, 26, .22);
    transition: transform .35s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease, border-color .35s ease;
}
.card::before {
    content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 2px;
    border-radius: 0 0 3px 3px; background: var(--primary);
    transform: scaleX(0); transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(46, 125, 85, .3);
    box-shadow: 0 22px 46px -28px rgba(20, 60, 40, .45);
}
.card:hover::before { transform: scaleX(1); }
.card-title { color: var(--text-2); font-size: 14px; letter-spacing: .3px; }
.stat-icon {
    background: #f1f7f3; color: var(--primary);
    transition: background .3s ease, transform .3s ease;
}
.card:hover .stat-icon { background: #e6f2ea; transform: scale(1.06) rotate(-4deg); }
.stat-value { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: -.5px; }
.stat::after { background: radial-gradient(circle, rgba(46, 125, 85, .10), transparent 70%); }
.analytics-summary > div, .analytics-filters {
    transition: transform .35s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease, border-color .35s ease;
}
.analytics-summary > div:hover {
    transform: translateY(-3px); border-color: rgba(46, 125, 85, .28);
    box-shadow: 0 18px 40px -28px rgba(20, 60, 40, .4);
}

/* ---------- 按钮 ---------- */
.btn {
    border-radius: 9px; border-color: var(--border); color: var(--text-2); background: #fff;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .25s ease, box-shadow .25s ease;
}
.btn:hover { background: #f7faf8; border-color: #c9d6cf; color: var(--text); transform: translateY(-1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover {
    background: var(--primary-2); border-color: var(--primary-2);
    box-shadow: 0 10px 22px -12px rgba(46, 125, 85, .7);
}
.btn-danger { background: #fbedec; border-color: #f3d6d3; color: var(--danger); }
.btn-danger:hover { background: #f6dcda; border-color: #ebc3bf; }
.btn-sm { border-radius: 7px; }

/* ---------- 输入 / 分段 / 开关 ---------- */
.field input:focus, .field textarea:focus, .field select:focus,
.search input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 125, 85, .1);
}
.seg { background: #f7faf8; border-color: var(--border); border-radius: 10px; }
.seg span { border-radius: 8px; font-size: 13px; }
.seg span:hover { color: var(--text); background: rgba(46, 125, 85, .06); }
.seg span.on { background: #fff; color: var(--primary-2); box-shadow: 0 1px 2px rgba(20, 24, 26, .06); }
.switch input:checked + .switch-slider { background: var(--primary); }

/* ---------- 表格 ---------- */
.table-wrap { border-color: var(--border); box-shadow: 0 1px 2px rgba(20, 24, 26, .04); }
thead th {
    background: #fbfdfc; color: #a6adb1; font-size: 11.5px;
    letter-spacing: 1px; font-weight: 500; padding: 12px 16px;
    border-bottom: 1px solid #edf0ef;
}
tbody td { border-bottom: 1px solid #f2f4f3; padding: 12px 16px; }
tbody tr:hover { background: #fbfdfc; }
.driver-table thead th { background: #fbfdfc; color: #a6adb1; }
.driver-table tbody tr:hover td { background: #fbfdfc; }
.driver-table .row-sum td { background: #f7faf8; }

/* ---------- 标签 ---------- */
.badge { border-radius: 999px; font-weight: 600; }
.badge-ok { background: #eef6f1; color: var(--primary); }
.badge-info { background: #f1f3f4; color: #4a5257; }
.badge-warn { background: #fbf3e4; color: var(--warn); }
.badge-danger { background: #fbedec; color: var(--danger); }
.badge-gray { background: #f3f5f4; color: var(--text-3); }
.badge-accent { background: #faf3d9; color: #9b7110; }

/* ---------- 弹窗 / 遮罩 ---------- */
.modal { border-radius: 16px; box-shadow: 0 34px 90px -46px rgba(20, 60, 40, .5); }
.modal-mask { background: rgba(20, 30, 26, .42); }
.icon-btn:hover { background: #eef6f1; color: var(--primary); }

/* ---------- 登录页 ---------- */
.login-screen {
    background:
        radial-gradient(900px 520px at 10% 6%, rgba(46, 125, 85, .14), transparent 60%),
        radial-gradient(760px 520px at 92% 96%, rgba(31, 91, 60, .12), transparent 62%),
        linear-gradient(160deg, #f7faf8 0%, #edf4ef 60%, #e6efea 100%);
}
.login-screen::before, .login-screen::after {
    background: radial-gradient(circle, rgba(46, 125, 85, .16), transparent 68%);
}
.login-card { border-radius: 18px; border: 1px solid rgba(255, 255, 255, .9); }
.login-logo {
    width: 54px; height: 54px; border-radius: 14px; padding: 4px;
    background: #eef6f1; border: 1px solid rgba(46, 125, 85, .18);
    box-shadow: none; overflow: hidden;
}
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-title { letter-spacing: .3px; }

/* ---------- 顶栏账号 ---------- */
.admin-avatar { background: linear-gradient(135deg, #2e7d55, #1f5b3c); }
.admin-chip { border-radius: 999px; }

/* ---------- 其他 ---------- */
.toast { background: #1f5b3c; border-radius: 10px; }
.toast.ok { background: var(--primary); }
.toast.err { background: var(--danger); }
.bar { background: linear-gradient(180deg, #7fb794, #2e7d55); }
.customer-thumb .placeholder { background: linear-gradient(135deg, #e6f2ea, #d5e8dc); color: var(--primary); }
.progress { background: #f1f7f3; }
::-webkit-scrollbar-thumb { background: #d2deda; }
::-webkit-scrollbar-thumb:hover { background: #b9ccc4; }

/* 上传框：选中文件后整框变绿 */
.dropzone { border-radius: 14px; background: #fbfdfc; }
.dropzone:hover, .dropzone.drag {
    border-color: var(--primary); background: #f1f7f3;
    box-shadow: 0 0 0 3px rgba(46, 125, 85, .08);
}
.dropzone svg { transition: fill .25s ease, transform .25s ease; }
.dropzone:hover svg { fill: var(--primary); }
.dropzone.filled {
    border: 1.5px solid var(--primary); background: #eef6f1;
    box-shadow: 0 0 0 3px rgba(46, 125, 85, .09);
}
.dropzone.filled svg { fill: var(--primary); transform: scale(1.05); }
.dropzone.filled .dz-title { color: var(--primary-2); }
.dropzone.filled .dz-sub { color: var(--primary); }


/* ---------- 统一筛选栏：同一行、同高 ---------- */
.filter-bar {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; row-gap: 10px;
    margin-bottom: 14px;
}
.filter-bar .seg { height: 36px; padding: 2px; margin: 0; box-sizing: border-box; }
.filter-bar .seg span {
    height: 30px; display: inline-flex; align-items: center;
    padding: 0 13px; border-radius: 7px; font-size: 13px;
}
.filter-field {
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; box-sizing: border-box; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 9px; background: #fff;
}
.filter-field > span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.filter-field input, .filter-field select {
    height: 32px; padding: 0; border: 0; outline: none;
    background: transparent; font-size: 13px; color: var(--text); font-family: inherit;
}
.filter-field input { width: 104px; }
.filter-field input[type="date"] { width: 124px; }
.filter-field select { width: 138px; cursor: pointer; }
.filter-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 125, 85, .10); }
.filter-spacer { flex: 1 1 auto; min-width: 8px; }
.filter-bar .exception-kw input, .filter-bar .reassign-kw input { width: 210px; }
.filter-bar .ord-kw input { width: 170px; }
.filter-bar .btn {
    height: 36px; padding: 0 15px; border-radius: 9px; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box;
}
.filter-bar .btn svg { width: 15px; height: 15px; fill: currentColor; }
.filter-bar .search { flex: 0 1 380px; max-width: 380px; }
.filter-bar .search input { height: 36px; padding: 0 14px 0 36px; font-size: 13px; border-radius: 9px; }
.filter-bar .search svg { width: 15px; height: 15px; left: 12px; }


/* ---------- 左导航红点 ---------- */
.nav-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: #e5484d; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    display: none; flex-shrink: 0;
}
.nav-badge:not([hidden]) { display: inline-block; }

/* ---------- 客户管理：列表 ---------- */
.filter-count { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.cust-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ctable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ctable th {
    padding: 11px 16px; background: #f7faf8; border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 600; color: var(--text-3); text-align: left; white-space: nowrap;
}
.ctable th:nth-child(1) { width: 26%; }
.ctable th:nth-child(2) { width: 9%; }
.ctable th:nth-child(3) { width: 9%; }
.ctable th:nth-child(4) { width: 33%; }
.ctable th:nth-child(5) { width: 13%; }
.ctable th:nth-child(6) { width: 10%; }
.ctable td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); vertical-align: top; text-align: left; }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable tbody tr { cursor: pointer; transition: background .16s ease; }
.ctable tbody tr:hover { background: #f8fbf9; }
.cust-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 22px; text-align: left; white-space: normal; word-break: break-word; }
.cust-sub { margin-top: 3px; font-size: 12px; color: var(--text-3); line-height: 1.5; text-align: left; word-break: break-word; }
.cust-tag {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 6px; font-size: 12px; white-space: nowrap;
}
.cust-tag.area { background: #eef6f1; color: #1f5b3c; }
.cust-tag.none { background: #f4f5f6; color: #8a9299; }
.cust-addr { line-height: 1.55; word-break: break-all; }
.cust-phone { font-variant-numeric: tabular-nums; }
.cust-photo-ok { color: var(--primary); font-weight: 600; }
.cust-photo-miss { color: var(--text-3); font-weight: 500; }

/* ---------- 客户画像：名称完整显示 ---------- */
.ana-name { min-width: 190px; }
.ana-name b { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.45; white-space: normal; word-break: break-all; }
.ana-name small { display: block; margin-top: 4px; font-size: 11px; color: var(--text-3); }


/* 客户画像表格：单元格不换行，名称列除外 */
.analytics-table th, .analytics-table td { white-space: nowrap; }
.analytics-table .ana-name { white-space: normal; }

/* ---------- 客户画像 v2：分层、趋势和偏好可视化 ---------- */
.ana-detail { padding-bottom: 4px; }
.ana-hero {
    display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 16px;
    border: 1px solid #d7e7dc; border-radius: 18px;
    background: linear-gradient(120deg, #fbfdfb 0%, #eaf5ee 55%, #fdfaf1 100%);
    box-shadow: 0 12px 30px -26px rgba(20, 80, 50, .45);
}
.ana-hero-photo { position: relative; width: 104px; height: 104px; flex: 0 0 104px; border-radius: 18px; overflow: hidden; background: #fff; border: 3px solid #fff; box-shadow: 0 8px 20px -10px rgba(20, 60, 40, .35); }
.ana-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.ana-hero-photo > span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #9bb5a5; font-size: 36px; font-weight: 700; }
.ana-hero-photo > i { position: absolute; right: 7px; bottom: 7px; display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; border-radius: 50%; background: rgba(31, 91, 60, .88); color: #fff; font-size: 13px; font-style: normal; font-weight: 700; }
.ana-hero-main { flex: 1; min-width: 0; }
.ana-hero-name { display: flex; align-items: center; gap: 10px; }
.ana-hero-name h2 { font-size: 21px; line-height: 1.35; overflow-wrap: anywhere; }
.ana-hero-main .analytics-tags { margin-top: 8px; }
.ana-hero-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--text-3); font-size: 12px; }
.ana-hero-sub span { position: relative; }
.ana-hero-sub span + span::before { content: '·'; position: absolute; left: -9px; color: #a6b2aa; }
.ana-hero-strategy { display: inline-flex; align-items: center; margin-top: 10px; padding: 5px 10px; border-radius: 8px; background: rgba(46, 125, 85, .09); color: #1f5b3c; font-size: 12px; line-height: 1.5; }
.ana-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.ana-kpis > div { padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.ana-kpis span { display: block; min-height: 17px; color: var(--text-3); font-size: 12px; }
.ana-kpis b { display: block; margin-top: 6px; font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.ana-kpis b.ana-kpi-date { font-size: 15px; line-height: 1.5; }
.ana-kpis small { display: block; margin-top: 5px; color: var(--text-3); font-size: 11px; }
.ana-kpis .ana-risk-danger { color: var(--danger); }
.ana-kpis .ana-risk-warn { color: #a66d12; }
.ana-kpis .ana-risk-ok { color: var(--primary); }
.ana-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.ana-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ana-grid-start { align-items: start; }
.ana-card { min-width: 0; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 5px 18px -16px rgba(20, 60, 40, .2); animation: anaUp .45s ease both; }
.ana-card:nth-child(2) { animation-delay: .04s; }
.ana-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ana-card-head h3 { font-size: 14px; font-weight: 650; color: var(--text); }
.ana-subhead { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed #e2eae5; }
.ana-subhead span { color: var(--text-2); font-size: 12px; font-weight: 600; }
.ana-subhead small { color: var(--text-3); font-size: 10px; }
.ana-pairs.ana-pairs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ana-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 7px; font-size: 11px; white-space: nowrap; }
.ana-pill.gray { background: #f0f3f1; color: var(--text-3); }
.ana-pill.ok { background: #e8f5ed; color: #1f6a46; }
.ana-pill.warn { background: #fff6df; color: #a66d12; }
.ana-pill.danger { background: #fceceb; color: #a33c35; }
.ana-note { margin: 0 0 11px; color: var(--text-3); font-size: 12px; line-height: 1.65; }
.ana-empty { display: flex; align-items: center; justify-content: center; min-height: 88px; padding: 12px; color: var(--text-3); font-size: 12px; text-align: center; background: var(--surface-2); border-radius: 10px; }
.ana-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.ana-chip.ok { background: #e8f5ed; color: #1f6a46; }
.ana-chip.warn { background: #fff6df; color: #a66d12; }
.ana-chip.danger { background: #fceceb; color: #a33c35; }
.ana-chip.gray { background: #f0f3f1; color: var(--text-3); }
.ana-bars { display: flex; flex-direction: column; gap: 9px; }
.ana-bar-row { display: grid; grid-template-columns: minmax(70px, 1fr) 2fr 54px; align-items: center; gap: 9px; min-height: 24px; }
.ana-bar-label { overflow: hidden; color: var(--text-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ana-bar-track { height: 8px; overflow: hidden; background: #f0f4f1; border-radius: 99px; }
.ana-bar-track i { display: block; height: 100%; border-radius: inherit; transform-origin: left; animation: anaGrow .7s cubic-bezier(.22, .9, .35, 1) both; }
.ana-bar-row > b { color: var(--text-2); font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.ana-cycle { display: flex; align-items: center; gap: 20px; }
.ana-cycle-gauge { flex: 0 0 122px; }
.ana-cycle-info { flex: 1; min-width: 0; }
.ana-cycle-info .sum-row { padding: 5px 0; }
.ana-cycle-info .sum-row b { max-width: 58%; }
.ana-gauge { position: relative; width: 116px; height: 116px; border-radius: 50%; background: conic-gradient(#2e7d55 0 var(--p), #edf3ef var(--p) 100%); animation: anaPop .6s ease both; }
.ana-gauge::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #fff; }
.ana-gauge > div { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center; }
.ana-gauge b { color: var(--text); font-size: 13px; line-height: 1.35; }
.ana-gauge small { margin-top: 3px; color: var(--text-3); font-size: 10px; line-height: 1.35; }
.ana-gauge.danger { background: conic-gradient(#c4453b 0 var(--p), #f7e9e8 var(--p) 100%); }
.ana-gauge.warn { background: conic-gradient(#c08a2e 0 var(--p), #fbf3e4 var(--p) 100%); }
.ana-gauge.gray { background: conic-gradient(#9aa5a0 0 var(--p), #eff2f0 var(--p) 100%); }
.ana-interval-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.ana-interval-line span { padding: 3px 7px; border-radius: 5px; background: #f5f8f6; color: var(--text-3); font-size: 10px; }
.ana-spark { position: relative; padding: 2px 0 1px; }
.ana-spark svg { display: block; width: 100%; height: 118px; overflow: visible; }
.ana-spark-area { fill: rgba(46, 125, 85, .08); }
.ana-spark-line { fill: none; stroke: #2e7d55; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1200; animation: anaDash 1.15s ease both; }
.ana-spark-dot { fill: #2e7d55; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; animation: anaPop .8s ease both; }
.ana-trend-stats { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2eae5; }
.ana-trend-stats div { display: flex; flex-direction: column; gap: 2px; }
.ana-trend-stats span { color: #8aa595; font-size: 10px; }
.ana-trend-stats b { color: #2f5743; font-size: 13px; }
.ana-trend-stats b.up { color: #2e7d55; }
.ana-trend-stats b.down { color: #b76b62; }
.ana-spark-foot { display: flex; align-items: center; justify-content: space-between; margin-top: -4px; color: var(--text-3); font-size: 11px; }
.ana-spark-foot b { color: var(--text-2); font-size: 12px; }
.ana-columns { display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 4px; height: 98px; padding-top: 16px; border-bottom: 1px solid #edf1ee; }
.ana-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.ana-col > i { display: block; width: 80%; min-height: 0; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #66ae86, #2e7d55); transform-origin: bottom; animation: anaRise .65s cubic-bezier(.22, .9, .35, 1) both; }
.ana-col-value { position: absolute; bottom: calc(100% + 2px); color: var(--text-3); font-size: 9px; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.ana-col:hover .ana-col-value { opacity: 1; }
.ana-col > small { position: absolute; top: calc(100% + 4px); color: var(--text-3); font-size: 9px; white-space: nowrap; transform: translateY(0); }
.ana-columns { margin-bottom: 8px; }
.ana-donut-wrap { display: flex; align-items: center; gap: 18px; min-height: 148px; }
.ana-donut { position: relative; width: 132px; height: 132px; flex: 0 0 132px; border-radius: 50%; background: var(--donut); animation: anaPop .7s cubic-bezier(.22, .9, .35, 1) both; }
.ana-donut > div { position: absolute; inset: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: #fff; text-align: center; }
.ana-donut b { max-width: 82px; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ana-donut small { margin-top: 3px; color: var(--text-3); font-size: 10px; }
.ana-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ana-legend-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) 44px; align-items: center; gap: 7px; min-width: 0; }
.ana-legend-row i { width: 8px; height: 8px; border-radius: 50%; }
.ana-legend-row span { overflow: hidden; color: var(--text-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ana-legend-row b { color: var(--text-3); font-size: 11px; text-align: right; }
.ana-mini-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.ana-prod-list { display: flex; flex-direction: column; gap: 10px; }
.ana-prod { min-width: 0; }
.ana-prod-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ana-prod-head > span { overflow: hidden; color: var(--text-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ana-prod-bar { height: 6px; margin-top: 5px; overflow: hidden; background: #f0f4f1; border-radius: 99px; }
.ana-prod-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8fc8a8, #2e7d55); transform-origin: left; animation: anaGrow .7s ease both; }
.ana-prod-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; color: var(--text-3); font-size: 10px; }
.ana-prod-meta b { color: var(--text-2); font-size: 11px; font-weight: 600; }
.ana-table-card { margin-bottom: 14px; }
.ana-mini-table { max-height: none; }
.ana-mini-table table { min-width: 640px; }
.ana-mini-table td { vertical-align: middle; }
.ana-mini-table td small { display: block; margin-top: 3px; color: var(--text-3); font-size: 10px; }
.ana-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ana-pair { min-width: 0; padding: 10px; background: var(--surface-2); border: 1px solid #edf1ee; border-radius: 9px; }
.ana-pair b { display: block; overflow: hidden; font-size: 11px; font-weight: 600; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.ana-pair span { display: block; margin: 2px 0; color: #8aa595; font-size: 11px; }
.ana-pair small { display: block; margin-top: 5px; color: var(--text-3); font-size: 10px; }
.ana-photo-card { margin-bottom: 14px; }
.ana-photo-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ana-photo-strip a { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 9px; background: #eef2ef; }
.ana-photo-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ana-photo-strip a:hover img { transform: scale(1.05); }
.ana-photo-strip span { position: absolute; left: 5px; bottom: 5px; padding: 2px 5px; border-radius: 4px; background: rgba(20, 30, 24, .62); color: #fff; font-size: 10px; }
.ana-archive { margin: 14px 0 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ana-archive > summary { padding: 13px 16px; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.ana-archive > summary::after { content: '＋'; float: right; color: var(--text-3); font-weight: 400; }
.ana-archive[open] > summary::after { content: '－'; }
.ana-archive > .grid { padding: 0 16px 16px; }
.ana-archive .card { box-shadow: none; background: var(--surface-2); }
@keyframes anaUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes anaGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes anaRise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes anaPop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
@keyframes anaDash { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
@media (max-width: 1180px) {
    .ana-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ana-photo-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .ana-hero { align-items: flex-start; flex-wrap: wrap; }
    .ana-hero-photo { width: 82px; height: 82px; flex-basis: 82px; }
    .ana-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ana-grid-2 { grid-template-columns: 1fr; }
    .ana-cycle { align-items: flex-start; }
    .ana-pairs { grid-template-columns: 1fr; }
    .ana-photo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .ana-donut-wrap { align-items: flex-start; flex-direction: column; }
    .ana-photo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ---- 异常处理（卡片式） ---- */
.exception-toolbar { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ex-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ex-filter-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ex-filter-right select, .ex-filter-right input { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; background: #fff; }
.ex-filter-right input { width: 220px; }
.ex-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ex-stat { background: #f7f9f8; border: 1px solid #edf1ef; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ex-stat span { font-size: 12px; color: var(--text-3); }
.ex-stat b { font-size: 18px; color: var(--text-1); }
.exception-list { display: flex; flex-direction: column; gap: 12px; }
.exception-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.exception-card.is-resolved { opacity: .88; background: #fbfcfc; }
.ex-card-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px dashed #eef2f0; }
.ex-card-main { flex: 1; min-width: 0; }
.ex-customer { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-1); }
.ex-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.ex-sub b { color: var(--text-2); font-weight: 600; }
.ex-card-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ex-card-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 10px 22px; padding: 12px 16px; }
.ex-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-field label { font-size: 11px; color: var(--text-3); }
.ex-field span { font-size: 13px; color: var(--text-1); word-break: break-all; }
.ex-field-wide { grid-column: 1 / -1; }
.ex-qty { font-style: normal; font-weight: 700; color: #c1440e; font-size: 13px; }
.ex-cat { font-style: normal; font-size: 11px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }
.ex-photo { grid-column: 1 / -1; }
.ex-photo img { max-width: 220px; max-height: 150px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.ex-handle { margin: 0 16px 12px; padding: 10px 12px; background: #f2f9f5; border-radius: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ex-handle b { font-size: 12px; color: #2f7d57; }
.ex-handle em { color: var(--text-3); font-style: normal; }
.ex-handle-return { background: #fdf3f3; }
.ex-handle-return b { color: #c0392b; }
.ex-card-foot { display: flex; align-items: center; padding: 10px 16px 14px; }
.ex-type { font-size: 11px; color: var(--text-3); }
.ex-actions { margin-left: auto; display: flex; gap: 8px; }
.exception-modal-head { padding: 0 2px 12px; }
.ex-modal-title { font-size: 15px; font-weight: 700; }
.ex-modal-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.order-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.order-photo-cell { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafbfb; }
.order-photo-cell img { width: 100%; height: 130px; object-fit: cover; display: block; }
.order-photo-meta { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; font-size: 11px; color: var(--text-3); }
.order-photo-meta.muted { padding-top: 0; color: var(--text-3); }
@media (max-width: 900px) {
  .ex-card-body { grid-template-columns: 1fr; }
  .ex-filter-right { width: 100%; margin-left: 0; }
  .ex-filter-right input { flex: 1; width: auto; }
}
/* ---------- 分页 ---------- */
.pager {
    display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
    margin-top: 14px; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
    font-size: 13px; color: var(--text-2);
}
.pager-info { color: var(--text-3); }
.pager-info b { color: var(--text); font-weight: 700; }
.pager-size { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.pager-size label { color: var(--text-3); }
.pager-size select {
    height: 30px; padding: 0 26px 0 9px; border: 1px solid var(--border);
    border-radius: 8px; background: #fff; color: var(--text);
    font-size: 13px; font-family: inherit; cursor: pointer; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pager-size select:hover { border-color: var(--border-strong); }
.pager-size select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 125, 85, .10); }
.pager-btns { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager-btn {
    min-width: 30px; height: 30px; padding: 0 9px;
    border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text-2); font-size: 13px;
    font-family: inherit; cursor: pointer; transition: all .15s ease;
}
.pager-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-2); background: #f2f9f5; }
.pager-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager-btn:disabled { color: var(--border-strong); background: var(--surface-2); cursor: not-allowed; }
.pager-dots { padding: 0 3px; color: var(--text-3); }
@media (max-width: 900px) {
    .pager { gap: 8px 10px; }
    .pager-btns { margin-left: 0; width: 100%; overflow-x: auto; }
}
/* ---------- 客户曾用名 ---------- */
.alias-box { border:1px solid var(--border); border-radius:10px; background:#fafbfb; padding:2px 10px; max-height:170px; overflow:auto; }
.alias-row { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px dashed var(--border); font-size:13px; }
.alias-row:last-child { border-bottom:0; }
.alias-main { flex:1; min-width:0; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.alias-main b { color:var(--text); font-weight:600; }
.alias-main i { font-style:normal; color:var(--text-3); }
.alias-target { color:var(--text-2); }
.alias-meta { color:var(--text-3); font-size:11.5px; white-space:nowrap; }
.alias-empty { padding:10px 2px; color:var(--text-3); font-size:12.5px; }
.alias-add { display:flex; gap:8px; margin-top:8px; }
.alias-add input { flex:1; height:36px; padding:0 12px; border:1px solid var(--border); border-radius:9px; font-size:13px; font-family:inherit; background:#fff; }
.alias-add input:focus { border-color:var(--primary); outline:none; box-shadow:0 0 0 3px rgba(46,125,85,.10); }
.alias-list { max-height:430px; overflow:auto; margin-top:12px; border:1px solid var(--border); border-radius:10px; padding:0 10px; background:#fff; }
.alias-total { color:var(--text-3); font-size:12px; }
/* ---------- 管理员功能权限 ---------- */
.perm-section { margin-top: 4px; }
.perm-section-title { display:block; font-size:13px; font-weight:600; color:var(--text-2); margin-bottom:8px; }
.perm-tools { display:flex; flex-direction:row; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.perm-tools-hint { font-size:12px; color:var(--text-3); margin-right:2px; }
.perm-preset { flex:0 0 auto; height:28px; padding:0 11px; border:1px solid var(--border); background:#fff; border-radius:8px; font-size:12px; color:var(--text-2); cursor:pointer; font-family:inherit; line-height:1; transition:border-color .15s, color .15s, background .15s; }
.perm-preset:hover { border-color:var(--primary); color:var(--primary); }
.perm-preset.on { border-color:var(--primary); background:#edf5f0; color:var(--primary); font-weight:600; }
.perm-count { margin-left:auto; font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.perm-groups { display:flex; flex-direction:column; gap:10px; }
.perm-group { border:1px solid var(--border); border-radius:12px; background:#fff; padding:8px; }
.perm-group-head { display:flex; flex-direction:row; align-items:center; gap:8px; padding:8px 9px; background:#f3f7f4; border-radius:8px; cursor:pointer; user-select:none; }
.perm-group-title { font-size:13px; font-weight:600; color:var(--text); }
.perm-group-count { margin-left:auto; font-size:11.5px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.perm-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 10px; margin-top:6px; }
.perm-item { display:flex; flex-direction:row; align-items:flex-start; gap:8px; padding:7px 9px; border-radius:8px; cursor:pointer; }
.perm-item:hover { background:#f6f9f7; }
.perm-text { display:flex; flex-direction:column; gap:2px; min-width:0; }
.perm-text b { font-size:12.5px; font-weight:600; color:var(--text); line-height:1.35; }
.perm-text i { font-style:normal; font-size:11.5px; color:var(--text-3); line-height:1.4; }
.perm-groups input[type="checkbox"] { flex:0 0 auto; width:15px; height:15px; min-width:15px; padding:0; margin:2px 0 0; border:1px solid var(--border); border-radius:4px; box-shadow:none; accent-color:var(--primary); cursor:pointer; }
.perm-groups.is-locked .perm-item, .perm-groups.is-locked .perm-group-head { opacity:.62; cursor:default; }
.perm-tip { margin:8px 0 0; font-size:11.5px; color:var(--text-3); line-height:1.6; }
@media (max-width: 720px) { .perm-items { grid-template-columns:1fr; } }
