/* ==========================================================
   Gemeinsame Basis (Farben, Reset, Typografie)
   ========================================================== */

:root {
  --bg: #f0f3f7;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #3b6b96;
  --accent-light: #dce6f0;
  --border: #d4dbe6;
  --header-bg: #2c4a6a;
  --row-hover: #f2f6fa;
  --input-bg: #f7f9fc;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}


/* ==========================================================
   Übersichtsseite – Header mit Bild
   ========================================================== */

header {
  background: var(--header-bg);
  padding: 0;
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #7bafd4, var(--accent));
}

.header-image-wrapper {
  width: 100%;
  max-height: 320px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--header-bg);
}

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

.header-placeholder {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: rgba(255,255,255,0.5);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.header-placeholder svg {
  opacity: 0.35;
}


/* ==========================================================
   Übersichtsseite – Inhalt & Tabelle
   ========================================================== */

.container {
  flex: 1;
  max-width: 960px;
  padding: 40px 24px 60px;
}

.placeholder-text {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.content-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 32px 36px;
}

.content-card h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 24px;
  margin-bottom: 10px;
}

.content-card h2:first-child {
  margin-top: 0;
}

.content-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.table-wrapper {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 20px;
  text-align: left;
  border-bottom: 2px solid var(--accent);
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.15s ease;
}

thead th:hover {
  background: #4a7fad;
}

thead th::after {
  content: '⇅';
  margin-left: 8px;
  opacity: 0.4;
  font-size: 0.75rem;
}

thead th.sort-asc::after {
  content: '▲';
  opacity: 0.9;
}

thead th.sort-desc::after {
  content: '▼';
  opacity: 0.9;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--row-hover);
}

tbody td {
  padding: 13px 20px;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

td:nth-child(1) {
  font-weight: 500;
  width: 70px;
  text-align: center;
}

.badge-neu {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td:nth-child(3),
td:nth-child(4) {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tbody td a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

tbody td a:hover {
  color: #4a7fad;
  border-bottom-color: #4a7fad;
}

/* ── Aufklappbare Zeilen ── */
.expandable-row {
  cursor: default;
}

.toggle-cell {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.toggle-cell.has-detail {
  cursor: pointer;
}

.toggle-cell.has-detail::after {
  content: '▸';
  display: inline-block;
  font-size: 1.1rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.toggle-cell.no-detail::after {
  content: '–';
  display: inline-block;
  font-size: 1.1rem;
  color: var(--border);
}

.expandable-row.open .toggle-cell.has-detail::after {
  transform: rotate(90deg);
}

.detail-row {
  display: none;
}

.detail-row.visible {
  display: table-row;
}

.detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}

.detail-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
  background: var(--accent-light);
}

.detail-row.visible .detail-content {
  max-height: 200px;
  padding: 16px 20px;
}

.detail-content p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-muted);
}


/* ==========================================================
   Übersichtsseite – Seitenmenü (Sidebar)
   ========================================================== */

.page-layout {
  display: flex;
  min-height: calc(100vh - 228px);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 2px;
}

.sidebar a {
  display: block;
  padding: 11px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--row-hover);
  border-left-color: var(--border);
}

.sidebar a.active {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
}


/* ── Hersteller-Tabelle ── */
.hersteller-table td:nth-child(1) {
  width: 70%;
  white-space: nowrap;
  text-align: left;
  font-weight: 500;
}


/* ==========================================================
   Login-Seite
   ========================================================== */

body.login-page {
  display: block;
}

body.login-page .login-wrapper,
body.login-page .register-wrapper {
  margin: 40px auto 60px;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  margin: 0 auto;
}

.login-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: 40px 36px;
}

.login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.info-text {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.info-text p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.info-text p:last-child {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: #a0aec0;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 107, 150, 0.12);
}

.login-card button {
  width: 100%;
  padding: 13px;
  margin-top: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, transform 0.1s ease;
}

.login-card button:hover {
  background: #4a7fad;
}

.login-card button:active {
  transform: scale(0.985);
}

/* ── Registrierungsseite ── */
.register-wrapper {
  max-width: 520px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-row .form-group-plz {
  flex: 0 0 120px;
}

.form-row .form-group-ort {
  flex: 1;
}

/* ── Link unter Login/Registrierung ── */
.register-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.register-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.register-link a:hover {
  border-bottom-color: var(--accent);
}


/* ==========================================================
   Profilseite
   ========================================================== */

.profile-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: 40px 36px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  color: var(--accent);
}

.profile-data {
  margin-bottom: 28px;
}

.profile-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.profile-label {
  flex: 0 0 140px;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-top: 1px;
}

.profile-value {
  flex: 1;
  font-size: 0.94rem;
  color: var(--text);
}

.profile-value a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.profile-value a:hover {
  border-bottom-color: var(--accent);
}

.profile-card button {
  padding: 12px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, transform 0.1s ease;
}

.profile-card button:hover {
  background: #4a7fad;
}

.profile-card button:active {
  transform: scale(0.985);
}

/* ── Allgemeiner Button-Link ── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  background: #4a7fad;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--row-hover);
  color: var(--text);
}

/* ── Profil-Edit Buttons ── */
.profile-edit-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.profile-edit-buttons button {
  padding: 12px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, transform 0.1s ease;
}

.profile-edit-buttons button:hover {
  background: #4a7fad;
}

.profile-edit-buttons button:active {
  transform: scale(0.985);
}


/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 640px) {
  .container {
    padding: 24px 12px 40px;
  }

  h1 {
    font-size: 1.35rem;
  }

  thead th,
  tbody td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .header-image-wrapper {
    max-height: 180px;
  }

  .sidebar {
    width: 180px;
    padding: 20px 0;
  }

  .sidebar a {
    padding: 10px 16px;
    font-size: 0.82rem;
  }

  .login-card {
    padding: 28px 20px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group-plz {
    flex: 1;
  }

  .profile-card {
    padding: 28px 20px;
  }

  .profile-row {
    flex-direction: column;
    gap: 2px;
  }

  .profile-label {
    flex: none;
  }
}
