/* =====================================================
   GLOBAL / BASIS
   ===================================================== */

body {
  font-family: Arial, sans-serif;
  font-size: 15px;
  padding: 20px;
  margin: 0;
  background-color: #ffffff;
}

.content {
  max-width: 1200px;
  margin: 0 auto;
}

a {
  color: #006;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

small {
  color: #444;
}

/* =====================================================
   HEADER
   ===================================================== */

.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid #ccc;
  padding: 10px 0 14px 0;
  margin-bottom: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;

  /* links ausgerichtet */
  margin-left: 20px;
  margin-right: 20px;
}

.logo {
  height: 60px;
  width: auto;
  max-width: 100%;
}

.site-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

/* =====================================================
   STARTSEITE
   ===================================================== */

.wrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

a.btn {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f6f6f6;
  color: #333;
}

a.btn:hover {
  background: #eeeeee;
}

/* =====================================================
   ADMIN (Body-Klasse: class="admin")
   ===================================================== */

body.admin .form-block {
  margin-bottom: 10px;
}

body.admin label.inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.box {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 14px;
  max-width: 720px;
}

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

input[type="password"] {
  padding: 8px;
  width: 220px;
}

input[type="file"] {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button {
  padding: 8px 12px;
  cursor: pointer;
}

.danger {
  background: #ffe6e6;
  border: 1px solid #ffb3b3;
}

.msg {
  margin: 12px 0;
}

/* =====================================================
   BAHNZUORDNUNG / ÜBERSICHT
   (Body-Klasse: class="bahnzuordnung")
   ===================================================== */

body.bahnzuordnung {
  font-size: 14px;
  padding: 16px;
}

body.bahnzuordnung h2 {
  margin: 0 0 12px;
}

body.bahnzuordnung .table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

body.bahnzuordnung table {
  border-collapse: collapse;
  min-width: 820px;
}

body.bahnzuordnung th,
body.bahnzuordnung td {
  padding: 6px 8px;
  white-space: nowrap;
  border: none;
}

body.bahnzuordnung tbody td {
  border-bottom: 1px solid #d6d6d6;
}
body.bahnzuordnung tbody tr:last-child td {
  border-bottom: none;
}

body.bahnzuordnung th,
body.bahnzuordnung td {
  border-right: 1px solid #e0e0e0;
}
body.bahnzuordnung th:last-child,
body.bahnzuordnung td:last-child {
  border-right: none;
}

body.bahnzuordnung th {
  background-color: #f2f2f2;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 2;
}

body.bahnzuordnung tbody tr:not(.warn):nth-child(even) {
  background-color: #fafafa;
}
body.bahnzuordnung tbody tr:not(.warn):hover {
  background: #f0f7ff;
}

body.bahnzuordnung tbody tr.warn,
body.bahnzuordnung tbody tr.warn:hover {
  background-color: #ffe0b2;
}

body.bahnzuordnung tr.sumrow td {
  font-weight: bold;
  background: #e8e8e8;
}
body.bahnzuordnung .sumlabel {
  text-align: right;
}

body.bahnzuordnung .col-katnr,
body.bahnzuordnung .col-bahnnr,
body.bahnzuordnung .col-km,
body.bahnzuordnung .col-posten,
body.bahnzuordnung .col-imziel,
body.bahnzuordnung .col-angemeldet,
body.bahnzuordnung .col-offen {
  text-align: right;
  width: 70px;
}

body.bahnzuordnung .col-kategorie {
  width: 110px;
}

body.bahnzuordnung .col-bahn {
  width: 260px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.bahnzuordnung .hint {
  margin: 6px 0 14px;
}

/* =====================================================
   BAHN-DRUCK
   (Body-Klasse: class="bahndruck")
   ===================================================== */

body.bahndruck {
  font-size: 14px;
  padding: 16px;
}

body.bahndruck h2 {
  margin: 0 0 12px;
}

body.bahndruck .hint {
  margin: 6px 0 14px;
}

body.bahndruck .table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

body.bahndruck table {
  border-collapse: collapse;
  min-width: 900px;
}

body.bahndruck th,
body.bahndruck td {
  padding: 6px 8px;
  white-space: nowrap;
  border: none;
}

body.bahndruck tbody td {
  border-bottom: 1px solid #d6d6d6;
}
body.bahndruck tbody tr:last-child td {
  border-bottom: none;
}

body.bahndruck th,
body.bahndruck td {
  border-right: 1px solid #e0e0e0;
}
body.bahndruck th:last-child,
body.bahndruck td:last-child {
  border-right: none;
}

body.bahndruck th {
  background-color: #f2f2f2;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 2;
}

body.bahndruck tbody tr:not(.warn):nth-child(even) {
  background-color: #fafafa;
}
body.bahndruck tbody tr:not(.warn):hover {
  background: #f0f7ff;
}

body.bahndruck tbody tr.warn,
body.bahndruck tbody tr.warn:hover {
  background-color: #ffe0b2;
}

body.bahndruck .right {
  text-align: right;
}

body.bahndruck .druck-form {
  margin: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

body.bahndruck .num {
  width: 70px;
  padding: 4px 6px;
  font-size: 14px;
}

body.bahndruck .btn-small {
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
}

body.bahndruck .col-bahnnr {
  width: 70px;
  text-align: right;
}

body.bahndruck .col-bahnbez {
  min-width: 260px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.bahndruck .col-auftrag {
  min-width: 220px;
}

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
  margin-top: 30px;
}

.footer-sep {
  border: none;
  border-top: 1px solid #ccc;
  margin-bottom: 15px;
}

.footer-actions {
  margin-top: 15px;
}

/* Footer-Button MUSS stärker sein als globale a-Regeln */
.footer-btn {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f7f7f7;
  color: #000;
  text-decoration: none;      /* WICHTIG */
  font-weight: bold;
}

.footer-btn:hover {
  background: #eeeeee;
  text-decoration: none;      /* WICHTIG */
}
/* =====================================================
   MOBILE / KLEINE SCREENS
   ===================================================== */

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .header-left {
    margin-left: 12px;
    margin-right: 12px;
  }

  .logo {
    height: 36px;
  }

  .site-title {
    font-size: 20px;
  }

  a.btn {
    padding: 10px 14px;
  }

  input[type="password"] {
    width: 100%;
    max-width: 320px;
  }
}

/* =====================================================
   TABELLEN LINKS AUSRICHTEN
   ===================================================== */

/* Bahnzuordnung & Bahn-Druck: Content nicht zentrieren */
body.bahnzuordnung .content,
body.bahndruck .content {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.hint { display: block; }
