#tp-maestro {
  --mr-bg: #f8fafc;
  --mr-card: #ffffff;
  --mr-line: rgba(15, 23, 42, .10);
  --mr-text: #0f172a;
  --mr-muted: #64748b;
  --mr-blue: #2563eb;
  --mr-green: #16a34a;
  --mr-amber: #d97706;
  --mr-red: #dc2626;
  color: var(--mr-text);
}

.maestro-shell {
  padding: 18px;
  max-width: 1500px;
  margin: 0 auto;
}

.maestro-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  background: linear-gradient(135deg, #0f172a, #1f2937);
  border-radius: 8px;
  color: #f8fafc;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
}

.maestro-kicker {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #93c5fd;
  font-weight: 800;
}

.maestro-title {
  margin: 3px 0 4px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.maestro-sub {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
}

.maestro-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 420px;
}

.maestro-btn,
.maestro-icon-btn {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #f8fafc;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.maestro-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  min-width: 170px;
}
.maestro-btn.success { background: #16a34a; border-color: #16a34a; }
.maestro-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.maestro-notice {
  margin: 14px 0;
  padding: 11px 13px;
  border: 1px solid rgba(37, 99, 235, .18);
  background: rgba(37, 99, 235, .06);
  color: #1e40af;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.maestro-notice.warn {
  border-color: rgba(217, 119, 6, .24);
  background: rgba(217, 119, 6, .08);
  color: #92400e;
}

.maestro-notice.fail {
  border-color: rgba(220, 38, 38, .24);
  background: rgba(220, 38, 38, .08);
  color: #991b1b;
}

.maestro-health {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.maestro-score,
.maestro-kpis > div,
.maestro-panel {
  background: var(--mr-card);
  border: 1px solid var(--mr-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.maestro-score {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.maestro-score span {
  font-size: 34px;
  font-weight: 900;
  color: var(--mr-blue);
  line-height: 1;
}

.maestro-score small,
.maestro-kpis span,
.maestro-panel-head span {
  color: var(--mr-muted);
  font-size: 11px;
  font-weight: 700;
}

.maestro-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px;
}

.maestro-kpis > div {
  padding: 15px;
}

.maestro-kpis b {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.maestro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.maestro-panel {
  min-height: 260px;
  overflow: hidden;
}

.maestro-panel.priority {
  min-height: 340px;
}

.maestro-panel.wide,
.maestro-panel.full {
  grid-column: 1 / -1;
}

.maestro-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--mr-line);
  background: #f8fafc;
}

.maestro-panel-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.maestro-table-wrap,
.maestro-tree,
.maestro-list,
.maestro-explain,
.maestro-gantt {
  padding: 12px;
  overflow: auto;
  max-height: 390px;
  font-size: 12px;
}

.maestro-empty {
  color: var(--mr-muted);
  display: flex;
  align-items: center;
  min-height: 120px;
}

.maestro-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.maestro-demo-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 8px;
  background: rgba(37, 99, 235, .06);
}

.maestro-demo-intro b {
  font-size: 13px;
}

.maestro-demo-intro span {
  color: var(--mr-muted);
  font-size: 12px;
}

.maestro-demo-intro button {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.maestro-table th,
.maestro-table td {
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  padding: 8px 9px;
  vertical-align: top;
}

.maestro-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

.maestro-table tr {
  cursor: default;
}

.maestro-table tr:hover td {
  background: rgba(37, 99, 235, .04);
}

.mr-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  border: 1px solid rgba(15, 23, 42, .10);
  color: #334155;
  background: #f1f5f9;
  white-space: nowrap;
}

.mr-pill.high { color: #166534; background: #dcfce7; border-color: rgba(22, 101, 52, .18); }
.mr-pill.mid { color: #92400e; background: #fef3c7; border-color: rgba(146, 64, 14, .18); }
.mr-pill.low { color: #991b1b; background: #fee2e2; border-color: rgba(153, 27, 27, .18); }
.mr-pill.ai { color: #3730a3; background: #e0e7ff; border-color: rgba(55, 48, 163, .18); }

.maestro-list {
  display: block;
}

.maestro-list-item {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 7px;
  padding: 9px;
  margin-bottom: 8px;
  background: #ffffff;
}

.maestro-list-item b {
  display: block;
  margin-bottom: 3px;
}

.maestro-list-item.warn { border-color: rgba(217, 119, 6, .25); }
.maestro-list-item.fail { border-color: rgba(220, 38, 38, .25); }
.maestro-list-item.pass { border-color: rgba(22, 163, 74, .25); }

.maestro-tree-row {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  font-family: "JetBrains Mono", monospace;
  color: #334155;
}

.maestro-explain-block {
  display: grid;
  gap: 9px;
}

.maestro-explain-block div {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 7px;
  padding: 9px;
}

.maestro-gantt {
  min-height: 260px;
  max-height: 520px;
}

.maestro-gantt-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.maestro-gantt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
}

.maestro-gantt-track {
  position: relative;
  height: 22px;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
}

.maestro-gantt-bar {
  position: absolute;
  top: 4px;
  height: 14px;
  min-width: 4px;
  border-radius: 4px;
  background: #2563eb;
}

.maestro-gantt-bar.warn { background: #d97706; }
.maestro-gantt-bar.critical { background: #dc2626; }

@media (max-width: 980px) {
  .maestro-header,
  .maestro-health,
  .maestro-grid {
    grid-template-columns: 1fr;
  }
  .maestro-header {
    display: grid;
  }
  .maestro-actions {
    min-width: 0;
    justify-content: stretch;
  }
  .maestro-btn {
    flex: 1 1 160px;
  }
  .maestro-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .maestro-panel.wide,
  .maestro-panel.full {
    grid-column: auto;
  }
}
