:root {
  --bg: #f5f8f4;
  --surface: #ffffff;
  --surface-soft: #eef6ed;
  --ink: #17231a;
  --muted: #667062;
  --line: #dbe7d7;
  --green: #0e5c2a;
  --green-2: #2f8d46;
  --green-3: #dff0dc;
  --amber: #d99a00;
  --amber-soft: #fff4cf;
  --red: #c83b32;
  --red-soft: #ffe3df;
  --shadow: 0 18px 50px rgba(16, 48, 24, .08);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}

button, input, select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #eef7ec 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-lockup {
  height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-lockup img {
  width: 88%;
  height: auto;
  object-fit: contain;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.nav-item:hover {
  background: #e6f1e5;
  color: var(--green);
}

.nav-item.active {
  background: var(--green);
  color: white;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}

.collector-card {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.collector-card strong,
.collector-card small {
  display: block;
}

.collector-card small {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 5px;
}

.status-dot.good { background: var(--green-2); box-shadow: 0 0 0 4px var(--green-3); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.workspace {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  color: var(--green);
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mode-chip,
.date-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
}

.mode-chip {
  color: #704c00;
  background: var(--amber-soft);
  border: 1px solid #efd37b;
}

.date-chip {
  color: var(--green);
  background: var(--green-3);
  border: 1px solid #b7d8b1;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.load-data-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  border-radius: var(--radius);
  padding: 7px 12px;
  font-weight: 800;
  cursor: pointer;
}

.load-data-button:hover {
  background: #0b4c22;
}

.metric-tile.info strong {
  color: var(--green-2);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.portal-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.portal-back-link:hover {
  border-color: var(--green);
  background: var(--surface-soft);
}

.kpi-rule-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(360px, 2fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}

.kpi-rule-panel h2 {
  margin: 12px 0 8px;
  font-size: 22px;
}

.kpi-rule-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rule-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf6;
}

.rule-grid strong,
.rule-grid span {
  display: block;
}

.history-panel {
  margin-bottom: 16px;
}

.due-date-panel {
  margin-bottom: 16px;
}

.due-date-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
}

.due-date-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.due-date-controls button,
.due-date-controls select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
}

.due-date-controls button {
  cursor: pointer;
}

.due-date-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.due-date-controls button:not(:disabled):hover,
.due-date-controls select:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-3);
}

.due-date-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.due-date-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.due-date-summary span,
.due-date-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.due-date-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 24px;
}

.due-date-table {
  min-width: 980px;
}

.due-date-table tr {
  cursor: default;
}

.due-date-check {
  width: 18px;
  height: 18px;
  accent-color: var(--green-2);
}

.due-date-task-link {
  display: block;
  max-width: 360px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.due-date-task-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
}

.history-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-controls input,
.history-controls button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
}

.history-controls button {
  cursor: pointer;
}

.history-controls button:hover {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-3);
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.history-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.history-summary span,
.history-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.history-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 24px;
}

.history-table {
  min-width: 1120px;
}

.history-table tr {
  cursor: default;
}

.history-task-samples {
  display: grid;
  gap: 5px;
  max-width: 340px;
}

.history-task-samples a,
.history-task-samples span {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-task-samples small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.rule-grid strong {
  color: var(--ink);
  margin-bottom: 6px;
}

.rule-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.metric-tile,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-tile {
  padding: 18px;
}

.metric-tile span,
.metric-tile small {
  display: block;
  color: var(--muted);
}

.metric-tile strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--green);
  font-size: 28px;
  line-height: 1;
}

.metric-tile.warning strong { color: var(--amber); }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.action-board {
  margin-bottom: 14px;
}

.workload-breakdown-panel {
  margin-bottom: 14px;
}

.person-workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.person-workload-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfb;
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank main count"
    "rank meta label";
  gap: 8px 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.person-workload-card:hover {
  border-color: #a7cfa0;
  background: #f4faf3;
}

.person-rank {
  grid-area: rank;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-3);
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}

.person-workload-main {
  grid-area: main;
  min-width: 0;
}

.person-workload-main strong,
.person-workload-main small {
  display: block;
}

.person-workload-main strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-workload-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.person-workload-count {
  grid-area: count;
  color: var(--green);
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
}

.person-workload-meta {
  grid-area: meta;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.person-workload-meta i {
  font-style: normal;
}

.person-workload-card .label {
  grid-area: label;
  justify-self: end;
}

.action-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.action-summary div {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fbfdfb;
}

.action-summary span,
.action-summary strong {
  display: block;
}

.action-summary span {
  color: var(--muted);
  font-size: 12px;
}

.action-summary strong {
  margin-top: 5px;
  color: var(--green);
  font-size: 26px;
  line-height: 1;
}

.action-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.action-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fcf8;
}

.action-column h3 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 15px;
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-item {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.action-item:hover {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-3);
}

.action-item strong,
.action-item small {
  display: block;
}

.action-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-empty {
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-size: 13px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header.compact {
  margin-bottom: 8px;
}

.panel h2 {
  margin: 0;
  font-size: 19px;
  color: var(--ink);
}

.panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-tools input,
.table-tools select,
#employeeSelect {
  min-height: 36px;
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  outline: none;
}

.table-tools input:focus,
.table-tools select:focus,
#employeeSelect:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-3);
}

.score-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.score-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
}

.score-table td {
  padding: 12px 6px;
  border-bottom: 1px solid #edf3ea;
  vertical-align: middle;
}

.score-table tr {
  cursor: pointer;
}

.score-table tr:hover,
.score-table tr.selected {
  background: #f3faf1;
}

.person-cell strong,
.person-cell small {
  display: block;
}

.person-cell small {
  color: var(--muted);
  margin-top: 2px;
}

.mini-bar {
  width: 104px;
  height: 8px;
  background: #edf2ea;
  border-radius: 999px;
  overflow: hidden;
}

.mini-bar i {
  display: block;
  height: 100%;
  background: var(--green-2);
  border-radius: 999px;
}

.mini-bar.amber i {
  background: var(--amber);
}

.label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 12px;
}

.label.strong { color: var(--green); background: var(--green-3); }
.label.watch { color: #765300; background: var(--amber-soft); }
.label.risk { color: var(--red); background: var(--red-soft); }

.score-ring {
  width: 176px;
  height: 176px;
  margin: 8px auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green-2) 0deg, var(--green-2) var(--score-deg, 0deg), #edf2ea var(--score-deg, 0deg));
  position: relative;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  background: var(--surface);
  border-radius: 50%;
}

.score-ring span,
.score-ring small {
  position: relative;
  z-index: 1;
}

.score-ring span {
  font-size: 42px;
  font-weight: 900;
  color: var(--green);
}

.score-ring small {
  align-self: end;
  margin-top: -50px;
  color: var(--muted);
  font-weight: 700;
}

.breakdown {
  display: grid;
  gap: 13px;
  margin-bottom: 18px;
}

.breakdown > div {
  display: grid;
  grid-template-columns: 78px 1fr 52px;
  gap: 9px;
  align-items: center;
}

.breakdown span {
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 10px;
  background: #edf2ea;
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green-2);
  border-radius: 999px;
  transition: width .2s ease;
}

.bar.amber i {
  background: var(--amber);
}

.flag-list {
  display: grid;
  gap: 8px;
}

.flag-item {
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fbfdfb;
  color: var(--muted);
  line-height: 1.35;
}

.flag-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

.reason-box {
  margin-top: 12px;
  padding: 13px;
  border-radius: var(--radius);
  background: #f8fcf7;
  border: 1px solid var(--line);
}

.reason-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--green);
}

.reason-box p {
  margin: 7px 0;
  color: var(--ink);
  line-height: 1.45;
}

.workload-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.workload-mini span {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
  color: var(--muted);
  font-size: 12px;
}

.workload-mini strong {
  display: block;
  color: var(--green);
  font-size: 19px;
  margin-top: 2px;
}

.detail-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--green-3);
  color: var(--green);
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.detail-link:hover,
.back-link:hover {
  background: var(--green);
  color: white;
}

.data-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.data-strip > div {
  padding: 10px 12px;
  border-left: 3px solid var(--green-2);
  background: #f9fcf8;
}

.data-strip strong,
.data-strip span {
  display: block;
}

.data-strip span {
  color: var(--muted);
  margin-top: 3px;
  font-size: 13px;
}

.employee-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
}

.employee-layout-polished {
  grid-template-columns: minmax(0, 1fr);
}

.employee-layout-polished .employee-profile {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

.employee-layout-polished .employee-profile > .panel-header,
.employee-layout-polished .employee-profile > .employee-score-line,
.employee-layout-polished .employee-profile > .capacity-panel {
  grid-column: 1 / 2;
}

.employee-layout-polished .employee-profile > .timeline {
  grid-column: 2 / 3;
  grid-row: 1 / 4;
}

.employee-layout-polished .employee-email-preview {
  margin-top: 14px;
}

.employee-score-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
}

.capacity-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.employee-score-line > div,
.capacity-panel > div {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.employee-score-line span,
.employee-score-line strong,
.capacity-panel span,
.capacity-panel strong,
.capacity-panel small {
  display: block;
}

.employee-score-line span,
.capacity-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.employee-score-line strong,
.capacity-panel strong {
  color: var(--green);
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.15;
  word-break: normal;
}

.employee-score-line strong .metric-unit,
.capacity-panel strong .metric-unit {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.capacity-panel small {
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.3;
  font-size: 12px;
}

.timeline h3 {
  margin: 18px 0 10px;
  font-size: 16px;
}

.weekly-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: end;
  height: 250px;
  padding: 16px;
  background: #f9fcf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.week-bar {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 7px;
  align-items: end;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.week-bar i {
  width: 100%;
  min-height: 8px;
  background: linear-gradient(180deg, #64b96a, #0e5c2a);
  border-radius: var(--radius) var(--radius) 0 0;
}

.week-bar strong {
  color: var(--ink);
}

.email-card {
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 190px;
  line-height: 1.55;
}

.email-card h3 {
  margin: 0 0 10px;
  color: var(--green);
}

.email-card p {
  color: var(--ink);
  margin: 8px 0;
}

.email-card ul {
  padding-left: 20px;
  margin: 10px 0;
}

.health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
}

.operation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.operation-hero h2 {
  margin: 0;
  color: var(--green);
  font-size: 24px;
}

.operation-status-card {
  min-width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.operation-status-card strong,
.operation-status-card small {
  display: block;
}

.operation-status-card small {
  margin-top: 4px;
  color: var(--muted);
}

.operation-metrics {
  margin-bottom: 14px;
}

.operation-progress-panel {
  margin-bottom: 14px;
}

.progress-label {
  color: var(--green);
  font-size: 24px;
}

.operation-progress-track,
.operation-row-track {
  height: 12px;
  border-radius: 999px;
  background: #edf2ea;
  overflow: hidden;
}

.operation-progress-track i,
.operation-row-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-2), var(--green));
}

.operation-small-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.operation-small-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.operation-small-grid span,
.operation-small-grid strong {
  display: block;
}

.operation-small-grid span {
  color: var(--muted);
  font-size: 12px;
}

.operation-small-grid strong {
  margin-top: 5px;
  color: var(--green);
  font-size: 24px;
}

.operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
  gap: 14px;
  margin-bottom: 14px;
}

.operation-group-list,
.operation-action-list,
.operation-error-list,
.operation-pending-list {
  display: grid;
  gap: 10px;
}

.operation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.operation-row strong,
.operation-row small {
  display: block;
}

.operation-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.operation-row-numbers {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.operation-row-numbers span {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.operation-row-numbers b {
  color: var(--green);
}

.operation-row-track {
  grid-column: 1 / -1;
  height: 8px;
}

.operation-table {
  min-width: 680px;
}

.operation-grid .panel {
  overflow: hidden;
}

.operation-error-item,
.operation-pending-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.operation-error-item {
  display: grid;
  gap: 4px;
}

.operation-error-item strong {
  color: var(--red);
}

.operation-error-item span {
  color: var(--ink);
}

.operation-error-item small {
  color: var(--muted);
}

.operation-pending-item {
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.operation-pending-item strong,
.operation-pending-item small {
  display: block;
}

.operation-pending-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-pending-item > div {
  min-width: 0;
  overflow: hidden;
}

.operation-pending-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.operation-pending-item span,
.operation-pending-item b {
  max-width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: var(--green-3);
  color: var(--green);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.health-list li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.health-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.schema-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.schema-list code {
  display: block;
  padding: 12px;
  border-radius: var(--radius);
  background: #17371f;
  color: #e7f7e5;
  font-size: 13px;
}

.employee-page {
  background: var(--bg);
}

.report-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.report-header,
.report-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.report-header {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.report-header img {
  width: 170px;
  height: auto;
}

.report-header h1 {
  margin: 0;
  color: var(--green);
  font-size: 27px;
}

.report-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.report-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.report-hero h2 {
  margin: 14px 0 8px;
  font-size: 54px;
  line-height: 1;
  color: var(--green);
}

.report-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.report-ring {
  width: 170px;
  height: 170px;
  margin: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.explain-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.explain-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.explain-item strong {
  display: block;
  color: var(--green);
  margin-bottom: 5px;
}

.explain-item p {
  color: var(--ink);
  line-height: 1.5;
}

.fact-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.workload-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.workload-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.workload-summary span,
.workload-summary strong {
  display: block;
}

.workload-summary span {
  color: var(--muted);
  font-size: 12px;
}

.workload-summary strong {
  margin-top: 6px;
  color: var(--green);
  font-size: 22px;
}

.fact-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.fact-grid span,
.fact-grid strong {
  display: block;
}

.fact-grid span {
  color: var(--muted);
  font-size: 12px;
}

.fact-grid strong {
  margin-top: 5px;
  color: var(--green);
  font-size: 18px;
}

.report-bars {
  margin-top: 14px;
}

.report-rule-note {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.note-grid p {
  margin: 0;
  padding: 12px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  line-height: 1.45;
}

.task-risk-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.task-risk-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fbfdfb;
  color: var(--ink);
  text-decoration: none;
}

.task-risk-item:hover {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-3);
}

.task-risk-item span {
  color: var(--muted);
  font-size: 13px;
}

.task-risk-item.empty {
  pointer-events: none;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow: auto;
  }
  .brand-lockup { width: 190px; height: 92px; flex: 0 0 auto; }
  .nav-stack { grid-auto-flow: column; }
  .collector-card { margin-top: 0; min-width: 220px; }
  .metric-grid,
  .kpi-rule-panel,
  .rule-grid,
  .due-date-summary,
  .history-summary,
  .action-summary,
  .action-columns,
  .content-grid,
  .employee-layout,
  .health-grid,
  .operation-grid,
  .data-strip,
  .report-grid,
  .workload-summary,
  .note-grid { grid-template-columns: 1fr; }
  .report-header { grid-template-columns: 1fr; }
  .employee-layout-polished .employee-profile {
    grid-template-columns: 1fr;
  }
  .employee-layout-polished .employee-profile > .panel-header,
  .employee-layout-polished .employee-profile > .employee-score-line,
  .employee-layout-polished .employee-profile > .capacity-panel,
  .employee-layout-polished .employee-profile > .timeline {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .workspace { padding: 14px; }
  .topbar,
  .operation-hero,
  .panel-header,
  .table-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar h1 { font-size: 23px; }
  .metric-grid,
  .employee-score-line,
  .capacity-panel,
  .operation-small-grid { grid-template-columns: 1fr; }
  .history-controls {
    align-items: stretch;
  }
  .due-date-controls {
    align-items: stretch;
  }
  .due-date-controls label,
  .due-date-controls button {
    width: 100%;
  }
  .history-controls label,
  .history-controls button {
    width: 100%;
  }
  .operation-status-card { min-width: 0; }
  .due-date-table {
    min-width: 0;
  }
  .due-date-table thead {
    display: none;
  }
  .due-date-table,
  .due-date-table tbody,
  .due-date-table tr,
  .due-date-table td {
    display: block;
    width: 100%;
  }
  .due-date-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
  }
  .due-date-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #edf3ea;
    text-align: right;
  }
  .due-date-table td:last-child {
    border-bottom: 0;
  }
  .due-date-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }
  .due-date-table td.due-date-task-cell {
    display: block;
    text-align: left;
  }
  .due-date-table td.due-date-task-cell::before {
    display: block;
    margin-bottom: 6px;
  }
  .due-date-task-link {
    max-width: none;
    white-space: normal;
  }
  .history-table {
    min-width: 0;
  }
  .history-table thead {
    display: none;
  }
  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }
  .history-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
  }
  .history-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #edf3ea;
    text-align: right;
  }
  .history-table td:last-child {
    border-bottom: 0;
  }
  .history-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }
  .history-table td.person-cell,
  .history-table td.history-samples-cell {
    display: block;
    text-align: left;
  }
  .history-table td.person-cell::before {
    display: none;
  }
  .history-table td.history-samples-cell::before {
    display: block;
    margin-bottom: 6px;
  }
  .history-table .history-task-samples {
    max-width: none;
  }
  .history-table .history-task-samples a,
  .history-table .history-task-samples span {
    white-space: normal;
  }
  .operation-pending-item { grid-template-columns: 1fr; }
  .operation-table {
    min-width: 100%;
    table-layout: fixed;
  }
  .operation-table th,
  .operation-table td {
    padding: 8px 4px;
    font-size: 11px;
    word-break: break-word;
  }
  .operation-table .person-cell small {
    display: none;
  }
  .collector-card {
    display: none;
  }
  .brand-lockup {
    display: none;
  }
  .sidebar { padding: 12px; }
  .nav-item { grid-template-columns: 28px; }
  .nav-item span:last-child { display: none; }
}
