/* Übersicht über alle Firmen – baut auf styles.css von Teamplan auf. */
.cp { min-height: 100vh; }
.cp-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.cp-head-actions { display: flex; align-items: center; gap: 10px; }
.cp-main { max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; display: grid; gap: 28px; min-width: 0; }
.cp-main .page-head { margin-bottom: 0; }
.cp-section { display: grid; gap: 12px; min-width: 0; }
.cp-section-head { display: flex; align-items: baseline; gap: 10px; }
.cp-section-head h2 { font-size: 18px; font-weight: 650; }
.cp-small { font-size: 13px; }
.cp-grid > .panel { align-content: start; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cp-grid .panel h3 { font-size: 15px; display: flex; align-items: center; gap: 4px; }

.cp-companies { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cp-company {
  display: grid; gap: 12px; padding: 16px 18px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius);
}
.cp-company.is-down { border-top-color: var(--danger); }
.cp-company-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-company-link:hover { text-decoration: underline; }
.cp-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.cp-warn { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); cursor: help; }

.cp-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.cp-company .cp-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp-num {
  display: grid; gap: 2px; padding: 8px 10px; text-align: left;
  background: var(--sunken); border: 1px solid transparent; border-radius: 8px;
}
button.cp-num { cursor: pointer; }
button.cp-num:hover { border-color: var(--line); }
.cp-num strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.cp-num span { font-size: 12px; line-height: 1.25; color: var(--muted); }
.cp-num.overdue strong { color: var(--danger); }
.cp-num.soon strong { color: var(--soon); }

.cp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cp-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 13px; color: var(--muted);
}
.cp-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cp-chip-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

.cp-task-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cp-task {
  display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 0.8fr) auto; align-items: center; gap: 12px;
  padding: 9px 6px; border-top: 1px solid var(--line);
}
.cp-task-list li:first-child .cp-task { border-top: 0; }
.cp-task:hover { background: var(--sunken); }
.cp-task-company {
  justify-self: start; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  color: color-mix(in srgb, var(--c) 70%, var(--ink)); background: color-mix(in srgb, var(--c) 14%, var(--surface));
}
.cp-task-title { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.cp-task-where { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cp-crm { display: grid; gap: 6px; }
.cp-crm + .cp-crm { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.cp-crm-head { display: flex; justify-content: space-between; gap: 8px; }
.cp-bar { display: grid; grid-template-columns: minmax(0, 9em) 1fr 3em; align-items: center; gap: 8px; font-size: 13px; }
.cp-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.cp-bar-track { height: 8px; background: var(--sunken); border-radius: 4px; overflow: hidden; }
.cp-bar-fill { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.cp-bar-n { text-align: right; font-variant-numeric: tabular-nums; }

.cp-people, .cp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.cp-people li { display: flex; justify-content: space-between; gap: 8px; }
.cp-checks li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr); gap: 0 6px; }
.cp-checks li > span:last-child { grid-column: 2; font-size: 13px; overflow-wrap: anywhere; }
.cp-checks .is-ok > span:first-child { color: var(--ok); }
.cp-checks .is-bad > span:first-child { color: var(--danger); }

@media (max-width: 720px) {
  .cp-head { padding: 10px 16px; }
  .cp-main { padding: 20px 16px 48px; }
  .cp-task { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .cp-task-company { grid-column: 1 / -1; }
  .cp-task-where { grid-column: 1; }
}
