/* ============================================================
   MAKU PLANER — Stylesheet (Design-Tokens wie maku-solutions.de)
   ============================================================ */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-v20-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-v20-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-v20-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-v20-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500 700; font-display: swap; src: url("../fonts/space-grotesk-v22-latin.woff2") format("woff2"); }

:root {
  --base: #0a0a0c;
  --panel: #101014;
  --panel-2: #14141a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #4d7df2;
  --accent-soft: #7ea1f7;
  --accent-deep: #2f56c4;
  --text: #d4d4d8;
  --text-dim: #a1a1aa;
  --text-faint: #71717a;
  --white: #fff;

  --s-open: #a1a1aa;      /* nicht begonnen */
  --s-progress: #f5b84d;  /* laufend */
  --s-done: #4ade80;      /* erledigt */
  --danger: #f87171;

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { overflow-x: hidden; color-scheme: dark; }
body {
  font-family: var(--font-body);
  background: var(--base);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(77, 125, 242, 0.14), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(47, 86, 196, 0.10), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--white); line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.grad { background: linear-gradient(135deg, var(--accent-soft), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dim { color: var(--text-dim); }
.small { font-size: 0.85rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.spacer { flex: 1; }

/* ---------- Buttons & Felder ---------- */
.btn {
  font: inherit; font-weight: 500; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  padding: 0.55rem 1.1rem; border-radius: 999px;
  transition: border-color .2s, background .2s, transform .2s;
}
.btn:hover { border-color: var(--accent); color: var(--white); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: transparent; color: var(--white); box-shadow: 0 6px 24px -8px rgba(77, 125, 242, 0.6); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--white); border-color: var(--line-strong); }
.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); background: transparent; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--danger); color: var(--danger); }
.btn-small { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--text-dim); font-size: 1.1rem; cursor: pointer; padding: 0.3rem 0.5rem; border-radius: 8px; }
.icon-btn:hover { color: var(--white); background: var(--line); }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; flex: 1 1 160px; min-width: 0; }
.field > span { font-size: 0.8rem; color: var(--text-dim); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
input, select, textarea {
  font: inherit; color: var(--white); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem; width: 100%;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.error { color: var(--danger); font-size: 0.9rem; min-height: 1.3em; margin-bottom: 0.6rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  width: 100%; max-width: 400px; padding: 2.2rem;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(77, 125, 242, 0.35);
}
.login-logo { height: 54px; display: block; margin-bottom: 1.2rem; }
.login-card h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.login-card form { margin-top: 1.4rem; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 12, 0.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0.8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--white); text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; }
.brand img { height: 32px; }
.brand b { color: var(--accent-soft); font-weight: 600; }
.topbar-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.container { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.page-head { margin-bottom: 1.8rem; }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem; margin-bottom: 1.6rem; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.9rem; color: var(--white); line-height: 1.1; }
.stat span { font-size: 0.85rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.45rem; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 1.4rem; }
.toolbar input[type=search] { flex: 1 1 180px; max-width: 280px; margin-left: auto; border-radius: 999px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 0.88rem; color: var(--text-dim); background: none; border: 0; padding: 0.4rem 0.95rem; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.seg button:hover { color: var(--white); }
.seg button.on { background: var(--accent); color: var(--white); }
.seg-status button[data-v=open].on { background: #3f3f46; }
.seg-status button[data-v=progress].on { background: var(--s-progress); color: #1a1205; }
.seg-status button[data-v=done].on { background: var(--s-done); color: #062010; }

/* ---------- Karten ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.card {
  position: relative; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1rem; display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 16px 40px -22px rgba(77, 125, 242, 0.55); }
.card::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--s-open); }
.card[data-status=progress]::before { background: var(--s-progress); }
.card[data-status=done]::before { background: var(--s-done); }
.card[data-status=done] .card-title { text-decoration: line-through; color: var(--text-dim); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.card-title { font-family: var(--font-display); font-size: 1.12rem; color: var(--white); font-weight: 600; word-break: break-word; }
.card-notes { font-size: 0.9rem; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.3rem; }

.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 500; padding: 0.15rem 0.65rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim); white-space: nowrap; }
.chip.type { color: var(--accent-soft); border-color: rgba(77, 125, 242, 0.4); }
.chip.late { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.chip.prio { color: var(--s-progress); border-color: rgba(245, 184, 77, 0.4); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-open); display: inline-block; }
.dot.progress { background: var(--s-progress); }
.dot.done { background: var(--s-done); }
.status-btn { cursor: pointer; background: none; font: inherit; }
.status-btn:hover { border-color: var(--accent); color: var(--white); }

.progress-bar { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); }

.empty { text-align: center; color: var(--text-dim); padding: 3rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- Dialoge ---------- */
.dlg { margin: auto; width: min(760px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 24px; padding: 0; overflow: hidden; }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-small { width: min(520px, calc(100vw - 1.5rem)); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 1.4rem; overflow-y: auto; flex: 1; }
.dlg-foot { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.4rem; border-top: 1px solid var(--line); background: var(--panel-2); }
.title-input { background: transparent; border: 0; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; padding: 0.2rem 0; color: var(--white); }
.title-input:focus { outline: none; border-bottom: 1px solid var(--accent); border-radius: 0; }

/* ---------- Dateien ---------- */
.files-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.files-head > span { font-size: 0.8rem; color: var(--text-dim); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.files-actions { display: flex; gap: 0.4rem; }
.dropzone { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 0.8rem; margin-top: 0.4rem; transition: border-color .2s, background .2s; }
.dropzone.over { border-color: var(--accent); background: rgba(77, 125, 242, 0.08); }
.folder { margin-bottom: 0.7rem; }
.folder-head { display: flex; align-items: center; gap: 0.5rem; color: var(--white); font-weight: 500; padding: 0.3rem 0.2rem; }
.folder-head .name { flex: 1; word-break: break-word; }
.file { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; margin-left: 1.2rem; border-radius: 8px; font-size: 0.92rem; }
.file:hover { background: var(--line); }
.file.root { margin-left: 0; }
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--white); }
.file .size { color: var(--text-faint); font-size: 0.8rem; }
.file select { width: auto; padding: 0.15rem 0.4rem; font-size: 0.78rem; border-radius: 8px; max-width: 120px; }
.file a, .file button { color: var(--accent-soft); background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.85rem; text-decoration: none; }
.file a:hover, .file button:hover { color: var(--white); }
.file .del, .folder-head .del { color: var(--text-faint); }
.file .del:hover, .folder-head .del:hover { color: var(--danger); }
.folder-head button { background: none; border: 0; cursor: pointer; color: var(--text-faint); font: inherit; font-size: 0.85rem; }

@media (max-width: 640px) {
  .topbar-actions .btn-ghost { padding-inline: 0.6rem; }
  .toolbar input[type=search] { max-width: none; margin-left: 0; }
  .file select { display: none; }
}
