/* stahlotec App-Portal – Corporate Design
   Farben: Rot #ED1C24, Grau #606A70, Text #333333, Linien #CCCCCC
   Schrift: Aptos 12 pt (Ersatz: Arial) */

:root {
  --rot: #ED1C24;
  --grau: #606A70;
  --silber-hell: #CFD1D3;
  --silber-dunkel: #9DA2A6;
  --text: #333333;
  --linie: #CCCCCC;
  --weiss: #FFFFFF;
  --flaeche: #F7F8F8;
  --radius: 6px;
  --schrift: Aptos, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--flaeche);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 { font-weight: 700; color: var(--text); }

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

/* Absatzzeile zwischen Kapitelueberschriften: grosszuegiger Abstand nach oben */
h2 {
  font-size: 1.25rem;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linie);
}

a { color: var(--grau); }
a:hover { color: var(--rot); }

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.muted { color: var(--grau); margin: 0 0 1.5rem; }
.error { color: var(--rot); font-weight: 700; margin: 1rem 0 0; }
.right { text-align: right; }
.num { text-align: right; }

/* Logo – Seitenverhaeltnis bleibt erhalten, Schutzraum durch margin */
.logo {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 0 2.5rem;
}
.logo--small {
  width: 130px;
  margin: 0;
}

/* Vollflaechige Bildschirme (Anmeldung, Hinweise) */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.card {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 3rem;
  max-width: 640px;
  width: 100%;
}
.card--narrow { max-width: 460px; }

/* Kopfzeile */
.topbar {
  background: var(--weiss);
  border-bottom: 3px solid var(--rot);
}
.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar__spacer { flex: 1 1 auto; }
.topbar__user { display: flex; align-items: center; gap: 0.6rem; }
.user-name { color: var(--grau); font-weight: 700; }

.badge {
  display: inline-block;
  background: var(--rot);
  color: var(--weiss);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Schaltflaechen */
.btn {
  font-family: var(--schrift);
  font-size: 1rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--grau);
  border-radius: var(--radius);
  background: var(--weiss);
  color: var(--grau);
  cursor: pointer;
}
.btn:hover { border-color: var(--rot); color: var(--rot); }
.btn--primary {
  background: var(--rot);
  border-color: var(--rot);
  color: var(--weiss);
  font-weight: 700;
}
.btn--primary:hover { background: #c8171e; border-color: #c8171e; color: var(--weiss); }
.btn--ghost { border-color: var(--linie); }
.btn--link {
  border: 0;
  background: none;
  padding: 0.2rem 0.4rem;
  color: var(--grau);
  text-decoration: underline;
}
.btn--link:hover { color: var(--rot); }
.btn--danger:hover { color: var(--rot); }

/* Suchleiste */
.toolbar { margin: 0 0 1.5rem; }

.input {
  font-family: var(--schrift);
  font-size: 1rem;
  color: var(--text);
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  width: 100%;
}
.input:focus { outline: 2px solid var(--silber-dunkel); outline-offset: 1px; }
.input--search { max-width: 320px; }

/* App-Kacheln */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tile {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.tile:hover {
  border-color: var(--rot);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.tile__icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--flaeche);
  border: 1px solid var(--silber-hell);
  color: var(--rot);
  font-weight: 700;
  font-size: 1rem;
}
.tile__body { min-width: 0; }
.tile__name { font-weight: 700; margin: 0 0 0.25rem; }
.tile__desc { color: var(--grau); font-size: 0.9rem; margin: 0; }
.tile__meta {
  color: var(--silber-dunkel);
  font-size: 0.78rem;
  margin: 0.5rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tile__flag { color: var(--rot); font-weight: 700; }

/* Tabellen */
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--weiss);
  border: 1px solid var(--linie);
  font-size: 0.94rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--linie);
  vertical-align: top;
}
.table th {
  background: var(--grau);
  color: var(--weiss);
  font-weight: 700;
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table td.right { text-align: right; white-space: nowrap; }
.table td.num { text-align: right; }
.state-off { color: var(--grau); }
.state-on { color: var(--text); }

/* Formulare */
.form {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 1.25rem 0 0;
}
.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.field { display: block; margin: 0 0 1.25rem; }
.field__label { display: block; font-weight: 700; margin: 0 0 0.35rem; }
.field__hint { display: block; color: var(--grau); font-size: 0.82rem; margin: 0.3rem 0 0; }
.check { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1.5rem; }
.form__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Fusszeile */
.footer {
  border-top: 1px solid var(--linie);
  background: var(--weiss);
  margin-top: 4rem;
}
.footer .wrap { padding: 1.5rem; }
.footer p { margin: 0; color: var(--grau); font-size: 0.85rem; }

/* Hinweis-Einblendung */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--grau);
  color: var(--weiss);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  max-width: 90vw;
}
.toast--error { background: var(--rot); }

@media (max-width: 640px) {
  .card { padding: 2rem 1.5rem; }
  .wrap { padding: 2rem 1.25rem; }
  h2 { margin-top: 2.5rem; }
}
