/* Minimal, clean UI inspired by the provided screenshots (cards, categories, top nav). */

:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(17,24,39,.08);
  --radius: 16px;

  --cat-lern: #10b981;   /* teal/green */
  --cat-stark: #7c3aed;  /* purple */
  --cat-kreativ: #ef4444;/* red */
  --cat-team: #f59e0b;   /* yellow/orange */
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

.topbar{
  position: sticky;
  top:0;
  z-index: 10;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display:flex;
  gap:16px;
  align-items:center;
  justify-content: space-between;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 240px;
}
.logo{
  width:40px; height:40px;
  border-radius: 12px;
  background: #111827;
  color:#fff;
  display:grid;
  place-items:center;
  font-weight: 800;
  letter-spacing: .5px;
}
.brand-title{ font-weight: 800; }
.brand-sub{ font-size: 12px; color: var(--muted); margin-top:2px; }

.nav{
  display:flex;
  gap:8px;
  flex-wrap: wrap;
  justify-content:flex-end;
}
.nav-btn{
  border:1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:600;
  color: #374151;
}
.nav-btn[aria-current="page"]{
  border-color: #111827;
  color: #111827;
}
.container{
  max-width: 1120px;
  margin: 18px auto 60px;
  padding: 0 16px;
}

.view-header{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
}
.view-header h1{ margin: 0; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; }

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  align-items: stretch;
}
.hero h1{ margin: 0 0 6px; font-size: 28px; }
.hero-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.hero-metrics{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric{
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fafafa;
}
.metric-label{ font-size: 12px; color: var(--muted); }
.metric-value{ font-size: 22px; font-weight: 800; margin-top: 4px; }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  align-items:center;
}
.select{
  display:flex;
  gap:8px;
  align-items:center;
  border:1px solid var(--border);
  background:#fff;
  padding: 8px 10px;
  border-radius: 999px;
}
.select span{ color: var(--muted); font-size: 12px; }
.select select{
  border:none;
  outline:none;
  background:transparent;
  font-weight: 700;
}

button{
  font: inherit;
}
.primary{
  background:#111827;
  color:#fff;
  border:1px solid #111827;
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
}
.secondary{
  background:#fff;
  color:#111827;
  border:1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
}
.ghost{
  background: transparent;
  border:1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
  color:#374151;
}

.section-title{
  margin: 18px 0 10px;
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap:10px;
}
.section-title h2{ margin:0; font-size: 16px; letter-spacing: .2px; }
.section-title .count{ font-size: 12px; color: var(--muted); }

.board{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.lesson-card{
  background: #fff;
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(17,24,39,.06);
  display:flex;
  flex-direction: column;
  min-height: 136px;
}
.lesson-top{
  height: 70px;
  background: #f3f4f6;
  display:flex;
  align-items:center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: .5px;
  color:#9ca3af;
}
.lesson-bottom{
  padding: 10px 12px 12px;
  position: relative;
  border-top: 6px solid var(--cat-lern);
}
.lesson-meta{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom: 6px;
}
.badge{
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background:#f3f4f6;
  color:#374151;
}
.title{
  font-weight: 800;
  line-height: 1.15;
}
.done-dot{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  border:1px solid #d1d5db;
}
.lesson-card.done .done-dot{
  background: #22c55e;
  border-color: #16a34a;
}
.lesson-card.locked{
  opacity: .55;
  cursor: not-allowed;
}
.lesson-card.locked .done-dot{ display:none; }

/* Category color mapping */
.lesson-card[data-category="LERNTECHNIKEN"] .lesson-bottom{ border-top-color: var(--cat-lern); }
.lesson-card[data-category="STARKES SELBST"] .lesson-bottom{ border-top-color: var(--cat-stark); }
.lesson-card[data-category="KREATIVES DENKEN"] .lesson-bottom{ border-top-color: var(--cat-kreativ); }
.lesson-card[data-category="TEAMPLAY"] .lesson-bottom{ border-top-color: var(--cat-team); }

.recommendation{
  padding: 12px;
  border:1px dashed var(--border);
  border-radius: 14px;
  background:#fafafa;
}
.rewards{ display:flex; flex-direction: column; gap:10px; }
.reward-item{
  display:flex; gap:10px; align-items:center;
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background:#fff;
}
.reward-item .num{
  font-weight: 900;
  width: 34px; height: 34px;
  border-radius: 12px;
  display:grid; place-items:center;
  background:#111827;
  color:#fff;
}
.reward-item input{
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
}

.field{ display:flex; flex-direction: column; gap:6px; margin: 10px 0; }
.field span{ font-size: 12px; color: var(--muted); }
.field input{
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background:#fff;
  font-weight: 700;
}
textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.right{ display:flex; justify-content: flex-end; margin-top: 10px; }

.plan{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.plan-item{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background:#fff;
}
.plan-item strong{ font-weight: 900; }

.timer{ display:flex; flex-direction: column; gap: 10px; }
.timer-value{
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align:center;
  padding: 8px 0;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background:#fafafa;
}
.timer-actions{ display:flex; gap: 10px; justify-content:center; flex-wrap: wrap; }

.quote{
  padding: 12px;
  border-left: 4px solid #111827;
  background:#fafafa;
  border-radius: 10px;
  color:#111827;
  font-weight: 700;
}

.footer{
  position: fixed;
  bottom:0;
  left:0;
  right:0;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
}

.hidden{ display:none !important; }

/* Modal */
.modal{ position: fixed; inset:0; display:grid; place-items:center; }
.modal-backdrop{ position:absolute; inset:0; background: rgba(17,24,39,.45); }
.modal-panel{
  position: relative;
  width: min(720px, calc(100vw - 22px));
  background: #fff;
  border:1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.icon-btn{
  width: 40px; height: 40px;
  border-radius: 12px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-size: 22px;
  line-height: 1;
}
.modal-body{ padding: 14px 16px 16px; }
.pill-row{ display:flex; gap:8px; margin: 6px 0 12px; flex-wrap: wrap; }
.pill{
  font-size: 12px;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 999px;
  background:#111827;
  color:#fff;
}
.pill-muted{ background:#f3f4f6; color:#374151; border: 1px solid var(--border); }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top: 10px; flex-wrap: wrap; }

@media (max-width: 980px){
  .board{ grid-template-columns: repeat(3, 1fr); }
  .hero{ grid-template-columns: 1fr; }
}
@media (max-width: 720px){
  .board{ grid-template-columns: repeat(2, 1fr); }
  .view-header{ flex-direction: column; align-items: flex-start; }
  .grid-2{ grid-template-columns: 1fr; }
  .brand{ min-width: auto; }
}
