/* ============ Nástěnka — clean ops board (light) ============ */

:root {
  --bg: #f3f4f6;
  --bg-glow: #fafbfc;
  --panel: #ffffff;
  --border: #e3e6eb;
  --border-soft: #edeff3;
  --text: #23272f;
  --text-soft: #5b6472;
  --text-faint: #8a93a3;

  --acc-yellow: #eab308;
  --acc-orange: #f97316;
  --acc-pink: #e11d48;
  --acc-magenta: #ec4899;
  --acc-purple: #7c3aed;
  --acc-blue: #2563eb;
  --acc-teal: #14b8a6;
  --acc-green: #16a34a;
  --acc-gray: #64748b;

  --ok: #3f9c58;
  --danger: #d64545;

  --sans: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -14px rgba(16, 24, 40, .12);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, .06), 0 16px 32px -14px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(59, 130, 196, .06), transparent 60%),
    radial-gradient(700px 400px at 10% 110%, rgba(217, 154, 43, .05), transparent 60%),
    linear-gradient(var(--bg-glow), var(--bg) 40%);
  background-attachment: fixed;
}

.frame {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 48px) 80px;
}

/* ============ header ============ */

.board-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.brand-label {
  display: block;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.board-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
}

.header-right { display: flex; gap: 10px; align-items: center; }

.btn-new, .btn-archive {
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .1s ease;
}

.btn-new {
  border: 1px solid transparent;
  background: var(--text);
  color: #fff;
}

.btn-new:hover { background: #000; }
.btn-new:active { transform: translateY(1px); }

.btn-archive {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-soft);
}

.btn-archive:hover { border-color: var(--text-faint); color: var(--text); }
.btn-archive.is-active { background: #e9ecf1; color: var(--text); border-color: var(--text-faint); }
.btn-archive span { font-family: var(--mono); font-size: .8rem; }

/* ============ board & cards ============ */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

.note {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  animation: card-in .25s ease backwards;
  overflow: hidden;
}

@keyframes card-in {
  from { transform: translateY(6px); opacity: 0; }
}

.note:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #d3d8e0;
}

/* colored accent strip */
.note::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: var(--accent, var(--acc-yellow));
}

.note { padding-top: 24px; }

.note[data-color="yellow"]  { --accent: var(--acc-yellow); }
.note[data-color="orange"]  { --accent: var(--acc-orange); }
.note[data-color="pink"]    { --accent: var(--acc-pink); }
.note[data-color="magenta"] { --accent: var(--acc-magenta); }
.note[data-color="purple"]  { --accent: var(--acc-purple); }
.note[data-color="blue"]    { --accent: var(--acc-blue); }
.note[data-color="teal"]    { --accent: var(--acc-teal); }
.note[data-color="green"]   { --accent: var(--acc-green); }
.note[data-color="gray"]    { --accent: var(--acc-gray); }

.pin { display: none; }

.note-date {
  position: absolute;
  top: 21px; right: 16px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-faint);
}

.note:has(.stamp) .note-date { display: none; }

.note-title {
  margin: 2px 64px 12px 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
  overflow-wrap: break-word;
  cursor: text;
}

.note-title-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  border: 0;
  border-bottom: 1px dashed var(--text-faint);
  background: transparent;
  color: var(--text);
  outline: none;
  margin: 2px 0 12px;
  padding: 0 0 2px;
}

/* ============ description ============ */

.note-desc {
  margin: -4px 0 12px;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  cursor: text;
}

.desc-add {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  margin: -6px 0 10px;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--text-faint);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .12s ease;
}

.note:hover .desc-add,
.note:focus-within .desc-add { opacity: 1; }
.desc-add:hover { color: var(--text); }

.note-desc-input {
  width: 100%;
  font-family: var(--sans);
  font-size: .88rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  margin: -4px 0 10px;
  outline: none;
  resize: vertical;
}

.note-desc-input:focus { border-color: var(--accent, var(--text-soft)); }

/* ============ todos ============ */

.todo-list { list-style: none; margin: 0; padding: 0; }

.todo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}

.todo:last-child { border-bottom: 0; }

.todo-check {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  margin-top: 2px;
  border: 1.5px solid #c3c9d4;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color .12s ease, background .12s ease;
  padding: 0;
}

.todo-check:hover { border-color: var(--accent, var(--text-soft)); }

.todo.is-done .todo-check {
  background: var(--ok);
  border-color: var(--ok);
}

.todo.is-done .todo-check::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.todo-text {
  flex: 1;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: break-word;
  cursor: text;
}

.todo.is-done .todo-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

.todo-del {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--text-faint);
  font-size: .8rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}

.todo:hover .todo-del { opacity: 1; }
.todo-del:hover { color: var(--danger); }

.todo-input {
  width: 100%;
  font-family: var(--sans);
  font-size: .9rem;
  line-height: 1.45;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 0;
}

/* add-step row — visible only on hover or while typing */
.todo-add {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 4px 0;
  opacity: 0;
  transition: opacity .15s ease;
}

.note:hover .todo-add,
.note:focus-within .todo-add,
.todo-add:focus-within { opacity: 1; }

.todo-add-plus {
  flex: 0 0 auto;
  width: 17px;
  text-align: center;
  color: var(--text-faint);
  font-weight: 500;
}

.todo-add .todo-input::placeholder { color: var(--text-faint); }
.todo-add:focus-within .todo-add-plus { color: var(--accent, var(--text-soft)); }

/* ============ footer / progress ============ */

.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.note-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.progress-bar {
  display: block;
  flex: 1;
  max-width: 110px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent, var(--acc-yellow));
  transition: width .25s ease;
}

.note-actions { display: flex; gap: 6px; }

.note-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-faint);
  padding: 5px 10px;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}

.note-btn:hover { color: var(--text); border-color: var(--border); background: #f5f6f8; }
.note-btn--danger:hover { color: var(--danger); border-color: rgba(214, 69, 69, .35); background: rgba(214, 69, 69, .06); }

/* completed badge */
.stamp {
  position: absolute;
  top: 18px; right: 14px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2f7d46;
  border: 1px solid rgba(63, 156, 88, .4);
  background: rgba(63, 156, 88, .09);
  border-radius: 20px;
  padding: 3px 10px;
  pointer-events: none;
}

/* archived cards */
.note.is-archived { opacity: .65; }
.note.is-archived::before { opacity: .4; }

/* ============ new-task form ============ */

.note--form { border-color: #c9cfd9; }

.note--form .new-title {
  width: 100%;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 2px 0 8px;
  transition: border-color .12s ease;
}

.note--form .new-title:focus { border-color: var(--accent, var(--text-soft)); }
.note--form .new-title::placeholder { color: var(--text-faint); }

.note--form .new-desc {
  width: 100%;
  font-family: var(--sans);
  font-size: .88rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  margin-top: 12px;
  outline: none;
  resize: vertical;
  transition: border-color .12s ease;
}

.note--form .new-desc:focus { border-color: var(--accent, var(--text-soft)); }
.note--form .new-desc::placeholder { color: var(--text-faint); }

.color-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

.color-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
}

.color-dot:hover { transform: scale(1.12); }
.color-dot.is-active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text-soft); }
.color-dot[data-color="yellow"]  { background: var(--acc-yellow); }
.color-dot[data-color="orange"]  { background: var(--acc-orange); }
.color-dot[data-color="pink"]    { background: var(--acc-pink); }
.color-dot[data-color="magenta"] { background: var(--acc-magenta); }
.color-dot[data-color="purple"]  { background: var(--acc-purple); }
.color-dot[data-color="blue"]    { background: var(--acc-blue); }
.color-dot[data-color="teal"]    { background: var(--acc-teal); }
.color-dot[data-color="green"]   { background: var(--acc-green); }
.color-dot[data-color="gray"]    { background: var(--acc-gray); }

.color-dot--custom {
  display: inline-block;
  background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  position: relative;
  overflow: hidden;
}

.color-dot--custom .color-custom-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.form-actions { display: flex; gap: 10px; align-items: center; }

.btn-pin {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  border: 0;
  border-radius: 7px;
  padding: 8px 16px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
}

.btn-pin:hover { background: #000; }

.btn-cancel {
  font-family: var(--sans);
  font-size: .85rem;
  border: 0;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}

.btn-cancel:hover { color: var(--text); }

/* ============ login & logout ============ */

.btn-logout {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-faint);
  text-decoration: none;
  padding: 9px 6px;
}

.btn-logout:hover { color: var(--danger); }

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
}

.login-card {
  width: min(360px, calc(100vw - 40px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--acc-yellow), var(--acc-pink), var(--acc-blue), var(--acc-green));
}

.login-title {
  margin: 4px 0 24px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.login-input {
  font-family: var(--sans);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.login-input:focus {
  border-color: var(--acc-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 196, .15);
}

.login-error {
  margin: 10px 0 0;
  font-size: .85rem;
  color: var(--danger);
}

.login-submit {
  margin-top: 18px;
  padding: 11px 16px;
}

/* ============ empty state ============ */

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 20px;
  font-size: .95rem;
  color: var(--text-faint);
  border: 1px dashed #d0d5dd;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .5);
}

@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
  .frame { padding-top: 24px; }
}
