:root {
  --bg: #f6f8fb;
  --card: #fff;
  --band: #eff3f8;
  --line: #e3e8ef;
  --text: #1c2540;
  --muted: #6b7690;
  --primary: #2150d6;
  --accent: #19a85a;
  --danger: #d23b3b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
}
h2 { margin: 0; font-size: 20px; }
.layout { display: flex; min-height: 100vh; }

/* sidebar */
.sidebar {
  width: 270px; flex: none; background: var(--card);
  border-right: 1px solid var(--line); padding: 20px 16px;
}
.sidebar h2 { margin-bottom: 14px; }
.project-list { list-style: none; margin: 14px 0 0; padding: 0; }
.project-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 2px;
}
.project-list li:hover { background: var(--band); }
.project-list li.active { background: #e2eafd; font-weight: 600; }
.project-list li.running::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); animation: pulse 1.2s infinite;
}
.project-list .p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-list .p-total { color: var(--muted); font-size: 12px; font-weight: 400; }
.project-list .p-del {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 16px; visibility: hidden;
}
.project-list .p-edit {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 0 2px; visibility: hidden;
}
.project-list li:hover .p-del, .project-list li:hover .p-edit { visibility: visible; }
.p-del:hover { color: var(--danger); }
.p-edit:hover { color: var(--primary); }
.inline-edit { flex: 1; min-width: 0; padding: 3px 6px; }
.row .editable { cursor: text; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.row .editable:hover { background: var(--band); }
@keyframes pulse { 50% { opacity: .3; } }

/* main */
.main { flex: 1; padding: 20px; max-width: 1100px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px; margin-bottom: 20px;
}

/* form prvky */
input, select {
  font: inherit; color: inherit; width: 100%;
  padding: 8px 10px; border: 1px solid #cfd6e2; border-radius: 6px; background: #fff;
}
input:focus, select:focus { outline: 2px solid #b9cbff; border-color: var(--primary); }
label { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
label input, label select, label .inline-form { margin-top: 4px; font-weight: 400; color: var(--text); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); }

.btn-round {
  flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: var(--primary); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.btn-round.small { width: 28px; height: 28px; font-size: 18px; }
.btn-outline {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
  border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer;
}
.btn-outline:hover { background: #eef3ff; }

/* přihlášení */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login-error { margin: 0; color: var(--danger); }
.btn-primary {
  background: var(--primary); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.logout-form { margin-top: 20px; }
.logout-form .btn-outline { width: 100%; }

/* časovač */
.timer-head { display: flex; align-items: center; gap: 24px; margin-bottom: 18px; }
.timer-head > div:first-child { flex: 1; min-width: 0; }
.timer-project { font-size: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-display {
  font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 2px solid var(--text); border-radius: 8px; padding: 4px 16px;
}
.btn-play {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); position: relative;
}
.btn-play::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid; border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
}
.btn-play.running { background: var(--danger); }
.btn-play.running::before {
  transform: translate(-50%, -50%); border: 0; width: 20px; height: 20px;
  background: #fff; border-radius: 3px;
}
.timer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.span-3 { grid-column: span 3; }
.timer-actions { margin-top: 14px; display: flex; align-items: center; gap: 14px; }
.msg { font-size: 13px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--accent); }

/* soupis */
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.total { font-size: 13px; text-align: right; }
.total strong { font-size: 22px; margin-left: 6px; }
.filters {
  display: flex; gap: 14px; align-items: end; flex-wrap: wrap;
  background: var(--band); padding: 12px 14px; border-radius: 8px; margin-bottom: 16px;
}
.filters label { min-width: 160px; }
.day { background: var(--band); border-radius: 8px; padding: 10px 12px 12px; margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; font-weight: 700; padding: 2px 4px 8px; }
.rows { background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.row {
  display: grid; align-items: center; gap: 12px; padding: 10px 12px;
  grid-template-columns: 1fr 110px 100px 60px 28px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .dur { font-weight: 700; text-align: right; }
.row .muted { color: var(--muted); }
.row .del {
  border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0;
   width: 24px;
}
.row .del:hover { color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 24px; }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .timer-grid { grid-template-columns: 1fr; }
  .span-3 { grid-column: auto; }
  .timer-head { flex-wrap: wrap; }
  .row { grid-template-columns: 2fr 100px 60px 28px; }
  .row .hide-sm { display: none; }
}
