:root{
 --brand:#173f73;--brand2:#2f855a;--bg:#f5f7fb;--card:#fff;--ink:#172033;
 --muted:#667085;--line:#e4e7ec;--danger:#d92d20;--warn:#f59e0b;--ok:#087443;
 --violet:#7f56d9;--blue:#1f6feb;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.app{height:100%;display:grid;grid-template-columns:230px 1fr}
.sidebar{background:#101828;color:#fff;padding:16px 12px;overflow:auto}
.brand{font-size:20px;font-weight:700}.sub{font-size:11px;color:#98a2b3;margin:4px 0 18px}
.nav{padding:10px 11px;border-radius:8px;color:#d0d5dd;margin:3px 0;cursor:pointer}
.nav.active,.nav:hover{background:#1d2939;color:#fff}
.main{display:grid;grid-template-rows:64px 1fr;min-width:0}
.top{background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:9px 12px}
.spacer{margin-right:auto}
.btn{border:1px solid #d0d5dd;background:#fff;border-radius:8px;padding:8px 10px}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.success{background:var(--ok);border-color:var(--ok);color:#fff}
.btn.danger{color:var(--danger)}
.btn.active{background:#eef4ff;border-color:#84adff;color:#175cd3}
.status{font-size:11px;color:var(--muted);white-space:nowrap}
.content{overflow:hidden;position:relative}
.page{display:none;height:100%;overflow:auto;padding:14px}
.page.active{display:block}
.cards{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px}
.num{font-size:28px;font-weight:700}.muted{font-size:12px;color:var(--muted);line-height:1.8}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.table-wrap{overflow:auto;max-height:68vh}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:8px;border-bottom:1px solid #eef2f6;text-align:right;font-size:12px}
.table th{position:sticky;top:0;background:#f8fafc;color:#475467}
.workspace{height:100%;display:grid;grid-template-columns:280px 1fr 350px;background:#eef2f7}
.pane{background:#fff;overflow:auto;padding:12px;border-left:1px solid var(--line)}
.pane.properties{border-left:0;border-right:1px solid var(--line)}
.list-item{padding:8px;border-radius:7px;cursor:pointer;border:1px solid transparent}
.list-item:hover,.list-item.active{background:#eef4ff;border-color:#c7d7fe}
.tabs{display:flex;gap:5px;margin-bottom:10px}
.tab{flex:1;border:1px solid #d0d5dd;background:#fff;padding:7px;border-radius:7px}
.tab.active{background:var(--brand);color:#fff}
.panel{display:none}.panel.active{display:block}
label{display:block;font-size:12px;color:#475467;margin:8px 0 4px}
input,select,textarea{width:100%;border:1px solid #d0d5dd;border-radius:7px;padding:8px;background:#fff}
textarea{min-height:72px;resize:vertical}
.row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.score{border:1px solid var(--line);border-radius:10px;padding:11px;margin:8px 0;background:#fff}
.bar{height:8px;background:#eaecf0;border-radius:8px;overflow:hidden}.bar span{height:100%;display:block;background:var(--brand2)}
.action-grid,.meeting-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.modal{display:none;position:fixed;inset:0;background:rgba(16,24,40,.55);z-index:50;align-items:center;justify-content:center;padding:12px}
.modal.show{display:flex}.modal-box{background:#fff;border-radius:12px;padding:16px;width:min(720px,100%);max-height:92vh;overflow:auto}
.badge{display:inline-block;padding:3px 8px;border-radius:14px;font-size:11px}
.ok{background:#ecfdf3;color:#027a48}.warn{background:#fff7e6;color:#b54708}.info{background:#eef4ff;color:#175cd3}

/* Graph */
.graph-shell{height:100%;display:grid;grid-template-rows:auto 1fr;min-width:0}
.graph-toolbar{display:flex;gap:7px;align-items:center;flex-wrap:wrap;padding:10px;background:#fff;border-bottom:1px solid var(--line)}
.graph-stage{position:relative;overflow:hidden;background:linear-gradient(#fff,#f8fafc);touch-action:none}
.graph-stage svg{width:100%;height:100%;display:block}
.graph-node rect{rx:12;ry:12;stroke-width:2.5;filter:drop-shadow(0 3px 5px rgba(16,24,40,.14));cursor:pointer}
.graph-node text{pointer-events:none;font-size:13px;font-weight:700;fill:#172033}
.graph-node .owner{font-size:10px;font-weight:400;fill:#667085}
.graph-node.selected rect{stroke-width:5}
.graph-edge{fill:none;stroke:#98a2b3;stroke-width:2.1;opacity:.75;marker-end:url(#arrow)}
.graph-edge.weighted{stroke:var(--blue)}
.graph-group{fill:none;stroke:#d0d5dd;stroke-dasharray:7 8;stroke-width:1.5}
.graph-label{font-size:16px;font-weight:700;fill:#667085;opacity:.78}
.matrix-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px;margin-bottom:10px}
.view-note{padding:10px;background:#fffaeb;border:1px solid #fedf89;border-radius:8px;color:#7a2e0e;font-size:12px}
.mobile{display:none}
@media(max-width:900px){
 .app{grid-template-columns:1fr}
 .sidebar{position:fixed;right:-245px;top:0;bottom:0;width:230px;z-index:40;transition:.2s}
 .sidebar.open{right:0}
 .mobile{display:inline-block}
 .cards{grid-template-columns:repeat(2,1fr)}
 .grid2,.grid3,.action-grid,.meeting-grid{grid-template-columns:1fr}
 .workspace{grid-template-columns:1fr}
 .pane.explorer,.pane.properties{display:none}
 .main{grid-template-rows:56px 1fr}
 .top{padding:7px 8px;gap:5px}
 .page{padding:9px}
 .status{display:none}
 .graph-toolbar{padding:7px;gap:5px}
}

.role-chip{display:flex;align-items:center;gap:6px}
.role-chip select{width:auto;min-width:110px;padding:6px}
.filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.filters select,.filters input{width:auto;min-width:150px}
.dashboard-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.kpi-status{font-size:11px;padding:3px 7px;border-radius:12px}
.s-green{background:#ecfdf3;color:#027a48}.s-yellow{background:#fffaeb;color:#b54708}.s-red{background:#fef3f2;color:#b42318}.s-gray{background:#f2f4f7;color:#475467}
.weight-label{font-size:11px;fill:#344054;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}
.hierarchy-card{border:1px solid var(--line);background:#fff;border-radius:10px;padding:10px;min-width:210px;box-shadow:0 2px 5px rgba(16,24,40,.08)}
.report-menu{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.report-option{border:1px solid var(--line);border-radius:10px;padding:12px;background:#fff;cursor:pointer}
.report-option:hover{border-color:#84adff;background:#f8faff}
.permission-note{background:#fff7e6;border:1px solid #fedf89;color:#7a2e0e;padding:8px;border-radius:8px;font-size:11px;margin-bottom:8px}
.mobile-inspector{display:none;position:fixed;inset:58px 0 0 0;background:#fff;z-index:35;overflow:auto;padding:12px}
.mobile-inspector.show{display:block}
@media(max-width:900px){
 .report-menu{grid-template-columns:1fr}
 .role-chip{display:none}
 .mobile-inspector .tabs{position:sticky;top:0;background:#fff;padding:5px 0;z-index:2}
}


.objective-head{display:flex;align-items:flex-start;gap:10px}
.objective-head>div:first-child{flex:1}
.chip-wrap{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
#objectiveList .list-item{margin-bottom:6px}
#objectiveDetail p{line-height:2}


.org-row{
 display:flex;align-items:center;gap:10px;justify-content:space-between;
 border:1px solid var(--line);border-radius:9px;padding:9px 10px;
 margin-bottom:6px;background:#fff;cursor:pointer
}
.org-row:hover,.org-row.active{background:#eef4ff;border-color:#84adff}
.org-row>div:first-child{flex:1}


#userList .list-item{margin-bottom:6px}
#rolePermissionRows td{text-align:center}
#rolePermissionRows td:first-child{text-align:right;font-weight:700}


.properties .tabs{flex-wrap:wrap}
.properties .tab{min-width:70px}


#performanceRows input[type="checkbox"]{width:auto;transform:scale(1.2)}
#performance .table td:nth-child(7),#performance .table th:nth-child(7){text-align:center}


.weight-item{cursor:pointer}
.weight-item:hover{border-color:#84adff;background:#f8faff}
#weights .cards{grid-template-columns:repeat(4,minmax(150px,1fr))}
@media(max-width:900px){#weights .cards{grid-template-columns:repeat(2,1fr)}}


.action-card .badge{margin-left:5px}
.editActionBtn,.editMeetingBtn{white-space:nowrap}

.auth-gate{position:fixed;inset:0;background:rgba(15,23,42,.88);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px}.auth-gate.hidden{display:none}.auth-card{width:min(430px,100%);background:#fff;border-radius:16px;padding:24px;box-shadow:0 24px 80px rgba(0,0,0,.35);direction:rtl}.auth-card h2{margin-top:0}.auth-note{margin-top:12px;color:#b91c1c;font-size:13px;line-height:1.8}.cloud-status{position:fixed;left:16px;bottom:16px;z-index:9999;background:#111827;color:#fff;padding:8px 12px;border-radius:999px;font-size:12px;box-shadow:0 8px 24px rgba(0,0,0,.25)}.cloud-status.ok{background:#166534}.cloud-status.working{background:#1d4ed8}.cloud-status.error{background:#b91c1c}
