/* Teamworkk Cloud – Farben 1:1 aus der App.
   Day (Standard, hell) = Tailwind-Werte der App. Night = html.dark-mode. */
:root {
  --bg: #f3f4f6;      /* App: bg-gray-100 */
  --card: #ffffff;    /* App: bg-white */
  --line: #e5e7eb;    /* App: border gray-200 */
  --text: #111827;    /* App: text-gray-900 */
  --muted: #6b7280;   /* App: text-gray-500/600 */
  --orange: #f59e0b;  /* App: --u-accent */
  --green: #10b981;   /* App: theme_color */
  --shadow: 0 10px 30px rgba(17,24,39,0.08);
}
html.dark-mode {
  --bg: #121212;      /* App dark */
  --card: #1a1a1a;    /* App dark card */
  --line: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.60);
  --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--green); }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 30px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 6px; }
.brand .logo { height: 46px; width: 44px; display: inline-block; background: url(teamworkk_logo.png) center/contain no-repeat; }
html.dark-mode .brand .logo { background-image: url(teamworkk_logo_white.png); }
.brand h1 { font-size: 1.3em; margin: 0; color: var(--text); }
.lead { text-align: center; color: var(--muted); margin: 6px 0 26px; font-size: 0.95em; }

label { display: block; font-size: 0.82em; color: var(--muted); margin: 14px 0 6px; }
input {
  width: 100%; padding: 13px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1em;
}
input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }
input.token { text-align: center; letter-spacing: 6px; font-size: 1.4em; font-family: monospace; text-transform: uppercase; }

.btn {
  width: 100%; margin-top: 22px; padding: 14px; border: none; border-radius: 12px;
  background: var(--green); color: #fff; font-size: 1.05em; font-weight: 700; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.switch { text-align: center; margin-top: 20px; font-size: 0.9em; color: var(--muted); }
.err { background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.4); color: #b91c1c; padding: 11px 14px; border-radius: 10px; font-size: 0.9em; margin-bottom: 10px; }
html.dark-mode .err { color: #fca5a5; }

.tokenbox { background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.45); border-radius: 12px; padding: 18px; text-align: center; margin: 18px 0; }
.tokenbox .code { font-size: 1.8em; font-weight: 800; letter-spacing: 4px; font-family: monospace; color: #059669; }
html.dark-mode .tokenbox .code { color: #34d399; }
.tokenbox .hint { font-size: 0.82em; color: var(--muted); margin-top: 8px; }

/* Dashboard */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; background: var(--card); border-bottom: 1px solid var(--line); }
.top .r { display: flex; align-items: center; gap: 16px; }
.badge { background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.45); color: #b45309; padding: 6px 12px; border-radius: 20px; font-size: 0.82em; font-weight: 600; }
html.dark-mode .badge { color: #fbbf24; }
.wrap { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 6px; color: var(--text); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; margin-top: 14px; font-size: 0.95em; }
.kv .k { color: var(--muted); }

.muted { color: var(--muted); }

/* Navigation */
.nav { display: flex; align-items: center; gap: 22px; padding: 10px 26px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand .logo { height: 30px; width: 30px; }
.nav-title { font-weight: 700; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 0.95em; }
.nav-links a:hover { background: rgba(127,127,127,0.10); color: var(--text); }
.nav-links a.active { background: rgba(16,185,129,0.14); color: var(--green); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-logout { color: var(--muted); text-decoration: none; font-size: 0.9em; }

/* Statistik-Kacheln */
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; text-align: center; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
a.stat-card:hover { border-color: var(--green); }
.stat-n { font-size: 2.4em; font-weight: 800; color: var(--green); }
.stat-l { color: var(--muted); font-size: 0.9em; margin-top: 4px; }

/* Aufgaben */
.task-form input[type=text], .task-form input[type=email], .task-form select, .task-form input[type=date] {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 0.95em;
}
.task-form-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.task-form-row select, .task-form-row input[type=date] { flex: 1; min-width: 130px; }
.task-form .btn { width: auto; margin-top: 0; padding: 11px 22px; }
.task { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.task-main { flex: 1; }
.task-title { font-weight: 600; }
.task-meta { color: var(--muted); font-size: 0.85em; margin-top: 2px; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.circle { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer; color: #fff; font-size: 0.8em; line-height: 1; }
.circle.checked { background: var(--green); border-color: var(--green); }
.task-check { display: inline; }
.del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1em; padding: 4px 8px; }
.del:hover { color: #ef4444; }
.prio { font-size: 0.72em; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-left: 6px; vertical-align: middle; }
.prio-high { background: rgba(239,68,68,0.15); color: #dc2626; }
.prio-normal { background: rgba(59,130,246,0.15); color: #2563eb; }
.prio-low { background: rgba(107,114,128,0.15); color: #6b7280; }
html.dark-mode .prio-high { color: #fca5a5; } html.dark-mode .prio-normal { color: #93c5fd; }

/* Day/Night-Umschalter */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 1.1em; cursor: pointer; box-shadow: var(--shadow);
}
