/* ============ Basis ============ */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
}
a { color: inherit; }

/* ============ Topbar ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.25rem;
  background: var(--accent, #334);
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar a { color: #fff; text-decoration: none; opacity: .9; }
.topbar a:hover { opacity: 1; text-decoration: underline; }
.logout { font-weight: 500; }

/* ============ Login ============ */
.page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2b5876, #4e4376);
}
.login-box {
  background: #fff;
  padding: 2rem 2.25rem;
  border-radius: 14px;
  width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-box h1 { margin: 0 0 1.25rem; font-size: 1.4rem; text-align: center; }
.login-box label { display: block; margin-bottom: .9rem; font-size: .85rem; font-weight: 600; color: #555; }
.login-box input {
  width: 100%;
  margin-top: .35rem;
  padding: .6rem .7rem;
  border: 1px solid #ccd;
  border-radius: 8px;
  font-size: 1rem;
}
.login-box button {
  width: 100%;
  padding: .7rem;
  margin-top: .3rem;
  border: 0;
  border-radius: 8px;
  background: #4e4376;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.login-box button:hover { background: #3c3560; }
.error {
  background: #fde8e8;
  color: #a12626;
  padding: .55rem .7rem;
  border-radius: 8px;
  font-size: .85rem;
  margin: 0 0 1rem;
}

/* ============ Menü-Kacheln ============ */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  transition: transform .12s ease;
}
.tile:hover { transform: translateY(-4px); }
.tile-wp   { background: #21759b; }
.tile-ipad { background: #e8590c; }
.tile-nc   { background: #0082c9; }
.tile-srv  { background: #2f855a; }
.tile-db   { background: #6b46c1; }
.tile-wartung { background: #0d9488; }

/* ============ iframe-Seiten ============ */
.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
}
.frame-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  border-top: 4px solid var(--accent, #334);
}
.frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .9rem;
  font-weight: 600;
  font-size: .95rem;
}
.frame-head .fh-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-head a { font-size: .8rem; text-decoration: none; color: var(--accent, #334); }
.frame-head .fh-status { font-size: .75rem; color: #667; font-weight: 500; }
.fh-reload {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--accent, #334);
  padding: .1rem .3rem;
  margin: 0;
  border-radius: 6px;
  opacity: .75;
  transition: opacity .12s ease, background .12s ease;
}
.fh-reload:hover { opacity: 1; background: rgba(0,0,0,.06); }
.fh-reload:active { transform: scale(.9); }
@keyframes fh-spin { to { transform: rotate(360deg); } }
.fh-reload.spin { animation: fh-spin .6s linear infinite; }
.dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #cbd; flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(0,0,0,.05);
}
.dot-up   { background: #2f9e44; }
.dot-warn { background: #f08c00; }
.dot-down { background: #e03131; }
.summary { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; }
.summary > span {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 999px;
  background: rgba(255,255,255,.15); font-weight: 600;
}
.summary b { font-weight: 700; }
.summary .s-up   { color: #b2f2bb; }
.summary .s-warn { color: #ffe8cc; }
.summary .s-down { color: #ffc9c9; }
.summary .s-prog { background: none; padding: 0; opacity: .8; font-weight: 400; }
.frame-card iframe {
  width: 100%;
  height: 420px;
  border: 0;
  border-top: 1px solid #eee;
  background: #fafafa;
}

/* ============ Link-Karten ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  padding: 1.75rem;
  max-width: 1000px;
  margin: 0 auto;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  border-left: 5px solid var(--accent, #334);
  transition: transform .12s ease, box-shadow .12s ease;
}
.link-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.14); }
.lc-name { font-weight: 700; font-size: 1.05rem; }
.lc-user { font-size: .82rem; color: #667; }
.lc-go   { margin-top: .3rem; font-size: .82rem; font-weight: 600; color: var(--accent, #334); }
.hint { color: #667; padding: 1rem; }
.hint code { background: #eef; padding: .1rem .35rem; border-radius: 5px; }

/* ============ Wartung: Schul-Kacheln ============ */
.wartung-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.75rem;
}
.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}
.school-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 120px;
  padding: 1rem;
  border-radius: 12px;
  background: #fff;
  color: #1f2430;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  border-top: 4px solid var(--accent, #0d9488);
}
.school-tile .st-name { font-size: 1.05rem; font-weight: 700; }
.school-tile .st-cert { font-size: .78rem; color: #667; font-weight: 500; line-height: 1.35; }
.school-tile .cert-date { color: var(--accent, #0d9488); font-weight: 700; }
.school-tile .st-warn { font-size: 2.4rem; line-height: 1; color: #e03131; }
.school-tile .st-link {
  margin-top: .2rem;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent, #0d9488);
}
.school-tile .st-link:hover { text-decoration: underline; }

/* ============ Akzentfarbe je Seite ============ */
.page-wp   { --accent: #21759b; }
.page-ipad { --accent: #e8590c; }
.page-nc   { --accent: #0082c9; }
.page-srv  { --accent: #2f855a; }
.page-db   { --accent: #6b46c1; }
.page-wartung { --accent: #0d9488; }
.page-menu { --accent: #334; }
