/* Biobalance Provisions-Tool — Brand-konform */
:root {
  --bb-green: #61A991;
  --bb-dark-blue: #253F58;
  --bb-bg-light: #C0DDD3;
  --bb-bg-medium: #AFD4C7;
  --bb-yellow: #FDD80B;
  --bb-grey: #424242;
  --bb-grey-light: #e6e6e6;
  --bb-grey-mid: #9aa0a6;
  --bb-red: #c0392b;
  --bb-amber: #d98a00;
  --sans: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #f7f8f9;
  color: var(--bb-grey);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--bb-dark-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================== Topbar / Nav ============================= */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--bb-grey-light);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 32px;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 32px; width: auto; }
.subtitle {
  color: var(--bb-dark-blue);
  font-weight: 600;
  border-left: 2px solid var(--bb-green);
  padding-left: 12px;
}

.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--bb-grey);
  font-weight: 500;
}
.mainnav a:hover { background: var(--bb-bg-light); text-decoration: none; }
.mainnav a.active {
  background: var(--bb-dark-blue);
  color: #fff;
}

.container {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 28px;
}

.sitefoot {
  text-align: center;
  color: var(--bb-grey-mid);
  font-size: 12px;
  padding: 24px;
  display: flex; justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
}

/* ================================ Flashes =============================== */
.flashes { margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-weight: 500;
}
.flash--success { background: #e0f3ea; color: #27624b; border-left: 4px solid var(--bb-green); }
.flash--error   { background: #fae3e0; color: #862c21; border-left: 4px solid var(--bb-red); }
.flash--warning { background: #fff5d9; color: #8a6a00; border-left: 4px solid var(--bb-amber); }

/* ================================= Cards ================================ */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px;
}
.page-head h1 {
  color: var(--bb-dark-blue);
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}
.page-head .subline { color: var(--bb-grey-mid); }

.card {
  background: #fff;
  border: 1px solid var(--bb-grey-light);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 16px;
  color: var(--bb-dark-blue);
  margin: 0 0 14px 0;
}
.card h3 {
  font-size: 14px;
  color: var(--bb-dark-blue);
  margin: 12px 0 8px 0;
  font-weight: 600;
}

/* ============================== Stat-Grid =============================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat {
  background: #fff;
  border: 1px solid var(--bb-grey-light);
  border-radius: 10px;
  padding: 18px;
}
.stat-val {
  color: var(--bb-dark-blue);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  color: var(--bb-grey-mid);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.stat.highlight .stat-val { color: var(--bb-green); }

/* ================================ Tables ================================ */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
}
table.data th {
  text-align: left;
  background: #f0f2f4;
  color: var(--bb-dark-blue);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bb-grey-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bb-grey-light);
  vertical-align: top;
}
table.data tr:hover td { background: #fafbfc; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.subrow td {
  background: #f9fafb;
  font-size: 12px;
  color: var(--bb-grey-mid);
  padding: 6px 12px 6px 32px;
}

/* ============================== Forms =================================== */
form .field { margin-bottom: 12px; }
form label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bb-grey-mid);
  margin-bottom: 4px;
  font-weight: 600;
}
form input[type=text],
form input[type=email],
form input[type=number],
form input[type=date],
form select,
form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--bb-grey-light);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--bb-green);
  outline: 2px solid rgba(97,169,145,.25);
}
form textarea { min-height: 80px; resize: vertical; }
form .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
form .grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 800px) {
  form .grid-2, form .grid-3 { grid-template-columns: 1fr; }
}
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.help { font-size: 12px; color: var(--bb-grey-mid); margin-top: 4px; }

/* ============================== Buttons ================================= */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--bb-dark-blue);
  border-color: var(--bb-grey-light);
}
.btn:hover { background: var(--bb-bg-light); text-decoration: none; }
.btn--primary {
  background: var(--bb-dark-blue);
  color: #fff;
  border-color: var(--bb-dark-blue);
}
.btn--primary:hover { background: #1a2f42; color: #fff; }
.btn--accent {
  background: var(--bb-green);
  color: #fff;
  border-color: var(--bb-green);
}
.btn--accent:hover { background: #4e9681; color: #fff; }
.btn--danger {
  background: #fff;
  color: var(--bb-red);
  border-color: #edcec9;
}
.btn--danger:hover { background: #fae3e0; color: var(--bb-red); }
.btn--small { padding: 5px 10px; font-size: 12px; }
.btn--ghost { background: transparent; }

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions--right { justify-content: flex-end; }

/* ============================= Filter Row =============================== */
.filter-row {
  display: flex; gap: 12px; align-items: flex-end;
  margin-bottom: 12px; flex-wrap: wrap;
}
.filter-row .field { margin: 0; }
.filter-row input[type=text],
.filter-row input[type=date] { width: 180px; }

/* ============================== Badges ================================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bb-grey-light);
  color: var(--bb-grey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge--green { background: #e0f3ea; color: #27624b; }
.badge--blue  { background: #d7e4f0; color: var(--bb-dark-blue); }
.badge--yellow{ background: #fff2b2; color: #6e5500; }
.badge--red   { background: #fae3e0; color: #862c21; }
.badge--grey  { background: #eceef1; color: #555; }

/* ============================== Utility ================================= */
.muted { color: var(--bb-grey-mid); }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.text-right { text-align: right; }
.sum-row td { font-weight: 700; background: #fafbfc; border-top: 2px solid var(--bb-dark-blue); }
.hidden { display: none; }

/* Dashboard cards list */
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--bb-grey-light);
}
.recent-list li:last-child { border-bottom: 0; }

/* ============================== Info-Grid (readonly display) ============ */
.info-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 6px 16px;
  margin: 0;
}
.info-grid dt {
  color: var(--bb-grey-mid);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f3;
}
.info-grid dd {
  margin: 0;
  padding: 8px 0;
  color: var(--bb-grey);
  border-bottom: 1px solid #eef1f3;
  font-weight: 500;
}
.info-grid dt:last-of-type,
.info-grid dd:last-of-type { border-bottom: 0; }

/* ============================== Status-Rows (Connect-Badges) ============ */
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e5e9ec;
}
.status-row--ok   { background: #effaf4; border-color: #c8e8d7; }
.status-row--warn { background: #fff9e6; border-color: #f1e1a0; }
.status-row--err  { background: #fbecea; border-color: #e8c5c1; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.dot--ok   { background: #27a36c; box-shadow: 0 0 0 3px rgba(39,163,108,0.15); }
.dot--warn { background: #e6b800; box-shadow: 0 0 0 3px rgba(230,184,0,0.15); }
.dot--err  { background: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,0.15); }

/* ============================== Callouts ================================ */
.callout {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid;
  margin: 0 0 16px 0;
}
.callout--info { background: #eef5fb; border-color: #cfe0ef; color: #0f3e6b; }
.callout--warn { background: #fff8e1; border-color: #ffe9a1; color: #6e5500; }
.callout--err  { background: #fbecea; border-color: #e8c5c1; color: #862c21; }
.callout a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ============================== Bulk rate editor ======================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f5f7f8;
  border-bottom: 1px solid #e5e9ec;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bb-grey-mid);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eef1f3;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.row-warn {
  background: #fff9e6;
}
.data-table tr.row-warn:hover { background: #fff3c7; }
.rate-input {
  width: 90px;
  padding: 6px 10px;
  text-align: right;
  border: 1px solid #cfd6db;
  border-radius: 6px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}
.rate-input:focus {
  outline: none;
  border-color: var(--bb-green);
  box-shadow: 0 0 0 3px rgba(97,169,145,0.2);
}

/* row-warn in normalen data-Tabellen (Partner-Liste) */
table.data tr.row-warn td { background: #fffcec; }
table.data tr.row-warn:hover td { background: #fff6d2; }

.btn--danger { background: var(--bb-red); color: #fff; border-color: var(--bb-red); }
.btn--danger.btn--ghost { background: transparent; color: var(--bb-red); }
