*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f1117;
  --bg-card:    #1a1d27;
  --bg-card-hover: #20243a;
  --border:     #2a2d3e;
  --text:       #e2e8f0;
  --text-muted: #7c8399;
  --accent:     #4f8ef7;
  --accent-dim: #2a3d6b;
  --green:      #22c55e;
  --yellow:     #f59e0b;
  --red:        #ef4444;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(0,0,0,.4);
}

body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; min-height: 100vh; }

/* ── Header ── */
.header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 600; }
.logo-icon { font-size: 1.3rem; }

/* ── Buttons ── */
.btn { padding: .45rem 1rem; border-radius: 8px; border: none; cursor: pointer; font-size: .875rem; font-weight: 500; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-login  { background: var(--accent); color: #fff; }
.btn-logout { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-primary { background: var(--accent); color: #fff; padding: .6rem 1.4rem; }

.user-info { display: flex; align-items: center; gap: .75rem; }
.user-name  { font-size: .875rem; color: var(--text-muted); }

/* ── Main ── */
.main { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.page-title h1 { font-size: 1.75rem; font-weight: 700; }
.subtitle { color: var(--text-muted); margin-top: .25rem; font-size: .95rem; }

/* ── Sections ── */
.section { margin-top: 2.5rem; }
.section-title { font-size: 1rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; }

/* ── Tile Grid ── */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .6rem;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.tile:hover { background: var(--bg-card-hover); border-color: var(--accent-dim); box-shadow: var(--shadow); }
.tile-coming-soon { opacity: .6; }
.tile-offline { border-color: var(--red) !important; }

.tile-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.tile-icon { font-size: 1.6rem; line-height: 1; }
.tile-badges { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }

.tile-title { font-size: 1rem; font-weight: 600; }
.tile-desc  { font-size: .85rem; color: var(--text-muted); flex-grow: 1; }

.tile-link {
  display: inline-block; margin-top: .5rem;
  font-size: .85rem; font-weight: 500; color: var(--accent);
  text-decoration: none;
}
.tile-link:hover { text-decoration: underline; }
.tile-link-disabled { display: inline-block; margin-top: .5rem; font-size: .85rem; color: var(--text-muted); }

/* ── Badges ── */
.badge {
  font-size: .7rem; font-weight: 600; padding: .2rem .5rem;
  border-radius: 999px; white-space: nowrap;
}
.badge-online    { background: rgba(34,197,94,.15);  color: var(--green);  border: 1px solid rgba(34,197,94,.3); }
.badge-degraded  { background: rgba(245,158,11,.15); color: var(--yellow); border: 1px solid rgba(245,158,11,.3); }
.badge-offline   { background: rgba(239,68,68,.15);  color: var(--red);    border: 1px solid rgba(239,68,68,.3); }
.badge-checking  { background: rgba(124,131,153,.1); color: var(--text-muted); border: 1px solid var(--border); }
.badge-soon      { background: rgba(79,142,247,.1);  color: var(--accent); border: 1px solid var(--accent-dim); }
.badge-lock      { background: rgba(245,158,11,.1);  color: var(--yellow); border: 1px solid rgba(245,158,11,.2); }
.badge-open      { background: rgba(34,197,94,.1);   color: var(--green);  border: 1px solid rgba(34,197,94,.2); }

.role-admin  { background: rgba(239,68,68,.15);  color: var(--red);    border: 1px solid rgba(239,68,68,.3); }
.role-family { background: rgba(79,142,247,.15); color: var(--accent); border: 1px solid var(--accent-dim); }
.role-guest  { background: rgba(124,131,153,.1); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Login-Hinweis ── */
.login-warning {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5rem 1.5rem; text-align: center; gap: 1.5rem;
}
.login-warning-icon { font-size: 3rem; line-height: 1; }
.login-warning-text { font-size: 1.05rem; color: var(--text-muted); max-width: 420px; line-height: 1.6; }

/* ── Footer ── */
.footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .8rem; border-top: 1px solid var(--border); }

/* ── Modal ── */
[x-cloak] { display: none !important; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; max-width: 420px; width: 90%;
  display: flex; flex-direction: column; gap: 1rem;
}
.modal h2 { font-size: 1.2rem; }
.modal p  { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .tile-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 1rem; }
  .main { padding: 1.5rem 1rem 3rem; }
}
