:root {
    --bg: #f4f7fb;
    --card: #fff;
    --text: #172033;
    --subtle: #6b7280;
    --line: #e6eaf0;
    --primary: #3455db;
    --primary-dark: #2442bd;
    --success: #15865c;
    --success-bg: #e8f7f0;
    --warning: #9a6500;
    --warning-bg: #fff4d6;
    --danger: #c83a4d;
    --danger-bg: #fff0f2;
    --radius: 14px;
    --shadow: 0 7px 28px rgba(27, 39, 67, .06);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
.container { width: min(1920px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 52px; background: #172033; color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.nav-wrap { height: 100%; display: flex; align-items: center; gap: 28px; position: relative; }
.brand { color: #fff; font-size: 17px; font-weight: 750; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
nav { display: flex; align-items: center; gap: 6px; flex: 1; }
nav a { color: #bfc7d8; padding: 8px 13px; border-radius: 8px; }
nav a:hover, nav a.active { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 12px; color: #dbe1ec; }
.user-menu form { margin: 0; }
.top-sync-clock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 18px; color: #bfc7d8; font-size: 12px; white-space: nowrap; }
.top-sync-clock span { display: inline-flex; align-items: center; }
.link-button { border: 0; background: none; color: #9eabc3; cursor: pointer; padding: 4px; }
.link-button:hover { color: #fff; }
.page { padding-top: 14px; padding-bottom: 10px; }
.page-heading { margin-bottom: 12px; }
.page-heading h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.page-heading p, .card-heading p, .toolbar p { margin: 0; color: var(--subtle); line-height: 1.6; }
.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.heading-row .inline-form { margin-left: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { min-height: 142px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-card span { color: var(--subtle); font-weight: 600; }
.stat-card strong { font-size: 38px; line-height: 1.3; margin: 8px 0 2px; }
.stat-card small { color: #9299a6; }
.stat-card.accent { color: #fff; border: 0; background: linear-gradient(135deg, #3455db, #6379ef); }
.stat-card.accent span, .stat-card.accent small { color: rgba(255,255,255,.8); }
.stat-card.danger-card strong { color: var(--danger); }
.toolbar { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.toolbar strong { display: block; margin-bottom: 4px; font-size: 16px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.compact-heading { margin-bottom: 14px; }
.sync-clock { display: grid; gap: 4px; min-width: 210px; color: var(--subtle); font-size: 12px; text-align: right; }
.sync-clock span { display: block; }
.unified-board { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.left-panel, .right-panel { min-width: 0; }
.tight-heading { padding: 12px 14px 8px; }
.tight-heading h2 { font-size: 16px; }
.count-panel { padding-bottom: 10px; }
.date-count-list { display: grid; gap: 7px; padding: 0 12px 9px; }
.date-count-card { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
.date-count-card:hover { text-decoration: none; border-color: #b9c4e8; }
.date-count-card.active { border-color: var(--primary); background: #eef2ff; box-shadow: inset 3px 0 0 var(--primary); }
.date-count-card span { font-weight: 750; }
.date-count-metrics { grid-row: span 2; align-self: center; display: grid; gap: 1px; text-align: right; }
.date-count-metrics b { font-size: 13px; color: var(--primary); white-space: nowrap; }
.date-count-card small { color: var(--subtle); }
.compact-segmented { margin: 0 12px; width: calc(100% - 24px); }
.compact-segmented a { flex: 1; }
.passed-list { padding: 0 12px 10px; }
.passed-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.passed-item small { display: block; margin-top: 4px; color: var(--subtle); }
.compact-empty { padding: 18px; margin: 0; }
.board-search-panel { padding: 12px 14px; }
.board-search-form { display: grid; grid-template-columns: 340px minmax(300px, 430px) 104px; gap: 12px; align-items: center; max-width: 900px; }
.board-search-form .form-field { min-width: 0; height: 40px; align-self: center; }
.board-search-form .radio-field { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.board-search-form .radio-card { min-height: 40px; height: 40px; padding: 0 14px; border-radius: 10px; gap: 9px; font-size: 15px; font-weight: 800; }
.board-search-form .radio-card input { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; }
.board-search-form .search-phone-field { display: block; }
.board-search-form .search-phone-field input { display: block; width: 100%; height: 40px; border-radius: 10px; padding: 0 14px; font-size: 15px; font-weight: 800; }
.board-search-form input { min-width: 0; }
.board-search-form .button { width: 100%; height: 40px; min-height: 40px; align-self: center; border-radius: 10px; font-size: 14px; }
.customer-list { padding: 0 12px 8px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.customer-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fff; display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(220px, 1.1fr) auto; align-items: center; gap: 8px 12px; }
.customer-card.highlight { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(52,85,219,.1); }
.customer-main { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.customer-main > div { min-width: 0; }
.customer-main .badge { flex: 0 0 auto; }
.customer-phone { font-size: 15px; font-weight: 800; color: var(--text); }
.customer-phone:hover { color: var(--primary); text-decoration: none; }
.customer-main small, .customer-meta span { display: block; color: var(--subtle); margin-top: 4px; }
.customer-meta { margin-top: 0; line-height: 1.35; overflow-wrap: anywhere; font-size: 12px; }
.program-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 0; min-width: 0; }
.program-pill { display: inline-flex; max-width: 100%; border-radius: 999px; padding: 3px 7px; font-size: 12px; font-weight: 650; background: #edf0f5; color: #657087; }
.program-pill.success { color: var(--success); background: var(--success-bg); }
.program-pill.warning { color: var(--warning); background: var(--warning-bg); }
.program-pill.danger { color: var(--danger); background: var(--danger-bg); }
.customer-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 0; padding-top: 0; border-top: 0; }
.customer-actions form { margin: 0; }
.customer-list-card .card-heading { align-items: center; }
.pager-size-form { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 12px; white-space: nowrap; }
.pager-size-form label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.pager-size-form select { height: 30px; padding: 0 28px 0 9px; }
.pager { padding: 0 12px 10px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--subtle); font-size: 12px; }
.button.disabled { pointer-events: none; opacity: .45; }
.workbench-grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.left-panel { display: grid; gap: 18px; }
.compact-heading { padding-bottom: 10px; }
.compact-heading h2 { margin-bottom: 3px; }
.pass-card { overflow: hidden; }
.date-count-list { display: grid; gap: 8px; padding: 0 16px 14px; }
.date-count-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; color: var(--text); background: #fff; }
.date-count-item:hover { text-decoration: none; border-color: #b8c4ff; }
.date-count-item.active { color: #fff; border-color: var(--primary); background: linear-gradient(135deg, #3455db, #6379ef); }
.date-count-item span { display: grid; gap: 3px; }
.date-count-item strong { font-size: 15px; }
.date-count-item small { color: var(--subtle); }
.date-count-item.active small { color: rgba(255,255,255,.78); }
.date-count-item b { font-size: 30px; line-height: 1; }
.mini-stat-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 16px 16px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.mini-stat-row span { padding: 5px 8px; border-radius: 999px; background: #f3f5f9; }
.danger-text { color: var(--danger) !important; }
.segmented.tiny a { min-width: 52px; padding: 5px 8px; font-size: 12px; }
.success-list { padding: 0 16px 16px; display: grid; gap: 10px; }
.success-item { border-top: 1px solid var(--line); padding-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; }
.success-item:first-child { border-top: 0; padding-top: 0; }
.success-item small { display: block; margin-top: 3px; color: var(--subtle); }
.success-item p { grid-column: 1 / -1; margin: 0; color: #3f4757; overflow-wrap: anywhere; }
.query-card { overflow: hidden; }
.quick-query-form { padding: 0 20px 16px; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(220px, 1fr) auto; gap: 12px; align-items: end; }
.quick-query-form .phone-input { display: grid; gap: 7px; color: var(--subtle); font-size: 12px; font-weight: 650; }
.quick-query-form .phone-input input { width: 100%; }
.mini-search-form { padding: 14px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfd; display: grid; grid-template-columns: 130px minmax(180px, 1fr) auto auto; gap: 10px; align-items: center; }
.mini-search-form input, .mini-search-form select { width: 100%; }
.account-result-list { display: grid; gap: 0; }
.account-result { padding: 18px 20px; border-top: 1px solid var(--line); }
.account-result:first-child { border-top: 0; }
.account-result.highlight { background: #f3f6ff; box-shadow: inset 3px 0 0 var(--primary); }
.account-result-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.account-result-head small { display: block; margin-top: 4px; color: var(--subtle); }
.account-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.muted-line { margin: 12px 0 0; color: var(--subtle); }
.program-status-list { margin-top: 14px; display: grid; gap: 8px; }
.program-status-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.program-status-item strong { font-size: 14px; }
.program-status-item small { display: block; margin-top: 2px; color: var(--subtle); overflow-wrap: anywhere; }
.small-empty { padding: 48px 20px; }
.card-heading { padding: 14px 14px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-heading h2 { margin: 0 0 2px; font-size: 17px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 14px 16px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: #657087; font-size: 12px; text-transform: uppercase; letter-spacing: .35px; white-space: nowrap; background: #fafbfd; }
td { line-height: 1.45; }
td strong { display: block; }
td small { display: block; margin-top: 3px; color: var(--subtle); max-width: 320px; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; color: #3f4a5f; background: #f2f4f8; padding: 3px 6px; border-radius: 5px; }
.empty-cell { color: var(--subtle); text-align: center; padding: 20px; }
.run-list { padding: 0 20px 12px; }
.run-item { border-top: 1px solid var(--line); padding: 14px 0; }
.run-item > div { display: flex; gap: 8px; align-items: center; }
.run-item > small { display: block; margin-top: 7px; color: var(--subtle); }
.run-item p { margin: 5px 0 0; color: var(--subtle); }
.badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.muted { color: #657087; background: #edf0f5; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; border: 1px solid #cdd3df; border-radius: 8px; background: #fff; color: #344054; padding: 7px 13px; cursor: pointer; font-weight: 650; white-space: nowrap; line-height: 1; }
.button:hover { border-color: #9ca7ba; text-decoration: none; }
.button.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.danger-outline { color: var(--danger); border-color: #efb6bd; }
.button.small { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.button.full { width: 100%; }
.button:disabled { opacity: .65; cursor: wait; }
.inline-form label, .filters label, .create-form label { color: var(--subtle); font-size: 12px; font-weight: 650; }
input, select, textarea { border: 1px solid #cfd5df; border-radius: 8px; background: #fff; color: var(--text); outline: none; }
input, select { height: 36px; padding: 0 10px; line-height: 1; }
textarea { padding: 12px; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: #748af0; box-shadow: 0 0 0 3px rgba(52,85,219,.11); }
.inline-form label { display: flex; align-items: center; gap: 9px; }
.create-panel { padding: 18px 20px; }
.search-panel { border-color: #cfd8ff; background: linear-gradient(180deg, #fff, #f8faff); }
.search-panel .create-form { align-items: end; }
.search-panel input { min-width: 340px; }
.search-panel .button.primary { min-width: 140px; }
.create-form { display: flex; align-items: flex-end; gap: 12px; }
.create-form label { display: grid; gap: 7px; }
.create-form small { color: var(--subtle); padding-bottom: 10px; }
.create-form input { min-width: 280px; }
.radio-field { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px 14px; }
.radio-field legend { grid-column: 1 / -1; padding: 0; color: var(--subtle); font-size: 13px; line-height: 1; font-weight: 700; margin: 0; }
.radio-card { height: 48px; border: 1px solid #cfd5df; border-radius: 10px; background: #fff; color: #344054; padding: 0 18px; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 16px; line-height: 1; font-weight: 750; }
.radio-card input { width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 0; accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: #eef2ff; color: var(--primary-dark); }
.filters { padding: 18px 20px; display: flex; gap: 12px; align-items: end; }
.filters label { display: grid; gap: 7px; }
.filters .grow { flex: 1; }
.filters .grow input { width: 100%; }
.detail-tools { padding: 0 20px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f6f8fc; }
.segmented a { min-width: 58px; padding: 6px 10px; border-radius: 7px; color: #59647a; text-align: center; font-weight: 650; }
.segmented a:hover { text-decoration: none; color: var(--primary); }
.segmented a.active { color: #fff; background: var(--primary); }
.account-link { font-weight: 750; font-size: 15px; }
.phone-confirm { border: 0; background: transparent; color: var(--primary); padding: 0; cursor: pointer; font-weight: 750; }
.phone-confirm:hover { text-decoration: underline; }
.phone-confirm:disabled { color: var(--subtle); cursor: wait; text-decoration: none; }
.phone-confirm.plain { color: #344054; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--subtle); }
.actions { display: flex; gap: 10px; }
.actions form { margin: 0; }
.sync-summary { display: grid; grid-template-columns: 1fr 1.5fr 3fr; gap: 1px; background: var(--line); overflow: hidden; }
.sync-summary > div { background: #fff; padding: 18px 20px; }
.sync-summary span, .sync-summary strong { display: block; }
.sync-summary span { color: var(--subtle); font-size: 12px; margin-bottom: 7px; }
.sync-summary strong { font-size: 14px; overflow-wrap: anywhere; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted, .subtle { color: var(--subtle); }
.inactive-row { opacity: .58; }
.compact-table td, .compact-table th { padding-top: 11px; padding-bottom: 11px; }
.users-create { align-items: end; }
.users-create input { min-width: 210px; }
.inline-password { display: flex; gap: 7px; }
.inline-password input { height: 34px; width: 150px; }
.toast-stack { position: fixed; top: 76px; right: 24px; z-index: 50; display: grid; gap: 10px; width: min(460px, calc(100vw - 32px)); }
.alert { padding: 13px 16px; margin-bottom: 18px; border-radius: 9px; border: 1px solid; line-height: 1.5; }
.toast-stack .alert { margin: 0; box-shadow: 0 14px 40px rgba(27, 39, 67, .14); animation: toastFade 5.2s ease forwards; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #bce7d4; }
.alert-error { color: #a82738; background: var(--danger-bg); border-color: #f0c0c6; }
@keyframes toastFade {
    0%, 78% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-6px); visibility: hidden; }
}
.empty-state { padding: 48px; text-align: center; }
.empty-state h1 { margin-top: 0; }
.empty-state p { color: var(--subtle); margin-bottom: 24px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #e5eaff, #f5f7fb 45%); }
.login-card { width: min(410px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 22px 70px rgba(29,45,86,.14); padding: 36px; }
.login-card h1 { text-align: center; margin: 14px 0 7px; font-size: 25px; }
.login-card > .subtle { text-align: center; display: block; margin-bottom: 24px; }
.login-mark { width: 52px; height: 52px; margin: 0 auto; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3455db, #7487ed); font-size: 25px; font-weight: 800; box-shadow: 0 9px 22px rgba(52,85,219,.25); }
.stack-form { display: grid; gap: 17px; }
.stack-form label { display: grid; gap: 8px; font-weight: 650; color: #3f4757; }
.stack-form input { width: 100%; }

/* 工作台三栏：左看板、中客户、右批量查询 */
.unified-board {
    min-height: calc(100vh - 76px);
    grid-template-columns: 380px minmax(600px, 1fr) 340px;
    gap: 14px;
    align-items: start;
}
.left-panel { display: grid; gap: 12px; }
.board-title { min-height: 58px; padding: 9px 2px 5px; display: flex; align-items: center; }
.board-title h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.center-panel, .query-panel { min-width: 0; }
.center-panel .customer-list-card { min-height: calc(100vh - 76px); margin-bottom: 0; }
.customer-list-heading { min-height: 68px; align-items: center; padding: 13px 14px; }
.customer-list-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.owner-filter-form { margin: 0; }
.owner-filter-form select { max-width: 132px; }
.query-panel { position: sticky; top: 66px; }
.batch-query-card { height: calc(100vh - 80px); min-height: 620px; margin-bottom: 0; display: flex; flex-direction: column; overflow: hidden; border-color: #cfd8ff; }
.batch-query-heading { padding: 16px 16px 9px; }
.batch-query-form { padding: 8px 16px 16px; display: flex; flex: 1; flex-direction: column; gap: 14px; min-height: 0; }
.batch-system-field { gap: 8px; }
.batch-system-field legend { margin-bottom: 9px; }
.batch-system-field .radio-card { min-width: 0; height: 44px; padding: 0 10px; gap: 8px; font-size: 14px; }
.batch-system-field .radio-card input { width: 17px; height: 17px; min-width: 17px; }
.batch-phone-field { min-height: 0; display: flex; flex: 1; flex-direction: column; gap: 8px; color: #495368; font-size: 13px; font-weight: 700; }
.batch-phone-field textarea { width: 100%; min-height: 0; flex: 1; resize: vertical; color: #172033; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; font-weight: 600; }
.batch-phone-field textarea::placeholder { color: #a0a8b7; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; font-weight: 400; }
.batch-query-status { min-height: 36px; display: grid; gap: 3px; color: var(--subtle); font-size: 12px; line-height: 1.45; }
.batch-query-status [data-batch-progress] { color: var(--primary); font-weight: 700; overflow-wrap: anywhere; }
.batch-query-status .has-error { color: var(--danger); }
.batch-query-submit { min-height: 42px; }

@media (max-width: 1500px) {
    .unified-board { grid-template-columns: 320px minmax(0, 1fr) 300px; }
    .customer-card { grid-template-columns: 1fr; align-items: stretch; }
    .customer-actions { justify-content: flex-start; }
    .batch-system-field { grid-template-columns: 1fr; }
    .batch-system-field legend { grid-column: 1; }
}

@media (max-width: 1180px) {
    .unified-board { grid-template-columns: 300px minmax(0, 1fr); }
    .query-panel { position: static; grid-column: 1 / -1; }
    .batch-query-card { height: auto; min-height: 0; }
    .batch-phone-field textarea { min-height: 300px; }
}

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .workbench-grid { grid-template-columns: 1fr; }
    .content-grid { grid-template-columns: 1fr; }
    .unified-board { grid-template-columns: 1fr; }
    .customer-list { grid-template-columns: 1fr; }
    .customer-card { grid-template-columns: 1fr; align-items: stretch; }
    .customer-actions { justify-content: flex-start; }
    .board-search-form { grid-template-columns: 1fr; }
    .board-search-form .radio-field { min-width: 0; }
    .center-panel .customer-list-card { min-height: 0; }
    .customer-list-heading { align-items: stretch; flex-direction: column; }
    .customer-list-tools { justify-content: flex-start; }
    .quick-query-form { grid-template-columns: 1fr; }
    .mini-search-form { grid-template-columns: 1fr 1fr auto; }
    .users-create { flex-wrap: wrap; }
    .sync-summary { grid-template-columns: 1fr 1fr; }
    .sync-summary .wide { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .container { width: min(100% - 20px, 1180px); }
    .topbar { height: auto; position: static; }
    .nav-wrap { min-height: 62px; flex-wrap: wrap; gap: 7px 14px; padding: 10px 0; }
    .brand { width: 100%; }
    .top-sync-clock { position: static; transform: none; order: 4; width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px 14px; }
    nav { order: 3; overflow-x: auto; }
    nav a { padding: 8px 10px; }
    .user-menu { margin-left: auto; position: absolute; right: 12px; top: 18px; }
    .heading-row { align-items: stretch; flex-direction: column; }
    .customer-list-card .card-heading { align-items: stretch; flex-direction: column; }
    .pager { justify-content: center; }
    .toast-stack { top: 12px; right: 10px; left: 10px; width: auto; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 120px; padding: 16px; }
    .stat-card strong { font-size: 31px; }
    .toolbar, .create-form, .filters { align-items: stretch; flex-direction: column; }
    .mini-search-form { grid-template-columns: 1fr; }
    .account-result-head, .program-status-item { align-items: stretch; flex-direction: column; }
    .account-badges { justify-content: flex-start; }
    .create-form input, .users-create input { min-width: 0; width: 100%; }
    .search-panel input { min-width: 0; }
    .actions { width: 100%; }
    .actions .button { flex: 1; }
    .sync-summary { grid-template-columns: 1fr; }
    .sync-summary .wide { grid-column: auto; }
    .login-card { padding: 28px 22px; }
}
