/* === Grundlayout === */
body {
  margin: 0;
  font-family: sans-serif;
  padding-top: 50px;
  background: #eef6f9;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

/* Private Bereiche bleiben auf hyden.cc verborgen, bis Cloudflare Access
   durch eine erfolgreiche Shelly-Abfrage bestätigt wurde. */
html.access-public:not(.access-private-visible) .private-access-content {
  display: none !important;
}

/* Im LAN gibt es keine Cloudflare-Sitzung, daher wird dort auch kein
   irreführender Login-/Logout-Schalter angeboten. */
html.access-local .access-session-link {
  display: none;
}

html.access-local .access-session-separator {
  display: none;
}

main {
  display: flex;
  height: calc(var(--vh, 1vh) * 100 - 50px);
}

.dashboard-page {
  display: flex;
  height: calc(var(--vh, 1vh) * 100 - 50px);
}

.equal-column {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  min-height: 0;
}

.topbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 50px;
  background: #004466;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 16px;
  z-index: 10;
}

.project-logo {
  height: 42px;
  margin-right: 13px;
  padding-right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}

.project-logo-mark {
  width: 34px;
  height: 34px;
  overflow: visible;
}

.project-logo-mark rect {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 1.4;
}

.project-logo-mark path {
  fill: none;
  stroke: #bfd730;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-wordmark {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.project-logo:hover .project-logo-mark rect {
  fill: rgba(255, 255, 255, 0.16);
}

.datetime {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.extra {
  margin-left: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.access-session-link {
  display: inline-flex;
  min-height: 30px;
  padding: 4px 7px;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  vertical-align: middle;
  transition: background .18s ease;
}

.access-session-link:hover { background: rgba(255, 255, 255, .16); }
.access-session-link.is-pending { opacity: .65; pointer-events: none; }

.access-session-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.access-logout-icon { display: none; }
.access-session-link.is-authenticated .access-login-icon { display: none; }
.access-session-link.is-authenticated .access-logout-icon { display: block; }

.back-button {
  position: absolute;
  top: 56px;
  left: 10px;
  font-size: 18px;
  text-decoration: none;
  background: #004466;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.2s ease;
  z-index: 10;
}

.back-button:hover {
  background: #006699;
}

/* === Responsive Layout === */
@media (max-width: 800px) {
  .station-name {
    font-size: 1.2rem;
  }
  .card-value {
    font-size: 1.2rem;
  }
}

@media (max-width: 500px) {
  .topbar { padding-left: 5px; }
  .project-logo { margin-right: 7px; padding-right: 7px; }
  .project-wordmark { display: none; }
  .access-session-label { display: none; }
  .access-session-link { padding-inline: 5px; }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .dashboard-page {
    display: flex;
    height: auto;
    min-height: calc(100dvh - 50px);
    flex-direction: column;
    overflow: visible;
  }

  .dashboard-page > .equal-column {
    width: 100%;
    height: auto;
    flex: none;
  }
}
