/* ITSU 主题样式 */
:root {
  --itsu-blue: #1B5AA7;
  --itsu-blue-dark: #14417A;
  --itsu-blue-darker: #0E2E58;
  --itsu-bg: #F4F7FB;
  --el-color-primary: #1B5AA7;
  --el-color-primary-light-3: #4a7fb9;
  --el-color-primary-light-5: #6e9ccb;
  --el-color-primary-light-7: #a3c0de;
  --el-color-primary-light-8: #c2d5ea;
  --el-color-primary-light-9: #e6eef7;
  --el-color-primary-dark-2: #14417A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--itsu-bg);
  color: #303133;
}

/* ---------- 登录页 ---------- */
.login-page { display: flex; height: 100%; }
.login-left {
  flex: 1.2; min-width: 0; position: relative; overflow: hidden;
  background: var(--itsu-blue-dark);
}
.login-left img.banner { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.login-left .mask {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(14,46,88,.88) 0%, rgba(27,90,167,.55) 60%, rgba(27,90,167,.25) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 48px;
}
.login-left .mask h1 { color: #fff; font-size: 30px; font-weight: 600; letter-spacing: 2px; }
.login-left .mask p { color: rgba(255,255,255,.85); margin-top: 10px; font-size: 15px; letter-spacing: .5px; }
.login-right {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: #fff; padding: 32px;
}
.login-box { width: 100%; max-width: 380px; }
.login-box .emblem { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 4px 16px rgba(27,90,167,.25); }
.login-box h2 { margin: 18px 0 4px; font-size: 22px; color: var(--itsu-blue-darker); }
.login-box .sub { color: #909399; font-size: 13px; margin-bottom: 28px; }
.login-box .el-input { margin-bottom: 16px; height: 44px; }
.login-box .el-input__wrapper { border-radius: 8px; }
.login-box .login-btn { width: 100%; height: 44px; font-size: 16px; letter-spacing: 6px; border-radius: 8px; }
.login-tip { margin-top: 16px; color: #b0b3b8; font-size: 12px; line-height: 1.8; }
@media (max-width: 860px) { .login-left { display: none; } }

/* ---------- 布局 ---------- */
.layout { height: 100%; }
.layout .el-aside { transition: width .25s; }
.sidebar {
  height: 100%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--itsu-blue-darker) 0%, var(--itsu-blue-dark) 55%, #17497f 100%);
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; }
.sidebar .brand img { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); flex-shrink: 0; }
.sidebar .brand .t { color: #fff; overflow: hidden; white-space: nowrap; }
.sidebar .brand .t .n { font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.sidebar .brand .t .d { font-size: 11px; color: rgba(255,255,255,.55); transform: scale(.85); transform-origin: left; }
.sidebar .el-menu { border-right: none; background: transparent; flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar .el-menu-item {
  color: rgba(255,255,255,.72); height: 46px; margin: 2px 10px; border-radius: 8px;
}
.sidebar .el-menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .el-menu-item.is-active { background: #fff; color: var(--itsu-blue); font-weight: 600; }
.sidebar .el-menu-item .el-icon { margin-right: 8px; font-size: 18px; width: 18px; height: 18px; }
.sidebar .el-menu-item .el-icon svg { width: 18px; height: 18px; }
/* 兜底：约束所有裸 SVG 图标，避免未包 el-icon 时按原始尺寸渲染 */
.sidebar svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .footer-note { color: rgba(255,255,255,.35); font-size: 11px; text-align: center; padding: 12px 0 14px; }

.header {
  background: #fff; border-bottom: 1px solid #e8ecf2; display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px; height: 56px;
}
.header .crumb { font-size: 16px; font-weight: 600; color: #1f2d3d; display: flex; align-items: center; gap: 8px; }
.header .user-box { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.header .avatar { background: var(--itsu-blue); color: #fff; font-weight: 600; }
.main-content { padding: 18px 20px; overflow-y: auto; background: var(--itsu-bg); }

/* ---------- 通用页面 ---------- */
.page-card { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(31,45,61,.06); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head .title { font-size: 17px; font-weight: 600; color: #1f2d3d; display: flex; align-items: center; gap: 8px; }
.page-head .title::before { content: ""; width: 4px; height: 16px; background: var(--itsu-blue); border-radius: 2px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar .el-input, .filter-bar .el-select { width: 190px; }
.muted { color: #909399; font-size: 12px; }
.money { font-variant-numeric: tabular-nums; }
.due-tag-warn { --el-tag-bg-color: #fdf6ec; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(31,45,61,.06);
  display: flex; align-items: center; gap: 14px; cursor: pointer; transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .icon {
  width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; background: linear-gradient(135deg, #1B5AA7, #3f7cc4); flex-shrink: 0;
}
.stat-card.warn .icon { background: linear-gradient(135deg, #d48806, #e6a23c); }
.stat-card.danger .icon { background: linear-gradient(135deg, #b32d2d, #e05a5a); }
.stat-card.green .icon { background: linear-gradient(135deg, #1f7a4d, #34a853); }
.stat-card .v { font-size: 24px; font-weight: 700; color: #1f2d3d; line-height: 1.2; }
.stat-card .l { font-size: 13px; color: #909399; margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* 组织结构 */
.org-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.org-group { border: 1px solid #e8ecf2; border-radius: 10px; overflow: hidden; }
.org-group .g-head { background: var(--itsu-blue); color: #fff; padding: 8px 14px; font-weight: 600; letter-spacing: 2px; }
.org-group .g-row { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.org-group .g-row:last-child { border-bottom: none; }
.org-group .g-row .t { color: #606266; }
.org-group .g-row .type-tag { margin-left: 6px; }

/* SOP 流程 */
.sop-block { margin-bottom: 26px; }
.sop-phase { margin-bottom: 14px; }
.sop-phase .p-title { font-weight: 600; color: var(--itsu-blue-dark); margin: 10px 0 8px; display: flex; align-items: center; gap: 8px; }
.sop-steps { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; }
.sop-step {
  background: #fff; border: 1px solid #d7e3f2; border-radius: 8px; padding: 10px 12px; min-width: 128px;
  flex: 1; position: relative;
}
.sop-step .s-name { font-weight: 600; font-size: 14px; color: #1f2d3d; }
.sop-step .s-desc { font-size: 12px; color: #8a919c; margin-top: 4px; line-height: 1.5; }
.sop-step .s-idx {
  position: absolute; top: -9px; left: -9px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--itsu-blue); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.sop-arrow { display: flex; align-items: center; color: var(--itsu-blue); padding: 0 4px; font-size: 18px; font-weight: 700; }
.sop-owner { margin-top: 6px; font-size: 12px; color: var(--itsu-blue); background: var(--itsu-bg); border-radius: 4px; padding: 1px 6px; display: inline-block; }

/* 文件类型徽标 */
.file-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--itsu-blue); cursor: pointer; }
.file-chip:hover { text-decoration: underline; }

/* 表格内金额列 */
.el-table .cell { line-height: 1.5; }
.days-danger { color: #d03050; font-weight: 600; }
.days-warn { color: #d48806; font-weight: 600; }
.days-ok { color: #1f7a4d; }

.drawer-sec { margin-top: 18px; }
.drawer-sec .sec-title { font-weight: 600; font-size: 15px; color: #1f2d3d; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }

.el-table { --el-table-header-bg-color: #f5f8fc; --el-table-header-text-color: #4a5568; }

/* ---------- 视图切换过渡 ---------- */
.view-fade-enter-active { transition: opacity .22s ease, transform .22s ease; }
.view-fade-leave-active { transition: opacity .12s ease; }
.view-fade-enter-from { opacity: 0; transform: translateY(6px); }
.view-fade-leave-to { opacity: 0; }

/* ---------- 表格与卡片细节 ---------- */
.el-table { border-radius: 8px; }
.el-table tr { transition: background-color .15s; }
.page-card { border: 1px solid #edf1f7; }
.stat-card { border: 1px solid #edf1f7; box-shadow: 0 1px 3px rgba(31,45,61,.05); }
.stat-card:hover { box-shadow: 0 6px 18px rgba(27,90,167,.12); border-color: #d7e3f2; }

/* ---------- 抽屉细节 ---------- */
.el-drawer__header { padding: 16px 20px 12px; border-bottom: 1px solid #eef2f7; margin-bottom: 0; }
.el-drawer__title { font-size: 16px; font-weight: 600; color: #1f2d3d; max-width: 82%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-drawer__body { padding: 16px 20px 24px; }

/* ---------- 弹窗表单 ---------- */
.el-dialog { border-radius: 12px; }
.el-dialog__header { padding: 16px 20px 12px; border-bottom: 1px solid #f0f2f5; margin-right: 0; }
.el-dialog__title { font-weight: 600; color: #1f2d3d; }
.el-dialog__body { padding: 18px 20px; }
.el-dialog__footer { padding: 12px 20px 16px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d4e3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8b8cd; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 空状态与提示 ---------- */
.el-table__empty-text { color: #a0a6b1; font-size: 13px; }
.el-alert { border-radius: 8px; }
