/* TasksBoard: Google-Workspace-like Kanban. Light theme by default, dark
   theme through the same variables ([data-theme="dark"] on <html>).
   14px base type, compact cards, desktop-first with a usable phone view. */
:root {
  --bg: #f1f3f4;
  --panel: #ffffff;
  --column-bg: #e9ebee;
  --card-bg: #ffffff;
  --ink: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --accent: #1a73e8;
  --accent-ink: #ffffff;
  --chip-bg: #e8f0fe;
  --chip-ink: #1a73e8;
  --danger: #b3261e;
  --overdue: #b3261e;
  --today-bg: #fef7e0;
  --today-ink: #7a5a00;
  --sidebar-bg: #ffffff;
  --hover: #f1f3f4;
  --active: #e8f0fe;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.25);
}
:root[data-theme="dark"] {
  --bg: #202124;
  --panel: #2d2e30;
  --column-bg: #2d2e30;
  --card-bg: #3c4043;
  --ink: #e8eaed;
  --muted: #9aa0a6;
  --border: #5f6368;
  --accent: #8ab4f8;
  --accent-ink: #202124;
  --chip-bg: #3c4043;
  --chip-ink: #8ab4f8;
  --danger: #f28b82;
  --overdue: #f28b82;
  --today-bg: #4d4812;
  --today-ink: #fdd663;
  --sidebar-bg: #292a2d;
  --hover: #3c4043;
  --active: #3c4043;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Google Sans", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
}
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel); }

.app { display: flex; height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  flex: 0 0 240px; display: flex; flex-direction: column;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  padding: 10px; gap: 4px; overflow-y: auto;
  transition: margin-left 0.15s ease;
}
.sidebar.collapsed { margin-left: -240px; border-right: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side-title { font-size: 1.1rem; font-weight: 600; }
.side-section { margin-top: 10px; }
.side-section h3 {
  margin: 0 0 4px; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; align-items: center; }
.side-link {
  flex: 1 1 auto; text-align: left; background: none; border: none;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; min-height: 30px;
}
.side-link:hover { background: var(--hover); }
.side-link.active { background: var(--active); color: var(--accent); font-weight: 600; }
.side-static { padding: 4px 8px; color: var(--muted); }
.row-del {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 1rem; padding: 2px 6px; border-radius: 4px;
}
.row-del:hover { color: var(--danger); }
.side-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.mini-btn {
  font-size: 0.82rem; min-height: 28px; padding: 4px 9px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.mini-btn:hover { background: var(--hover); }
.file-label { display: inline-flex; align-items: center; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip {
  font-size: 0.78rem; padding: 3px 7px; border-radius: 20px; cursor: pointer;
  background: var(--chip-bg); color: var(--chip-ink); border: 1px solid transparent;
}
.tag-chip.active { border-color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); font-size: 0.85rem; }

.footbar { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; position: relative; }
.profile { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; }
.profile-name { background: none; border: none; cursor: pointer; font-weight: 600; padding: 4px 2px; text-align: left; }
a.profile-name { color: var(--accent); text-decoration: none; }
.profile-menu {
  position: absolute; bottom: 44px; left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 4px; z-index: 30;
}
.menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 7px 9px; border-radius: 5px; cursor: pointer;
}
.menu-item:hover { background: var(--hover); }

/* ---------- main / board ---------- */
.main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; padding: 10px 12px; }
.topbar { display: flex; align-items: center; gap: 8px; }
.topbar h1 { font-size: 1.15rem; margin: 0; flex: 1 1 auto; }
.icon-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  min-width: 30px; min-height: 30px; cursor: pointer; background: var(--panel);
}
.status-line { min-height: 1.1em; margin: 5px 0; color: var(--muted); font-size: 0.85rem; }
.status-line.error { color: var(--danger); }

.board {
  flex: 1 1 auto; display: flex; gap: 10px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; padding-bottom: 8px;
}
.column {
  flex: 0 0 300px; max-height: 100%; display: flex; flex-direction: column;
  background: var(--column-bg); border-radius: 10px; padding: 8px;
}
.col-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 6px; }
.col-head h2 { font-size: 0.95rem; margin: 0; flex: 1 1 auto; }
.count {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  font-size: 0.78rem; border-radius: 20px; padding: 1px 8px;
}
.add-form input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 7px; min-height: 34px; margin-bottom: 7px;
}
.cards { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.card {
  display: flex; gap: 7px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 8px; cursor: pointer; box-shadow: var(--shadow);
}
.card:hover { border-color: var(--accent); }
.card.dragging { opacity: 0.5; }
.card.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.card.done .card-title { text-decoration: line-through; color: var(--muted); }
.card-check { width: 17px; height: 17px; margin-top: 2px; flex: 0 0 auto; cursor: pointer; }
.card-body { flex: 1 1 auto; min-width: 0; }
.card-title { font-size: 0.93rem; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.due-chip {
  font-size: 0.75rem; background: var(--chip-bg); color: var(--chip-ink);
  border-radius: 20px; padding: 2px 7px;
}
.due-chip.overdue { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .due-chip.overdue { color: #202124; }
.due-chip.today { background: var(--today-bg); color: var(--today-ink); font-weight: 600; }
.hash-chip {
  font-size: 0.75rem; color: var(--accent); background: transparent;
  border: 1px solid var(--border); border-radius: 20px; padding: 1px 6px;
}
.notes-ind { font-size: 0.75rem; color: var(--muted); }
.empty { color: var(--muted); margin: 4px 2px; font-size: 0.85rem; }

/* ---------- connect panel ---------- */
.connect-panel {
  margin: auto; max-width: 420px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 26px;
  text-align: center; box-shadow: var(--shadow);
}
.connect-panel h2 { margin-top: 0; }
.connect-btn {
  display: inline-block; margin-top: 8px; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; padding: 10px 18px; border-radius: 7px; font-weight: 600;
}

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(32, 33, 36, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 12px 12px; z-index: 50;
}
.modal {
  background: var(--panel); border-radius: 12px; padding: 18px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 10px; font-size: 1.05rem; }
.modal label { display: block; margin-bottom: 10px; font-size: 0.85rem; color: var(--muted); }
.modal input[type="text"], .modal textarea, .modal input[type="date"] {
  display: block; width: 100%; margin-top: 4px; padding: 8px 9px;
  border: 1px solid var(--border); border-radius: 7px; min-height: 36px;
}
.due-row { display: flex; gap: 6px; }
.due-row input { flex: 1 1 auto; }
.modal-list-line { color: var(--muted); font-size: 0.85rem; }
.modal-actions { display: flex; gap: 7px; align-items: center; margin-top: 12px; }
.spacer { flex: 1 1 auto; }
.btn {
  min-height: 34px; padding: 6px 14px; border-radius: 7px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--danger); }
.board-lists-fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 6px; }
.board-choice { display: block; padding: 3px 0; color: var(--ink) !important; }

@media (max-width: 720px) {
  .sidebar { flex-basis: 210px; }
  .sidebar.collapsed { margin-left: -210px; }
  .column { flex-basis: 82vw; }
}
