:root{
  --navy:#16324f;
  --navy-deep:#0d2036;
  --gold:#c98a2e;
  --gold-light:#f4e3c6;
  --blue-header:#a9c4e0;
  --paper:#f7f5f0;
  --ink:#1c2530;
  --line:#d8d2c4;
  --ok:#3f7a4d;
}
*{box-sizing:border-box;}

body{
  margin:0;
  background:var(--paper);
  font-family:"Segoe UI", ui-sans-serif, system-ui, Arial, sans-serif;
}

.cpm-app{
  color:var(--ink);
  max-width:960px;
  margin:24px auto;
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  background:var(--paper);
}
.cpm-band{
  background:linear-gradient(135deg,var(--navy-deep),var(--navy));
  color:#fff;
  padding:18px 22px;
}
.cpm-band h1{
  margin:0;
  font-size:18px;
  letter-spacing:.02em;
  font-weight:700;
}
.cpm-band p{
  margin:4px 0 0;
  font-size:12.5px;
  color:#cfd9e6;
}
.cpm-body{padding:20px 22px 26px;}
.cpm-section-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--gold);
  font-weight:700;
  margin:22px 0 10px;
  border-bottom:2px solid var(--gold-light);
  padding-bottom:6px;
}
.cpm-section-label:first-child{margin-top:0;}
.cpm-grid5{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.cpm-field label{
  display:block;
  font-size:11px;
  font-weight:700;
  color:var(--navy);
  margin-bottom:4px;
}
.cpm-field input{
  width:100%;
  padding:7px 9px;
  border:1px solid var(--line);
  border-radius:6px;
  font-size:13px;
  background:#fff;
  color:var(--ink);
}
.cpm-field input:focus{
  outline:2px solid var(--navy);
  outline-offset:1px;
}
.cpm-field select{
  width:100%;
  padding:7px 9px;
  border:1px solid var(--line);
  border-radius:6px;
  font-size:13px;
  background:#fff;
  color:var(--ink);
}
.cpm-field select:focus{
  outline:2px solid var(--navy);
  outline-offset:1px;
}
.cpm-co-row{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}
.cpm-co-tag{
  background:var(--navy);
  color:#fff;
  font-weight:700;
  font-size:12px;
  padding:7px 10px;
  border-radius:6px;
  min-width:44px;
  text-align:center;
}
.cpm-co-row input{
  flex:1;
  padding:7px 9px;
  border:1px solid var(--line);
  border-radius:6px;
  font-size:13px;
}
.cpm-remove{
  background:none;
  border:1px solid var(--line);
  color:#a33;
  border-radius:6px;
  width:30px;
  height:30px;
  cursor:pointer;
  font-size:14px;
  line-height:1;
}
.cpm-remove:hover{background:#fbe9e9;}
.cpm-add{
  background:#fff;
  border:1px dashed var(--navy);
  color:var(--navy);
  padding:7px 12px;
  border-radius:6px;
  font-size:12.5px;
  font-weight:700;
  cursor:pointer;
  margin-top:2px;
}
.cpm-add:hover{background:var(--gold-light);}
.cpm-table-wrap{
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:8px;
  margin-top:4px;
}
table.cpm-map{
  border-collapse:collapse;
  width:100%;
  min-width:760px;
  font-size:12.5px;
}
table.cpm-map th, table.cpm-map td{
  border:1px solid var(--line);
  text-align:center;
  padding:6px 4px;
}
table.cpm-map thead th{
  background:var(--blue-header);
  color:var(--navy-deep);
  font-weight:700;
  position:sticky;
  top:0;
}
table.cpm-map thead th.cpm-co-col{
  background:var(--navy);
  color:#fff;
}
table.cpm-map tbody td.cpm-co-col{
  background:#eef2f6;
  font-weight:700;
  color:var(--navy);
}
table.cpm-map td.cpm-cb{cursor:pointer;}
table.cpm-map td.cpm-cb input{
  width:15px;height:15px;cursor:pointer;
}
table.cpm-map td.cpm-t2-activity input,
table.cpm-map td.cpm-t2-hours input{
  width:100%;
  padding:5px 6px;
  border:1px solid var(--line);
  border-radius:5px;
  font-size:12.5px;
  text-align:left;
}
table.cpm-map td.cpm-t2-hours input{
  text-align:center;
}
table.cpm-map td.cpm-t2-cos{
  text-align:left;
  padding:6px 8px;
}
table.cpm-map td.cpm-t2-cos label{
  display:inline-flex;
  align-items:center;
  gap:3px;
  font-size:11.5px;
  margin-right:8px;
  white-space:nowrap;
  cursor:pointer;
}
table.cpm-map td.cpm-t2-cos input{
  width:13px;height:13px;cursor:pointer;
}
table.cpm-map td.cpm-t2-po{
  text-align:left;
  padding:6px 8px;
  font-size:11.5px;
  color:var(--navy);
  font-weight:600;
}
table.cpm-map td.cpm-t2-po.empty{
  color:#999;
  font-weight:400;
  font-style:italic;
}
.cpm-actions{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:20px;
  flex-wrap:wrap;
}
.cpm-generate{
  background:var(--gold);
  color:#2b1c05;
  border:none;
  padding:11px 20px;
  border-radius:7px;
  font-weight:700;
  font-size:13.5px;
  cursor:pointer;
}
.cpm-generate:hover{filter:brightness(1.06);}
.cpm-status{
  font-size:12.5px;
  color:#555;
}
.cpm-status.ok{color:var(--ok); font-weight:600;}
.cpm-status.error{color:#b3261e; font-weight:600;}
.cpm-field input.cpm-invalid,
.cpm-field select.cpm-invalid{
  border-color:#b3261e;
  outline:1px solid #b3261e;
  background:#fdf1f0;
}
.cpm-hint{
  font-size:11.5px;
  color:#777;
  margin-top:6px;
}