/* ==========================================================================
   Lumanio Time — v0.4 UI
   Toggl-inspirierte Zeiterfassung · Dark/Light · responsive
   ========================================================================== */

/* ---- Theme tokens -------------------------------------------------------- */
:root{
  --brand:#7c5cff;          /* primary / Toggl-Akzent (violett-pink) */
  --brand-strong:#6a45ff;
  --brand-soft:rgba(124,92,255,.14);
  --ok:#16b67a;             /* Start / billable */
  --ok-soft:rgba(22,182,122,.14);
  --danger:#ff4d57;         /* Stop / löschen */
  --danger-soft:rgba(255,77,87,.14);
  --warn:#f5a623;
  --radius:14px;
  --radius-lg:20px;
  --shadow:0 8px 30px rgba(8,10,20,.10);
  --maxw:1120px;
  --sidebar:0px;
}

/* Dark (default) */
html[data-theme="dark"]{
  --bg:#0e1016;
  --bg-soft:#13151d;
  --card:#171a23;
  --card-2:#1e222e;
  --line:#262b39;
  --line-soft:#1f2430;
  --text:#f3f5fc;
  --muted:#9aa3b8;
  --input:#11141c;
  --topbar:#0b0d13;
}

/* Light */
html[data-theme="light"]{
  --bg:#f4f5fa;
  --bg-soft:#eceef6;
  --card:#ffffff;
  --card-2:#f6f7fc;
  --line:#e4e7f0;
  --line-soft:#eceef5;
  --text:#1a1d29;
  --muted:#697089;
  --input:#ffffff;
  --topbar:#ffffff;
  --shadow:0 8px 24px rgba(60,66,120,.08);
}

/* ---- Base ---------------------------------------------------------------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  transition:background .25s ease,color .25s ease;
}
a{ color:var(--brand); text-decoration:none; }
a:hover{ text-decoration:underline; }
h1,h2,h3{ margin:0; }

.container{
  padding:22px clamp(14px,4vw,28px);
  padding-bottom:92px;
  max-width:var(--maxw);
  margin:0 auto;
}

/* ---- Topbar -------------------------------------------------------------- */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px clamp(14px,4vw,28px);
  background:color-mix(in srgb,var(--topbar) 88%,transparent);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--line);
}
.brand-wrap{ display:flex; align-items:center; gap:10px; }
.brand{
  font-weight:800; letter-spacing:.2px; font-size:17px;
  display:flex; align-items:center; gap:8px;
}
.brand::before{
  content:""; width:22px; height:22px; border-radius:7px;
  background:linear-gradient(135deg,var(--brand),#b18bff);
  box-shadow:0 2px 10px var(--brand-soft);
}
.version-tag{
  font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); background:var(--bg-soft);
  padding:3px 8px; border-radius:999px; border:1px solid var(--line);
}
.right{ display:flex; gap:10px; align-items:center; }
.muted{ color:var(--muted); font-size:14px; }
.link{ color:var(--muted); font-weight:600; font-size:14px; }
.link:hover{ color:var(--text); text-decoration:none; }

/* Theme toggle */
.theme-toggle{
  width:38px; height:38px; border-radius:11px;
  border:1px solid var(--line); background:var(--card);
  color:var(--text); cursor:pointer; font-size:16px; line-height:1;
  display:inline-flex; align-items:center; justify-content:center;
  transition:background .15s,border-color .15s,transform .1s;
}
.theme-toggle:hover{ border-color:var(--brand); }
.theme-toggle:active{ transform:scale(.94); }
.theme-toggle .ico-sun{ display:none; }
html[data-theme="light"] .theme-toggle .ico-sun{ display:inline; }
html[data-theme="light"] .theme-toggle .ico-moon{ display:none; }

/* ---- Cards --------------------------------------------------------------- */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:18px;
  margin:14px 0;
  box-shadow:var(--shadow);
}
.h1{ font-size:16px; font-weight:700; margin:0 0 4px; letter-spacing:.2px; }
.h2{ font-size:13px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin:0 0 4px; }
.card-sub{ color:var(--muted); font-size:13px; margin-bottom:12px; }
.small{ font-size:12px; color:var(--muted); }

/* Layout helper grids */
.cols{ display:grid; gap:14px; }
@media (min-width:880px){
  .cols-2{ grid-template-columns:1fr 1fr; }
}

/* ---- Forms --------------------------------------------------------------- */
.row{ display:flex; gap:12px; align-items:flex-end; }
.row > *{ flex:1; }
label{ display:block; font-size:12px; color:var(--muted); margin:12px 0 6px; font-weight:600; }
input,select,textarea{
  width:100%; padding:12px 13px;
  border-radius:var(--radius); border:1px solid var(--line);
  background:var(--input); color:var(--text);
  font-size:15px; outline:none; transition:border-color .15s,box-shadow .15s;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand-soft);
}
textarea{ min-height:84px; resize:vertical; }
.grid{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }

/* ---- Buttons ------------------------------------------------------------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  width:100%; padding:13px 16px; border-radius:var(--radius);
  border:1px solid var(--line); background:var(--card-2); color:var(--text);
  font-weight:700; font-size:15px; cursor:pointer;
  transition:transform .08s,filter .15s,background .15s,border-color .15s;
}
.btn:hover{ filter:brightness(1.06); }
.btn:active{ transform:translateY(1px); }
.btn.primary{ background:var(--brand); border-color:transparent; color:#fff; box-shadow:0 6px 18px var(--brand-soft); }
.btn.ok{ background:var(--ok); border-color:transparent; color:#fff; box-shadow:0 6px 18px var(--ok-soft); }
.btn.danger{ background:var(--danger); border-color:transparent; color:#fff; box-shadow:0 6px 18px var(--danger-soft); }
.btn.ghost{ background:transparent; }
.btn.inline{ width:auto; padding:10px 14px; }

/* ---- Pills / chips ------------------------------------------------------- */
.pills{ display:flex; flex-wrap:wrap; gap:8px; }
.pill{
  display:inline-flex; gap:8px; align-items:center;
  padding:9px 13px; border-radius:999px;
  border:1px solid var(--line); background:var(--card-2); color:var(--text);
  font-size:13px; font-weight:600; cursor:pointer;
  transition:border-color .15s,background .15s,transform .08s;
}
.pill:hover{ border-color:var(--brand); }
.pill:active{ transform:scale(.97); }
.pill.subtle{ background:transparent; }
.pill.active{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand); }
.pill.icon{ padding:9px 11px; }
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 12px; border-radius:10px; cursor:pointer;
  border:1px solid var(--line); background:var(--card-2);
  color:var(--text); font-size:13px; font-weight:600;
  transition:border-color .15s,background .15s;
}
.chip:hover{ border-color:var(--brand); }
.chip.active{ background:var(--brand-soft); border-color:var(--brand); color:var(--text); }

/* Quick-pick recents: project chip with two actions */
.quickpick{ display:flex; flex-direction:column; gap:8px; }
.quickpick-row{
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:var(--radius);
  border:1px solid var(--line); background:var(--card-2);
}
.quickpick-row .qp-label{ flex:1; min-width:0; font-size:14px; font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qp-label .qp-client{ color:var(--muted); font-weight:500; }
.qp-actions{ display:flex; gap:6px; flex-shrink:0; }

/* ---- Timer hero ---------------------------------------------------------- */
.timer-hero{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; flex-wrap:wrap;
}
.timer-clock{
  font-variant-numeric:tabular-nums; font-weight:800;
  font-size:clamp(34px,7vw,52px); letter-spacing:1px; line-height:1;
}
.timer-meta{ display:flex; flex-direction:column; gap:6px; min-width:200px; }
.timer-dot{
  display:inline-flex; align-items:center; gap:8px;
  color:var(--ok); font-weight:700; font-size:13px;
}
.timer-dot::before{
  content:""; width:10px; height:10px; border-radius:50%;
  background:var(--ok);
  animation:pulse 1.8s infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(22,182,122,.5); }
  70%{ box-shadow:0 0 0 10px rgba(22,182,122,0); }
  100%{ box-shadow:0 0 0 0 rgba(22,182,122,0); }
}
.timer-stop{ width:auto; min-width:140px; }

/* ---- Flash / badges ------------------------------------------------------ */
.flash{
  background:var(--brand-soft); border:1px solid var(--brand);
  color:var(--text); padding:12px 14px; border-radius:var(--radius);
  margin:14px 0; font-size:14px;
}
.badge{
  display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px;
  font-size:11px; font-weight:700; letter-spacing:.02em;
}
.badge.intern{ background:var(--bg-soft); color:var(--muted); border:1px solid var(--line); }
.badge.billable{ background:var(--ok-soft); color:var(--ok); }
.badge.draft{ background:var(--bg-soft); color:var(--muted); border:1px solid var(--line); }

/* ---- Tables -------------------------------------------------------------- */
.table{ width:100%; border-collapse:collapse; }
.table th,.table td{ padding:12px 8px; border-bottom:1px solid var(--line-soft); font-size:14px; vertical-align:top; }
.table th{ color:var(--muted); font-weight:600; text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.table tr:hover td{ background:var(--card-2); }
.table tr.row-editing td{ background:var(--card-2); box-shadow:inset 3px 0 0 var(--brand); }
.day-head{ margin:18px 0 6px; font-size:13px; font-weight:700; color:var(--muted); display:flex; justify-content:space-between; }

/* ---- Navigation (bottom tabbar -> desktop sidebar) ----------------------- */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:20;
  display:flex; background:color-mix(in srgb,var(--topbar) 92%,transparent);
  backdrop-filter:blur(10px); border-top:1px solid var(--line);
}
.tabbar a{
  flex:1; padding:10px 6px 8px; text-align:center;
  color:var(--muted); font-weight:600; font-size:11px;
  display:flex; flex-direction:column; align-items:center; gap:3px;
}
.tabbar a .tico{ font-size:19px; line-height:1; }
.tabbar a:hover{ color:var(--text); text-decoration:none; }
.tabbar a.active{ color:var(--brand); }

@media (min-width:980px){
  :root{ --sidebar:212px; }
  .container{ max-width:calc(var(--maxw) - 40px); margin-left:calc(var(--sidebar) + 24px); margin-right:24px; padding-bottom:32px; }
  .topbar{ padding-left:calc(var(--sidebar) + 24px); }
  .tabbar{
    top:0; bottom:0; right:auto; width:var(--sidebar);
    flex-direction:column; border-top:none; border-right:1px solid var(--line);
    padding:74px 12px 12px; gap:4px; background:var(--bg-soft);
  }
  .tabbar a{
    flex:0 0 auto; flex-direction:row; justify-content:flex-start;
    gap:12px; padding:11px 14px; border-radius:11px; font-size:14px; text-align:left;
  }
  .tabbar a .tico{ font-size:18px; }
  .tabbar a:hover{ background:var(--card); }
  .tabbar a.active{ background:var(--brand-soft); color:var(--brand); }
}

/* ---- Misc ---------------------------------------------------------------- */
details summary{ list-style:none; cursor:pointer; }
details summary::-webkit-details-marker{ display:none; }
.hr{ height:1px; background:var(--line); border:0; margin:14px 0; }
.spacer{ height:12px; }

/* ==========================================================================
   Track page — iOS-style redesign
   ========================================================================== */

/* ---- Segmented control --------------------------------------------------- */
.seg-wrap{ margin:0 0 20px; }
.seg-ctrl{
  display:flex; gap:3px;
  background:var(--card-2); border:1px solid var(--line); border-radius:13px;
  padding:3px;
}
.seg-btn{
  flex:1; padding:10px 0; border:none; border-radius:10px;
  background:transparent; color:var(--muted);
  font-size:15px; font-weight:600; cursor:pointer;
  transition:all .15s;
  font-family:inherit; letter-spacing:.01em;
}
.seg-btn.active{
  background:var(--card); color:var(--text);
  box-shadow:0 1px 5px rgba(0,0,0,.18);
}

/* ---- Mode panes ---------------------------------------------------------- */
.mode-pane.hidden{ display:none; }

/* ---- Project list (iOS table-view style) --------------------------------- */
.proj-list{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); overflow:hidden; margin:0 0 4px;
}
.proj-list-inner{ padding:0; }
.proj-row{
  display:flex; align-items:center; width:100%;
  padding:14px 16px; border:none; background:none; cursor:pointer;
  text-align:left; border-bottom:1px solid var(--line-soft); color:var(--text);
  transition:background .1s; min-height:62px; font-family:inherit;
}
.proj-row:last-child{ border-bottom:none; }
.proj-row:active{ background:var(--card-2); }
.proj-row.selected{ background:var(--brand-soft); }
.proj-row-inner{ flex:1; min-width:0; }
.proj-name{
  font-size:15px; font-weight:600; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}
.proj-meta{
  font-size:13px; color:var(--muted); margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.proj-check{ flex-shrink:0; margin-left:12px; }
.proj-check.hidden{ display:none; }

/* ---- Section headers (above groups) ------------------------------------- */
.list-section-header{
  font-size:12px; font-weight:600; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em;
  padding:18px 2px 6px;
}

/* ---- Search field -------------------------------------------------------- */
.search-field{
  width:100%; padding:13px 16px; border-radius:var(--radius);
  border:1px solid var(--line); background:var(--input); color:var(--text);
  font-size:16px; outline:none; transition:border-color .15s,box-shadow .15s;
  font-family:inherit; margin-bottom:8px;
}
.search-field:focus{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }

/* ---- Project / activity select ------------------------------------------ */
.list-select{
  width:100%; padding:14px 16px; border-radius:var(--radius);
  border:1px solid var(--line); background:var(--input); color:var(--text);
  font-size:16px; font-weight:500; outline:none; cursor:pointer;
  transition:border-color .15s,box-shadow .15s; min-height:52px;
  font-family:inherit;
}
.list-select:focus{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.inline-select{ border-radius:0; border:none; background:transparent; min-height:50px; padding:13px 16px; }
.inline-select:focus{ box-shadow:none; border-color:transparent; }

/* ---- Hidden group (activity) --------------------------------------------- */
.hidden-group{ display:none; }

/* ---- Datetime card ------------------------------------------------------- */
.datetime-card{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); overflow:hidden; margin:16px 0 0;
}
.dt-row{
  display:flex; align-items:center; gap:10px;
  padding:14px 16px; min-height:52px;
}
.dt-separator{ height:1px; background:var(--line-soft); margin:0 16px; }
.dt-label{
  font-size:15px; color:var(--text); font-weight:500;
  flex-shrink:0; min-width:32px;
}
.dt-val-input{
  flex:1; border:none; background:transparent; color:var(--brand);
  font-size:15px; font-weight:600; text-align:right; padding:0; outline:none;
  cursor:pointer; font-family:inherit; min-width:0;
}
.dt-val-input::-webkit-calendar-picker-indicator{ cursor:pointer; opacity:.7; }
.dt-time{ font-size:17px; text-align:center; }
.dt-arrow{ color:var(--muted); font-size:15px; flex-shrink:0; }

/* ---- Duration chips ------------------------------------------------------ */
.dur-chips{
  display:flex; flex-wrap:wrap; gap:8px; margin:16px 0;
}
.dur-chip{
  padding:10px 16px; border-radius:10px;
  border:1px solid var(--line); background:var(--card-2); color:var(--text);
  font-size:14px; font-weight:600; cursor:pointer; min-height:44px;
  transition:all .12s; font-family:inherit;
}
.dur-chip:active{ transform:scale(.95); }
.dur-chip.active{
  background:var(--brand-soft); border-color:var(--brand);
}

/* ---- Track field (note etc.) --------------------------------------------- */
.track-field{ margin:16px 0; }
.track-label{
  display:block; font-size:12px; color:var(--muted);
  font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px;
}
.track-opt{ font-weight:400; text-transform:none; letter-spacing:0; opacity:.7; }
.track-input{
  width:100%; padding:13px 16px; border-radius:var(--radius);
  border:1px solid var(--line); background:var(--input); color:var(--text);
  font-size:16px; outline:none; transition:border-color .15s,box-shadow .15s;
  font-family:inherit;
}
.track-input:focus{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }

/* ---- Action buttons (Save / Start / Stop) -------------------------------- */
.action-btn{
  width:100%; height:56px; border-radius:16px; border:none;
  font-size:17px; font-weight:700; cursor:pointer; margin-top:24px;
  transition:transform .08s,filter .12s; letter-spacing:.01em;
  font-family:inherit;
}
.action-btn:active{ transform:scale(.97); }
.save-btn{ background:var(--brand); color:#fff; box-shadow:0 6px 20px var(--brand-soft); }
.start-btn{ background:var(--ok); color:#fff; box-shadow:0 6px 20px var(--ok-soft); }
.stop-btn{ background:var(--danger); color:#fff; box-shadow:0 6px 20px var(--danger-soft); }

/* ---- Timer hero ---------------------------------------------------------- */
.timer-hero{
  text-align:center; padding:36px 16px 28px;
}
.live-badge{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px; font-weight:700; color:var(--ok);
  text-transform:uppercase; letter-spacing:.08em; margin-bottom:14px;
}
.live-dot{
  width:8px; height:8px; border-radius:50%; background:var(--ok);
  animation:pulse 1.8s infinite; flex-shrink:0;
}
.timer-digits{
  font-variant-numeric:tabular-nums; font-weight:800;
  font-size:clamp(52px,15vw,76px); letter-spacing:2px; line-height:1;
  color:var(--text); margin-bottom:20px;
}
.timer-info{
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.ti-project{ font-size:18px; font-weight:700; }
.ti-client{ font-size:14px; color:var(--muted); }
.ti-sub{ font-size:13px; color:var(--muted); }
