/* ============================================================
   客户运维记录系统 · Metro / Modern 扁平风格样式
   ============================================================ */

:root {
    --accent: #0078d4;
    --accent-dark: #005a9e;
    --accent-light: #deecf9;
    --ink: #1f1f1f;
    --ink-2: #4d4d4d;
    --line: #d6d6d6;
    --bg: #f3f3f3;
    --panel: #ffffff;
    --sidebar: #1b1b1f;
    --sidebar-hover: #2b2b31;
    --danger: #c42b1c;
    --ok: #107c10;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- 框架 ---------- */

.app-shell {
    display: flex;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    width: 214px;
    flex: 0 0 214px;
    height: 100vh;
    background: var(--sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    color: #fff;
    border-bottom: 1px solid #303036;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 12px;
    height: 12px;
    background: var(--accent);
    display: inline-block;
}

.brand-text {
    font-size: 15px;
    letter-spacing: 0.5px;
}

.nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #d9d9d9;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent);
    color: #fff;
    border-left-color: #ffffff;
}

.nav-glyph {
    font-size: 14px;
    opacity: 0.85;
    width: 16px;
    text-align: center;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.topbar {
    height: 52px;
    flex: 0 0 52px;
    background: #d3e3fd;
    border-bottom: 1px solid #bcd2f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-name {
    color: var(--ink-2);
}

.logout-form {
    margin: 0;
}

.content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px;
    overflow: auto;
}

.statusbar {
    flex: 0 0 30px;
    height: 30px;
    background: #d3e3fd;
    border-top: 1px solid #bcd2f0;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    font-size: 12px;
    color: #8a8a8a;
}

.statusbar .status-left { justify-self: start; white-space: nowrap; }
.statusbar .status-right { justify-self: end; white-space: nowrap; }
.statusbar .status-center {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.statusbar .status-center > span { overflow: hidden; text-overflow: ellipsis; }
.statusbar .status-sep { color: #c0ccda; }

@media (max-width: 760px) {
    .statusbar .status-center { display: none; }
}

/* ---------- 首页磁贴 ---------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.tile {
    display: block;
    position: relative;
    padding: 22px 20px 20px;
    min-height: 132px;
    color: #fff;
    background: var(--accent);
    border-radius: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tile:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.tile.t-1 { background: #0078d4; }
.tile.t-2 { background: #107c10; }
.tile.t-3 { background: #8764b8; }
.tile.t-4 { background: #c19c00; }

.tile-icon {
    font-size: 22px;
    opacity: 0.9;
    display: block;
    margin-bottom: 16px;
}

.tile-title {
    font-size: 18px;
    font-weight: 600;
    display: block;
}

.tile-desc {
    font-size: 12px;
    opacity: 0.85;
    display: block;
    margin-top: 6px;
}

.hello {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--ink-2);
}

/* ---------- 卡片 / 面板 ---------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ececec;
}

.add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* ---------- 表单控件 ---------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 12px 14px;
    margin-bottom: 0;
}

.toolbar .spacer {
    flex: 1 1 auto;
}

label.field-label,
.lbl {
    color: var(--ink-2);
    font-size: 13px;
    white-space: nowrap;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
select,
textarea {
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #c8c8c8;
    border-radius: 0;
    padding: 6px 8px;
    min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
}

textarea {
    width: 100%;
    resize: vertical;
    line-height: 1.6;
}

select {
    min-width: 120px;
}

.w90 { width: 90px; }
.w100 { width: 100px; }
.w110 { width: 110px; }
.w120 { width: 120px; }
.w140 { width: 140px; }
.w160 { width: 160px; }
.w200 { width: 200px; }
.w240 { width: 240px; }
.w320 { width: 320px; }

/* 客户列表内嵌的“省/市/城区”三连输入 */
.region-cell {
    display: flex;
    gap: 4px;
    min-width: 0;
}
.region-cell input {
    width: 100%;
    min-width: 0;
    padding: 4px 6px;
    font-size: 12px;
}

/* 客户基本信息：12 栅格表单，字段按比例对齐 */
.cust-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px 12px;
    margin-bottom: 14px;
}
.cust-grid input, .cust-grid select, .cust-grid textarea {
    width: 100%;
    min-width: 0;
    height: 38px;
}
.cust-grid .c2 { grid-column: span 2; }
.cust-grid .c3 { grid-column: span 3; }
.cust-grid .c4 { grid-column: span 4; }
.cust-grid .c6 { grid-column: span 6; }
.cust-grid .c1 { grid-column: span 1; }
.cust-grid .c5 { grid-column: span 5; }
.cust-grid .c7 { grid-column: span 7; }
.cust-grid .c8 { grid-column: span 8; }
.cust-grid .c9 { grid-column: span 9; }
.cust-grid .c10 { grid-column: span 10; }
.cust-grid .c11 { grid-column: span 11; }
.cust-grid .c12 { grid-column: span 12; }

/* 窄窗口（含左侧菜单后的内容区不足 700px）改为两列表单，避免标签与输入框被压扁 */
@media (max-width: 1000px) {
    .cust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cust-grid .c1, .cust-grid .c2, .cust-grid .c3, .cust-grid .c4, .cust-grid .c5 { grid-column: span 1; }
    .cust-grid .c6, .cust-grid .c7, .cust-grid .c8, .cust-grid .c9, .cust-grid .c10, .cust-grid .c11, .cust-grid .c12 { grid-column: span 2; }
}
@media (max-width: 560px) {
    .cust-grid { grid-template-columns: 1fr; }
    .cust-grid [class*="c"] { grid-column: span 1; }
}

/* 单据页“新增客户”弹窗：两列对齐 */
.modal .cust-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}
.modal .cust-form-grid .full { grid-column: span 2; }
.modal .cust-form-grid label {
    display: block;
    font-size: 12px;
    color: #5b6472;
    margin-bottom: 4px;
}
.modal .cust-form-grid input {
    width: 100%;
    min-width: 0;
    height: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 0;
    cursor: pointer;
    line-height: 1.2;
}

.btn:hover {
    background: var(--accent-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: #6b6b6b;
}

.btn-secondary:hover {
    background: #4f4f4f;
}

.btn-ghost {
    background: #fff;
    color: var(--ink-2);
    border-color: var(--line);
}

.btn-ghost:hover {
    background: #f0f0f0;
    color: var(--ink);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #9d2118;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* 统计口径切换：当前选中态 */
.btn-on {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}
.btn-on:hover { background: var(--accent-dark); color: #fff; }

.btn-mini {
    padding: 3px 8px;
    font-size: 12px;
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid var(--accent);
}

.btn-mini:hover {
    background: var(--accent);
    color: #fff;
}

.icon-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.icon-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 0;
}

.icon-btn:hover {
    background: var(--accent-dark);
}

.icon-btn.danger {
    background: #d13438;
}

.icon-btn.danger:hover {
    background: #a4262c;
}

/* ---------- 表格 ---------- */

.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: none;
    overflow-x: auto;
}

table.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.grid th {
    background: #2f7cf6;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 9px 8px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
}

table.grid td {
    border-bottom: 1px solid #eaeaea;
    border-right: 1px solid #f0f0f0;
    padding: 8px;
    vertical-align: middle;
}

table.grid tbody tr:nth-child(even) {
    background: #fafafa;
}

table.grid tbody tr:hover {
    background: var(--accent-light);
}

table.grid td.center { text-align: center; }
table.grid td.nowrap { white-space: nowrap; }
table.grid td.ellipsis {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table.grid input[type="text"] {
    width: 100%;
    padding: 4px 6px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fafafa;
    border: 1px solid var(--line);
    border-top: 1px solid #eaeaea;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--ink-2);
}

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 12px;
}

.pager a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.pager .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pager .disabled {
    color: #bdbdbd;
    background: #fafafa;
}

.empty {
    padding: 40px;
    text-align: center;
    color: #9a9a9a;
    background: #fff;
    border: 1px solid var(--line);
    border-top: none;
}

/* ---------- 状态标签 ---------- */

.tag {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    color: #fff;
    background: #8a8a8a;
    white-space: nowrap;
}

.tag-ok { background: var(--ok); }
.tag-skip { background: #8a6d3b; }
.tag-fail { background: var(--danger); }

/* ---------- 编辑表单 ---------- */

.form-grid {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) 132px minmax(0, 1fr);
    gap: 12px 10px;
    align-items: center;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-grid .lbl {
    text-align: right;
    padding-right: 4px;
}

.field-with-add {
    display: flex;
    gap: 6px;
    align-items: center;
}

.field-with-add select {
    flex: 1 1 auto;
    min-width: 0;
}

.field-with-add .btn-mini {
    flex: 0 0 auto;
    height: 30px;
}

.hint {
    font-size: 12px;
    color: var(--danger);
    margin-top: -4px;
    grid-column: 2 / -1;
}

.form-stack {
    display: grid;
    gap: 8px;
}

.inline-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lbl-block {
    color: var(--ink-2);
    font-size: 13px;
    text-align: left;
    display: block;
}

.val-summary {
    margin-top: 4px;
}

.val-summary ul {
    margin: 4px 0 0 18px;
    padding: 0;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eaeaea;
}

/* ---------- 弹窗（原生 dialog） ---------- */

dialog.modal {
    border: none;
    border-top: 4px solid var(--accent);
    padding: 0;
    width: 460px;
    max-width: 92vw;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

dialog.modal::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.modal-head {
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
}

.modal-body {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.modal-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px;
    align-items: center;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #eaeaea;
}

/* ---------- 提示条 ---------- */

.toast {
    background: #e8f4ea;
    border-left: 3px solid var(--ok);
    color: #0f5a10;
    padding: 9px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}

.errors {
    background: #fdecea;
    border-left: 3px solid var(--danger);
    color: #8a1c12;
    padding: 9px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}

.errors ul {
    margin: 4px 0 0 18px;
    padding: 0;
}

/* ---------- 登录页 ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    background: #0b7ec2;
}

.login-hero {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-hero .ring {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.login-hero .ring.r2 { width: 300px; height: 300px; }
.login-hero .ring.r3 { width: 200px; height: 200px; }

.login-hero .core {
    position: relative;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
}

.login-hero .dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.75;
}

.login-hero .node {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0b7ec2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-card {
    width: 380px;
    flex: 0 0 380px;
    background: #fff;
    align-self: center;
    margin: 0 60px 0 0;
    padding: 30px 30px 26px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.login-avatar {
    width: 74px;
    height: 74px;
    margin: 0 auto 20px;
    line-height: 0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    margin-bottom: 22px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #b9d3ea;
}

.login-divider span {
    white-space: nowrap;
}

.login-field {
    display: flex;
    align-items: center;
    border: 1px solid #9dc3e6;
    background: #fff;
    margin-bottom: 14px;
    height: 44px;
}

.login-field .ico {
    width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
}

.login-field input {
    flex: 1 1 auto;
    border: none;
    outline: none;
    height: 100%;
    font-size: 14px;
    padding: 0 8px;
}

.login-field input:focus {
    outline: none;
}

.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 26px;
}

.login-actions .btn {
    flex: 1 1 0;
    padding: 11px 0;
    font-size: 14px;
}

.login-error {
    background: #fdecea;
    color: #8a1c12;
    font-size: 12px;
    padding: 8px 10px;
    margin-bottom: 14px;
    border-left: 3px solid var(--danger);
}

.login-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

@media (max-width: 860px) {
    .login-hero { display: none; }
    .login-card { margin: 40px auto; width: 92%; flex: 0 0 auto; }
}

@media (max-width: 780px) {
    .sidebar { width: 170px; flex-basis: 170px; }
    .form-grid { grid-template-columns: 110px minmax(0, 1fr); }
    .form-grid .lbl { text-align: left; }
}

/* ============================================================
   V1.1 视觉升级：渐变侧栏、圆角卡片、彩色图标、批量操作区
   ============================================================ */

:root {
    --accent: #2f7cf6;
    --accent-2: #7b61ff;
    --accent-dark: #1f5fd0;
    --radius: 12px;
    --shadow-sm: 0 2px 10px rgba(20, 40, 80, 0.06);
    --shadow-md: 0 8px 24px rgba(20, 40, 80, 0.10);
}

body {
    background: #f4f7fb;
}

.app-shell {
    background: linear-gradient(160deg, #f7faff 0%, #eef3fb 100%);
}

.sidebar {
    width: 230px;
    flex: 0 0 230px;
    background: linear-gradient(178deg, #1e2b46 0%, #274160 46%, #2a4b74 100%);
    box-shadow: 6px 0 20px rgba(12, 24, 48, 0.16);
}

.brand {
    padding: 20px 18px 16px;
    justify-content: center;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.6px;
    background: linear-gradient(90deg, #8ab6ff, #cfb0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav {
    padding: 12px 0 20px;
    gap: 2px;
}

.nav-item {
    margin: 2px 10px;
    padding: 11px 12px;
    border-left: none;
    border-radius: 10px;
    color: #b8c6db;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(47, 124, 246, 0.95), rgba(123, 97, 255, 0.9));
    box-shadow: 0 6px 18px rgba(47, 124, 246, 0.35);
    color: #fff;
    border-left-color: transparent;
}

.nav-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 10px rgba(4, 18, 44, 0.22);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    opacity: 1;
}

.nav-glyph svg {
    width: 17px;
    height: 17px;
}

.glyph-svg {
    display: block;
}

.nav-sub {
    margin: 0 10px 6px 36px;
    padding-left: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    display: none;
    flex-direction: column;
    gap: 2px;
}

.nav-group.open > .nav-sub {
    display: flex;
}

.nav-group {
    display: block;
}

.nav-row {
    display: flex;
    align-items: center;
}

.nav-row .nav-item {
    flex: 1 1 auto;
    margin-right: 0;
}



.nav-sub-item {
    font-size: 12px;
    color: #8ea2bd;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.nav-sub-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    text-decoration: none;
}

.nav-sub-item.on {
    color: #fff;
    background: rgba(47, 124, 246, 0.38);
}

.topbar {
    height: 52px;
    flex: 0 0 52px;
    background: #d3e3fd;
    backdrop-filter: none;
    border-bottom: 1px solid #bcd2f0;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.05);
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.avatar {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 3px 10px rgba(47, 124, 246, 0.3);
}

.statusbar {
    background: #d3e3fd;
    border-top: 1px solid #bcd2f0;
}

.content {
    padding: 20px;
}

/* 磁贴 */

.tiles {
    gap: 16px;
}

.tile {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.tile.t-1 { background: linear-gradient(140deg, #2f7cf6, #4facfe); }
.tile.t-2 { background: linear-gradient(140deg, #12b886, #43e97b); }
.tile.t-3 { background: linear-gradient(140deg, #a06cf7, #c471ed); }
.tile.t-4 { background: linear-gradient(140deg, #f5a623, #ffcd83); }
.tile.t-5 { background: linear-gradient(140deg, #7b61ff, #9d8bff); }

.tile-icon {
    margin-bottom: 14px;
}

.tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.10));
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 18px rgba(6, 24, 62, 0.20);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.tile-icon svg {
    width: 26px;
    height: 26px;
}

/* 面板 / 工具条 */

.panel,
.toolbar {
    border: 1px solid rgba(20, 40, 80, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel {
    padding: 16px 18px;
}

.toolbar {
    padding: 14px 16px;
}

.panel-title {
    border-bottom: 1px solid rgba(20, 40, 80, 0.07);
}

/* 按钮：统一圆角渐变，工具条内等宽 */

.btn {
    border-radius: 9px;
    padding: 8px 18px;
    font-weight: 500;
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
    box-shadow: 0 3px 10px rgba(47, 124, 246, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 124, 246, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #8494a8);
    box-shadow: 0 3px 10px rgba(100, 116, 139, 0.22);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #64748b, #8494a8);
}

.btn-ghost {
    background: #fff;
    color: var(--ink-2);
    border-color: rgba(20, 40, 80, 0.14);
    box-shadow: none;
}

.btn-ghost:hover {
    background: #f5f8fd;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: linear-gradient(135deg, #e04242, #d13438);
}

.btn-mini {
    border-radius: 7px;
    box-shadow: none;
}

/* 工具条按钮等宽等色 */

.btn-tool {
    min-width: 120px;
    width: 120px;
    padding-left: 0;
    padding-right: 0;
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
    color: #fff;
    border: none;
}

/* 日期区间等内联组合不被换行拆开 */

.inline-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-tool:hover {
    color: #fff;
}

.icon-btn {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(47, 124, 246, 0.2);
}

/* 表格 */

.table-wrap {
    border: 1px solid rgba(20, 40, 80, 0.08);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-sm);
}

table.grid th {
    background: #2f7cf6;
}

table.grid tbody tr:hover {
    background: #eef5ff;
}

input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.summary-row {
    background: #fbfdff;
    border: 1px solid rgba(20, 40, 80, 0.08);
    border-top: 1px solid rgba(20, 40, 80, 0.08);
    border-radius: 0 0 var(--radius) var(--radius);
}

pager a {
    border-radius: 6px;
}

.page-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-2);
}

.page-size select {
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 76px;
}

/* 查询统计 */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    background: #fff;
    border: 1px solid rgba(20, 40, 80, 0.08);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
    font-size: 12px;
    color: #8a97a8;
    letter-spacing: 0.4px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 6px;
    background: linear-gradient(90deg, #2f7cf6, #7b61ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-card .stat-unit {
    font-size: 12px;
    color: #8a97a8;
    margin-left: 4px;
}

.stat-card.c-2 { border-left-color: #12b886; }
.stat-card.c-3 { border-left-color: #ffb020; }
.stat-card.c-4 { border-left-color: #7b61ff; }

.seg {
    display: inline-flex;
    border: 1px solid rgba(20, 40, 80, 0.12);
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
}

.seg a {
    padding: 7px 16px;
    font-size: 13px;
    color: var(--ink-2);
}

.seg a.on {
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
    color: #fff;
}

.seg a:hover {
    text-decoration: none;
}

/* 弹窗 */

dialog.modal {
    border-radius: var(--radius);
    border-top: 4px solid var(--accent);
    box-shadow: 0 18px 50px rgba(12, 24, 48, 0.35);
}

/* 登录页微调 */

.login-page {
    background: linear-gradient(135deg, #0b5fb0 0%, #0b7ec2 45%, #12a1d9 100%);
}

.login-card {
    border-radius: 16px;
}

/* ---------- 打印 ---------- */

@media print {
    .sidebar, .topbar, .statusbar, .no-print { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
}

/* ---------- 登录页 V1.2：点阵网格渐变背景 + 透明 logo ---------- */

.login-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 520px at 4% -10%, rgba(34, 211, 238, 0.85) 0%, rgba(34, 211, 238, 0) 58%),
        radial-gradient(820px 480px at 100% 2%, rgba(168, 85, 247, 0.9) 0%, rgba(168, 85, 247, 0) 62%),
        radial-gradient(1100px 640px at 50% 126%, rgba(37, 99, 235, 0.95) 0%, rgba(37, 99, 235, 0) 72%),
        linear-gradient(118deg, #0b3fa6 0%, #1f74ff 46%, #6a4bff 100%);
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1.4px);
    background-size: 17px 17px;
    opacity: 0.42;
    -webkit-mask-image: radial-gradient(135% 100% at 30% -10%, #000 30%, transparent 82%);
    mask-image: radial-gradient(135% 100% at 30% -10%, #000 30%, transparent 82%);
    pointer-events: none;
}

.login-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: repeating-linear-gradient(56deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 9px);
    opacity: 0.3;
    pointer-events: none;
}

.login-hero,
.login-card {
    position: relative;
    z-index: 1;
}

.login-hero .ring {
    border-color: rgba(255, 255, 255, 0.35);
}

.login-hero .core {
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18));
    box-shadow: 0 0 60px rgba(180, 220, 255, 0.45);
}

.login-card {
    border-radius: 20px;
    box-shadow: 0 26px 60px rgba(6, 24, 70, 0.34);
}

.login-logo {
    display: block;
    width: 118px;
    height: auto;
    margin: 0 auto 14px;
}

/* ---------- 登录页 V3：蓝白商务风（与内页一致、控件居中、适配手机浏览器） ---------- */

body.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: #ffffff;
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    background: #2a5fd0 url("../img/login-bg.jpg") center / cover no-repeat fixed;
    overflow-x: hidden;
}

/* 背景图已由 body 承载，旧的网格/光斑层隐藏 */
.login-bg {
    display: none;
}

.login-shell {
    width: 100%;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 40px 18px calc(26px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.login-brand {
    text-align: center;
    width: 100%;
    max-width: 470px;
    box-sizing: border-box;
}

.login-brand .login-logo {
    display: block;
    width: 92px;
    max-width: 40%;
    height: auto;
    margin: 0 auto 14px;
}

.login-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
    text-shadow: 0 2px 16px rgba(8, 26, 70, 0.45);
}

.login-subtitle {
    margin: 10px 0 0;
    font-size: 12px;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.86);
    text-shadow: 0 1px 10px rgba(8, 26, 70, 0.35);
    overflow-wrap: anywhere;
}

.login-card {
    flex: 0 0 auto;
    margin: 0 auto;
    width: 100%;
    max-width: 372px;
    box-sizing: border-box;
    padding: 26px 26px 24px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(14, 52, 106, 0.46), rgba(8, 32, 74, 0.34));
    border: 1px solid rgba(168, 216, 255, 0.35);
    box-shadow: 0 24px 60px rgba(4, 18, 48, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.20), inset 0 0 40px rgba(120, 190, 255, 0.10);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.login-divider {
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.login-divider::before,
.login-divider::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent) !important;
}

.login-field {
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.10);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-field:focus-within {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(160, 226, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(130, 210, 255, 0.28), 0 0 18px rgba(120, 205, 255, 0.35);
}

.login-field .ico {
    width: 40px;
    flex: 0 0 40px;
}

.login-field input {
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 0.4px;
}

.login-field input::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

.login-field input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0 999px rgba(12, 44, 92, 0.9) inset;
}

.login-actions {
    gap: 10px;
    margin-top: 22px;
}

.login-btn,
.login-btn-ghost {
    flex: 1 1 0;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-btn {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #2f7cf6, #1f66dd);
    box-shadow: 0 8px 18px rgba(47, 124, 246, 0.32);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(47, 124, 246, 0.4);
}

.login-btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #eaf3ff;
}

.login-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.login-foot {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}

.login-demo-hint {
    margin-top: 14px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(170, 230, 255, 0.55);
    background: rgba(120, 200, 255, 0.14);
    color: #eaf8ff;
    font-size: 13px;
    text-align: center;
    letter-spacing: .2px;
}

.login-demo-hint b {
    color: #ffd479;
    font-weight: 600;
    letter-spacing: .5px;
}

.login-error {
    border-radius: 10px;
    background: rgba(255, 120, 110, 0.16);
    border: 1px solid rgba(255, 150, 140, 0.5);
    color: #ffe3e0;
    padding: 9px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.login-info {
    border-radius: 10px;
    background: rgba(140, 220, 255, 0.16);
    border: 1px solid rgba(170, 230, 255, 0.45);
    color: #eaf8ff;
    padding: 9px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.login-copyright {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 0.6px;
    text-align: center;
}

@media (max-width: 560px) {
    .login-shell { gap: 18px; padding: 30px 16px calc(20px + env(safe-area-inset-bottom)); }
    .login-title { font-size: 21px; letter-spacing: 3px; }
    .login-subtitle { font-size: 11px; letter-spacing: 0.5px; }
    .login-brand .login-logo { width: 76px; }
    .login-card { max-width: 100%; padding: 22px 18px 18px; }
    .login-btn, .login-btn-ghost { width: 100%; }
}

/* 数据备份与还原 */

.backup-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.backup-col {
    flex: 1 1 360px;
    min-width: 300px;
    padding: 16px 18px;
    border-radius: 12px;
    background: #f6f9ff;
    border: 1px solid #e2ecfa;
}

.backup-head {
    font-size: 14px;
    font-weight: 600;
    color: #16324f;
}

/* ---------- 信息维护：流程条 ---------- */
.flow-panel {
    background: linear-gradient(120deg, #f7fbff, #eef5ff);
}

.flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 4px 2px;
}

.flow-step {
    flex: 1 1 132px;
    min-width: 126px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #dfeaf9;
    box-shadow: 0 6px 16px rgba(28, 92, 176, 0.08);
}

.flow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
}

.flow-no {
    font-size: 12px;
    color: #7d93ae;
    letter-spacing: 0.5px;
}

.flow-name {
    font-size: 14px;
    font-weight: 600;
    color: #16324f;
}

.flow-arrow {
    flex: 0 0 20px;
    text-align: center;
    font-size: 18px;
    color: #9db6d6;
}

.flow-or {
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #7d93ae;
    background: #f3f7fd;
    border: 1px dashed #c9d8ea;
    border-radius: 999px;
    padding: 3px 4px;
}

@media (max-width: 900px) {
    .flow {
        flex-direction: column;
        align-items: stretch;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}

/* ---------- 勾选面板 ---------- */
.pick {
    position: relative;
    display: inline-block;
}

/* 列表里的勾选入口：与「数据机房」「保存」同色同高的实心按钮 */
.pick > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 30px;
    padding: 4px 22px 4px 10px;
    position: relative;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    border-radius: 8px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
    box-shadow: 0 3px 10px rgba(47, 124, 246, 0.22);
}

.pick > summary::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -4px;
    border-right: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(45deg);
}

.pick > summary:hover {
    filter: brightness(1.05);
}

.pick[open] > summary {
    background: linear-gradient(135deg, #2668d8, #4a7fe0);
}

.pick > summary::-webkit-details-marker {
    display: none;
}

.pick[open] > summary {
    background: rgba(47, 124, 246, 0.14);
}

.pick-body {
    position: absolute;
    z-index: 30;
    margin-top: 6px;
    padding: 10px 12px;
    min-width: 180px;
    max-width: 320px;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(18, 52, 96, 0.18);
}

.pick-head {
    font-size: 12px;
    font-weight: 600;
    color: #16324f;
    margin: 4px 0 6px;
}

.chk {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #33506e;
    padding: 3px 0;
    white-space: nowrap;
}

.chk input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}

.eng-pick {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
/* 勾选浮层：打开时用居中弹层一次展示全部选项（不再被表格滚动区裁切） */
.pick-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 28, 52, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.pick-modal.show {
    display: flex;
}

.pick-modal-card {
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(10, 30, 60, 0.34);
    overflow: hidden;
}

.pick-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #eef3fa;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.pick-modal-headtext {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pick-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #16324f;
    line-height: 1.3;
}

.pick-modal-sub {
    font-size: 12px;
    color: #8a9bb0;
}

.pick-modal-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.pick-all,
.pick-none {
    border: 1px solid #dbe6f5;
    background: #fff;
    color: #3d6fa8;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.pick-all:hover,
.pick-none:hover {
    border-color: #b9d3f5;
    background: #f3f8ff;
}

.pick-modal-close {
    border: none;
    background: #2f7cf6;
    color: #fff;
    font-size: 12.5px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(47, 124, 246, 0.28);
}

.pick-modal-close:hover {
    background: #1f68e0;
}

.pick-modal-body {
    padding: 14px 18px 6px;
    overflow: auto;
}

/* 弹层内选项：卡片式两列网格 */
.pick-modal-body .pick-body {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    max-width: none;
    max-height: none;
    padding: 0;
    border: none;
    box-shadow: none;
    overflow: visible;
    background: transparent;
}

.pick-modal-body .chk {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid #e3ecf8;
    border-radius: 10px;
    background: #fbfdff;
    color: #33506e;
    font-size: 13px;
    white-space: normal;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.pick-modal-body .chk:hover {
    border-color: #bcd5f7;
    background: #f4f9ff;
}

.pick-modal-body .chk:has(input:checked) {
    border-color: #2f7cf6;
    background: linear-gradient(135deg, rgba(47, 124, 246, 0.10), rgba(91, 141, 239, 0.06));
    box-shadow: 0 2px 8px rgba(47, 124, 246, 0.14);
    color: #1b4a86;
    font-weight: 500;
}

.pick-modal-body .chk input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2f7cf6;
    flex: 0 0 auto;
}

.pick-modal-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 18px 14px;
}

.pick-count {
    font-size: 12px;
    color: #5b7089;
    background: #f2f7fe;
    border: 1px solid #e2ecfa;
    border-radius: 999px;
    padding: 3px 10px;
}

/* 操作列按钮保持一行，不因列宽换行 */
.icon-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* 列表单元格内的按钮/勾选芯片不换行 */
.grid td .btn,
.grid td .pick > summary {
    white-space: nowrap;
}

.grid td .btn {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
}

.icon-actions .btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

/* 查询统计：明细下方的打印/导出按钮组，居中排列 */
.stat-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* 勾选面板入口做成与「停用」一致的实心按钮（重置密码等） */
.pick > summary.btn {
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 5px 12px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
    box-shadow: 0 3px 10px rgba(47, 124, 246, 0.22);
}

.pick > summary.btn:hover {
    filter: brightness(1.05);
}

.pick[open] > summary.btn {
    background: linear-gradient(135deg, #2f7cf6, #5b8def);
}

/* 本人改密等窄表单：两列（标签 + 输入框）整齐对齐 */
.form-rows {
    display: grid;
    margin: 0 auto;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px 12px;
    align-items: center;
    max-width: 460px;
}

.form-rows .lbl {
    text-align: right;
}

.form-rows .w320 {
    width: 100%;
    max-width: 320px;
}

.form-rows-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .form-rows {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .form-rows .lbl {
        text-align: left;
    }
}

/* 列表页工具条：操作按钮统一居中一行 */
.toolbar-actions {
    flex: 1 0 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.toolbar-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

/* 操作列内「重置密码」与「停用」等按钮高度一致 */
.icon-actions .btn,
.icon-actions .pick > summary.btn {
    height: 30px;
    min-height: 30px;
    padding: 0 14px;
    line-height: 1;
    box-sizing: border-box;
}

/* 修改本人密码页：面板在页面水平居中，按钮与提示在输入框列下居中 */
.pwd-panel {
    max-width: 720px;
    margin: 48px auto;
}

.form-rows .form-rows-actions {
    grid-column: 2;
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.form-rows .form-rows-note {
    grid-column: 2;
    margin: 0;
    text-align: center;
}

/* ===== 信息维护：数据机房 ===== */
.room-block{margin:12px 0 4px;padding:12px;border:1px dashed #d6e2f6;border-radius:10px;background:#f8fbff;}
.room-block-head{display:flex;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.room-block-head strong{font-size:14px;color:#22354f;}
.room-have{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid #dbe6f5;border-radius:999px;background:#fff;color:#33536f;font-size:12px;cursor:pointer;}
.room-have input{width:15px;height:15px;margin:0;}
.room-have input:checked + span{color:#1f6fd1;font-weight:600;}
.room-rows{display:flex;flex-direction:column;gap:8px;}
.room-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.room-row input[type=text]{height:34px;}
/* 采购单位：多组联系人 */
.supc-row input[type=text]{flex:1 1 0;min-width:0;max-width:300px;}
/* 公司账号：类型标签 */
.acc-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.acc-type.basic {
    background: #2f7cf6;
    color: #fff;
}
.acc-type.general {
    background: #eef3fa;
    color: #3d6fa8;
    border: 1px solid #dbe6f5;
}
.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

/* 擅长技术：自定义输入行 */
.skill-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e3ecf8;
}
.skill-add input.skill-new {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d7e2f1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12.5px;
}
.danger-chk{color:#d9534f;}
dialog.modal.modal-wide[open]{width:min(1240px,96vw);max-width:96vw;max-height:88vh;display:flex;flex-direction:column;}
dialog.modal.modal-wide .modal-body{overflow:auto;flex:1 1 auto;min-height:0;}
dialog.modal.modal-wide .modal-foot{flex:0 0 auto;}
dialog.modal.modal-wide .modal-head{flex:0 0 auto;}
/* 维护流程步骤可点击 */
a.flow-step{text-decoration:none;color:inherit;transition:transform .15s,box-shadow .15s;}
a.flow-step:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(37,99,235,.18);}
/* 侧栏二级菜单变长后可滚动 */
.sidebar .nav{overflow-y:auto;}
.sidebar .nav-sub-item{display:flex;}

/* 表单里的勾选入口：与「新增客户」同款实心按钮 */
.pick > summary.pick-btn{
    color:#fff !important;
    border:1px solid transparent !important;
    background:linear-gradient(135deg,#2f7cf6,#5b8def) !important;
    box-shadow:0 3px 10px rgba(47,124,246,.22);
    display:inline-flex;align-items:center;gap:6px;
}
.pick > summary.pick-btn svg{width:13px;height:13px;display:block;}
.pick > summary.pick-btn::after{content:none;}
.pick > summary.pick-btn:hover{filter:brightness(1.05);}
.pick[open] > summary.pick-btn{background:linear-gradient(135deg,#2f7cf6,#5b8def) !important;}

/* ---------- 二级菜单：小尺寸玻璃图标（延续一级菜单质感） ---------- */
.nav-sub {
    margin: 2px 8px 10px 34px;
    padding-left: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.10);
    gap: 4px;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    line-height: 26px;
    letter-spacing: 0.2px;
    color: #a9bcd6;
    padding: 6px 9px;
    border-radius: 9px;
}

.nav-sub-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-sub-item.on {
    color: #fff;
    background: linear-gradient(90deg, rgba(47, 124, 246, 0.42), rgba(123, 97, 255, 0.28));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-sub-glyph {
    display: inline-flex;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 3px 8px rgba(4, 18, 44, 0.20);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.nav-sub-glyph svg {
    width: 16px !important;
    height: 16px !important;
}

.nav-sub-item.on .nav-sub-glyph {
    border-color: rgba(255, 255, 255, 0.42);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.10));
}

/* 机房行右侧「移除」按钮 */
.room-del {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(47, 124, 246, 0.28);
    background: rgba(47, 124, 246, 0.06);
    color: #2f7cf6;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.room-del:hover {
    background: rgba(226, 74, 74, 0.12);
    border-color: rgba(226, 74, 74, 0.4);
    color: #d13c3c;
}

/* ---------- 新增客户：基本信息 + 数据机房合并为一张卡 ---------- */
.add-card {
    display: block;
    padding: 14px 16px 12px;
    border: 1px solid #dfeafb;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    box-shadow: inset 0 1px 0 #fff;
}

.add-card .add-sec-title {
    font-size: 13px;
    font-weight: 600;
    color: #22354f;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    padding-left: 9px;
    border-left: 3px solid #2f7cf6;
    line-height: 1.1;
}

.add-card .add-row {
    margin-bottom: 0;
}

/* 机房区块与基本信息同卡，仅用分隔线区分 */
.add-card .room-block {
    margin: 14px 0 0;
    padding: 12px 0 0;
    border: none;
    border-top: 1px dashed #dbe6f7;
    border-radius: 0;
    background: transparent;
}

.add-card .add-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eef3fb;
}

.add-card .add-actions .btn-sm,
.add-card .add-actions .pick > summary {
    height: 30px;
}

/* 侧栏禁止横向滚动、长文本按容器收缩 */
.sidebar{overflow-x:hidden;}
.sidebar .nav-sub{box-sizing:border-box;max-width:calc(100% - 44px);}
.sidebar .nav-sub-item{box-sizing:border-box;min-width:0;width:100%;}
.sidebar .nav-sub-item > span:not(.nav-sub-glyph){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ---------- 彻底消除横向滚动条（侧栏 + 页面级） ---------- */
@media screen {
    html, body { overflow-x: hidden; max-width: 100%; }
    .shell { max-width: 100%; overflow-x: hidden; }
}
.sidebar { overflow: hidden; }
.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.sidebar .nav-item, .sidebar .nav-sub, .sidebar .nav-sub-item { max-width: 100%; }
.topbar { flex-wrap: nowrap; min-width: 0; gap: 10px; }
.page-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box { min-width: 0; flex: 0 0 auto; }
.content { overflow-x: auto; }

/* ---------- 单据二级菜单：维护系统 + 其下年份 ---------- */
.nav-sub-group { margin: 2px 0 4px; }
.nav-sub-group .nav-sub-item { font-size: 13.5px; }
.nav-yr {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 2px 14px;
    padding-left: 10px;
    border-left: 1px dashed rgba(255, 255, 255, 0.16);
}
.nav-yr-item {
    display: block;
    font-size: 12.5px;
    line-height: 22px;
    padding: 2px 8px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-yr-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-yr-item.on { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }

/* 单据二级菜单：收紧缩进，保证系统名完整显示；父项高亮更柔和 */
.sidebar .nav-sub { margin-left: 22px; }
.nav-sub-group .nav-sub-item { font-size: 13px; gap: 8px; padding-left: 6px; padding-right: 6px; }
.service-report-root > .nav-sub > .nav-group > .nav-sub {
    margin-left: 10px;
    padding-left: 8px;
    max-width: none;
    border-left: 1px dashed rgba(255, 255, 255, 0.16);
}
.service-report-root > .nav-sub > .nav-group > .nav-row .nav-sub-item { flex: 1 1 auto; }
.nav-sub-group > .nav-sub-item.on {
    background: linear-gradient(90deg, rgba(47, 124, 246, 0.42), rgba(123, 97, 255, 0.28)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.42) !important;
    color: #fff !important;
}
.nav-yr { margin-left: 10px; }
.nav-yr-item.on { background: linear-gradient(135deg, #2f7cf6, #5b8def); color: #fff; }

/* 三级（年份）默认收起，仅展开当前选中的维护系统 */
.nav-sub-group .nav-yr { display: none; }
.nav-sub-group.sel .nav-yr { display: flex; }
/* 巡检单模板表格（录入页） */
.tpl-box { margin: 2px 0 10px; }
.tpl-title { font-weight: 700; font-size: 15px; color: #1f2d3d; margin-bottom: 8px; }
.tpl-edit { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.tpl-edit th { background: #eef2f7; border: 1px solid #d6dde7; padding: 5px 6px; font-weight: 600; color: #3b4a5a; }
.tpl-edit td { border: 1px solid #d6dde7; padding: 3px 4px; }
.tpl-edit td input, .tpl-edit td select { width: 100%; border: 1px solid #dfe4ea; border-radius: 3px; padding: 3px 5px; font-size: 13px; background: #fff; }
.tpl-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tpl-actions .hint { color: #8492a6; font-size: 12px; }
/* 技术字典：来源小标记 */
.tag-plain {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #eef3fb;
    color: #5b7a9c;
    font-size: 12px;
}
/* ---------- 密码策略页面（本人改密 + 密码规则） ---------- */
.policy-panel { width: min(900px, 100%); max-width: 900px; margin: 40px auto; }
.policy-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.policy-chip {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    background: #eef4ff; color: #2f6fd0; font-size: 12.5px; border: 1px solid #dbe7fb;
}
.policy-tip {
    margin: 10px 0 18px; padding: 10px 14px; border-radius: 10px;
    background: #f5f8fd; border: 1px solid #e6eefb; color: #5a6f8a; font-size: 12.5px; line-height: 1.7;
}
.policy-form { display: flex; flex-direction: column; gap: 14px; }
.policy-card {
    background: #fff; border: 1px solid #e6ecf5; border-radius: 12px;
    padding: 16px 18px; box-shadow: 0 4px 14px rgba(23, 58, 110, 0.04);
}
.policy-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.policy-card-title { font-size: 14px; font-weight: 600; color: #1f3350; }
.policy-card-desc { font-size: 12px; color: #8ba0ba; }
.policy-length { display: flex; align-items: center; gap: 10px; }
.policy-length input {
    width: 96px; height: 36px; padding: 0 10px; border: 1px solid #d7e2f1; border-radius: 8px;
    font-family: inherit; font-size: 14px; color: #22405f; background: #fbfdff;
}
.policy-length input:focus { outline: none; border-color: #2f7cf6; box-shadow: 0 0 0 3px rgba(47,124,246,.12); }
.policy-length-unit { color: #5c728d; font-size: 13px; }
.policy-length-range { margin-left: auto; color: #9aabc0; font-size: 12px; }
.policy-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.policy-opt {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
    border: 1px solid #e2eaf5; border-radius: 10px; background: #fbfdff;
    cursor: pointer; transition: all .15s ease; position: relative;
}
.policy-opt input { position: absolute; opacity: 0; pointer-events: none; }
.policy-opt-main { font-size: 13.5px; color: #1f3350; padding-left: 26px; }
.policy-opt-sub { font-size: 12px; color: #93a6bd; padding-left: 26px; }
.policy-opt::before {
    content: ""; position: absolute; left: 14px; top: 14px; width: 14px; height: 14px;
    border: 1px solid #cfdcEC; border-radius: 4px; background: #fff;
}
.policy-opt:has(input:checked) { border-color: #2f7cf6; background: #f2f7ff; box-shadow: 0 2px 8px rgba(47,124,246,.10); }
.policy-opt:has(input:checked)::before {
    border-color: #2f7cf6; background: linear-gradient(135deg,#2f7cf6,#5b8def);
}
.policy-opt:has(input:checked)::after {
    content: ""; position: absolute; left: 18px; top: 17px; width: 6px; height: 3px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}
.policy-actions { display: flex; justify-content: flex-end; padding-top: 4px; }

/* 系统设置：用户管理下的三级菜单 */
.nav-sub-item.nav-sub-child {
    margin-left: 16px;
    padding-left: 10px;
    font-size: 12.5px;
    line-height: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}
.nav-sub-item.nav-sub-child .nav-sub-glyph { flex: 0 0 24px; width: 24px; height: 24px; }
.nav-sub-item.nav-sub-child .nav-sub-glyph svg { width: 14px !important; height: 14px !important; }
/* 侧栏品牌：小尺寸 logo + 标题文字 */
.brand {
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
}
.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex: 0 0 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px;
    box-shadow: 0 2px 6px rgba(6, 18, 38, 0.28);
}
.brand-text { white-space: nowrap; }
/* 擅长技术：自定义“添加”按钮不被压成竖排 */
.skill-add .btn {
    flex: 0 0 auto;
    min-width: 64px;
    white-space: nowrap;
    padding: 0 14px;
}
/* 擅长技术：添加按钮、已选计数与“完成”按钮等高 */
.skill-add .btn,
.pick-modal-tools button {
    height: 34px;
    line-height: 32px;
    padding: 0 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 8px;
}
.pick-count {
    height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 8px;
}
/* 列表里的擅长技术单元格：点击弹出选择 */
.skill-cell { display: block; }
.skill-cell > summary {
    cursor: pointer;
    list-style: none;
    padding: 6px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #23405f;
    min-height: 32px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.skill-cell > summary::-webkit-details-marker { display: none; }
.skill-cell > summary:hover { border-color: #2f7cf6; color: #2f7cf6; }
/* 列表表头排序 */
.sort-link { color: inherit; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; cursor: pointer; }
.sort-link:hover { color: var(--primary, #1f6feb); text-decoration: underline; }
.sort-link .sort-arrow { font-size: 12px; color: var(--primary, #1f6feb); }

/* ---------- 列表双击弹出的单据窗口 ---------- */
tr.doc-row { cursor: pointer; }
tr.doc-row:hover { background: #f4f8ff; }

.doc-dialog {
    width: 98vw;
    height: 94vh;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 1px solid #d7e2f1;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(16, 38, 68, 0.28);
    overflow: hidden;
    background: #fff;
}

.doc-dialog::backdrop { background: rgba(12, 28, 48, 0.62); }

/* 弹窗打开时隐藏背后的站点框架，避免露出“系统管理员 / 退出” */
body.dialog-open .sidebar,
body.dialog-open .topbar,
body.dialog-open .statusbar { visibility: hidden; }

.doc-dialog-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5edf8;
    background: #f7fafe;
}

.doc-dialog-title { font-weight: 600; color: #1b3b5c; font-size: 14px; }
.doc-dialog-tip { flex: 1 1 auto; color: #64798f; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.doc-dialog-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #4b6f93;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.doc-dialog-close:hover { background: #e8f0fc; color: #1f6feb; }

.doc-dialog-frame {
    display: block;
    width: 100%;
    height: calc(100% - 49px);
    border: 0;
    background: #fff;
}

/* 单据窗口内嵌页：去掉站点侧栏、顶栏和页脚 */
body.embed-body { background: #fff; }
body.embed-body .app-shell { min-height: 100vh; }
body.embed-body .content { padding: 12px 16px 24px; }

/* 合同文档页：面板和预览区撑满可视高度，底部不再留空白 */
body.doc-page-body .content {
    display: flex;
    padding: 12px 16px 12px;
    min-height: 0;
}
body.doc-page-body .panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    min-height: 0;
}
body.doc-page-body .doc-layout {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}
body.doc-page-body .doc-nav {
    align-self: start;
    max-height: 100%;
    overflow: auto;
}
body.doc-page-body .doc-view {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.doc-page-body .doc-view-body {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
}
body.doc-page-body .doc-view-body > iframe {
    height: 100%;
}
.invoice-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.invoice-row input[type="file"] { flex: 1 1 auto; min-width: 0; }
.invoice-add { margin-top: 8px; }

/* 侧栏二级分组标签（如“合同基础信息”） */
/* ---------- 列表只读 + 双击编辑 / 弹窗内勾选区 ---------- */
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-head .panel-title { margin: 0; }
.grid tbody tr.dbl-row { cursor: default; }
.grid tbody tr.dbl-row:hover { background: #f6f9fe; }
.modal .modal-body > .pick-body {
    position: static;
    max-width: none;
    width: 100%;
    margin: 0;
    box-shadow: none;
}
.chk-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    max-height: 180px;
    overflow: auto;
    padding: 8px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    background: #fff;
}
.chk-list .chk { margin: 0; }
.modal .eng-pick { display: block; }
.modal .add-sec-title {
    font-size: 13px;
    font-weight: 600;
    color: #22354f;
    letter-spacing: 0.3px;
    margin: 10px 0 6px;
    padding-left: 9px;
    border-left: 3px solid #2f7cf6;
    line-height: 1.1;
}
.chk-list .skill-add { flex: 1 1 100%; display: flex; gap: 8px; margin-top: 4px; }
.chk-list .skill-add input[type="text"] { flex: 1 1 auto; min-width: 160px; max-width: 260px; }

/* 关联客户多选：按网格排列，长名称自动换行，避免挤成一团 */
.company-customer-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 16px;
    max-height: 240px;
    padding: 10px 12px;
}
.company-customer-list .chk {
    min-width: 0;
    white-space: normal;
    align-items: flex-start;
    line-height: 1.35;
    padding: 4px 0;
}
.company-customer-list .chk input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 2px;
}
@media (max-width: 900px) {
    .company-customer-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .company-customer-list { grid-template-columns: 1fr; }
}

/* 主体档案：公司 Logo */
.logo-field {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f2;
    border-radius: 9px;
    background: #f8fbff;
}
.logo-preview {
    width: 132px;
    height: 58px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px dashed #c9d6e8;
    border-radius: 7px;
    background: #fff;
    color: #98a7ba;
    font-size: 12px;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview span { white-space: nowrap; }
.logo-side { min-width: 0; }
.logo-title { font-size: 13px; font-weight: 600; color: #22354f; }
.logo-side .hint { margin: 2px 0 5px; }
.logo-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-actions .chk { margin: 0; }
.logo-pick { cursor: pointer; }

/* ---------- 合同录入：销售 / 采购双列表 ---------- */
.list-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 17px 0 10px;
}
.list-topbar-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #1f3b57;
}
.list-topbar-title span {
    font-size: 12px;
    color: #8b9aab;
    font-weight: 400;
}
.contract-block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(31, 59, 87, .04);
    overflow: hidden;
    margin-bottom: 18px;
}
.contract-block.sales { border-left: 4px solid #2f7cf6; }
.contract-block.purchase { border-left: 4px solid #ffb020; }
.contract-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 11px 15px;
    border-bottom: 1px solid #edf1f6;
    background: linear-gradient(90deg, #fbfdff 0%, #fff 65%);
}
.contract-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 146px;
    color: #1f3b57;
    font-size: 15px;
    font-weight: 700;
}
.contract-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2f7cf6;
    box-shadow: 0 0 0 3px rgba(47, 124, 246, .12);
}
.contract-block.purchase .contract-dot {
    background: #ffb020;
    box-shadow: 0 0 0 3px rgba(255, 176, 32, .14);
}
.contract-count {
    color: #8b9aab;
    font-size: 12px;
    font-weight: 400;
}
.contract-tabs {
    display: flex;
    align-items: center;
    gap: 7px;
}
.contract-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border: 1px solid #dce7f4;
    border-radius: 999px;
    background: #fff;
    color: #5b7187;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.contract-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #eef4fc;
    color: #55718e;
    font-size: 11px;
}
.contract-tab:hover {
    border-color: #a8c5e9;
    color: #2f7cf6;
    text-decoration: none;
}
.contract-tab.active {
    background: #2f7cf6;
    border-color: #2f7cf6;
    color: #fff;
    box-shadow: 0 3px 8px rgba(47, 124, 246, .2);
}
.contract-tab.active span {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}
.contract-tab.active:hover { color: #fff; }
.contract-meta {
    margin-left: auto;
    color: #8293a6;
    font-size: 12px;
    white-space: nowrap;
}
.contract-meta b {
    color: #1f3b57;
    font-size: 15px;
    font-weight: 700;
}
.contract-table-wrap {
    border: none;
    border-top: 1px solid #edf1f6;
    background: #fff;
}
.contract-grid th { padding-top: 10px; padding-bottom: 10px; }
.contract-grid {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}
.contract-grid th {
    padding: 9px 6px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
}
.contract-grid td {
    padding: 8px 6px;
    font-size: 12px;
}
/* 按内容自适应：合同编号、客户/采购单位、签约主体、地区尽量单行显示；多余宽度留给合同名称 */
.contract-grid .col-seq { width: 36px; }
.contract-grid .col-no { white-space: nowrap; }
.contract-grid .col-name { min-width: 200px; }
.contract-grid .col-party,
.contract-grid .col-company,
.contract-grid .col-region { white-space: nowrap; }
.contract-grid .col-actions { white-space: nowrap; }
.contract-empty {
    padding: 26px 16px !important;
    text-align: center;
    color: #8b9aab;
    background: #fcfdff;
}
.contract-wrap {
    white-space: nowrap !important;
    word-break: normal;
    line-height: 1.45;
    color: #4c6178;
    font-size: 11.5px;
}
.contract-name {
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.45;
}
.contract-name .doc-link {
    vertical-align: -3px;
}
.contract-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 9px 15px;
    border-top: 1px solid #edf1f6;
    background: #fbfcfe;
}
.contract-pageinfo {
    margin-left: 8px;
    color: #8798aa;
    font-size: 12px;
}

/* ---------- 收支管理：按内容分配列宽，剩余宽度给合同名称 ---------- */
.payment-grid {
    width: 100%;
    border-collapse: collapse;
}
.payment-grid,
.payment-grid thead,
.payment-grid tbody,
.payment-grid tr { display: block; }
.payment-grid tr {
    display: grid;
    grid-template-columns: 32px 36px 164px minmax(190px, 1fr) 50px 72px 78px 72px 78px 60px 54px 192px;
    align-items: stretch;
    border-bottom: 1px solid #edf1f6;
}
.payment-grid.without-amount tr {
    grid-template-columns: 32px 36px 164px minmax(190px, 1fr) 50px 78px 78px 60px 54px 192px;
}
.payment-grid th {
    padding: 9px 6px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
}
.payment-grid td {
    min-width: 0;
    align-self: center;
    padding: 7px 6px;
    font-size: 12px;
}
.payment-grid .col-no,
.payment-grid .col-period,
.payment-grid .col-plan-date,
.payment-grid .col-actual-date,
.payment-grid .col-reminder { white-space: nowrap; }
.payment-name {
    min-width: 0;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.45;
    color: #2f4053;
}
.payment-name .hint {
    display: inline;
    font-size: 11.5px;
}
.pay-record-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pay-record-summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.pay-record-value {
    font-weight: 600;
    color: #2f4053;
    font-variant-numeric: tabular-nums;
}
.pay-record-date {
    font-size: 11.5px;
    color: #60758e;
    font-variant-numeric: tabular-nums;
}
.pay-record-summary .pay-reset-form { margin: 0; }
.pay-record-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.pay-record-form { margin: 0; width: 100%; }
.pay-record-line {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pay-amount {
    width: 106px;
    min-width: 0;
    padding: 5px 6px;
    font-size: 12px;
}
.pay-date {
    width: 120px;
    min-width: 0;
    padding: 5px 4px;
    font-size: 12px;
}
.pay-record-label {
    flex: 0 0 auto;
    font-size: 11px;
    color: #8798aa;
    white-space: nowrap;
}
.pay-record-form .btn,
.pay-reset-form .btn {
    padding: 4px 7px;
    font-size: 11.5px;
    white-space: nowrap;
}
.pay-reset-form { margin: 0; }

/* ---------- 合同明细：库存多选弹窗 ---------- */
dialog.modal.stock-picker-dialog[open] {
    width: min(980px, 96vw);
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.stock-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}
.stock-picker-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: .8;
}
.stock-picker-close:hover { opacity: 1; }
.stock-picker-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px;
}
.stock-picker-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.stock-picker-tools input[type="search"] {
    width: 340px;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid #d9e3ef;
    border-radius: 7px;
    outline: none;
}
.stock-picker-tools input[type="search"]:focus {
    border-color: #2f7cf6;
    box-shadow: 0 0 0 2px rgba(47, 124, 246, .12);
}
.stock-picker-tools span {
    color: #8595a7;
    font-size: 12px;
}
.stock-picker-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid #e1e8f1;
    border-radius: 8px;
}
.stock-picker-table {
    min-width: 760px;
}
.stock-picker-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}
.stock-picker-table td {
    padding: 8px 10px;
}
.stock-picker-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.stock-picker-name {
    display: block;
    color: #203a56;
    font-weight: 600;
}
.stock-picker-spec {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
    color: #8292a5;
    font-size: 11.5px;
    line-height: 1.45;
}
.stock-picker-stock {
    color: #1f3b57;
    font-weight: 600;
}
.stock-picker-stock.zero {
    color: #b7791f;
}
.stock-picker-row-disabled td {
    background: #fafbfc;
    color: #9aa9b8;
}
.stock-picker-row-disabled .stock-picker-name,
.stock-picker-row-disabled .stock-picker-stock {
    color: #9aa9b8;
}
.stock-picker-row-disabled input[type="checkbox"] {
    cursor: not-allowed;
}
.stock-picker-empty {
    flex: 1 1 auto;
    padding: 36px 20px;
    text-align: center;
    color: #8b9aab;
    border: 1px dashed #d9e4f1;
    border-radius: 8px;
    background: #fcfdff;
}
.stock-picker-foot {
    flex: 0 0 auto;
}
.stock-selected-count {
    margin-right: auto;
    color: #8293a6;
    font-size: 12px;
}







/* 合同管理模块：统一胶囊按钮 / 胶囊页签 */
body.module-contracts .btn,
body.module-contracts .btn-tool,
body.module-contracts .btn-sm,
body.module-contracts .btn-mini,
body.module-contracts .btn-on,
body.module-contracts .btn-ghost,
body.module-contracts .icon-btn {
    border-radius: 999px;
}
body.module-contracts .btn-tool {
    min-width: 0;
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
}
body.module-contracts .pager a,
body.module-contracts .pager span {
    border-radius: 999px;
}

/* ---------- 统一大弹窗：客户/主体/维护人员/采购单位/用户/角色/库存导入 ----------
   与“单据窗口”保持同一外壳：深色遮罩、98vw×94vh、浅灰标题栏、右上角关闭。 */
dialog.doc-shell[open] {
    width: 98vw !important;
    height: 94vh !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0;
    margin: auto;
    border: 1px solid #d7e2f1;
    border-radius: 12px;
    background: #f5f8fd;
    box-shadow: 0 18px 48px rgba(16, 38, 68, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

dialog.doc-shell::backdrop { background: rgba(12, 28, 48, 0.62); }

dialog.doc-shell > .doc-shell-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5edf8;
    background: #f7fafe;
}

.doc-shell-title {
    font-weight: 600;
    color: #1b3b5c;
    font-size: 14px;
}

.doc-shell-close {
    width: 28px;
    height: 28px;
    margin-left: auto;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #4b6f93;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.doc-shell-close:hover { background: #e8f0fc; color: #1f6feb; }

/* 标题栏以下的白色圆角内容面板，对应合同单据窗口里的内嵌页 */
dialog.doc-shell > .doc-shell-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 12px 14px 14px;
    border: 1px solid #dbe5f1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(20, 48, 80, 0.05);
    overflow: hidden;
}

/* 原弹窗的表单/标题/正文/底栏改成上下固定、正文滚动的单据窗口布局 */
dialog.doc-shell .doc-shell-body > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
}

dialog.doc-shell .modal-head,
dialog.doc-shell .dlg-head,
dialog.doc-shell .inv-dialog-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px 9px;
    border: 0;
    border-bottom: 1px solid #eef3f9;
    border-radius: 0;
    background: #fff;
    color: #1b3b5c;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
dialog.doc-shell .dlg-head h3,
dialog.doc-shell .inv-dialog-head h3 {
    margin: 0;
    color: #1b3b5c;
    font-size: 16px;
    font-weight: 600;
}
dialog.doc-shell .modal-head { justify-content: flex-start; }
dialog.doc-shell .dlg-head { justify-content: flex-start; }

/* 顶部已经有统一的关闭按钮，隐藏各页面自己的小叉 */
dialog.doc-shell .dlg-x,
dialog.doc-shell .inv-dialog-close { display: none; }

dialog.doc-shell .modal-body,
dialog.doc-shell .dlg-body,
dialog.doc-shell .inv-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 16px 22px 18px;
}
/* 信息维护弹窗的正文里混用分区标题和自定义网格，改为普通流式布局，避免标题左侧蓝线被网格行拉长 */
dialog.doc-shell .modal-body { display: block; }
dialog.doc-shell .add-sec-title { margin: 14px 0 8px; }
/* 用户/角色弹窗原本是固定高度的小网格，拉成大窗后让行从顶部自然排列，不要被平均拉伸 */
dialog.doc-shell .dlg-body { align-content: start; }

dialog.doc-shell .modal-foot,
dialog.doc-shell .dlg-foot,
dialog.doc-shell .inv-dialog-foot {
    flex: 0 0 auto;
    padding: 12px 22px;
    border-top: 1px solid #e5edf8;
    border-radius: 0;
    background: #fff;
}

/* 外层遮罩打开时和单据窗口一样隐藏站点侧栏/顶栏，避免露出账号和退出按钮 */
body.dialog-open .sidebar,
body.dialog-open .topbar,
body.dialog-open .statusbar { visibility: hidden; }

/* 侧栏菜单统一字号为 14px；用 .sidebar .nav 提高优先级，覆盖维护系统 13px、系统设置 12.5px 等旧规则 */
.sidebar .nav .nav-item,
.sidebar .nav .nav-sub-item,
.sidebar .nav .nav-yr-item { font-size: 14px; }

/* 每一级菜单高亮条的右边缘统一对齐到侧栏右侧 10px 处 */
.nav .nav-row > .nav-item { margin-right: 10px; }
.nav > .nav-group > .nav-sub { margin-right: 10px; max-width: none; }
.nav .nav-sub .nav-sub { margin-right: 0; max-width: none; }
.nav-sub-item,
.nav-yr-item { width: 100%; box-sizing: border-box; }

/* 侧栏菜单层级高度：一级 52px、二级 46px、三级 40px、四级 34px */
.sidebar .nav .nav-item {
    padding-top: 11px;
    padding-bottom: 11px;
}
.sidebar .nav .nav-item .nav-glyph {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
}

.sidebar .nav .nav-sub-item {
    padding-top: 9px;
    padding-bottom: 9px;
    line-height: 28px;
}
.sidebar .nav .nav-sub-item .nav-sub-glyph {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
}

/* 三级：维护系统、统计查询子项、系统设置子项 */
.sidebar .nav .nav-sub .nav-sub .nav-sub-item,
.sidebar .nav .nav-sub-item.nav-sub-child {
    padding-top: 7px;
    padding-bottom: 7px;
    line-height: 26px;
}
.sidebar .nav .nav-sub .nav-sub .nav-sub-item .nav-sub-glyph,
.sidebar .nav .nav-sub-item.nav-sub-child .nav-sub-glyph {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
}
.sidebar .nav .nav-sub-item .nav-sub-glyph svg {
    width: 16px !important;
    height: 16px !important;
}

/* 四级：年份行按 24px 图标 + 上下 5px，整体 34px */
.sidebar .nav .nav-yr-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    line-height: 24px;
}
.nav-yr-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 6px rgba(4, 18, 44, 0.18);
}
.nav-yr-glyph svg {
    width: 14px !important;
    height: 14px !important;
}

/* 合同录入：列表底部显示数量 */
.contract-list-foot { margin-top: 14px; border-radius: var(--radius); }
