/* ==========================================================
   京启科技 · 人事销售管理后台
   ========================================================== */
:root {
    --brand: #2f5ada;
    --brand-dark: #24479f;
    --brand-soft: #eef2ff;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1b2233;
    --text-2: #5b6478;
    --text-3: #98a1b3;
    --line: #e8ebf2;
    --green: #16a34a;
    --red: #e03c3c;
    --amber: #d98510;
    --purple: #7c5cd6;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(23, 36, 66, .04), 0 8px 24px rgba(23, 36, 66, .05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ------------------ 框架 ------------------ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 226px;
    flex: 0 0 226px;
    background: #101a33;
    color: #c7d0e3;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 18px;
}

.brand-logo {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f7cff, #2f5ada);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 15px;
    letter-spacing: .5px;
}

.brand-name { color: #fff; font-size: 15px; font-weight: 600; line-height: 1.3; }
.brand-sub { font-size: 11px; color: #6e7c99; letter-spacing: .6px; }

.nav-group { padding: 6px 0; }
.nav-group-title {
    padding: 12px 22px 6px;
    font-size: 11px;
    color: #5b6884;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 10px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    color: #b3bed4;
    transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(47,90,218,.35); }
.nav-item.active svg { opacity: 1; }

.sidebar-foot {
    margin-top: auto;
    padding: 14px 18px 18px;
    font-size: 11.5px;
    color: #52607d;
    border-top: 1px solid rgba(255,255,255,.06);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 62px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-2); }

.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
}

.content { padding: 22px 26px 40px; }

/* ------------------ 卡片 ------------------ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(232,235,242,.8);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.card-hd h3 { font-size: 14.5px; }
.card-hd .hint { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.card-bd { padding: 18px 20px; }
.card-bd.tight { padding: 0; }

/* ------------------ KPI ------------------ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.kpi {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(232,235,242,.8);
    position: relative;
    overflow: hidden;
}
.kpi-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.kpi-sub { font-size: 12px; color: var(--text-3); }
.kpi-sub b { color: var(--text-2); font-weight: 600; }
.kpi-bar { height: 4px; border-radius: 4px; background: #eef1f7; margin-top: 12px; overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.kpi .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* ------------------ 表格 ------------------ */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
    text-align: left;
    padding: 11px 14px;
    background: #fafbfd;
    color: var(--text-2);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}
table.table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f3f8;
    color: var(--text);
    vertical-align: middle;
}
table.table tbody tr:hover td { background: #fafbff; }
table.table .num { font-variant-numeric: tabular-nums; }
table.table .muted { color: var(--text-3); }
table.table .strong { font-weight: 600; }
table.table tfoot td { background: #fafbfd; font-weight: 600; border-bottom: none; }
.table-empty { padding: 46px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* ------------------ 徽标 / 标签 ------------------ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 20px;
    font-size: 12px; line-height: 19px;
    background: #f1f3f8; color: var(--text-2);
    white-space: nowrap;
}
.badge.blue { background: #eaf0ff; color: var(--brand); }
.badge.green { background: #e8f7ee; color: var(--green); }
.badge.red { background: #fdecec; color: var(--red); }
.badge.amber { background: #fdf3e3; color: var(--amber); }
.badge.purple { background: #f1ecfd; color: var(--purple); }
.badge.pink { background: #fdeef4; color: #c2417f; }
.badge.gray { background: #f2f4f8; color: var(--text-2); }

/* ------------------ 按钮 ------------------ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff; color: var(--text-2);
    font-size: 13px; cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn:hover { border-color: #cfd6e6; color: var(--text); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-link { border: none; background: none; color: var(--brand); padding: 0 4px; height: auto; cursor: pointer; font-size: 12.5px; font-family: inherit; }
.btn-link.danger { color: var(--red); }
.btn-link:hover { text-decoration: underline; }

/* ------------------ 表单 / 筛选 ------------------ */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
}
.filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input, .select, textarea.input {
    height: 34px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47,90,218,.1);
}
textarea.input { height: auto; padding: 10px 11px; line-height: 1.7; resize: vertical; }
.filter-label { font-size: 12.5px; color: var(--text-3); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-2); }
.field label i { color: var(--red); font-style: normal; margin-left: 2px; }
.field .input, .field .select { width: 100%; }
.field-hint { font-size: 11.5px; color: var(--text-3); }

/* ------------------ 分页 ------------------ */
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 30px; height: 30px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--line);
    font-size: 12.5px; color: var(--text-2); background: #fff;
}
.pager .active span, .pager span.current {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.pager .disabled span { color: #cfd6e6; }
.pager-total { font-size: 12.5px; color: var(--text-3); margin-left: auto; }

/* ------------------ 图表 ------------------ */
.chart-box { width: 100%; }
.chart-svg { width: 100%; height: 240px; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); padding: 0 2px 4px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-name { width: 78px; flex: 0 0 78px; font-size: 12.5px; color: var(--text-2); }
.bar-track { flex: 1; height: 8px; background: #f1f3f8; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #5b83ff, #2f5ada); }
.bar-val { width: 84px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); }

/* ------------------ 考勤表 ------------------ */
.att-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.att-table th, .att-table td {
    border: 1px solid #eef1f7;
    text-align: center;
    padding: 0;
    height: 30px;
    min-width: 26px;
}
.att-table th { background: #fafbfd; color: var(--text-2); font-weight: 500; font-size: 11.5px; height: 32px; }
.att-table th.weekend, .att-table td.weekend { background: #fcfcfe; }
.att-table td.name-cell {
    text-align: left; padding: 0 10px; position: sticky; left: 0; background: #fff;
    font-weight: 500; min-width: 84px; z-index: 2; border-right: 1px solid var(--line);
}
.att-table th.name-cell { position: sticky; left: 0; background: #fafbfd; z-index: 3; }
.att-cell { cursor: pointer; user-select: none; transition: background .12s; font-size: 11.5px; }
.att-cell:hover { background: #eef3ff; }
.att-cell.has { font-weight: 600; }
.att-ok { color: #16a34a; }
.att-half { color: #d98510; }
.att-rest { color: #98a1b3; }
.att-leave { color: #e03c3c; }
.att-legal { color: #7c5cd6; }
.att-late { color: #d97706; }
.att-none { color: #d5dae5; }
.att-sum { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------ 弹窗 ------------------ */
.modal-mask {
    position: fixed; inset: 0; background: rgba(16,26,51,.42);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff; border-radius: 16px; width: 620px; max-width: 100%;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(16,26,51,.25);
}
.modal.wide { width: 760px; }
.modal-hd { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-hd h3 { font-size: 15px; }
.modal-close { border: none; background: none; font-size: 20px; line-height: 1; color: var(--text-3); cursor: pointer; }
.modal-bd { padding: 20px 22px; overflow-y: auto; }
.modal-ft { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ------------------ 提示 ------------------ */
.toast {
    position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-20px);
    background: #16213a; color: #fff; padding: 9px 18px; border-radius: 10px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b42323; }

/* ------------------ 登录页 ------------------ */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 15% 0%, #22356b 0%, #0e1730 55%, #0b1226 100%);
    padding: 24px;
}
.login-card {
    width: 380px; background: #fff; border-radius: 18px; padding: 34px 32px 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.login-card h2 { font-size: 20px; margin-bottom: 6px; }
.login-card p.sub { color: var(--text-3); font-size: 13px; margin: 0 0 24px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; justify-content: center; height: 40px; font-size: 14px; margin-top: 8px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }

/* ------------------ 日报 ------------------ */
.report-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.report-paper {
    background: #fff; border-radius: var(--radius); padding: 26px 30px;
    box-shadow: var(--shadow); line-height: 1.9; font-size: 13.5px; white-space: pre-wrap;
}
.report-head { text-align: center; border-bottom: 1px dashed var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.report-head h2 { font-size: 18px; }
.report-head .meta { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-mini div { background: #fafbfd; border-radius: 10px; padding: 10px 12px; }
.stat-mini span { display: block; font-size: 11.5px; color: var(--text-3); }
.stat-mini b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ------------------ 打印 ------------------ */
@media print {
    .sidebar, .topbar, .toolbar, .pager, .no-print, .btn { display: none !important; }
    body, .content { background: #fff !important; padding: 0 !important; }
    .card { box-shadow: none; border: none; }
    .report-paper { box-shadow: none; padding: 0; }
}

@media (max-width: 1100px) {
    .report-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .content { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ------------------ 布局工具 ------------------ */
.row-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.row-2.even { grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.stack-8 > * + * { margin-top: 8px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

@media (max-width: 1180px) {
    .row-2, .row-2.even, .row-3 { grid-template-columns: 1fr; }
}

/* ==========================================================
   销售端（销售自行登录填报）
   ========================================================== */
.sales-body { background: #f2f4f9; }

.sales-top {
    background: linear-gradient(125deg, #1b2b52 0%, #2f5ada 100%);
    color: #fff;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.sales-top-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.sales-top-titles { flex: 1; min-width: 0; }
.sales-top-title { font-size: 15.5px; font-weight: 600; letter-spacing: .3px; }
.sales-top-sub { font-size: 11.5px; color: rgba(255,255,255,.68); margin-top: 2px; }
.sales-top-user { display: flex; align-items: center; gap: 8px; }
.sales-chip {
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12.5px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-ghost {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.24);
    color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.3); }

.sales-main { max-width: 1240px; margin: 0 auto; padding: 18px 20px 40px; }

.sales-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.sales-kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.sales-kpi-label { font-size: 12px; color: var(--text-3); }
.sales-kpi-val {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.6px;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.sales-kpi-val small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.sales-kpi-val.green { color: var(--green); }

.sales-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 16px;
    align-items: start;
}
.sales-col-form { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 78px; }

.sales-form { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.sales-form-card .card-hd { border-bottom: 1px solid var(--line); }
.sales-form textarea.input { resize: vertical; font-family: inherit; line-height: 1.6; }
.btn-block { width: 100%; justify-content: center; height: 40px; font-size: 14px; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-list-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.bar-list-top b { color: var(--text); font-weight: 600; }
.bar-list-track { height: 6px; border-radius: 6px; background: #eef1f7; overflow: hidden; }
.bar-list-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4f7cff, #2f5ada); }

/* 销售端登录 */
.sales-login-body {
    min-height: 100vh;
    background: linear-gradient(160deg, #16223d 0%, #23386b 55%, #2f5ada 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}
.sales-login-wrap { width: 100%; max-width: 400px; }
.sales-login-head { text-align: center; color: #fff; margin-bottom: 18px; }
.sales-login-head .brand-logo {
    width: 46px; height: 46px; border-radius: 13px;
    margin: 0 auto 12px; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700;
}
.sales-login-title { font-size: 19px; font-weight: 600; letter-spacing: .5px; }
.sales-login-sub { font-size: 12px; color: rgba(255,255,255,.62); margin-top: 4px; letter-spacing: .4px; }
.sales-login-card {
    background: #fff;
    border-radius: 18px;
    padding: 26px 24px 22px;
    box-shadow: 0 24px 60px rgba(10, 20, 45, .32);
}
.sales-login-card h2 { font-size: 18px; }
.sales-login-card .sub { font-size: 12.5px; color: var(--text-3); margin: 6px 0 18px; line-height: 1.6; }
.sales-login-card form { display: flex; flex-direction: column; gap: 14px; }
.sales-login-back { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.sales-login-back a { color: var(--brand); }

@media (max-width: 980px) {
    .sales-grid { grid-template-columns: 1fr; }
    .sales-col-form { position: static; order: -1; }
    .sales-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .sales-top { padding: 12px 14px; }
    .sales-top-title { font-size: 14px; }
    .sales-top-sub { display: none; }
    .sales-main { padding: 14px 12px 32px; }
    .sales-chip { max-width: 90px; font-size: 12px; }
    .sales-main .card-hd { padding: 14px 14px 10px; }
    .sales-form { padding: 14px; }
    .sales-main .toolbar { padding: 12px 14px; }
    .sales-main .filter { gap: 6px; }
    .sales-main .filter .input[type="date"] { width: 132px; }
}

/* 试岗安排弹窗：人员信息条 */
.assign-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f5f7fc;
    border: 1px solid var(--line);
}
.assign-person b { font-size: 15px; color: var(--text); }

/* ==========================================================
   移动端适配
   ========================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 顶栏左侧结构 + 汉堡按钮（默认桌面隐藏） */
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-toggle {
    display: none;
    width: 38px; height: 38px; flex: 0 0 38px;
    align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--text-2); cursor: pointer;
    padding: 0;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle:active { background: #f3f5fa; }
.sidebar-close {
    display: none;
    margin-left: auto;
    width: 30px; height: 30px;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); color: #c7d0e3;
    border: none; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer;
}
.nav-mask { display: none; }

/* 触屏表格滚动更顺滑 */
.table-wrap { -webkit-overflow-scrolling: touch; }

/* ---------- 平板 / 手机：抽屉侧边栏 ---------- */
@media (max-width: 900px) {
    .topbar { height: 56px; padding: 0 14px; }
    .topbar-left { min-width: 0; }
    .topbar-left > div:last-child { min-width: 0; }
    .topbar-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-sub { font-size: 11px; }
    .topbar-user { display: none; }
    .topbar-right { gap: 8px; flex: 0 0 auto; }
    .nav-toggle { display: inline-flex; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 264px;
        height: 100vh;
        flex: none;
        z-index: 120;
        transform: translateX(-104%);
        transition: transform .26s cubic-bezier(.4, 0, .2, 1);
        box-shadow: 0 0 40px rgba(6, 14, 32, .35);
        overflow-y: auto;
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: inline-flex; }

    .nav-mask {
        display: block;
        position: fixed; inset: 0;
        background: rgba(16, 26, 51, .46);
        z-index: 110;
        opacity: 0; visibility: hidden;
        transition: opacity .22s, visibility .22s;
    }
    body.nav-open .nav-mask { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }

    .content { padding: 14px 14px 32px; }
    .card { border-radius: 12px; }
    .card-hd { padding: 13px 14px; }
    .card-bd { padding: 14px; }

    /* 表格：保持可横向滑动，不挤压变形 */
    table.table { min-width: 680px; font-size: 12.5px; }
    table.table th, table.table td { padding: 10px 12px; }
    .att-table { min-width: 720px; }

    /* 工具栏换行 */
    .toolbar { padding: 12px 14px; gap: 10px; }
    .filter { width: 100%; gap: 6px; }
    .filter .input, .filter .select { flex: 1 1 118px; width: auto !important; min-width: 0; }
    .toolbar > .btn, .toolbar > .btn-primary { width: 100%; justify-content: center; }

    .pager { padding: 12px 14px; }

    /* 弹窗：手机端底部弹出，占满宽度 */
    .modal-mask { padding: 0; align-items: flex-end; }
    .modal {
        width: 100%; max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
    }
    .modal-hd { padding: 15px 16px; }
    .modal-bd { padding: 16px; }
    .modal-ft { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .modal-ft .btn { flex: 1; justify-content: center; height: 40px; }

    /* 报表 / 打印预览 */
    .report-paper { padding: 20px 16px; font-size: 13px; }
    .report-head h2 { font-size: 16px; }

    /* 图表 */
    .chart-svg { height: 200px; }

    /* 登录页 */
    .login-wrap { padding: 18px 14px; }
    .login-card { width: 100%; max-width: 380px; padding: 26px 20px 22px; }
}

/* ---------- 手机竖屏 ---------- */
@media (max-width: 640px) {
    body { font-size: 13.5px; }
    .content { padding: 12px 12px 28px; }

    /* KPI 两列 */
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
    .kpi { padding: 13px 14px; border-radius: 11px; }
    .kpi-label { font-size: 12px; }
    .kpi-val { font-size: 21px; margin: 6px 0 3px; }
    .kpi-sub { font-size: 11px; line-height: 1.5; }

    /* 表单控件加大，避免 iOS 聚焦自动放大 */
    .input, .select, textarea.input { height: 40px; font-size: 16px; }
    textarea.input { height: auto; }
    .filter .input, .filter .select { height: 38px; font-size: 15px; }
    .btn { height: 38px; }
    .btn-sm { height: 34px; font-size: 13px; }
    .btn-link { font-size: 13px; padding: 4px 6px; }

    /* 操作列按钮更易点按 */
    table.table td .btn-link { display: inline-block; padding: 4px 6px; }

    /* 排行条 */
    .bar-name { width: 66px; flex: 0 0 66px; font-size: 12px; }
    .bar-val { width: 62px; font-size: 12px; }
    .bar-row { gap: 8px; }

    .pager a, .pager span { min-width: 28px; height: 28px; font-size: 12px; }
    .pager-total { width: 100%; margin-left: 0; text-align: right; padding-top: 4px; }

    .card-hd h3 { font-size: 13.5px; }
    .card-bd { padding: 12px; }

    /* 销售端 */
    .sales-kpis { gap: 8px; }
    .sales-kpi { padding: 11px 12px; }
    .sales-kpi-val { font-size: 20px; }
    .sales-main .filter .input, .sales-main .filter .select { height: 38px; font-size: 15px; }
}

/* ---------- 超窄屏 ---------- */
@media (max-width: 380px) {
    .topbar-user { display: none; }
    .kpi-val { font-size: 19px; }
    .sidebar { width: 82vw; }
    .modal-ft { flex-direction: column-reverse; }
}

/* ---------- 横屏矮屏 ---------- */
@media (max-height: 480px) and (max-width: 900px) {
    .modal { max-height: 96vh; }
    .sidebar-foot { display: none; }
}
