:root {
  --wos-sky: #3b83be;
  --wos-navy: #002756;
  --wos-gold: #e19e20;
  --wos-mint: #e6f4f1;
  --wos-ink: #10283e;
  --wos-muted: #617384;
  --wos-line: rgba(0, 39, 86, 0.14);
  --wos-soft-line: rgba(0, 39, 86, 0.08);
  --wos-canvas: #f5f9f8;
  --wos-white: #ffffff;
  --wos-danger: #b42318;
  --wos-success: #237a4b;
  --wos-shadow: 0 12px 34px rgba(0, 39, 86, 0.08);
  --portal-width: 1240px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  background: var(--wos-canvas);
}

body {
  background: var(--wos-canvas);
  color: var(--wos-ink);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  letter-spacing: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

:focus-visible {
  outline: 3px solid rgba(59, 131, 190, 0.35);
  outline-offset: 2px;
}

.button,
button.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 760;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button-primary {
  background: var(--wos-navy);
  color: #fff;
}

.button-primary:hover {
  background: #063b78;
}

.button-gold {
  background: var(--wos-gold);
  color: var(--wos-navy);
}

.button-secondary {
  background: #fff;
  border-color: rgba(0, 39, 86, 0.2);
  color: var(--wos-navy);
}

.button-danger {
  background: #fff;
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--wos-danger);
}

.eyebrow {
  color: var(--wos-sky);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 9px;
  text-transform: uppercase;
}

.preview-badge {
  align-items: center;
  background: var(--wos-gold);
  border-radius: 6px;
  color: var(--wos-navy);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  min-height: 26px;
  padding: 5px 8px;
}

/* Preview overview */
.preview-page {
  background: var(--wos-canvas);
}

.preview-header {
  background: var(--wos-navy);
  border-bottom: 5px solid var(--wos-gold);
  color: #fff;
  padding: 42px 24px 48px;
}

.preview-header-inner,
.preview-main {
  margin: 0 auto;
  max-width: var(--portal-width);
}

.preview-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.preview-brand img {
  height: 64px;
  width: 64px;
}

.preview-brand strong {
  display: block;
  font-size: 20px;
}

.preview-brand span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.preview-header-copy {
  margin-top: 48px;
  max-width: 760px;
}

.preview-header .eyebrow {
  color: var(--wos-gold);
}

.preview-header h1 {
  font-size: 48px;
  line-height: 1.05;
}

.preview-header p:last-child {
  color: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  line-height: 1.6;
  margin-top: 16px;
}

.preview-main {
  padding: 48px 24px 80px;
}

.preview-section + .preview-section {
  margin-top: 52px;
}

.preview-section-heading {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.preview-section-heading h2 {
  color: var(--wos-navy);
  font-size: 28px;
}

.preview-section-heading p {
  color: var(--wos-muted);
  font-size: 14px;
}

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

.preview-card {
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  box-shadow: 0 7px 22px rgba(0, 39, 86, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 186px;
  padding: 20px;
}

.preview-card:hover {
  border-color: rgba(59, 131, 190, 0.45);
}

.preview-card-number {
  color: var(--wos-gold);
  font-size: 12px;
  font-weight: 850;
}

.preview-card h3 {
  color: var(--wos-navy);
  font-size: 20px;
  margin-top: 18px;
}

.preview-card p {
  color: var(--wos-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
}

.preview-card-link {
  color: var(--wos-sky);
  font-size: 13px;
  font-weight: 760;
  margin-top: auto;
  padding-top: 18px;
}

/* Authentication */
.auth-page {
  background-image: url("./medien/homepage_torwarttraining.jpeg");
  background-position: center;
  background-size: cover;
  color: #fff;
  display: grid;
  min-height: 100vh;
  position: relative;
}

.auth-page::before {
  background: rgba(0, 39, 86, 0.8);
  content: "";
  inset: 0;
  position: fixed;
  z-index: 0;
}

.auth-toplink {
  align-items: center;
  display: flex;
  justify-content: space-between;
  left: 24px;
  position: fixed;
  right: 24px;
  top: 20px;
  z-index: 2;
}

.auth-toplink > a {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 720;
}

.auth-layout {
  align-items: center;
  display: grid;
  gap: 72px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  margin: auto;
  max-width: 1120px;
  padding: 96px 24px 48px;
  width: 100%;
  z-index: 1;
}

.auth-copy {
  max-width: 600px;
}

.auth-mark {
  height: 76px;
  margin-bottom: 28px;
  width: 76px;
}

.auth-copy .eyebrow {
  color: var(--wos-gold);
}

.auth-copy h1 {
  font-size: 52px;
  line-height: 1.04;
}

.auth-copy > p:last-child {
  color: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  line-height: 1.6;
  margin-top: 18px;
  max-width: 550px;
}

.auth-card {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  color: var(--wos-ink);
  padding: 30px;
}

.auth-card-header {
  border-bottom: 1px solid var(--wos-line);
  margin-bottom: 24px;
  padding-bottom: 20px;
}

.auth-card h2 {
  color: var(--wos-navy);
  font-size: 28px;
}

.auth-card-header p:last-child {
  color: var(--wos-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 7px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.field > label {
  color: var(--wos-navy);
  font-size: 13px;
  font-weight: 740;
}

.field input,
.field select,
.field textarea {
  background: #fff;
  border: 1px solid rgba(0, 39, 86, 0.22);
  border-radius: 7px;
  color: var(--wos-ink);
  min-height: 46px;
  padding: 11px 12px;
  width: 100%;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--wos-sky);
  box-shadow: 0 0 0 3px rgba(59, 131, 190, 0.14);
  outline: 0;
}

.auth-options {
  align-items: center;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}

.check-label {
  align-items: center;
  color: var(--wos-muted);
  display: inline-flex;
  gap: 8px;
}

.check-label input {
  accent-color: var(--wos-sky);
  height: 18px;
  width: 18px;
}

.auth-options a,
.auth-card-footer a {
  color: var(--wos-sky);
  font-weight: 720;
}

.auth-card .button {
  width: 100%;
}

.auth-card-footer {
  color: var(--wos-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 18px;
  text-align: center;
}

/* Portal shell */
.portal-body {
  background: var(--wos-canvas);
}

.portal-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--wos-line);
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  height: 70px;
  left: 0;
  padding: 10px 20px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.portal-menu-button {
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  color: var(--wos-navy);
  cursor: pointer;
  display: none;
  font-size: 13px;
  font-weight: 760;
  min-height: 42px;
  padding: 8px 12px;
}

.portal-brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  justify-self: start;
}

.portal-brand img {
  height: 42px;
  width: 42px;
}

.portal-brand strong,
.portal-brand small {
  display: block;
}

.portal-brand strong {
  color: var(--wos-navy);
  font-size: 15px;
}

.portal-brand small {
  color: var(--wos-muted);
  font-size: 11px;
  margin-top: 2px;
}

.portal-top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.role-chip {
  background: var(--wos-mint);
  border: 1px solid var(--wos-line);
  border-radius: 6px;
  color: var(--wos-navy);
  font-size: 12px;
  font-weight: 760;
  padding: 7px 9px;
}

.portal-website-link {
  color: var(--wos-navy);
  font-size: 13px;
  font-weight: 720;
}

.user-avatar {
  align-items: center;
  background: var(--wos-navy);
  border: 2px solid var(--wos-gold);
  border-radius: 6px;
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.portal-sidebar {
  background: var(--wos-navy);
  bottom: 0;
  color: #fff;
  left: 0;
  overflow-y: auto;
  padding: 22px 14px;
  position: fixed;
  top: 70px;
  width: 252px;
  z-index: 15;
}

.portal-sidebar-label {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  margin: 20px 10px 8px;
  text-transform: uppercase;
}

.portal-sidebar-label:first-child {
  margin-top: 2px;
}

.portal-nav {
  display: grid;
  gap: 3px;
}

.portal-nav a {
  align-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.74);
  display: flex;
  font-size: 14px;
  font-weight: 650;
  min-height: 44px;
  padding: 10px 12px;
}

.portal-nav a:hover,
.portal-nav a.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.portal-nav a.is-active {
  border-left: 3px solid var(--wos-gold);
}

.portal-sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 24px;
  padding: 18px 10px 0;
}

.portal-sidebar-footer a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.portal-overlay {
  background: rgba(0, 39, 86, 0.45);
  display: none;
  inset: 70px 0 0;
  position: fixed;
  z-index: 14;
}

.portal-main {
  margin-left: 252px;
  padding: 70px 0 0;
}

.portal-main-inner {
  margin: 0 auto;
  max-width: var(--portal-width);
  padding: 42px 28px 80px;
}

.page-heading {
  align-items: end;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-heading h1 {
  color: var(--wos-navy);
  font-size: 36px;
  line-height: 1.08;
}

.page-heading-copy {
  color: var(--wos-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
  max-width: 680px;
}

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

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

.metric-card {
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 39, 86, 0.05);
  min-height: 142px;
  padding: 18px;
}

.metric-label {
  color: var(--wos-muted);
  font-size: 12px;
  font-weight: 720;
}

.metric-value {
  color: var(--wos-navy);
  display: block;
  font-size: 36px;
  font-weight: 800;
  margin-top: 14px;
}

.metric-note {
  color: var(--wos-muted);
  display: block;
  font-size: 11px;
  margin-top: 8px;
}

.content-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  margin-top: 18px;
}

.panel {
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  box-shadow: 0 7px 24px rgba(0, 39, 86, 0.05);
  padding: 22px;
}

.panel-heading {
  align-items: end;
  border-bottom: 1px solid var(--wos-soft-line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 15px;
}

.panel-heading h2 {
  color: var(--wos-navy);
  font-size: 20px;
}

.panel-heading p {
  color: var(--wos-muted);
  font-size: 12px;
}

.bar-list {
  display: grid;
  gap: 16px;
}

.bar-row-head {
  color: var(--wos-ink);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bar-track {
  background: var(--wos-mint);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.bar-value {
  background: var(--wos-sky);
  height: 100%;
}

.bar-value.gold {
  background: var(--wos-gold);
}

.bar-value.navy {
  background: var(--wos-navy);
}

.ranking-list,
.activity-list,
.entity-list {
  display: grid;
  gap: 0;
}

.ranking-row,
.activity-row,
.entity-row {
  align-items: center;
  border-bottom: 1px solid var(--wos-soft-line);
  display: grid;
  gap: 12px;
  min-height: 62px;
  padding: 10px 0;
}

.ranking-row {
  grid-template-columns: 26px 1fr auto;
}

.ranking-row:last-child,
.activity-row:last-child,
.entity-row:last-child {
  border-bottom: 0;
}

.ranking-position {
  color: var(--wos-gold);
  font-size: 12px;
  font-weight: 850;
}

.ranking-name,
.entity-name {
  color: var(--wos-navy);
  font-size: 14px;
  font-weight: 740;
}

.ranking-meta,
.entity-meta {
  color: var(--wos-muted);
  font-size: 12px;
  margin-top: 2px;
}

.ranking-value {
  color: var(--wos-sky);
  font-size: 12px;
  font-weight: 760;
}

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

table {
  border-collapse: collapse;
  min-width: 680px;
  width: 100%;
}

th {
  color: var(--wos-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 11px 12px;
  text-align: left;
  text-transform: uppercase;
}

td {
  border-top: 1px solid var(--wos-soft-line);
  color: var(--wos-ink);
  font-size: 13px;
  padding: 13px 12px;
}

.status {
  border-radius: 5px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 760;
  padding: 5px 7px;
}

.status-success {
  background: #e6f5ec;
  color: var(--wos-success);
}

.status-open {
  background: #fff4d6;
  color: #79520b;
}

.status-info {
  background: #eaf2f8;
  color: var(--wos-navy);
}

.form-panel {
  max-width: 920px;
}

.form-section {
  border-bottom: 1px solid var(--wos-soft-line);
  padding: 6px 0 24px;
}

.form-section + .form-section {
  padding-top: 24px;
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section h2 {
  color: var(--wos-navy);
  font-size: 18px;
  margin-bottom: 16px;
}

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

.form-field-wide {
  grid-column: 1 / -1;
}

.segmented-control {
  background: var(--wos-mint);
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
}

.segmented-control button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--wos-navy);
  cursor: pointer;
  min-height: 42px;
}

.segmented-control button.is-active {
  background: var(--wos-navy);
  color: #fff;
}

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

.choice-item {
  align-items: center;
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.choice-item input {
  accent-color: var(--wos-sky);
  height: 19px;
  width: 19px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 24px;
}

.filter-bar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  margin-bottom: 18px;
}

.training-list {
  display: grid;
  gap: 12px;
}

.training-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  padding: 16px;
}

.date-tile {
  background: var(--wos-mint);
  border-radius: 7px;
  color: var(--wos-navy);
  padding: 10px;
  text-align: center;
}

.date-tile strong,
.date-tile span {
  display: block;
}

.date-tile strong {
  font-size: 24px;
}

.date-tile span {
  font-size: 11px;
  font-weight: 760;
}

.training-item h3 {
  color: var(--wos-navy);
  font-size: 16px;
}

.training-item p {
  color: var(--wos-muted);
  font-size: 13px;
  margin-top: 5px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.tag {
  background: var(--wos-mint);
  border-radius: 5px;
  color: var(--wos-navy);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 7px;
}

.entity-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.entity-avatar {
  align-items: center;
  background: var(--wos-mint);
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  color: var(--wos-navy);
  display: flex;
  font-size: 12px;
  font-weight: 820;
  height: 46px;
  justify-content: center;
  overflow: hidden;
  width: 46px;
}

.entity-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.entity-stat {
  color: var(--wos-muted);
  font-size: 12px;
  min-width: 96px;
  text-align: right;
}

.empty-state,
.access-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  justify-content: center;
  text-align: center;
}

.access-state img {
  height: 70px;
  margin-bottom: 18px;
  width: 70px;
}

.access-state h2 {
  color: var(--wos-navy);
  font-size: 26px;
}

.access-state p {
  color: var(--wos-muted);
  line-height: 1.5;
  margin: 10px 0 22px;
  max-width: 520px;
}

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

.profile-photo {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
}

.profile-photo img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.profile-card h2 {
  color: var(--wos-navy);
  font-size: 22px;
  margin-top: 16px;
}

.profile-card p {
  color: var(--wos-muted);
  font-size: 13px;
  margin-top: 5px;
}

.preview-toast {
  background: var(--wos-navy);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  bottom: 22px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 11px 15px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 40;
}

.preview-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Legal pages */
.legal-page {
  background: var(--wos-canvas);
}

.legal-header {
  background: var(--wos-navy);
  border-bottom: 4px solid var(--wos-gold);
  color: #fff;
}

.legal-header-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--portal-width);
  min-height: 78px;
  padding: 10px 24px;
}

.legal-brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.legal-brand img {
  height: 46px;
  width: 46px;
}

.legal-brand strong {
  font-size: 16px;
}

.legal-nav {
  display: flex;
  font-size: 13px;
  font-weight: 720;
  gap: 20px;
}

.legal-hero {
  background: var(--wos-navy);
  color: #fff;
  padding: 64px 24px 72px;
}

.legal-hero-inner {
  margin: 0 auto;
  max-width: var(--portal-width);
}

.legal-hero .eyebrow {
  color: var(--wos-gold);
}

.legal-hero h1 {
  font-size: 48px;
}

.legal-hero p:last-child {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  margin-top: 12px;
  max-width: 690px;
}

.legal-main {
  display: grid;
  gap: 34px;
  grid-template-columns: 220px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1060px;
  padding: 54px 24px 80px;
}

.legal-tabs {
  display: grid;
  gap: 6px;
  position: sticky;
  top: 20px;
}

.legal-tabs a {
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--wos-muted);
  font-size: 14px;
  padding: 11px 12px;
}

.legal-tabs a.is-active {
  background: var(--wos-mint);
  border-left-color: var(--wos-gold);
  color: var(--wos-navy);
  font-weight: 760;
}

.legal-content {
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  box-shadow: var(--wos-shadow);
  line-height: 1.65;
  padding: 38px 42px;
}

.legal-content h2,
.legal-content h3 {
  color: var(--wos-navy);
}

.legal-content h2 {
  font-size: 27px;
  margin-bottom: 14px;
}

.legal-content h3 {
  font-size: 18px;
  margin: 30px 0 8px;
}

.legal-content p,
.legal-content li {
  color: #394b5d;
}

.legal-content a {
  color: var(--wos-sky);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-note {
  background: #fff7df;
  border: 1px solid rgba(225, 158, 32, 0.4);
  border-left: 4px solid var(--wos-gold);
  border-radius: 6px;
  color: #624713;
  margin: 22px 0;
  padding: 14px 16px;
}

@media (max-width: 1060px) {
  .preview-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-layout {
    gap: 42px;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  }
}

@media (max-width: 820px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .auth-copy {
    display: none;
  }

  .portal-menu-button {
    display: inline-flex;
  }

  .portal-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .portal-brand {
    justify-self: center;
  }

  .portal-sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
  }

  .portal-overlay.is-open {
    display: block;
  }

  .portal-main {
    margin-left: 0;
  }

  .portal-main-inner {
    padding: 34px 20px 70px;
  }

  .metric-grid,
  .content-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-main {
    grid-template-columns: 1fr;
  }

  .legal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }
}

@media (max-width: 560px) {
  .preview-header h1,
  .auth-copy h1,
  .legal-hero h1 {
    font-size: 36px;
  }

  .preview-main,
  .preview-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .preview-section-heading,
  .page-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-toplink {
    left: 16px;
    right: 16px;
  }

  .auth-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .portal-topbar {
    gap: 8px;
    padding: 9px 12px;
  }

  .portal-brand small,
  .portal-website-link,
  .role-chip {
    display: none;
  }

  .portal-brand img {
    height: 38px;
    width: 38px;
  }

  .portal-main-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .metric-grid,
  .form-grid,
  .choice-list,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .training-item {
    align-items: start;
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .training-item-actions {
    grid-column: 1 / -1;
  }

  .entity-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .entity-stat {
    display: none;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }

  .legal-header-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-nav a:first-child {
    display: none;
  }

  .legal-hero {
    padding-left: 18px;
    padding-right: 18px;
  }

  .legal-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .legal-content {
    padding: 28px 22px;
  }
}

/* Functional staging additions */
[hidden] {
  display: none !important;
}

.auth-error {
  background: #fff0ee;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 7px;
  color: var(--wos-danger);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
}

.demo-login-panel {
  border-top: 1px solid var(--wos-line);
  display: grid;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
}

.demo-login-panel > strong {
  color: var(--wos-navy);
  font-size: 13px;
}

.demo-login-panel > p {
  color: var(--wos-muted);
  font-size: 11px;
  line-height: 1.45;
}

.demo-account {
  align-items: center;
  background: var(--wos-mint);
  border: 1px solid rgba(0, 39, 86, 0.12);
  border-radius: 7px;
  color: var(--wos-navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
}

.demo-account span {
  font-size: 12px;
  font-weight: 780;
}

.demo-account small {
  color: var(--wos-muted);
  font-size: 11px;
}

.quick-link-list {
  display: grid;
  gap: 8px;
}

.quick-link-list a {
  background: var(--wos-mint);
  border: 1px solid rgba(0, 39, 86, 0.08);
  border-radius: 7px;
  display: grid;
  gap: 3px;
  padding: 13px 14px;
}

.quick-link-list strong {
  color: var(--wos-navy);
  font-size: 13px;
}

.quick-link-list span {
  color: var(--wos-muted);
  font-size: 12px;
}

.portal-section-gap,
.staging-form-panel {
  margin-top: 18px;
}

.staging-form-panel {
  border-top: 4px solid var(--wos-gold);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions .button {
  font-size: 11px;
  min-height: 34px;
  padding: 6px 9px;
}

.staging-file-button {
  margin-top: 18px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.staging-file-button input {
  inset: 0;
  opacity: 0;
  position: absolute;
}

@media (max-width: 620px) {
  .demo-account {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-actions {
    min-width: 190px;
  }
}

/* Partnerverwaltung */
.partner-form-layout {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
}

.partner-logo-editor {
  display: grid;
  gap: 10px;
}

.partner-logo-editor > small {
  color: var(--wos-muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.partner-logo-dropzone {
  align-items: center;
  background: var(--wos-mint);
  border: 1px dashed rgba(0, 39, 86, 0.35);
  border-radius: 8px;
  cursor: copy;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 20px;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.partner-logo-dropzone.is-dragging,
.partner-logo-dropzone:focus-visible {
  background: #d9eeee;
  border-color: var(--wos-sky);
}

.partner-logo-preview {
  align-items: center;
  background: #fff;
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  display: flex;
  height: 110px;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 14px;
  width: 100%;
}

.partner-logo-preview img {
  max-height: 80px;
  object-fit: contain;
  width: 100%;
}

.partner-logo-preview span {
  color: var(--wos-navy);
  font-size: 13px;
  font-weight: 800;
}

.partner-logo-dropzone > strong {
  color: var(--wos-navy);
  font-size: 15px;
}

.partner-logo-dropzone > p {
  color: var(--wos-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 5px 0 14px;
}

.partner-logo-file {
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.partner-logo-file input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.partner-admin-list {
  display: grid;
  gap: 12px;
}

.partner-admin-card {
  align-items: center;
  border: 1px solid var(--wos-line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  padding: 16px;
}

.partner-admin-card-logo {
  align-items: center;
  background: #f7fafb;
  border-radius: 7px;
  display: flex;
  height: 96px;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.partner-admin-logo {
  max-height: 70px;
  object-fit: contain;
  width: 100%;
}

.partner-logo-placeholder {
  align-items: center;
  color: var(--wos-navy);
  display: flex;
  font-size: 24px;
  font-weight: 820;
  justify-content: center;
}

.partner-admin-card-body {
  display: grid;
  gap: 11px;
}

.partner-admin-card h3 {
  color: var(--wos-navy);
  font-size: 18px;
}

.partner-admin-card-body > div > p {
  color: var(--wos-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.partner-admin-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
}

.partner-admin-details div {
  display: grid;
  gap: 2px;
}

.partner-admin-details dt {
  color: var(--wos-muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.partner-admin-details dd {
  color: var(--wos-ink);
  font-size: 12px;
  margin: 0;
}

.partner-admin-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.partner-admin-links a {
  color: var(--wos-sky);
  font-size: 12px;
  font-weight: 760;
}

.partner-admin-links span {
  color: var(--wos-muted);
  font-size: 11px;
}

.partner-admin-actions {
  display: grid;
  gap: 8px;
}

.partner-empty-state {
  background: var(--wos-mint);
  border-radius: 7px;
  color: var(--wos-muted);
  padding: 24px;
  text-align: center;
}

.partner-empty-state strong {
  color: var(--wos-navy);
  display: block;
  margin-bottom: 5px;
}

.partner-empty-state p {
  font-size: 12px;
}

@media (max-width: 820px) {
  .partner-form-layout {
    grid-template-columns: 1fr;
  }

  .partner-logo-editor {
    margin: 0 auto;
    max-width: 420px;
    width: 100%;
  }

  .partner-logo-dropzone {
    min-height: 235px;
  }

  .partner-admin-card {
    align-items: start;
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .partner-admin-actions {
    display: flex;
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .partner-admin-card {
    grid-template-columns: 1fr;
  }

  .partner-admin-card-logo {
    width: 100%;
  }

  .partner-admin-actions {
    grid-column: auto;
  }

  .partner-admin-actions .button {
    flex: 1;
  }
}

/* Buchhaltung */
.status-cancelled {
  background: #f3f5f6;
  color: #64717c;
}

.invoice-position-heading {
  align-items: center;
  border-top: 1px solid var(--wos-line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 22px;
}

.invoice-position-heading h3,
.invoice-position-heading p {
  margin: 0;
}

.invoice-position-heading h3 {
  color: var(--wos-navy);
  font-size: 17px;
}

.invoice-position-heading p {
  color: var(--wos-muted);
  font-size: 12px;
  margin-top: 4px;
}

.invoice-position-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.invoice-position-row {
  align-items: end;
  background: #f7fafb;
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.25fr) auto;
  padding: 14px;
}

.invoice-position-remove {
  margin-bottom: 1px;
}

.compliance-note {
  align-items: flex-start;
  background: var(--wos-mint);
  border-left: 4px solid var(--wos-gold);
  border-radius: 0 7px 7px 0;
  color: var(--wos-muted);
  display: grid;
  font-size: 12px;
  gap: 3px;
  line-height: 1.5;
  margin-top: 18px;
  padding: 13px 15px;
}

.compliance-note strong {
  color: var(--wos-navy);
  font-size: 13px;
}

.invoice-delivery-note {
  align-items: flex-start;
  border-bottom: 1px solid var(--wos-line);
  color: var(--wos-muted);
  display: flex;
  font-size: 12px;
  gap: 10px;
  line-height: 1.5;
  margin-top: 16px;
  padding: 0 0 16px;
}

.invoice-delivery-note strong {
  color: var(--wos-navy);
  flex: 0 0 auto;
}

.invoice-form-actions {
  padding-top: 16px;
}

.receipt-upload {
  background: var(--wos-mint);
  border: 1px dashed rgba(0, 39, 86, 0.3);
  border-radius: 7px;
  padding: 14px;
}

.receipt-upload input[type="file"] {
  background: #fff;
  cursor: pointer;
}

.receipt-upload small {
  color: var(--wos-muted);
  font-size: 11px;
  line-height: 1.45;
}

.eur-filter {
  align-items: end;
  background: #f7fafb;
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 0.35fr) minmax(220px, 0.65fr) auto;
  margin-bottom: 18px;
  padding: 14px;
}

.eur-sheet {
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  overflow: hidden;
  padding: 22px;
}

.eur-sheet-header {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.eur-sheet-header h3,
.eur-sheet-header p {
  margin: 0;
}

.eur-sheet-header h3 {
  color: var(--wos-navy);
  font-size: 24px;
  margin-top: 4px;
}

.eur-sheet-header > strong {
  color: var(--wos-muted);
  font-size: 13px;
}

.eur-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.eur-summary-grid > div {
  background: var(--wos-mint);
  border: 1px solid rgba(0, 39, 86, 0.08);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  padding: 15px;
}

.eur-summary-grid span,
.eur-summary-grid small {
  color: var(--wos-muted);
  font-size: 11px;
}

.eur-summary-grid strong {
  color: var(--wos-navy);
  font-size: 22px;
}

.eur-summary-grid .positive {
  background: #edf8f1;
}

.eur-summary-grid .negative {
  background: #fff0ee;
}

.eur-summary-grid .negative strong {
  color: var(--wos-danger);
}

.eur-comparison {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.eur-comparison > div {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 82px minmax(0, 1fr);
}

.eur-comparison span {
  color: var(--wos-muted);
  font-size: 12px;
  font-weight: 700;
}

.eur-bar-track {
  background: #edf1f4;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.eur-bar-track i {
  display: block;
  height: 100%;
  min-width: 2px;
}

.eur-bar-income {
  background: var(--wos-blue);
}

.eur-bar-expense {
  background: var(--wos-gold);
}

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

.eur-tables table {
  border: 1px solid var(--wos-line);
  border-radius: 7px;
  overflow: hidden;
}

.eur-tables th,
.eur-tables td {
  font-size: 12px;
}

.eur-tables th:last-child,
.eur-tables td:last-child {
  text-align: right;
}

.eur-tables .total-row td {
  border-top: 2px solid var(--wos-navy);
  color: var(--wos-navy);
  font-weight: 800;
}

.eur-method-note {
  border-left: 3px solid var(--wos-gold);
  color: var(--wos-muted);
  font-size: 11px;
  line-height: 1.5;
  margin: 20px 0 0;
  padding-left: 12px;
}

@media (max-width: 820px) {
  .invoice-position-row,
  .eur-filter,
  .eur-summary-grid,
  .eur-tables {
    grid-template-columns: 1fr;
  }

  .invoice-position-remove {
    width: 100%;
  }

  .eur-sheet-header {
    display: grid;
    gap: 8px;
  }
}

@media (max-width: 620px) {
  .invoice-position-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-position-heading .button,
  .eur-filter .button {
    width: 100%;
  }

  .eur-sheet {
    padding: 16px;
  }
}
