/* ===== 母版页布局 ===== */
* { margin:0; padding:0; box-sizing:border-box; }
html,body { height:100%; overflow:hidden; }
body { font-family: 'Microsoft YaHei', sans-serif; background: #F2EFEA; display:flex; flex-direction:column; }

/* 顶部导航 */
.header { height:52px; background: #1A1A1A; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.header .logo { font-size: 18px; font-weight: 700; }
.header .user-info { font-size: 13px; color: #aaa; }
.header .user-info a { color: #CB2A31; text-decoration: none; }

/* 主体包裹：侧边栏 + 内容 水平排列 */
.wrap { display:flex; flex:1; min-height:0; }
.sidebar { width: 200px; min-width: 200px; background: linear-gradient(180deg, #1A1A1A, #0D0D0D); padding: 16px 0; overflow-y:auto; flex-shrink:0; }
.nav-section { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 1px; padding: 16px 20px 6px; }
.nav-item { display: block; padding: 8px 20px; color: #aaa; font-size: 13px; text-decoration: none; cursor: pointer; transition: .2s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { background: #CB2A31; color: #fff; font-weight: 600; }

/* 右侧内容 */
.main-content { flex: 1; min-width: 0; padding: 20px 24px; overflow-y: auto; }


/* KPI 卡片 */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: #fff; padding: 16px; border-radius: 10px; border-left: 3px solid #CB2A31; }
.kpi-card .label { font-size: 11px; color: #999; margin-bottom: 6px; }
.kpi-card .value { font-size: 24px; font-weight: 700; color: #1A1A1A; }
.kpi-card .sub { font-size: 11px; color: #999; margin-top: 4px; }

/* 查询栏 */
.search-bar { background: #fff; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }

/* 表格 */
.data-table { background: #fff; border-radius: 10px; padding: 16px; }

/* 页面标题 */
.page-title { font-size: 16px; font-weight: 600; color: #1A1A1A; margin-bottom: 16px; }

/* 通用表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #FAF6EE; padding: 10px 14px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid #E8E2D3; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #F3EFE6; color: #333; }
.tbl .mn { font-family: Consolas, monospace; font-size: 12px; }
.tbl .empty { text-align: center; color: #999; padding: 40px; }

/* 按钮 */
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; background: #CB2A31; color: #fff; font-weight: 500; }
.btn:hover { opacity: .85; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.ghost { background: transparent; color: #666; border: 1px solid #ddd; }
.btn.o { background: transparent; color: #CB2A31; border: 1px solid #CB2A31; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 输入框 */
.inp { padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; outline: none; }
.inp:focus { border-color: #CB2A31; }

/* 遮罩 + 弹窗 */
.mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; justify-content: center; align-items: center; }
.mask.show, .mask[style*="flex"] { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 440px; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.modal.wide { width: 640px; }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid #E8E2D3; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal .mbd { padding: 20px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid #E8E2D3; display: flex; justify-content: flex-end; gap: 10px; }
.x { cursor: pointer; color: #999; font-size: 18px; }
.x:hover { color: #333; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #CB2A31; color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 13px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .3s; }
.toast.show { opacity: 1; }

/* ===== 员工权限卡片 ===== */
.perm-card { background: #fff; border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.perm-card-hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; flex-wrap: wrap; gap: 10px; cursor: pointer; user-select: none; transition: background .15s; }
.perm-card-hd:hover { background: #fafafa; }
.perm-arrow { display: inline-block; width: 16px; font-size: 10px; color: #999; transition: transform .2s; flex-shrink: 0; }
.perm-card.expanded .perm-arrow { transform: rotate(90deg); color: #CB2A31; }
.perm-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.perm-acc { font-weight: 700; font-size: 14px; color: #1A1A1A; }
.perm-name { font-size: 12px; color: #888; }
.perm-body { display: none; padding: 14px 18px; border-top: 1px solid #F3EFE6; }
.perm-card.expanded .perm-body { display: block; }
.perm-ops { display: flex; gap: 8px; padding-top: 12px; margin-top: 10px; border-top: 1px solid #F3EFE6; }
.perm-sec { margin-bottom: 14px; }
.perm-sec:last-child { margin-bottom: 0; }
.perm-sec-t { font-size: 11px; color: #999; letter-spacing: 1px; margin-bottom: 8px; border-left: 3px solid #CB2A31; padding-left: 8px; }
.perm-sec-items { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #333; cursor: pointer; user-select: none; }
.chk input { accent-color: #CB2A31; width: 15px; height: 15px; }
.chk.disabled { color: #999; cursor: not-allowed; }

/* 标签 */
.tag { font-size: 11px; padding: 2px 9px; border-radius: 10px; background: #EEE; color: #666; white-space: nowrap; }
.role-tag.admin  { background: #EAF2FF; color: #2b6cb0; }
.role-tag.super  { background: #FBE9E7; color: #CB2A31; }
.role-tag.clerk  { background: #EAF7EE; color: #2E7D32; }
.tag.on  { background: #EAF7EE; color: #2E7D32; }
.tag.off { background: #F5E6E6; color: #c62828; }
.lock-tag { background: #FBE9E7; color: #CB2A31; }

/* ===== 租用监控看板 ===== */
.monitor-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.monitor-bar .live { font-size: 12px; color: #2E7D32; display: flex; align-items: center; gap: 6px; }
.monitor-bar .live .dot { width: 8px; height: 8px; border-radius: 50%; background: #2E7D32; animation: rmPulse 1.4s infinite; }
@keyframes rmPulse { 0% { box-shadow: 0 0 0 0 rgba(46,125,50,.5); } 70% { box-shadow: 0 0 0 6px rgba(46,125,50,0); } 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); } }
.st-normal { background: #EAF7EE; color: #2E7D32; }
.st-soon { background: #FFF4E0; color: #E69B00; }
.st-overdue { background: #FBE9E7; color: #CB2A31; }

/* ===== 管理协议页面（贴合后台暖米底 + 品牌红基调）===== */
.coord-tip { display:flex; align-items:flex-start; gap:8px; background:#FBF7F0; border-left:3px solid #CB2A31; padding:10px 14px; border-radius:6px; font-size:12px; color:#7a6a55; line-height:1.7; margin-bottom:14px; }
.coord-tip .ico { flex-shrink:0; font-size:14px; line-height:1.4; }

/* 表格内按钮：保存=品牌红实心（主操作），预览=中性描边（次操作），统一视觉层级 */
.coord-save { background-color:#CB2A31 !important; }
.coord-save:hover { background-color:#b12429 !important; }
.coord-preview { background-color:#fff !important; color:#666 !important; border:1px solid #ddd !important; }
.coord-preview:hover { background-color:#f3f3f3 !important; color:#333 !important; }

/* 让 Layui 表格融入整体配色（仅作用于本页 .data-table 容器内，不影响其他页）*/
.data-table .layui-table-view { border-color:#E8E2D3 !important; font-size:13px; }
.data-table .layui-table-view .layui-table-header,
.data-table .layui-table-view .layui-table-header th { background-color:#FAF6EE !important; }
.data-table .layui-table-view .layui-table-header th { color:#555 !important; font-weight:600; }
.data-table .layui-table-view .layui-table[lay-even] tbody tr:nth-child(even) { background-color:#FBF8F2 !important; }
.data-table .layui-table-view td,
.data-table .layui-table-view th { border-color:#F3EFE6 !important; }
.data-table .layui-table-view .layui-table tbody tr:hover { background-color:#FCEFEF !important; }
