:root {
  color-scheme: light;
  --ink: #141b4d;
  --muted: #66708f;
  --line: #d7e3ee;
  --surface: #ffffff;
  --field: #f5f9fc;
  --accent: #429fe0;
  --accent-strong: #4676ad;
  --night: #141b4d;
  --sky: #429fe0;
  --mid: #4676ad;
  --warning: #bd5b00;
  --danger: #b42318;
  --paid: #1f7a52;
  --work: #806000;
  --open: #4676ad;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 27, 77, 0.94), rgba(20, 27, 77, 0.48)),
    url("/assets/team-autarkieprofis.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

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

.shell {
  width: min(1040px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0 32px;
  display: grid;
  align-content: center;
  gap: 24px;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--night);
  box-shadow: 0 14px 42px rgba(20, 27, 77, 0.28);
  font-weight: 700;
}

.brand {
  max-width: 720px;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.36);
}

.brandLogo {
  width: min(330px, 82vw);
  height: auto;
  margin-bottom: 26px;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
}

.brand p {
  margin: 14px 0 0;
  font-size: 19px;
}

.eyebrow,
.step {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel {
  width: min(760px, 100%);
  max-width: 100%;
  padding: 28px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(215, 227, 238, 0.95);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(20, 27, 77, 0.28);
}

#dashboardView {
  width: min(1180px, 100%);
}

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

.choiceButton,
.loginForm button,
.secondaryButton {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.choiceButton:hover,
.loginForm button:hover,
.secondaryButton:hover {
  background: var(--accent-strong);
}

.dangerButton {
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--danger);
  cursor: pointer;
  font-weight: 700;
}

.dangerButton:hover {
  background: #8f1d15;
}

.loginLinks {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.loginForm,
.recommendationForm,
.noticeBox {
  display: grid;
  gap: 16px;
}

.loginForm label,
.recommendationForm label,
.noticeBox label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.loginForm input,
.noticeBox input,
.recommendationForm input,
.recommendationForm select,
.recommendationForm textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--field);
  color: var(--ink);
}

.loginForm input,
.noticeBox input,
.recommendationForm input,
.recommendationForm select {
  min-height: 46px;
}

.recommendationForm textarea {
  min-height: 108px;
  padding-top: 12px;
  resize: vertical;
}

.loginForm input:focus,
.noticeBox input:focus,
.recommendationForm input:focus,
.recommendationForm select:focus,
.recommendationForm textarea:focus {
  outline: 3px solid rgba(15, 124, 99, 0.2);
  border-color: var(--accent);
}

.linkButton {
  border: 0;
  padding: 0;
  margin-bottom: 18px;
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  font-weight: 700;
}

.inlineLink {
  min-height: auto;
  margin-bottom: 0;
}

.error {
  min-height: 22px;
  color: var(--danger);
  font-weight: 700;
}

.dashboardHead {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
}

.advisorCard {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 100%);
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.advisorCard img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.advisorCard span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.advisorCard strong {
  display: block;
}

.advisorCard small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.employeePhotoButton {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  cursor: pointer;
  overflow: hidden;
}

.employeePhotoButton:hover {
  border-color: var(--accent);
}

.employeePhotoButton img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dashboardActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.dashboardHead h2,
#loginTitle {
  margin: 0 0 22px;
  font-size: 30px;
}

.secondaryButton {
  padding: 0 18px;
  background: var(--night);
}

.ghostButton {
  background: var(--mid);
}

.creditSummary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.creditSummary div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.creditSummary span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.creditSummary strong {
  display: block;
  color: var(--night);
  font-size: 30px;
}

.adminSummary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 22px;
}

.adminMetric {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.adminMetric span,
.adminMetric small {
  color: var(--muted);
  font-weight: 700;
}

.adminMetric strong {
  color: var(--night);
  font-size: 34px;
}

.adminMetric:hover {
  border-color: var(--accent);
}

.bigInviteButton {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}

.bigInviteButton.hidden {
  display: none;
}

.bigInviteButton:hover {
  background: var(--accent-strong);
}

.payoutButton {
  margin-bottom: 22px;
  background: var(--paid);
}

.payoutButton:hover {
  background: #176642;
}

.customerListBackButton {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px;
}

.customerActionBox {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f2f8fd);
}

.customerActionBox span {
  display: block;
  margin-bottom: 8px;
  color: var(--mid);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

.customerActionBox strong {
  display: block;
  margin-bottom: 8px;
  color: var(--night);
  font-size: 26px;
}

.customerActionBox p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.customerActionButtons {
  display: grid;
  gap: 10px;
}

.recommendationForm {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.noticeBox,
.reviewBox {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.noticeBox h3,
.reviewBox h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.noticeBox p,
.reviewBox p {
  margin: 0;
}

.noticeBox button[type="submit"],
.reviewButton {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.noticeBox button[type="submit"] {
  width: fit-content;
  padding: 0 18px;
}

.reviewBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.reviewActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.reviewButton {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
}

.submittedBadge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: #eaf8ee;
  color: var(--paid);
  font-weight: 700;
}

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

.profileEditor {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

#profileView {
  width: min(960px, 100%);
}

#profileView .profileEditor {
  grid-template-columns: 180px minmax(0, 1fr);
}

#profileView .profileEditor.customerProfileEditor {
  grid-template-columns: 1fr;
}

#profileView .profileEditor .formGrid {
  width: 100%;
}

.profileEditor img {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fbfe;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.reviewStatus,
.friendStatus {
  display: inline-flex;
  min-width: 104px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.reviewDone {
  color: #1f7a52;
  background: #eaf8ee;
}

.reviewOpen {
  color: #b42318;
  background: #fdebea;
}

.reviewUnknown {
  color: var(--muted);
  background: #edf2f7;
}

.friendDone {
  color: #1f7a52;
  background: #eaf8ee;
}

.friendOpen {
  color: #b42318;
  background: #fdebea;
}

.formHead {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.formHead h3 {
  margin: 0;
  font-size: 22px;
}

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

.fullWidth {
  grid-column: 1 / -1;
}

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

.recommendationForm button[type="submit"],
.recommendationForm button[type="button"] {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.recommendationForm button[type="submit"]:hover,
.recommendationForm button[type="button"]:hover {
  background: var(--accent-strong);
}

.formMessage {
  min-height: 22px;
  margin: 0;
  color: var(--mid);
  font-weight: 700;
}

.successMessage {
  color: #1f7a52;
}

.formMessage a {
  color: var(--night);
  word-break: break-word;
}

.resultBox {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f9fc;
}

.resultBox p {
  margin: 0;
}

.resultBox code {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--night);
  color: #ffffff;
  overflow-wrap: anywhere;
}

.tableWrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

.statusStack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.helpButton {
  width: 100%;
  background: var(--night);
}

.helpSteps {
  display: grid;
  gap: 14px;
}

.helpSteps article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.helpSteps strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.helpSteps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.emailHistoryList {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.emailHistoryItem {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.emailHistoryItem span {
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.clickableRow {
  cursor: pointer;
}

.clickableRow:hover,
.clickableEmployeeRow:hover,
.clickableCustomerRow:hover {
  background: #f5f9fc;
}

.status {
  display: inline-flex;
  min-width: 112px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}

.status.offen {
  color: var(--open);
  background: #eaf4ff;
}

.status.in_bearbeitung {
  color: var(--work);
  background: #fff4dd;
}

.status.ausgezahlt {
  color: var(--paid);
  background: #eaf8ee;
}

.status.zur_auszahlung_bereit {
  color: #1f7a52;
  background: #eaf8ee;
}

.status.payout_requested {
  color: #806000;
  background: #fff4dd;
}

.approvePayoutButton,
.projectDoneButton,
.resendOverviewButton {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--paid);
  cursor: pointer;
  font-weight: 700;
}

.approvePayoutButton:hover,
.projectDoneButton:hover,
.resendOverviewButton:hover {
  background: #176642;
}

.resendOverviewButton {
  background: var(--mid);
}

.resendOverviewButton:hover {
  background: var(--night);
}

.empty {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.mutedText {
  color: var(--muted);
}

.noteText {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
}

.demoAccess {
  width: min(760px, 100%);
  padding: 14px 18px;
  color: #ffffff;
  background: rgba(20, 27, 77, 0.72);
  border-radius: 8px;
}

.demoAccess p {
  margin: 4px 0;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    width: min(1040px, calc(100% - 20px));
    padding-top: 28px;
    padding-bottom: 20px;
    align-content: start;
  }

  .panel {
    padding: 18px;
  }

  .brandLogo {
    width: min(260px, 76vw);
    margin-bottom: 18px;
  }

  .brand h1 {
    font-size: 34px;
  }

  .brand p {
    font-size: 17px;
  }

  .choiceGrid,
  .dashboardHead {
    grid-template-columns: 1fr;
    display: grid;
  }

  .advisorCard {
    width: 100%;
    align-items: flex-start;
  }

  .employeePhotoButton {
    width: 64px;
    height: 64px;
  }

  .dashboardActions {
    justify-content: stretch;
  }

  .dashboardActions button {
    width: 100%;
  }

  .loginLinks {
    display: grid;
    justify-content: stretch;
  }

  .formGrid {
    grid-template-columns: 1fr;
  }

  .profileEditor {
    grid-template-columns: 1fr;
  }

  #profileView .profileEditor {
    grid-template-columns: 1fr;
  }

  .formActions {
    grid-template-columns: 1fr;
  }

  .creditSummary {
    grid-template-columns: 1fr;
  }

  .adminSummary {
    grid-template-columns: 1fr;
  }

  .reviewBox {
    display: grid;
  }

  .reviewActions {
    justify-content: stretch;
  }

  .reviewActions > * {
    width: 100%;
    justify-content: center;
  }

  .secondaryButton {
    width: 100%;
  }

  .bigInviteButton {
    min-height: 56px;
    padding: 12px 16px;
    white-space: normal;
  }

  .customerActionBox {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .customerActionBox strong {
    font-size: 22px;
  }
}

@media (max-width: 760px) {
  .tableWrap {
    border: 0;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
  }

  td:last-child {
    border-bottom: 0;
  }

  .status,
  .reviewStatus,
  .friendStatus {
    min-width: 0;
    width: fit-content;
  }
}
