/* 布局：左项目树 + 右主列 */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }
.sidebar { width: 230px; background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; }
.side-title { font-size: 12px; color: var(--muted); letter-spacing: 2px; margin-bottom: 10px; }
.tree { list-style: none; font-size: 13px; }
.tree-root { font-weight: 700; color: var(--blue-d); }
.tree-root ul { list-style: none; margin: 8px 0 0 4px; border-left: 2px solid var(--line); padding-left: 10px; }
.tree-leaf { color: #4a5468; padding: 6px 0; }
.tree-leaf:hover { color: var(--blue); }
.main-col { flex: 1; min-width: 0; }
.container { padding: 18px 22px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }

/* 今日计划 */
.sun-plan { padding: 4px 0; }
.sun-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sun-cell { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.sun-cell span { display: block; font-size: 12px; color: var(--muted); }
.sun-cell b { font-size: 17px; }
.sun-state { margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-weight: 600; }
.sun-state.on { background: #e7f7ee; color: var(--green); }
.sun-state.off { background: #eef1f6; color: var(--muted); }

/* 节能四件套 */
.four { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 6px 0; }
.four-cell { background: var(--bg); border-radius: 8px; padding: 12px 10px; text-align: center; }
.four-cell .k { font-size: 12px; color: var(--muted); }
.four-cell .v { font-size: 20px; font-weight: 700; margin-top: 4px; }

/* 权限标签 / 切换按钮 / 日志 */
.perm-tag { display: inline-block; background: #eaf1ff; color: var(--blue-d); font-size: 11px; padding: 2px 8px; border-radius: 5px; margin: 2px 3px 2px 0; }
.toggle-btn { border: 1px solid var(--blue); background: #fff; color: var(--blue); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.toggle-btn:hover { background: var(--blue); color: #fff; }
code.log-detail { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #4a5468; word-break: break-all; }

/* 碳排放进度条 */
.carbon-row { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
.carbon-row b { font-size: 20px; color: var(--green); min-width: 86px; }
.progress { background: var(--bg); border-radius: 8px; height: 14px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #18b56a, #52c41a); border-radius: 8px; transition: width .4s; }

/* 项目管理操作按钮 */
.op-cell { white-space: nowrap; }
.op-btn { border: 1px solid var(--line); background: #fff; color: #4a5468; padding: 4px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; margin: 2px 3px 2px 0; }
.op-btn:hover { border-color: var(--blue); color: var(--blue); }
.op-btn.primary { border-color: var(--blue); color: var(--blue); }
.op-btn.primary:hover { background: var(--blue); color: #fff; }
.op-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* 轻量 toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); background: #1f2733; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; transition: all .3s; z-index: 99; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 日志：查看按钮（请求/响应详情） */
.link-btn { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 13px; padding: 2px 4px; text-decoration: underline; }
.link-btn:hover { color: var(--blue-d); }

/* 客户组织树 */
.org-tree { font-size: 13px; }
.org-root, .org-children { list-style: none; }
.org-children { margin-left: 4px; border-left: 2px solid var(--line); padding-left: 12px; }
.org-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 7px; }
.org-row:hover { background: var(--bg); }
.org-toggle { color: var(--muted); width: 14px; }
.org-row b { color: var(--ink); }
.org-type { background: #eaf1ff; color: var(--blue-d); font-size: 11px; padding: 1px 8px; border-radius: 5px; }
.org-ops { margin-left: auto; display: flex; gap: 6px; }
.mini-btn { border: 1px solid var(--line); background: #fff; color: #4a5468; padding: 3px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.mini-btn:hover { border-color: var(--blue); color: var(--blue); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 38, .45); }
.modal-box { position: relative; width: 560px; max-width: 92vw; max-height: 80vh; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 16px 18px; overflow: auto; }
.json { background: #0f1726; color: #d6e2ff; border-radius: 8px; padding: 14px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; font-family: "Consolas", "Monaco", monospace; }
