/* =========================================================
   Simon Morscher – Portal Stylesheet
   Auth · interne App
   =========================================================
   Farben, Schrift und Hell/Dunkel stehen in tokens.css und werden von dort
   uebernommen — diese Datei definiert nur noch Bausteine. tokens.css muss
   deshalb VOR app.css eingebunden werden.

   Das Erscheinungsbild folgt dem Fitness-Dashboard: warme Flaechen, flache
   Fuellungen, Zurueckhaltung. Die frueheren Indigo-Verlaeufe (brand-mark,
   btn-primary, aktiver Navigationspunkt, stat.accent) sind bewusst weg —
   sie waren die einzige Stelle im Portal mit einer eigenen Farbwelt.

   DM Mono hat keinen Fettschnitt: nie font-weight ueber 500.
   ========================================================= */

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font);background:var(--bg);color:var(--ink);line-height:1.55;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
h1,h2,h3{line-height:1.2;margin:0}
/* Formularelemente erben die Schrift nicht von selbst — sonst stehen Knoepfe
   und Dateiauswahl in der Systemschrift statt in DM Mono. */
button,input,select,textarea{font:inherit;color:inherit}

.brand-mark{display:inline-grid;place-items:center;width:2rem;height:2rem;border-radius:9px;
  background:var(--accent);color:var(--accent-ink);font-weight:500;font-size:.85rem;letter-spacing:.02em}

/* ---------- Buttons ---------- */
.btn-primary{display:inline-block;background:var(--accent);
  color:var(--accent-ink);border:0;border-radius:12px;padding:.85rem 1.4rem;font-weight:500;font-size:1rem;
  cursor:pointer;transition:transform .12s ease,filter .12s ease}
.btn-primary:hover{transform:translateY(-1px);filter:brightness(1.08)}
.btn-ghost{display:inline-block;padding:.85rem 1.4rem;border-radius:12px;border:1px solid var(--border);
  font-weight:500;color:var(--ink);background:var(--surface)}
.btn-ghost:hover{border-color:var(--accent)}

/* Die Startseite hat seit "Startseite v2" ein eigenes, in sich
   geschlossenes Design in assets/css/start.css — hier steht dazu nichts mehr. */

/* =========================================================
   Auth
   ========================================================= */
body.auth{min-height:100vh;display:grid;place-items:center;padding:1.5rem;
  background:radial-gradient(1200px 600px at 50% -10%,var(--accent-weich),transparent),var(--bg)}
.auth-card{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--border);
  border-radius:20px;padding:2.4rem;box-shadow:var(--shadow)}
.auth-brand{margin-bottom:1.2rem}
.auth-brand .brand-mark{width:2.6rem;height:2.6rem;font-size:1rem}
.auth-card h1{font-size:1.5rem;font-weight:500;letter-spacing:-.01em}
.auth-sub{color:var(--muted);margin:.4rem 0 1.6rem}
.auth-card label{display:block;font-weight:500;font-size:.9rem;margin-bottom:1rem}
.auth-card .hint{font-weight:400;color:var(--muted)}
.auth-card input{width:100%;margin-top:.4rem;padding:.8rem .9rem;border:1px solid var(--border);
  border-radius:11px;background:var(--surface-2);color:var(--ink);font-size:1rem}
.auth-card input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-weich)}
.auth-card label.check{display:flex;align-items:center;gap:.55rem;font-weight:500;
  color:var(--muted);margin:-.4rem 0 1.3rem;cursor:pointer}
.auth-card label.check input{width:auto;margin:0;accent-color:var(--accent)}
.auth-card .btn-primary{width:100%;margin-top:.4rem}
.auth-foot{text-align:center;margin:1.4rem 0 0}
.auth-foot a{color:var(--muted)}
.alert{padding:.8rem 1rem;border-radius:11px;margin-bottom:1.2rem;font-size:.92rem}
.alert.error{background:color-mix(in srgb,var(--st-serious) 12%,transparent);color:var(--st-serious);
  border:1px solid color-mix(in srgb,var(--st-serious) 30%,transparent)}

/* =========================================================
   App-Layout (Sidebar + Content)
   ========================================================= */
body.app{display:flex;min-height:100vh}
.sidebar{width:240px;flex-shrink:0;background:var(--surface);border-right:1px solid var(--border);
  padding:1.5rem 1rem;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.sidebar .brand{display:flex;align-items:center;gap:.6rem;font-weight:500;padding:.4rem .6rem 1.4rem}
.sidebar nav{display:flex;flex-direction:column;gap:.25rem}
.sidebar nav a{display:flex;align-items:center;gap:.7rem;padding:.7rem .8rem;border-radius:11px;
  color:var(--muted);font-weight:500;font-size:.95rem}
.sidebar nav a:hover{background:var(--surface-2);color:var(--ink)}
.sidebar nav a.active{background:var(--accent-weich);color:var(--accent)}
.nav-ico{width:1.2rem;text-align:center}
.sidebar-foot{margin-top:auto;padding-top:1rem;border-top:1px solid var(--border)}
.sidebar-foot .who{font-weight:500;font-size:.9rem;padding:.2rem .6rem}
.sidebar-foot .logout{display:block;padding:.5rem .6rem;color:var(--muted);font-size:.9rem}
.sidebar-foot .logout:hover{color:var(--st-serious)}
.content{flex:1;min-width:0}
.topbar{padding:1.6rem 2rem;border-bottom:1px solid var(--border)}
.topbar h1{font-size:1.5rem;font-weight:500;letter-spacing:-.01em}
.page{padding:2rem}
.lead{font-size:1.1rem;color:var(--muted);margin:0 0 1.6rem}

/* Tool-Grid (Dashboard) */
.tool-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1.1rem}
.tool-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:1.5rem;box-shadow:var(--shadow);transition:transform .12s,border-color .12s;display:block}
a.tool-card:hover{transform:translateY(-2px);border-color:var(--accent)}
.tool-ico{font-size:1.8rem}
.tool-card h3{font-size:1.15rem;margin:.6rem 0 .3rem}
.tool-card p{color:var(--muted);margin:0;font-size:.92rem}
.tool-go{display:inline-block;margin-top:1rem;color:var(--accent);font-weight:500;font-size:.9rem}
.tool-card.disabled{opacity:.55}

/* Stat-Kacheln */
.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1.1rem;margin-bottom:1.1rem}
.stat-row.sub{grid-template-columns:minmax(200px,1fr) 2fr}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.3rem 1.4rem;box-shadow:var(--shadow)}
.stat-label{color:var(--muted);font-size:.85rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em}
.stat-val{font-size:2rem;font-weight:500;margin-top:.3rem;letter-spacing:-.03em}
.stat-val .unit{font-size:1rem;font-weight:500;color:var(--muted);margin-left:.2rem}
.stat-note{color:var(--muted);font-size:.85rem;margin-top:.3rem}
.stat.accent{background:var(--accent);color:var(--accent-ink);border:0}
.stat.accent .stat-label,.stat.accent .stat-val .unit,.stat.accent .stat-note{color:rgba(255,255,255,.85)}

/* Karten & Chart */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.4rem 1.5rem;box-shadow:var(--shadow);margin-bottom:1.1rem}
.card-title{font-weight:500;margin-bottom:1rem;text-transform:uppercase;letter-spacing:.06em;font-size:.88rem}
.chart-card{margin-bottom:0}
.bars{display:flex;align-items:flex-end;gap:.6rem;height:150px}
.bar-wrap{flex:1;display:flex;flex-direction:column;align-items:center;gap:.4rem;height:100%;justify-content:flex-end}
.bar{width:100%;max-width:38px;border-radius:7px 7px 0 0;background:var(--sport)}
.bar-lbl{font-size:.72rem;color:var(--muted)}

/* Tabelle */
.tbl{width:100%;border-collapse:collapse;font-size:.92rem}
.tbl th{text-align:left;color:var(--muted);font-weight:500;font-size:.8rem;text-transform:uppercase;
  letter-spacing:.04em;padding:.5rem .6rem;border-bottom:1px solid var(--border)}
.tbl td{padding:.7rem .6rem;border-bottom:1px solid var(--border)}
.tbl tr:last-child td{border-bottom:0}
.tbl .r{text-align:right}
.pill{display:inline-block;padding:.15rem .6rem;border-radius:20px;background:var(--surface-2);
  font-size:.78rem;font-weight:500;color:var(--muted)}

/* Leerzustand */
.empty{text-align:center;padding:4rem 1.5rem;max-width:460px;margin:0 auto;color:var(--muted)}
.empty-ico{font-size:3rem;margin-bottom:.5rem}
.empty h2{color:var(--ink);margin-bottom:.6rem}
.muted{color:var(--muted)}

/* Schmaler Schreibtisch und Tablet — Leiste schrumpfen statt umbrechen.
   Greift auch, wenn ein Handy die Seite in Desktop-Breite rendert
   ("Desktop-Website" in Chrome): dort ist die 720er-Regel unten wirkungslos,
   weil der Darstellungsbereich rund 1000 px breit gemeldet wird. */
@media(max-width:1100px){
  .sidebar{width:190px;padding:1.2rem .7rem}
  .sidebar nav a{padding:.6rem .6rem;font-size:.88rem;gap:.5rem}
  .sidebar .brand{font-size:.95rem;padding:.3rem .4rem 1rem}
  .topbar{padding:1.2rem 1.4rem}
  .page{padding:1.4rem}
  .tool-grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.9rem}
  .tool-card{padding:1.2rem}
}

/* Mobil */
@media(max-width:720px){
  body.app{flex-direction:column}
  .sidebar{width:100%;height:auto;position:static;flex-direction:row;align-items:center;flex-wrap:wrap;gap:.5rem}
  .sidebar .brand{padding:.4rem .6rem}
  .sidebar nav{flex-direction:row;flex-wrap:wrap}
  .sidebar-foot{margin-left:auto;border:0;padding:0;display:flex;align-items:center;gap:.5rem}
  .stat-row.sub{grid-template-columns:1fr}
  .page{padding:1.2rem}
}
