/* ============================================================
   Kolaboard — Papan Kanban
   Desain: bersih, modern, terinspirasi Trello
   ============================================================ */

:root {
  --topbar-h: 52px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 0 rgba(9, 30, 66, 0.18);
  --shadow-md: 0 4px 12px rgba(9, 30, 66, 0.22);
  --shadow-lg: 0 12px 32px rgba(9, 30, 66, 0.32);
  --ink: #172b4d;
  --ink-soft: #44546f;
  --ink-mute: #626f86;
  --line: #dfe1e6;
  --list-bg: #f1f2f4;
  --card-bg: #ffffff;
  --accent: #0c66e4;
  --accent-dark: #0055cc;
  --danger: #c9372c;
  --danger-dark: #ae2a19;
  --board-bg: linear-gradient(135deg, #0079bf, #5067c5);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #1d2125;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

button { font-family: inherit; cursor: pointer; }

/* ----------------------------- Top bar ----------------------------- */
#topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: #fff;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 18px;
  flex: 0 0 auto;
  user-select: none;
}
.brand-logo { font-size: 20px; line-height: 1; }
.brand-name { background: linear-gradient(90deg,#fff,#cfe2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

.board-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}
.board-pills::-webkit-scrollbar { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 220px;
  transition: background 0.15s ease;
}
.pill:hover { background: rgba(255, 255, 255, 0.28); }
.pill.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.pill .pill-swatch { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.pill .pill-label { overflow: hidden; text-overflow: ellipsis; }
.pill-input {
  height: 32px; border: 2px solid var(--accent); border-radius: 8px;
  padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); min-width: 120px;
}

.pill-add {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 9px; font-size: 12px; opacity: 0.7; pointer-events: none; }
#search {
  height: 32px;
  width: 180px;
  border: none;
  border-radius: 8px;
  padding: 0 10px 0 28px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  outline: none;
  transition: width 0.2s ease, background 0.15s ease;
}
#search::placeholder { color: rgba(255, 255, 255, 0.75); }
#search:focus { background: #fff; color: var(--ink); width: 220px; }
#search:focus::placeholder { color: var(--ink-mute); }

.icon-btn {
  width: 32px; height: 32px;
  border: none; border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* ----------------------------- Board area ----------------------------- */
.board {
  flex: 1 1 auto;
  background: var(--board-bg);
  background-size: cover;
  background-position: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.board::-webkit-scrollbar { height: 12px; }
.board::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.25); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }

/* ----------------------------- List ----------------------------- */
.list {
  flex: 0 0 272px;
  width: 272px;
  max-height: 100%;
  background: var(--list-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 28px);
}
.list.dragging { opacity: 0.5; transform: rotate(2deg); }

.list-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 4px 12px;
  cursor: grab;
}
.list-title {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 2px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-title:hover { background: rgba(9,30,66,0.06); }
.list-count {
  font-size: 12px; font-weight: 600; color: var(--ink-mute);
  background: rgba(9,30,66,0.08); border-radius: 10px; padding: 1px 8px; flex: 0 0 auto;
}
.list-title-input {
  flex: 1 1 auto; font-size: 14px; font-weight: 700; color: var(--ink);
  border: 2px solid var(--accent); border-radius: 4px; padding: 3px 6px; outline: none;
}
.list-menu-btn {
  flex: 0 0 auto; width: 28px; height: 28px; border: none; background: transparent;
  border-radius: 6px; color: var(--ink-soft); font-size: 17px; line-height: 1;
}
.list-menu-btn:hover { background: rgba(9,30,66,0.08); }

.cards {
  list-style: none;
  margin: 0;
  padding: 2px 8px 2px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 8px;
  scrollbar-width: thin;
}
.cards::-webkit-scrollbar { width: 8px; }
.cards::-webkit-scrollbar-thumb { background: rgba(9,30,66,0.2); border-radius: 8px; }

/* ----------------------------- Card ----------------------------- */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  word-break: break-word;
}
.card:hover { border-color: var(--accent); }
.card.dragging { opacity: 0.45; transform: rotate(3deg); }
.card.completed .card-title { text-decoration: line-through; color: var(--ink-mute); }

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-label { height: 8px; min-width: 36px; border-radius: 4px; }

.card-title { line-height: 1.35; }

.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--ink-mute);
  padding: 2px 6px; border-radius: 6px;
}
.badge.due { background: rgba(9,30,66,0.06); }
.badge.due.overdue { background: #ffe2dd; color: var(--danger); }
.badge.due.done { background: #dcfff1; color: #216e4e; }
.badge.checklist.complete { background: #dcfff1; color: #216e4e; }
.badge .badge-ico { font-size: 12px; }

/* add-card / add-list forms */
.list-footer { padding: 4px 8px 8px; }
.add-card-btn, .add-list-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex; align-items: center; gap: 6px;
}
.add-card-btn:hover { background: rgba(9,30,66,0.08); color: var(--ink); }

.composer { padding: 0 8px 8px; }
.composer textarea, .composer input {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  box-shadow: var(--shadow-sm);
  outline: 2px solid var(--accent);
  color: var(--ink);
}
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.btn {
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  padding: 8px 14px; background: var(--accent); color: #fff;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: rgba(9,30,66,0.08); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: var(--danger-dark); }
.btn-close { border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--ink-soft); padding: 4px 8px; border-radius: 6px; }
.btn-close:hover { background: rgba(9,30,66,0.08); }

/* The "add list" column */
.add-list {
  flex: 0 0 272px;
  width: 272px;
}
.add-list .add-list-btn {
  background: rgba(255,255,255,0.24);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}
.add-list .add-list-btn:hover { background: rgba(255,255,255,0.34); }
.add-list .composer { background: var(--list-bg); border-radius: 12px; padding: 8px; }

/* ----------------------------- Popover menu ----------------------------- */
.popover {
  position: fixed;
  z-index: 60;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 6px;
  animation: pop 0.12s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.popover-title { font-size: 12px; font-weight: 700; color: var(--ink-mute); text-align: center; padding: 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.popover-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--ink);
}
.popover-item:hover { background: rgba(9,30,66,0.08); }
.popover-item.danger { color: var(--danger); }
.popover-item .ico { width: 18px; text-align: center; }
.popover-sep { height: 1px; background: var(--line); margin: 4px 2px; }

.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px; }
.swatch {
  height: 36px; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
}
.swatch.selected { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* ----------------------------- Modal ----------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #f7f8f9;
  width: 100%;
  max-width: 720px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 0.18s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 16px 10px 20px;
}
.modal-head .head-ico { font-size: 18px; margin-top: 4px; color: var(--ink-soft); }
.modal-title-input {
  flex: 1 1 auto;
  font-size: 20px; font-weight: 700; color: var(--ink);
  border: 2px solid transparent; border-radius: 8px;
  padding: 4px 8px; background: transparent; outline: none;
}
.modal-title-input:focus { background: #fff; border-color: var(--accent); }

.modal-sub { padding: 0 20px 14px 48px; color: var(--ink-mute); font-size: 13px; }
.modal-sub b { color: var(--ink-soft); }

.modal-body { display: grid; grid-template-columns: 1fr 180px; gap: 18px; padding: 0 20px 22px; }
@media (max-width: 620px) { .modal-body { grid-template-columns: 1fr; } }

.section { margin-bottom: 22px; }
.section-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.section-head .ico { font-size: 15px; }

.labels-row { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip {
  height: 32px; min-width: 48px; border: none; border-radius: 6px;
  color: #fff; font-size: 12px; font-weight: 700; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 6px; opacity: 0.55;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.label-chip.on { opacity: 1; }
.label-chip:hover { transform: translateY(-1px); }
.label-chip .check { font-size: 13px; }

.desc-input {
  width: 100%; min-height: 90px; border: none; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); line-height: 1.5;
}
.desc-input:focus { outline: 2px solid var(--accent); }

.date-input { border: none; border-radius: 8px; padding: 9px 12px; font-size: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-family: inherit; }

/* checklist */
.checklist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress-pct { font-size: 12px; font-weight: 700; color: var(--ink-mute); width: 34px; }
.progress-track { flex: 1 1 auto; height: 8px; background: rgba(9,30,66,0.1); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: #4bce97; border-radius: 6px; transition: width 0.25s ease; }
.progress-fill.full { background: #22a06b; }

.check-item { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 6px; }
.check-item:hover { background: rgba(9,30,66,0.05); }
.check-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
.check-item .check-text { flex: 1 1 auto; font-size: 14px; color: var(--ink); }
.check-item.done .check-text { text-decoration: line-through; color: var(--ink-mute); }
.check-item .check-del { border: none; background: transparent; color: var(--ink-mute); font-size: 15px; padding: 2px 6px; border-radius: 4px; opacity: 0; }
.check-item:hover .check-del { opacity: 1; }
.check-item .check-del:hover { background: rgba(9,30,66,0.1); color: var(--danger); }
.check-add { display: flex; gap: 8px; margin-top: 8px; }
.check-add input { flex: 1 1 auto; border: none; border-radius: 8px; padding: 9px 12px; font-size: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-family: inherit; }
.check-add input:focus { outline: 2px solid var(--accent); }

/* sidebar actions in modal */
.modal-side .section-head { margin-bottom: 6px; }
.side-btn {
  width: 100%; text-align: left; border: none; border-radius: 8px;
  background: #e9ebee; color: var(--ink-soft); font-size: 14px; font-weight: 600;
  padding: 9px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.side-btn:hover { background: #dfe2e6; }
.side-btn.danger { color: var(--danger); }
.side-btn.danger:hover { background: #ffe2dd; }
.side-btn.toggled { background: #cfe1ff; color: var(--accent-dark); }

/* empty state */
.empty-board {
  margin: auto; text-align: center; color: #fff; opacity: 0.92; max-width: 360px;
}
.empty-board .big { font-size: 52px; margin-bottom: 8px; }
.empty-board h2 { margin: 0 0 6px; font-size: 22px; }
.empty-board p { margin: 0 0 16px; font-size: 15px; opacity: 0.85; }
.empty-board .btn { background: rgba(255,255,255,0.92); color: var(--ink); }
.empty-board .btn:hover { background: #fff; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; box-shadow: var(--shadow-md); z-index: 80; animation: toastin 0.2s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================================
   Tambahan: anggota tim, filter, lampiran, komentar, tema gelap
   ============================================================ */

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
  user-select: none;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }

/* Tombol filter: titik indikator */
.icon-btn { position: relative; }
.icon-btn svg { display: block; }
.filter-dot {
  position: absolute; top: 4px; right: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #f5cd47; box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
}
.team-btn { overflow: hidden; }

/* Kartu: baris meta kiri + avatar kanan */
.card-meta { justify-content: space-between; }
.meta-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-avatars { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.card-avatars .avatar { box-shadow: 0 0 0 2px var(--card-bg); }

/* Popover: filter & pilihan */
.filter-pop { min-width: 240px; max-height: 80vh; overflow-y: auto; }
.filter-group { font-size: 11px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--ink-mute); padding: 10px 8px 4px; }
.check-row { cursor: pointer; }
.check-row input { margin: 0 2px 0 0; accent-color: var(--accent); }
.check-row .dot { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.popover-item.member-pick.on { background: rgba(12,102,228,0.1); }
.pick-check { margin-left: auto; color: var(--accent); font-weight: 700; }

/* Modal: penugasan anggota */
.assignee-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.assignee-add {
  width: 36px; height: 36px; border-radius: 50%; border: 2px dashed var(--line);
  background: transparent; color: var(--ink-mute); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.assignee-add:hover { border-color: var(--accent); color: var(--accent); }

/* Modal: lampiran */
.attach-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.attach-item { display: flex; align-items: center; gap: 10px; }
.attach-thumb {
  width: 56px; height: 42px; border-radius: 6px; flex: 0 0 auto;
  background: #e2e6ea center/cover no-repeat; box-shadow: inset 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; text-decoration: none;
}
.attach-info { flex: 1 1 auto; min-width: 0; }
.attach-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-name:hover { text-decoration: underline; color: var(--accent); }
.attach-meta { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.attach-del { border: none; background: transparent; color: var(--ink-mute); font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.attach-del:hover { background: rgba(201,55,44,0.12); color: var(--danger); }
.attach-actions { display: flex; gap: 8px; }
.side-btn.inline { width: auto; margin: 0; }

/* Modal: komentar */
.comment-add { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-input-wrap { flex: 1 1 auto; }
.comment-input {
  width: 100%; border: none; border-radius: 8px; padding: 9px 12px; font-size: 14px;
  font-family: inherit; resize: vertical; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink);
}
.comment-input:focus { outline: 2px solid var(--accent); }
.comment-input-wrap .btn { margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-row { display: flex; gap: 10px; }
.comment-bubble { position: relative; flex: 1 1 auto; background: #fff; border-radius: 8px; padding: 8px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.comment-meta { font-size: 12px; color: var(--ink-mute); margin-bottom: 3px; }
.comment-meta b { color: var(--ink-soft); }
.comment-text { font-size: 14px; color: var(--ink); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.comment-del { position: absolute; top: 6px; right: 6px; border: none; background: transparent; color: var(--ink-mute); font-size: 13px; padding: 2px 6px; border-radius: 4px; opacity: 0; }
.comment-row:hover .comment-del { opacity: 1; }
.comment-del:hover { background: rgba(201,55,44,0.12); color: var(--danger); }

/* Dialog (tim) */
.modal.dialog.narrow { max-width: 460px; }
.dialog-title { flex: 1 1 auto; font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.dialog-body { padding: 4px 20px 22px; }
.dialog-hint { font-size: 13px; color: var(--ink-mute); margin: 0 0 14px; }
.dialog-subhead { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 18px 0 8px; }
.dialog-input { width: 100%; border: none; border-radius: 8px; padding: 9px 12px; font-size: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-family: inherit; color: var(--ink); }
.dialog-input:focus { outline: 2px solid var(--accent); }
.member-list { display: flex; flex-direction: column; gap: 6px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.member-row.me { background: rgba(12,102,228,0.08); }
.member-name { flex: 1 1 auto; font-size: 14px; font-weight: 600; color: var(--ink); }
.member-actions { display: flex; align-items: center; gap: 6px; }
.me-tag { font-size: 12px; font-weight: 700; color: var(--accent-dark); background: #cfe1ff; padding: 3px 9px; border-radius: 10px; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost.sm.danger { color: var(--danger); }
.btn.ghost.sm.danger:hover { background: rgba(201,55,44,0.12); }
.member-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.member-add .dialog-input { flex: 1 1 160px; }
.color-row { display: flex; gap: 6px; flex-wrap: wrap; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-dot.selected { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* ----------------------------- Mode gelap ----------------------------- */
:root[data-theme="dark"] {
  --ink: #c7d1db;
  --ink-soft: #9fb0c0;
  --ink-mute: #8a98a8;
  --line: #3a444f;
  --list-bg: #161a1d;
  --card-bg: #22272b;
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 14px 36px rgba(0,0,0,0.6);
}
:root[data-theme="dark"] body { background: #0f1214; }
:root[data-theme="dark"] .modal { background: #1d2125; }
:root[data-theme="dark"] .desc-input,
:root[data-theme="dark"] .date-input,
:root[data-theme="dark"] .check-add input,
:root[data-theme="dark"] .comment-input,
:root[data-theme="dark"] .comment-bubble,
:root[data-theme="dark"] .dialog-input,
:root[data-theme="dark"] .composer textarea,
:root[data-theme="dark"] .composer input { background: #22272b; color: var(--ink); }
:root[data-theme="dark"] .modal-title-input:focus { background: #22272b; }
:root[data-theme="dark"] .side-btn { background: #2c333a; color: var(--ink-soft); }
:root[data-theme="dark"] .side-btn:hover { background: #353d45; }
:root[data-theme="dark"] .side-btn.toggled { background: #09326d; color: #cfe1ff; }
:root[data-theme="dark"] .popover { background: #22272b; color: var(--ink); }
:root[data-theme="dark"] .popover-item { color: var(--ink); }
:root[data-theme="dark"] .popover-item:hover { background: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .list-count { background: rgba(255,255,255,0.1); }
:root[data-theme="dark"] .progress-track { background: rgba(255,255,255,0.14); }
:root[data-theme="dark"] .add-card-btn:hover,
:root[data-theme="dark"] .list-title:hover,
:root[data-theme="dark"] .check-item:hover { background: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .badge.due { background: rgba(255,255,255,0.1); }
:root[data-theme="dark"] .attach-thumb { background-color: #2c333a; }
:root[data-theme="dark"] .me-tag { background: #09326d; }
:root[data-theme="dark"] .member-row.me { background: rgba(12,102,228,0.16); }
:root[data-theme="dark"] .popover-item.member-pick.on { background: rgba(12,102,228,0.22); }
:root[data-theme="dark"] .swatch.selected { box-shadow: 0 0 0 2px #1d2125 inset; }

/* ----------------------------- Status cloud ----------------------------- */
.cloud-status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 8px; border-radius: 13px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,0.16); white-space: nowrap;
}
.cloud-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #c7d1db; flex: 0 0 auto;
}
.cloud-status[data-state="ok"]::before { background: #4bce97; }
.cloud-status[data-state="sync"]::before { background: #f5cd47; animation: pulse 1s ease-in-out infinite; }
.cloud-status[data-state="error"]::before { background: #f87168; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (max-width: 720px) { .cloud-status { display: none; } }

/* ----------------------------- Overlay login ----------------------------- */
.auth-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: linear-gradient(135deg, #0079bf, #5067c5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 28px 26px; animation: rise 0.2s ease;
}
.auth-brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.auth-brand .brand-logo { font-size: 22px; }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; color: var(--ink); }
.auth-sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-mute); line-height: 1.5; }
.auth-card input {
  width: 100%; height: 44px; border: none; border-radius: 8px; padding: 0 12px;
  font-size: 15px; font-family: inherit; margin-bottom: 12px; color: var(--ink);
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
}
.auth-card input:focus { outline: 2px solid var(--accent); }
.auth-submit { width: 100%; height: 44px; font-size: 15px; margin-top: 4px; }
.auth-submit:disabled { opacity: 0.7; cursor: default; }
.auth-toggle { margin-top: 16px; text-align: center; font-size: 13px; color: var(--ink-mute); }
.auth-toggle a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-toggle a:hover { text-decoration: underline; }
.auth-err { background: #ffe2dd; color: var(--danger-dark); font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; }
