:root {
  --deussen-blau: #25408f;
  --deussen-anthrazit: #151515;
  --deussen-weiss: #ffffff;
  --grau-hell: #f4f5f8;
  --grau-rand: #e1e3ea;
  --fehler: #c0392b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", Arial, sans-serif;
  color: var(--deussen-anthrazit);
  background: transparent;
}

.portal-wrapper {
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--deussen-weiss);
  border: 1px solid var(--grau-rand);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 4px 18px rgba(21, 21, 21, 0.06);
}

.logo {
  height: 40px;
  margin-bottom: 20px;
}

.logo-small {
  height: 28px;
  margin-bottom: 0;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--deussen-anthrazit);
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--deussen-anthrazit);
}

.subtitle {
  font-size: 14px;
  color: #565656;
  margin: 0 0 24px;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 13px;
  font-weight: 500;
  margin: 14px 0 6px;
}

input {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 12px;
  border: 1px solid var(--grau-rand);
  border-radius: 8px;
  background: var(--grau-hell);
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus {
  border-color: var(--deussen-blau);
  background: var(--deussen-weiss);
}

button {
  font-family: inherit;
  cursor: pointer;
}

#login-button {
  margin-top: 22px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  color: var(--deussen-weiss);
  background: var(--deussen-blau);
  border: none;
  border-radius: 8px;
  transition: opacity 0.15s ease;
}

#login-button:hover {
  opacity: 0.9;
}

#login-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.link-button {
  background: none;
  border: none;
  color: var(--deussen-blau);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  padding: 0;
}

.error {
  font-size: 13px;
  color: var(--fehler);
  margin: 12px 0 0;
}

/* --- Dashboard --- */

.dashboard {
  max-width: 920px;
}

.dashboard-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.dashboard-col {
  min-width: 0;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.objekt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

#dashboard-objekt {
  margin-bottom: 4px;
}

#objekt-adresse {
  font-size: 20px;
  line-height: 1.3;
}

.status-badge {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--deussen-weiss);
  white-space: nowrap;
}

.objekt-kennzahlen {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.objekt-kennzahl {
  flex: 1;
  background: var(--grau-hell);
  border-radius: 10px;
  padding: 14px 16px;
}

.kennzahl-label {
  display: block;
  font-size: 12px;
  color: #565656;
  margin-bottom: 4px;
}

.kennzahl-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--deussen-anthrazit);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--grau-hell);
  border-radius: 10px;
  padding: 16px 8px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--deussen-blau);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11.5px;
  color: #565656;
  line-height: 1.3;
}

.naechster-termin {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(37, 64, 143, 0.07);
  border: 1px solid rgba(37, 64, 143, 0.18);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 28px;
}

.naechster-termin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--deussen-blau);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.naechster-termin-value {
  font-size: 16px;
  font-weight: 600;
}

.naechster-termin-ort {
  font-size: 13px;
  color: #565656;
}

.gebote-liste {
  margin-bottom: 0;
}

.timeline-section {
  background: var(--grau-hell);
  border-radius: 10px;
  padding: 16px 18px;
  max-height: 460px;
  overflow-y: auto;
}

.gebote-liste ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gebote-liste li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grau-rand);
  font-size: 14px;
}

.gebote-liste li:last-child {
  border-bottom: none;
}

.gebot-hauptzeile {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.gebot-kunde {
  font-weight: 500;
  color: var(--deussen-anthrazit);
}

.gebot-betrag {
  font-weight: 600;
  color: var(--deussen-anthrazit);
  white-space: nowrap;
}

.gebot-datum {
  font-size: 12.5px;
  color: #565656;
}

/* --- Timeline --- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 20px 22px;
  border-left: 2px solid var(--grau-rand);
  margin-left: 5px;
}

.timeline li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--deussen-blau);
  border: 2px solid var(--deussen-weiss);
}

.timeline-datum {
  display: block;
  font-size: 12px;
  color: #565656;
  margin-bottom: 2px;
}

.timeline-titel {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .dashboard-body {
    grid-template-columns: 1fr;
  }
  .timeline-section {
    max-height: 320px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .objekt-kennzahlen {
    flex-direction: column;
  }
}

@media (prefers-color-scheme: dark) {
  .card {
    background: #1b1b1b;
    border-color: #2c2c2c;
    color: var(--deussen-weiss);
  }
  h1, h2, .gebot-betrag, .gebot-kunde, .kennzahl-value {
    color: var(--deussen-weiss);
  }
  input {
    background: #262626;
    border-color: #333;
    color: var(--deussen-weiss);
  }
  .stat-card,
  .objekt-kennzahl,
  .timeline-section {
    background: #262626;
  }
  .timeline li {
    border-left-color: #333;
  }
  .timeline li::before {
    border-color: #1b1b1b;
  }
}
