/* ==========================================================================
   AI Boost Efficiency — Bosch-flavoured design system
   Palette: Bosch red #E2000F, anthracite #424C58, technical blue #007BC0
   ========================================================================== */

:root {
  --bosch-red: #e2000f;
  --bosch-red-dark: #b3000c;
  --bosch-red-soft: #fdecee;
  --bosch-blue: #007bc0;
  --bosch-blue-dark: #004975;
  --bosch-blue-soft: #e9f3f9;

  --ink: #1a1a1a;
  --anthracite: #424c58;
  --grey-700: #5c5c5c;
  --grey-500: #828282;
  --grey-300: #b2b3b5;
  --grey-200: #d6d8da;
  --grey-100: #eeeeee;
  --grey-050: #f6f7f8;
  --white: #ffffff;

  --status-idea: #9e9e9e;
  --status-assessment: #ffc000;
  --status-poc: #92d050;
  --status-scaled: #0070c0;

  --radius-sm: 3px;
  --radius: 5px;
  --radius-lg: 8px;

  --shadow-xs: 0 1px 2px rgba(26, 26, 26, 0.06);
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.07);
  --shadow-md: 0 10px 30px rgba(26, 26, 26, 0.14);
  --shadow-lg: 0 24px 60px rgba(26, 26, 26, 0.22);

  --font: "Bosch Office Sans", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 66px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--grey-050);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

a {
  color: var(--bosch-blue-dark);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- Top bar ---------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.topbar__inner {
  max-width: 1440px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar__accent {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--bosch-red) 0%,
    var(--bosch-red) 34%,
    var(--anthracite) 34%,
    var(--anthracite) 100%
  );
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand__mark {
  color: var(--bosch-red);
  display: grid;
  place-items: center;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand__text strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand__text small {
  font-size: 11.5px;
  color: var(--grey-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.tab {
  padding: 9px 16px;
  border-radius: var(--radius);
  color: var(--anthracite);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.tab:hover {
  background: var(--grey-050);
  color: var(--ink);
}

.tab.is-active {
  color: var(--white);
  background: var(--anthracite);
  border-color: var(--anthracite);
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar__stat {
  font-size: 12.5px;
  color: var(--grey-500);
  white-space: nowrap;
}

/* ---------- Buttons ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  background: var(--white);
  color: var(--anthracite);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--grey-300);
  background: var(--grey-050);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--bosch-red);
  border-color: var(--bosch-red);
  color: var(--white);
  box-shadow: var(--shadow-xs);
}

.btn--primary:hover {
  background: var(--bosch-red-dark);
  border-color: var(--bosch-red-dark);
  color: var(--white);
}

.btn--dark {
  background: var(--anthracite);
  border-color: var(--anthracite);
  color: var(--white);
}
.btn--dark:hover {
  background: #333c46;
  border-color: #333c46;
  color: var(--white);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
}
.btn--ghost:hover {
  background: var(--grey-100);
}

.btn--danger {
  color: var(--bosch-red);
  border-color: #f2c3c8;
  background: var(--white);
}
.btn--danger:hover {
  background: var(--bosch-red-soft);
  border-color: var(--bosch-red);
}

.btn--sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.btn--icon {
  padding: 6px 9px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Layout ----------------------------------------------------- */

.main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 28px 56px;
}

.view[hidden] {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-head__eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bosch-red);
  font-weight: 600;
  margin-bottom: 6px;
}

.page-head h1 {
  font-size: 26px;
  line-height: 1.25;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--grey-700);
  font-size: 14px;
}

.page-head__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card + .card {
  margin-top: 20px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--grey-100);
  flex-wrap: wrap;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card__title small {
  font-weight: 400;
  color: var(--grey-500);
  font-size: 12.5px;
}

.card__body {
  padding: 20px 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--grey-100);
  color: var(--anthracite);
  white-space: nowrap;
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---------- KPI strip -------------------------------------------------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--grey-200);
}

.kpi--red::before {
  background: var(--bosch-red);
}
.kpi--blue::before {
  background: var(--bosch-blue);
}
.kpi--anthracite::before {
  background: var(--anthracite);
}

.kpi__label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-500);
  font-weight: 600;
}

.kpi__value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 6px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kpi__meta {
  font-size: 12.5px;
  color: var(--grey-500);
  margin-top: 3px;
}

.kpi--red.kpi--wide,
.kpi--wide {
  grid-column: 1 / -1;
}

.kpi__bar {
  margin-top: 10px;
  height: 4px;
  border-radius: 2px;
  background: var(--grey-100);
  overflow: hidden;
}

.kpi__bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ---------- Heatmap ---------------------------------------------------- */

.heatmap-wrap {
  overflow: auto;
  max-height: 620px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.heatmap {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 1180px;
}

.heatmap th,
.heatmap td {
  border-right: 1px solid var(--grey-100);
  border-bottom: 1px solid var(--grey-100);
  padding: 8px;
  vertical-align: top;
}

.heatmap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--anthracite);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 12px 8px;
  text-align: center;
  vertical-align: bottom;
}

.heatmap thead th:first-child {
  left: 0;
  z-index: 5;
  text-align: left;
  width: 176px;
}

.heatmap tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--white);
  border-right: 2px solid var(--grey-100);
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--anthracite);
  padding: 12px 14px;
  vertical-align: middle;
  width: 176px;
}

.heatmap tbody th small {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--grey-500);
  margin-top: 2px;
}

.heatmap td {
  background: #fcfcfc;
  height: 92px;
  padding: 6px;
}

.heatmap tbody tr:hover td {
  background: #f7f9fb;
}

.heatmap tbody tr:hover th {
  background: var(--grey-050);
}

.hm-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hm-chip {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--grey-200);
  border-left: 4px solid var(--grey-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.35;
  box-shadow: var(--shadow-xs);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.hm-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--bosch-blue);
}

.hm-chip strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  line-height: 1.3;
}

.hm-chip span {
  display: block;
  color: var(--grey-500);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-empty {
  color: var(--grey-300);
  font-size: 11px;
  text-align: center;
  padding: 12px 0;
  border: 1px dashed var(--grey-100);
  border-radius: var(--radius-sm);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--anthracite);
}

.legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---------- Filters ---------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 16px 22px;
  border-bottom: 1px solid var(--grey-100);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field__label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-700);
}

.field__label .req {
  color: var(--bosch-red);
  margin-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--grey-300);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--bosch-red);
  box-shadow: 0 0 0 3px rgba(226, 0, 15, 0.12);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235c5c5c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.field__hint {
  font-size: 11.5px;
  color: var(--grey-500);
}

.field__error {
  font-size: 12px;
  color: var(--bosch-red);
  font-weight: 500;
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
  border-color: var(--bosch-red);
  background: #fffafa;
}

.filters .field {
  min-width: 170px;
}

.filters .field--search {
  flex: 1 1 260px;
}

/* ---------- Table ------------------------------------------------------ */

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

.table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-700);
  font-weight: 600;
  padding: 12px 16px;
  background: var(--grey-050);
  border-bottom: 1px solid var(--grey-200);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: middle;
}

.table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: #f7f9fb;
}

.table tbody tr.is-selected {
  background: var(--bosch-blue-soft);
}

.cell-title {
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-title small {
  font-weight: 400;
  color: var(--grey-500);
  font-size: 11.5px;
  white-space: nowrap;
}

.cell-sub {
  color: var(--grey-500);
  font-size: 12px;
  margin-top: 2px;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ---------- Form ------------------------------------------------------- */

.profile-head {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.profile-head__main {
  flex: 1 1 420px;
  background: var(--anthracite);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  position: relative;
  overflow: hidden;
}

.profile-head__main::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.profile-head__eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.profile-head__main h1 {
  color: var(--white);
  font-size: 26px;
  margin-top: 6px;
}

.profile-head__main p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
  max-width: 620px;
}

.profile-head__side {
  flex: 0 1 380px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.meta-card {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}

.meta-card__title {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-500);
  font-weight: 600;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-grid--one {
  grid-template-columns: minmax(0, 1fr);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.form-side {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.section {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--grey-100);
  background: linear-gradient(90deg, #fbfbfc, #ffffff);
}

.section__code {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--anthracite);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13.5px;
  flex-shrink: 0;
}

.section__title {
  font-size: 14.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--anthracite);
}

.section__body {
  padding: 18px 20px 20px;
  display: grid;
  gap: 16px;
}

.section--a .section__code {
  background: var(--bosch-red);
}
.section--b .section__code {
  background: var(--bosch-blue);
}
.section--c .section__code {
  background: var(--bosch-blue-dark);
}
.section--d .section__code {
  background: #6b7280;
}
.section--e .section__code {
  background: var(--ink);
}

.rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rating__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--grey-200);
  background: var(--white);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.rating__dot:hover {
  transform: scale(1.08);
  border-color: var(--bosch-red);
}

.rating__dot.is-on {
  background: var(--bosch-red);
  border-color: var(--bosch-red);
}

.rating__value {
  margin-left: 8px;
  font-size: 13px;
  color: var(--grey-700);
  font-weight: 600;
}

.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  box-shadow: 0 -2px 14px rgba(26, 26, 26, 0.07);
  margin-top: 22px;
  flex-wrap: wrap;
}

.form-actions__hint {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--grey-500);
}

.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid;
}

.alert--error {
  background: var(--bosch-red-soft);
  border-color: #f3c5ca;
  color: #8c0010;
}

.alert--info {
  background: var(--bosch-blue-soft);
  border-color: #c6dcee;
  color: var(--bosch-blue-dark);
}

/* ---------- Modal ------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease;
}

.modal__dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(1020px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.modal__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--grey-100);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--anthracite);
  color: var(--white);
}

.modal__head h2 {
  color: var(--white);
  font-size: 19px;
}

.modal__head .cell-sub,
.modal__head p {
  color: rgba(255, 255, 255, 0.75);
  margin: 4px 0 0;
  font-size: 12.5px;
}

.modal__head-main {
  flex: 1;
  min-width: 0;
}

.modal__head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.modal__body {
  padding: 22px 24px;
  overflow-y: auto;
  display: grid;
  gap: 18px;
}

.modal__foot {
  padding: 14px 24px;
  border-top: 1px solid var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--grey-050);
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-block {
  border: 1px solid var(--grey-100);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.detail-block--wide {
  grid-column: 1 / -1;
}

.detail-block__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--grey-050);
  border-bottom: 1px solid var(--grey-100);
}

.detail-block__code {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--anthracite);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.detail-block__title {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--anthracite);
}

.detail-list {
  padding: 4px 14px 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--grey-100);
  font-size: 13.5px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row dt {
  color: var(--grey-500);
  font-size: 12.5px;
  padding-top: 1px;
}

.detail-row dd {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-row dd.is-empty {
  color: var(--grey-300);
  font-style: italic;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.timeline li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
}

.timeline__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-300);
  margin-top: 6px;
  flex-shrink: 0;
}

.timeline__time {
  color: var(--grey-500);
  font-size: 11.5px;
  margin-left: auto;
  white-space: nowrap;
}

.vote-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  background: var(--white);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--anthracite);
  transition: all 0.15s ease;
}

.vote-btn:hover {
  border-color: var(--bosch-red);
  color: var(--bosch-red);
}

.vote-btn.is-voted {
  background: var(--bosch-red);
  border-color: var(--bosch-red);
  color: var(--white);
}

.vote-btn.is-voted:hover {
  background: var(--bosch-red-dark);
  color: var(--white);
}

.vote-count {
  font-weight: 700;
}

.vote-note {
  font-size: 12px;
  color: var(--grey-500);
}

/* ---------- Toasts ----------------------------------------------------- */

.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.2s ease;
  max-width: 380px;
}

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bosch-red);
  flex-shrink: 0;
}

.toast--success::before {
  background: #4caf50;
}
.toast--error::before {
  background: var(--bosch-red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* ---------- Leaderboard ------------------------------------------------ */

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 8px 22px 18px;
  display: grid;
  gap: 2px;
}

.leaderboard__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s ease;
}

.leaderboard__item:hover {
  background: var(--grey-050);
}

.leaderboard__rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grey-100);
  color: var(--anthracite);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard__item:first-child .leaderboard__rank {
  background: var(--bosch-red);
  color: var(--white);
}

.leaderboard__name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.leaderboard__name strong {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard__name small {
  color: var(--grey-500);
  font-size: 11.5px;
}

.leaderboard__votes {
  font-weight: 700;
  color: var(--bosch-red);
  background: var(--bosch-red-soft);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12.5px;
}

/* ---------- Empty state ------------------------------------------------ */

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--grey-500);
}

.empty h3 {
  font-size: 16px;
  color: var(--anthracite);
  margin-bottom: 6px;
}

.empty p {
  margin: 0 0 16px;
  font-size: 13.5px;
}

/* ---------- Responsive ------------------------------------------------- */

@media (max-width: 1080px) {
  .form-grid,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-side {
    position: static;
  }
}

@media (max-width: 860px) {
  .topbar__inner {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 18px;
    gap: 12px;
  }
  .tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .topbar__stat {
    display: none;
  }
  .main {
    padding: 20px 16px 44px;
  }
  .detail-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .modal {
    padding: 0;
  }
  .modal__dialog {
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }
}

@media print {
  .topbar,
  .footer,
  .row-actions,
  .filters {
    display: none !important;
  }
}
