/* Team Master dashboard — match IAM/archive grid pattern */
.app.view-team {
  grid-template-columns: var(--sidebar-w, 64px) 1fr;
  grid-template-areas:
    "sidebar top"
    "sidebar team";
}
.app.view-team .inbox-panel,
.app.view-team .chat-panel,
.app.view-team .profile-panel,
.app.view-team .iam-panel,
.app.view-team .archive-panel,
.app.view-team .templates-panel {
  display: none !important;
}

.team-panel {
  grid-area: team;
  background: var(--bg, #f8fafc);
  overflow: hidden;
  display: none;
  flex-direction: column;
  min-height: 0;
}
/* Must respect [hidden]: both #team-panel and #insights-panel use .team-panel */
.app.view-team .team-panel:not([hidden]) {
  display: flex;
}
.app.view-team .team-panel[hidden] {
  display: none !important;
}

.team-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px 0;
  flex-shrink: 0;
}
.team-panel .panel-header h1 {
  margin: 0;
  font-size: 20px;
}
.team-body {
  padding: 12px 20px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.team-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.team-toolbar label {
  font-size: 13px;
  color: #475569;
}
.team-toolbar select {
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.team-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.team-metric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
}
.team-metric-card .label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}
.team-metric-card .value {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}
.team-metric-card .sub {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.team-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.team-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.team-info-dl {
  margin: 0;
  display: grid;
  gap: 10px 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.team-info-dl > div {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.team-info-dl dt {
  margin: 0 0 4px;
  font-size: 12px;
  color: #64748b;
}
.team-info-dl dd {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.team-panel .iam-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.team-panel .iam-table th,
.team-panel .iam-table td {
  border: 1px solid var(--border, #e2e8f0);
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
}
.team-panel .iam-table th {
  background: #f8fafc;
}

.insights-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.insights-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.insights-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
}
.insights-bar-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.insights-summary-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insights-summary-btn {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insights-summary-btn:hover {
  color: var(--primary, #0f766e);
  text-decoration: underline;
}
.insights-detail-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  max-height: 360px;
  overflow: auto;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
