/* COMPRIBAND — B2B Dashboard, HTML/CSS getrennt */

:root {
  --cb-bg: #f0f2f5;
  --cb-surface: #ffffff;
  --cb-text: #1a1d24;
  --cb-muted: #5c6370;
  --cb-border: #dde1e6;
  --cb-accent: #c8102e;
  --cb-accent-hover: #a00d25;
  --cb-focus: rgba(200, 16, 46, 0.25);
  --cb-radius: 8px;
  --cb-shadow: 0 1px 3px rgba(26, 29, 36, 0.08);
  --cb-font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--cb-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cb-text);
  background: var(--cb-bg);
}

a {
  color: var(--cb-accent);
  text-decoration: none;
}

a:hover {
  color: var(--cb-accent-hover);
  text-decoration: underline;
}

.cb-skip {
  position: absolute;
  left: -9999px;
}

.cb-skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--cb-surface);
  border: 2px solid var(--cb-accent);
}

.cb-header {
  background: var(--cb-surface);
  border-bottom: 1px solid var(--cb-border);
  box-shadow: var(--cb-shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cb-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cb-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  line-height: 0;
}

.cb-brand:hover {
  text-decoration: none;
}

.cb-brand__logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: min(220px, 72vw);
  object-fit: contain;
}

.cb-brand--login .cb-brand__logo {
  height: 42px;
  max-width: min(270px, 88vw);
}

.cb-login__brand {
  margin-bottom: 1rem;
}

.cb-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cb-text);
  border-bottom: 2px solid var(--cb-accent);
  padding-bottom: 0.35rem;
}

.cb-card--warn {
  border-color: #f5c6cb;
  background: #fff8f8;
}

.cb-warn-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--cb-text);
  font-size: 0.95rem;
}

.cb-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cb-param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem 1.25rem;
}

.cb-table--compact {
  font-size: 0.8rem;
}

.cb-table--compact th,
.cb-table--compact td {
  padding: 0.45rem 0.5rem;
}

.cb-formset-lines {
  font-size: 0.75rem;
}

.cb-formset-lines input[type="text"],
.cb-formset-lines input[type="number"],
.cb-formset-lines select {
  max-width: 5.5rem;
  font-size: 0.75rem;
  padding: 0.25rem;
}

.cb-formset-lines .cb-flags {
  white-space: normal;
  min-width: 6rem;
}

.cb-formset-lines .cb-flags label {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-right: 0.35rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.cb-check {
  width: 1rem;
  height: 1rem;
}

.cb-formset-errors td {
  color: #721c24;
  font-size: 0.85rem;
}

.cb-hub-row--latest {
  background: rgba(200, 16, 46, 0.06);
}

.cb-kunde-panel[hidden] {
  display: none !important;
}

.cb-kunde-panel:not([hidden]) {
  display: block;
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--cb-border);
}

.cb-kopf-2col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem 1.25rem;
}

.cb-field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--cb-muted);
}

.cb-hub-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--cb-accent);
  background: rgba(200, 16, 46, 0.12);
  border-radius: 999px;
  vertical-align: middle;
}

.cb-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--cb-muted);
}

.cb-user__name {
  color: var(--cb-text);
  font-weight: 600;
}

.cb-nav {
  background: var(--cb-surface);
  border-bottom: 1px solid var(--cb-border);
}

.cb-nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.cb-nav a {
  display: inline-block;
  padding: 0.65rem 0.85rem;
  color: var(--cb-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.cb-nav a:hover {
  color: var(--cb-text);
  text-decoration: none;
}

.cb-nav a.is-active {
  color: var(--cb-text);
  font-weight: 600;
  border-bottom-color: var(--cb-accent);
}

.cb-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.cb-card {
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  padding: 1.5rem;
}

.cb-card + .cb-card {
  margin-top: 1.25rem;
}

.cb-page-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.cb-lead {
  margin: 0 0 1.25rem;
  color: var(--cb-muted);
  max-width: 65ch;
}

.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.cb-btn:focus-visible {
  outline: 2px solid var(--cb-accent);
  outline-offset: 2px;
}

.cb-btn--primary {
  background: var(--cb-accent);
  color: #fff;
}

.cb-btn--primary:hover {
  background: var(--cb-accent-hover);
  color: #fff;
  text-decoration: none;
}

.cb-btn--secondary {
  background: var(--cb-surface);
  color: var(--cb-text);
  border-color: var(--cb-border);
}

.cb-btn--secondary:hover {
  background: var(--cb-bg);
  text-decoration: none;
}

.cb-btn--danger {
  background: #fff;
  color: var(--cb-accent);
  border-color: var(--cb-accent);
}

.cb-btn--danger:hover {
  background: #fff5f5;
  text-decoration: none;
}

.cb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.cb-table-wrap {
  overflow-x: auto;
}

.cb-table--excel-mkalk {
  width: max-content;
  min-width: 100%;
  font-size: 0.78rem;
}

.cb-table--excel-mkalk th,
.cb-table--excel-mkalk td {
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}

.cb-table--excel-mkalk th {
  white-space: normal;
  max-width: 6.5rem;
  line-height: 1.25;
}

.cb-mkalk-ro {
  background: #f0f2f5;
  color: #3d4450;
}

.cb-mkalk-nr {
  font-weight: 600;
  text-align: center;
}

.cb-table--excel-mkalk th:first-child,
.cb-table--excel-mkalk td:first-child {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  text-align: center;
  padding: 0.2rem;
}

.cb-delete-line {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.cb-delete-line:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

table.cb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cb-table th,
.cb-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--cb-border);
}

.cb-table th {
  font-weight: 600;
  color: var(--cb-muted);
  background: var(--cb-bg);
}

.cb-table tr:hover td {
  background: #fafbfc;
}

/* Unsere-Bzg: Kopfzeile beim vertikalen Scrollen; Ecke auch beim horizontalen Scroll */
#cb-relation-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--cb-bg);
}

#cb-relation-table thead th:first-child {
  left: 0;
  z-index: 6;
  box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.12);
}

#cb-relation-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.08);
}

#cb-relation-table tbody tr:hover td:first-child {
  background: #fafbfc;
}

#cb-relation-table tbody td:first-child input.relation-col {
  min-width: 20rem;
}

.cb-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--cb-bg);
  color: var(--cb-muted);
}

.cb-form .form-control {
  display: block;
  width: 100%;
  max-width: 32rem;
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--cb-border);
  border-radius: 6px;
  margin-top: 0.25rem;
}

.cb-form label {
  font-weight: 600;
  font-size: 0.9rem;
}

.cb-form .cb-field {
  margin-bottom: 1rem;
}

.cb-errorlist {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  background: #fff5f5;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  color: #721c24;
  font-size: 0.9rem;
}

.cb-messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.cb-messages li {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.cb-messages .success {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  color: #1b5e20;
}

.cb-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.cb-login__card {
  width: 100%;
  max-width: 420px;
}

.cb-login__footer {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--cb-muted);
  text-align: center;
}

.cb-dl {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}

.cb-dl dt {
  color: var(--cb-muted);
  font-weight: 500;
}

.cb-dl dd {
  margin: 0;
}

@media (max-width: 720px) {
  .cb-dl {
    grid-template-columns: 1fr;
  }

  .cb-nav__inner {
    gap: 0;
  }

  .cb-nav a {
    flex: 1 1 45%;
    text-align: center;
  }
}
