/* Grundlayout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f5f5f7;
  color: #222;
}

/* Topbar / Navigation */
.topbar {
  background: #1f2933;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.main-nav a {
  color: #e5e7eb;
  text-decoration: none;
  margin-left: 1rem;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.main-nav .nav-secondary {
  opacity: 0.85;
  font-size: 0.9rem;
}

/* Seiten-Container */
.page {
  max-width: 1100px;
  margin: 1.5rem auto 2.5rem auto;
  padding: 0 1rem;
}

/* Footer */
.footer {
  border-top: 1px solid #d1d5db;
  background: #f9fafb;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
  text-align: right;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Überschriften / Typo */
h1, h2, h3 {
  margin-top: 0;
  color: #111827;
}

h2 {
  margin-bottom: 0.8rem;
}

h3 {
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}

/* Flash-Messages */
.flash-container {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.flash-success {
  background-color: #ecfdf5;
  color: #166534;
  border: 1px solid #6ee7b7;
}

.flash-error {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Links allgemein */
a {
  color: #2563eb;
}

a:hover {
  color: #1d4ed8;
}

/* Tabellen */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
  background: #ffffff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

th, td {
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}

th {
  text-align: left;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr:hover {
  background: #eef2ff;
}

/* Formulare */
form {
  background: #ffffff;
  padding: 1rem;
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-top: 1rem;
  max-width: 600px;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  color: #374151;
}

input[type="text"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.7rem;
  border-radius: 0.4rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

button,
input[type="submit"] {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 0.4rem;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  background: #1d4ed8;
}

/* Cards (für Charts & Boxen) */
.card {
  background: #ffffff;
  border-radius: 0.6rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1.2rem;
}

/* Canvas für Charts */
canvas {
  max-width: 100%;
}

/* Kleinere Bildschirme */
@media (max-width: 700px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    margin-top: 0.5rem;
  }

  .main-nav a {
    margin-left: 0;
    margin-right: 0.8rem;
  }
}
