/* ─────────────────────────────────────────────
   Page Transitions
───────────────────────────────────────────── */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.08s;
  animation-timing-function: ease;
}

/* ─────────────────────────────────────────────
   Material Symbols Rounded (self-hosted variable font)
───────────────────────────────────────────── */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 100 700;
  src: url('/assets/fonts/MaterialSymbolsRounded.woff2') format('woff2');
  font-display: block;
}

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  user-select: none;
  vertical-align: middle;
}

/* ─────────────────────────────────────────────
   Reset & base
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --header-bg: #026AA7;
  --header-height: 44px;
  --kanbam-blue: #0079BF;
  --white: #ffffff;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,.2);
  --list-bg: #ebecf0;
  --list-width: 272px;
  --radius: 4px;
  --danger: #eb5a46;
  --text: #172b4d;
  --text-subtle: #5e6c84;
  --border: #dfe1e6;
  --page-bg: #dddddd;
  --dialog-bg: #ffffff;
  --modal-bg: #dddddd;
  --input-border: #dfe1e6;
  --input-bg: transparent;
}

/* Dark mode overrides */
html.dark {
  --header-bg: #0d1117;
  --kanbam-blue: #2684FF;
  --white: #e6edf3;
  --card-bg: #21262d;
  --card-shadow: 0 1px 3px rgba(0,0,0,.5);
  --list-bg: #161b22;
  --danger: #f85149;
  --text: #e6edf3;
  --text-subtle: #8b949e;
  --border: #30363d;
  --page-bg: #0d1117;
  --dialog-bg: #161b22;
  --modal-bg: #0d1117;
  --input-border: #30363d;
  --input-bg: rgba(255,255,255,.04);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg);
}


a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; color: var(--text); }

/* ─────────────────────────────────────────────
   App header
───────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.app-logo {
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: .9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.app-logo:hover { opacity: 1; }

#board-title-header {
  color: rgba(255,255,255,.9);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 3px 7px;
  border: 2px solid transparent;
  outline: none;
  cursor: text;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
#board-title-header:hover { background: rgba(255,255,255,.15); }
#board-title-header:focus { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header search */
.header-search-wrap {
  position: relative;
}
.header-search-input {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  color: rgba(255,255,255,.9);
  padding: 5px 10px;
  font-size: 13px;
  width: 180px;
  outline: none;
  transition: background .15s, width .2s;
}
.header-search-input::placeholder { color: rgba(255,255,255,.55); }
.header-search-input:focus {
  background: rgba(255,255,255,.25);
  width: 240px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 300px;
  background: var(--dialog-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 300;
  max-height: 360px;
  overflow-y: auto;
}
.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(0,0,0,.04); }
html.dark .search-result-item:hover { background: rgba(255,255,255,.05); }
.search-result-card { font-size: 14px; font-weight: 500; color: var(--text); }
.search-result-path { font-size: 12px; color: var(--text-subtle); }
.search-result-snippet { font-size: 12px; color: var(--text-subtle); font-style: italic; }
.search-no-results { padding: 16px; text-align: center; color: var(--text-subtle); font-size: 13px; }

/* Header icon buttons */
.btn-header-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: rgba(255,255,255,.85);
  transition: background .12s;
  flex-shrink: 0;
}
.btn-header-icon .material-symbols-rounded { font-size: 22px; }
.btn-header-icon:hover { background: rgba(255,255,255,.2); color: var(--white); }

/* Logged-in user pill in header */
.header-user {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   Board sidebar
───────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
}
.board-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--dialog-bg);
  z-index: 160;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0,0,0,.25);
  transform: translateX(0);
  transition: transform .2s ease;
}
.board-sidebar.hidden { transform: translateX(100%); display: flex !important; visibility: hidden; }
.board-sidebar:not(.hidden) { visibility: visible; }
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-board-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.sidebar-board-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
}
.sidebar-board-item:hover { background: rgba(0,0,0,.05); }
html.dark .sidebar-board-item:hover { background: rgba(255,255,255,.05); }
.sidebar-board-item--active { background: rgba(0,121,191,.1); }
.sidebar-board-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}
.sidebar-board-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   Background overlay
───────────────────────────────────────────── */
.board-bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 0;
  pointer-events: none;
}

/* ─────────────────────────────────────────────
   Utility
───────────────────────────────────────────── */
.hidden { display: none !important; }
.loading {
  padding: 60px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 16px;
  opacity: 0;
  animation: loading-appear 0s 600ms forwards;
}
@keyframes loading-appear { to { opacity: 1; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background .1s, opacity .1s;
}
.btn--primary { background: var(--kanbam-blue); color: #fff; }
.btn--primary:hover { filter: brightness(1.1); }
.btn--ghost { background: rgba(0,0,0,.06); color: var(--text); }
.btn--ghost:hover { background: rgba(0,0,0,.12); }
html.dark .btn--ghost { background: rgba(255,255,255,.08); }
html.dark .btn--ghost:hover { background: rgba(255,255,255,.14); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.1); }
.btn--sm { padding: 4px 8px; font-size: 13px; }
.btn--full { width: 100%; justify-content: center; }

/* ─────────────────────────────────────────────
   Board list page
───────────────────────────────────────────── */
#app {
  margin-top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: auto;
  position: relative;
  z-index: 1;
}

.board-list-page {
  padding: 32px 24px;
}

.board-list-page h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.board-list-section { margin-bottom: 32px; }

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  background: #cccccc;
  border-radius: 6px;
  padding: 4px 8px;
}
.section-header h2 { margin-bottom: 0; flex: 1; }
html.dark .section-header { background: #2e333b; }

.section-drag-handle {
  cursor: grab;
  color: var(--text-subtle);
  font-size: 15px;
  padding: 2px 3px;
  opacity: 0;
  transition: opacity .15s;
  line-height: 1;
  user-select: none;
}
.board-list-section:hover .section-drag-handle { opacity: 1; }
.section-drag-handle:active { cursor: grabbing; }

.section-header-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.board-list-section:hover .section-header-actions { opacity: 1; }

.section-rename-btn,
.section-delete-btn,
.section-confirm-btn,
.section-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.4;
  transition: background .12s, color .12s;
}
.section-rename-btn:hover,
.section-delete-btn:hover,
.section-confirm-btn:hover,
.section-cancel-btn:hover {
  background: rgba(0,0,0,.08);
  color: var(--text);
}

.section-title-input {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-subtle);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  outline: none;
  flex: 1;
  min-width: 0;
}
.section-title-input:focus { border-color: var(--focus-ring); }

/* "Other Boards" unsectioned header — no drag handle */
.section-header--plain .section-drag-handle,
.section-header--plain .section-header-actions { display: none; }

/* Add Section button */
.board-list-footer { padding: 0 0 16px; }
.btn-add-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--kanbam-blue);
  cursor: pointer;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--kanbam-blue);
  background: transparent;
  transition: background .12s, color .12s;
}
.btn-add-section:hover { background: var(--kanbam-blue); color: #fff; }

/* Sortable ghost/drag for board cards */
.board-grid .sortable-ghost { opacity: .35; }
.board-grid .sortable-drag { opacity: .9; }

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 12px;
  max-width: 1200px;
}

.board-card {
  display: block;
  position: relative;
  height: 100px;
  border-radius: var(--radius);
  padding: 12px;
  background: var(--kanbam-blue);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: filter .15s;
}
.board-card:hover { filter: brightness(1.08); }
.board-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .15s;
}
.board-card:hover::after { background: rgba(255,255,255,.12); }

.board-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.board-card--new {
  background: rgba(0,0,0,.08) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
  border: 2px dashed var(--border);
  transition: background .15s, color .15s;
  order: 9999;
}
.board-card--new:hover { background: rgba(0,0,0,.13) !important; color: var(--text); }

/* Archived board cards */
.board-card--archived { opacity: .65; }
.board-card-actions {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 8px;
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .15s;
  z-index: 1;
}
.board-card:hover .board-card-actions { opacity: 1; }
.board-card-action-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: none;
  cursor: pointer;
}
.board-card-action-btn:hover { background: rgba(255,255,255,.35); }

/* "Show archived" toggle */
.board-archived-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: background .12s;
}
.board-archived-toggle:hover { background: rgba(0,0,0,.06); color: var(--text); }

/* ─────────────────────────────────────────────
   Board view
───────────────────────────────────────────── */
.board-view {
  min-height: calc(100vh - var(--header-height));
  padding: 12px 12px 0;
}

.board-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px 8px;
}

.board-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 4px 8px;
  border: 2px solid transparent;
  outline: none;
  min-width: 80px;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.board-title:focus {
  background: #fff;
  color: var(--text);
  border-color: var(--kanbam-blue);
}

.board-header-actions { margin-left: auto; }
.board-header-actions .btn--ghost {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.board-header-actions .btn--ghost:hover { background: rgba(255,255,255,.4); }


.lists-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - var(--header-height) - 80px);
}

/* ─────────────────────────────────────────────
   List
───────────────────────────────────────────── */
.list {
  flex-shrink: 0;
  width: var(--list-width);
  background: var(--list-bg);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height) - 90px);
}

.list-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 8px 6px;
  gap: 4px;
}

.list-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  border-radius: var(--radius);
  padding: 2px 4px;
  border: 2px solid transparent;
  word-break: break-word;
}
.list-title:focus { background: var(--card-bg); border-color: var(--kanbam-blue); color: var(--text); }

.list-menu-btn {
  padding: 2px 6px;
  border-radius: var(--radius);
  color: var(--text-subtle);
  font-size: 18px;
  line-height: 1;
}
.list-menu-btn:hover { background: rgba(0,0,0,.1); color: var(--text); }

.list-menu {
  position: absolute;
  top: 36px;
  right: 4px;
  background: var(--dialog-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 50;
  min-width: 140px;
  padding: 4px 0;
}
.list-menu-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}
.list-menu-item:hover { background: rgba(0,0,0,.05); }
html.dark .list-menu-item:hover { background: rgba(255,255,255,.05); }
.list-menu-item--danger { color: var(--danger); }

.list-cards {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
  min-height: 4px;
}

.list-footer {
  padding: 6px 8px 8px;
}

.btn-add-card {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-subtle);
  font-size: 14px;
}
.btn-add-card:hover { background: rgba(0,0,0,.08); color: var(--text); }

.add-card-form {
  padding: 4px 0;
}
.add-card-input {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--kanbam-blue);
  border-radius: var(--radius);
  resize: none;
  margin-bottom: 6px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
}
.add-card-actions { display: flex; gap: 6px; align-items: center; }

.list-add-wrapper {
  flex-shrink: 0;
  width: var(--list-width);
}

.btn-add-list {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,.25);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s;
}
.btn-add-list:hover { background: rgba(255,255,255,.35); }

.add-list-form {
  background: var(--list-bg);
  border-radius: 6px;
  padding: 10px;
}
.add-list-input {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--kanbam-blue);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
}
.add-list-actions { display: flex; gap: 6px; }

/* ─────────────────────────────────────────────
   Card
───────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .15s, transform .1s;
  position: relative;
}
.card:hover { box-shadow: 0 3px 8px rgba(0,0,0,.2); transform: translateY(-1px); }
.card.sortable-ghost { opacity: .5; }
.card.sortable-drag { box-shadow: 0 6px 20px rgba(0,0,0,.3); transform: rotate(2deg); }

/* Quick edit pencil */
.card-quick-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  background: rgba(0,0,0,.08);
  color: var(--text-subtle);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .12s, background .12s;
  z-index: 2;
}
.card:hover .card-quick-edit { opacity: 1; }
.card-quick-edit:hover { background: rgba(0,0,0,.18); color: var(--text); }

/* Inline title edit */
.card-title-edit {
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border: 2px solid var(--kanbam-blue);
  border-radius: var(--radius);
  padding: 2px 4px;
  background: var(--card-bg);
  resize: none;
  outline: none;
  line-height: 1.4;
}

.card-cover {
  height: 32px;
  width: 100%;
}
.card-cover--image {
  height: 120px;
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 8px 10px 10px;
}

.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.label-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--kanbam-blue);
  text-shadow: 0 1px 1px rgba(0,0,0,.2);
}

.label-chip[data-label="bug"] { background: #eb5a46; }
.label-chip[data-label="backend"] { background: #0079bf; }
.label-chip[data-label="frontend"] { background: #61bd4f; }
.label-chip[data-label="urgent"] { background: #ffab4a; color: var(--text); }
.label-chip[data-label="design"] { background: #c377e0; }
.label-chip[data-label="docs"] { background: #29cce5; color: var(--text); }

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.card-due {
  font-size: 12px;
  background: rgba(0,0,0,.06);
  border-radius: var(--radius);
  padding: 2px 6px;
  color: var(--text-subtle);
}
.card-due--overdue { background: var(--danger); color: #fff; }

.card-checklist-badge {
  font-size: 12px;
  background: rgba(0,0,0,.06);
  border-radius: var(--radius);
  padding: 2px 6px;
  color: var(--text-subtle);
}

.card-assigned-badge {
  font-size: 11px;
  background: rgba(0,121,191,.12);
  border-radius: 10px;
  padding: 2px 7px;
  color: var(--kanbam-blue);
  font-weight: 600;
}

.card-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.card-progress-bar {
  height: 100%;
  background: #61bd4f;
  border-radius: 2px;
  transition: width .2s;
}

.card-desc-preview {
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.45;
  margin: 4px 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-desc-preview p { margin: 0; }
.card-desc-preview p + p { margin-top: 4px; }
.card-desc-preview strong { font-weight: 700; }
.card-desc-preview em { font-style: italic; }
.card-desc-preview code { font-family: monospace; background: rgba(0,0,0,.08); padding: 0 3px; border-radius: 2px; }
.card-desc-preview ul, .card-desc-preview ol { padding-left: 14px; margin: 2px 0; }
.card-desc-preview li { margin: 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.card[data-show-desc="false"] .card-desc-preview { display: none; }
.card[data-show-checklist="false"] .card-checklist-front,
.card[data-show-checklist="false"] .card-checklist-badge,
.card[data-show-checklist="false"] .card-progress { display: none; }

.card-checklist-front {
  list-style: none;
  margin: 5px 0 2px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-checklist-front-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
}
.card-checklist-front-item.done .card-checklist-front-name {
  text-decoration: line-through;
  color: var(--text-subtle);
}
.card-checklist-front-check {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--text-subtle);
  border-radius: 2px;
  flex-shrink: 0;
  background: transparent;
}
.card-checklist-front-item.done .card-checklist-front-check {
  background: #61bd4f;
  border-color: #61bd4f;
}
.card-checklist-front-item.done .card-checklist-front-check::after {
  content: 'check';
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
  display: block;
  color: #fff;
  font-size: 11px;
  line-height: 12px;
  text-align: center;
}

/* ─────────────────────────────────────────────
   Modal
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 12px 12px;
  overflow-y: auto;
}

.modal-container {
  width: 100%;
  max-width: 768px;
}

.modal {
  background: var(--modal-bg);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-subtle);
  z-index: 10;
}
.modal-close .material-symbols-rounded { font-size: 20px; }
.modal-close:hover { background: rgba(0,0,0,.1); color: var(--text); }

.modal-cover { height: 120px; width: 100%; }
.modal-cover--image { background-size: cover; background-position: center; }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0;
  padding: 16px;
}

.modal-main { padding-right: 20px; }
.modal-sidebar { padding-left: 12px; border-left: 1px solid var(--border); }

.modal-section { margin-bottom: 24px; }

.modal-title-section { margin-bottom: 16px; }
.modal-title-input {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  padding: 6px 8px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  resize: none;
}
.modal-title-input:focus { border-color: var(--kanbam-blue); background: var(--card-bg); outline: none; }

.modal-list-label { font-size: 13px; color: var(--text-subtle); margin-top: 4px; padding-left: 8px; }

.modal-section-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.modal-desc {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: rgba(0,0,0,.05);
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  transition: border .15s, background .15s;
  color: var(--text);
}
.modal-desc:focus { border-color: var(--kanbam-blue); background: var(--card-bg); outline: none; }

/* Markdown preview */
.markdown-preview {
  min-height: 40px;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
}
.markdown-preview:hover { border-color: var(--kanbam-blue); }
.markdown-preview h1 { font-size: 20px; margin: 8px 0 4px; }
.markdown-preview h2 { font-size: 17px; margin: 8px 0 4px; }
.markdown-preview h3 { font-size: 15px; margin: 6px 0 4px; }
.markdown-preview p { margin-bottom: 8px; }
.markdown-preview p:last-child { margin-bottom: 0; }
.markdown-preview strong { font-weight: 700; }
.markdown-preview em { font-style: italic; }
.markdown-preview code {
  background: rgba(0,0,0,.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}
html.dark .markdown-preview code { background: rgba(255,255,255,.1); }
.markdown-preview pre {
  background: rgba(0,0,0,.08);
  padding: 10px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 8px 0;
}
html.dark .markdown-preview pre { background: rgba(255,255,255,.07); }
.markdown-preview pre code { background: none; padding: 0; }
.markdown-preview ul, .markdown-preview ol { padding-left: 20px; margin-bottom: 8px; }
.markdown-preview li { margin-bottom: 2px; }
.markdown-preview a { color: var(--kanbam-blue); text-decoration: underline; }
.markdown-preview blockquote {
  border-left: 3px solid var(--border);
  padding-left: 10px;
  color: var(--text-subtle);
  margin: 8px 0;
}

.modal-date-input, .modal-text-input {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 6px;
  background: var(--input-bg);
  color: var(--text);
}
.modal-date-input:focus, .modal-text-input:focus { border-color: var(--kanbam-blue); outline: none; }

/* Checklist */
.modal-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-checklist-progress { font-size: 12px; color: var(--text-subtle); }

.checklist-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.checklist-progress-fill {
  height: 100%;
  background: #61bd4f;
  border-radius: 4px;
  transition: width .2s;
}

.checklist-items { list-style: none; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.checklist-item--done .checklist-item-name {
  text-decoration: line-through;
  color: var(--text-subtle);
}
.checklist-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: #61bd4f; }
.checklist-item-name { flex: 1; font-size: 14px; }
.checklist-item-delete {
  opacity: 0;
  color: var(--text-subtle);
  font-size: 12px;
  padding: 2px 4px;
}
.checklist-item:hover .checklist-item-delete { opacity: 1; }
.checklist-item-delete:hover { color: var(--danger); }

.add-checklist-item {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.add-checklist-item input {
  flex: 1;
  padding: 6px 8px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--input-bg);
  color: var(--text);
}
.add-checklist-item input:focus { border-color: var(--kanbam-blue); outline: none; }

/* Comments */
.comment-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.comment-author-input, .comment-text-input {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--input-bg);
  color: var(--text);
}
.comment-author-input:focus, .comment-text-input:focus { border-color: var(--kanbam-blue); outline: none; }
.comment-text-input { min-height: 60px; resize: vertical; }

.comments-list { margin-top: 8px; }
.comment {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: var(--text-subtle); margin-bottom: 4px; }
.comment-meta strong { color: var(--text); }
.comment-time { margin-left: 6px; }
.comment-text { font-size: 14px; line-height: 1.5; }

/* Activity */
.activity-list { font-size: 13px; }
.activity-entry {
  padding: 4px 0;
  display: flex;
  gap: 6px;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  color: var(--text-subtle);
}
.activity-entry:last-child { border-bottom: none; }
.activity-author { font-weight: 700; color: var(--text); flex-shrink: 0; }
.activity-text { flex: 1; }
.activity-time { font-size: 11px; flex-shrink: 0; }

/* Labels sidebar */
.labels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.label-chip--removable { display: flex; align-items: center; gap: 4px; }
.label-remove {
  color: rgba(255,255,255,.7);
  font-size: 10px;
  line-height: 1;
  padding: 0 2px;
}
.label-remove:hover { color: #fff; }
.label-input {
  padding: 4px 6px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-size: 12px;
  width: 100%;
  margin-top: 4px;
  background: var(--input-bg);
  color: var(--text);
}
.label-input:focus { border-color: var(--kanbam-blue); outline: none; }

/* Cover swatches */
.cover-colours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.cover-swatch {
  width: 32px;
  height: 24px;
  border-radius: 3px;
  border: 2px solid transparent;
  transition: border-color .1s, transform .1s;
}
.cover-swatch:hover { border-color: rgba(0,0,0,.3); transform: scale(1.1); }
.cover-swatch--remove {
  background: var(--border) !important;
  color: var(--text-subtle);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.colour-swatch--add {
  background: #e4e6ea !important;
  color: var(--text-subtle);
  font-size: 18px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c1c7d0;
}
html.dark .colour-swatch--add { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.2); }
.colour-swatch--add:hover { background: #d0d3d8 !important; color: var(--text); }
html.dark .colour-swatch--add:hover { background: rgba(255,255,255,.18) !important; }

.hidden-color-input {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Custom colour chips — click to delete */
.settings-colour-chip {
  position: relative;
  transition: opacity .12s;
}
.settings-colour-chip::after {
  content: 'close';
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}
.settings-colour-chip:hover {
  opacity: 0.5;
}
.settings-colour-chip:hover::after {
  opacity: 1;
}

/* Modal sidebar action buttons */
.modal-sidebar-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ─────────────────────────────────────────────
   Button saved state
───────────────────────────────────────────── */
.btn--saved {
  background: #61bd4f !important;
  color: #fff !important;
  opacity: .9;
}

/* ─────────────────────────────────────────────
   Video background
───────────────────────────────────────────── */
.board-bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  display: none;
}

/* ─────────────────────────────────────────────
   Board-defined label toggles (card modal)
───────────────────────────────────────────── */
.board-label-defs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.board-label-toggle {
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  background: transparent;
  border: 2px solid var(--label-colour, var(--kanbam-blue));
  cursor: pointer;
  transition: background .12s, color .12s;
}
.board-label-toggle:hover {
  background: color-mix(in srgb, var(--label-colour, var(--kanbam-blue)) 20%, transparent);
  color: rgba(255,255,255,.8);
}
.board-label-toggle--active {
  background: var(--label-colour, var(--kanbam-blue));
  color: #fff;
}

/* ─────────────────────────────────────────────
   Dialog (small modal — new board, confirm)
───────────────────────────────────────────── */
.dialog {
  background: var(--dialog-bg);
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.dialog--sm {
  max-width: 340px;
}

.dialog--lg {
  max-width: 560px;
}

.dialog-section {
  margin-bottom: 20px;
}

.dialog-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-subtle);
  margin-bottom: 10px;
}

.dialog-hint {
  font-size: 13px;
  color: var(--text-subtle);
  margin-top: 6px;
  line-height: 1.4;
}

.dialog-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* User profile modal */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.profile-avatar:hover { opacity: .85; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Header user avatar (small pill version) */
.header-user-wrap { position: relative; }
.header-user { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--dialog-bg);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  min-width: 140px;
  padding: 4px;
  z-index: 500;
}
.header-user-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.header-user-dropdown-item:hover { background: var(--page-bg); }
.header-user-dropdown-item--danger { color: #c0392b; }
.header-user-dropdown-item--danger:hover { background: #fde8e8; color: #c0392b; }

.header-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 4px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  height: 44px;
  box-sizing: border-box;
  overflow: hidden;
}
.user-name { flex: 1; font-weight: 500; }
.user-role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--border);
  color: var(--text-subtle);
}
.user-role-badge--admin { background: #ede9fe; color: #6d28d9; }
.dark .user-role-badge--admin { background: #2e1065; color: #c4b5fd; }
.user-role-badge--manager { background: #dbeafe; color: #1e40af; }
.dark .user-role-badge--manager { background: #1e3a5f; color: #93c5fd; }

.sys-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.sys-logo-preview {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--list-bg);
  flex-shrink: 0;
}

.sys-logo-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sys-colour-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.sys-colour-preview {
  width: 44px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
}

.sys-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.sys-toggle-label input { display: none; }

.sys-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.sys-toggle-label input:checked + .sys-toggle-track {
  background: var(--kanbam-blue);
}

.sys-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}

.sys-toggle-label input:checked + .sys-toggle-track .sys-toggle-thumb {
  left: 18px;
}

.dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-right: 32px;
}

.dialog-message {
  font-size: 14px;
  color: var(--text-subtle);
  margin-bottom: 20px;
  line-height: 1.5;
}

.dialog-field {
  margin-bottom: 16px;
}

.dialog-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-subtle);
  margin-bottom: 6px;
}

.dialog-input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color .15s;
}
.dialog-input:focus { border-color: var(--kanbam-blue); outline: none; }
.dialog-input--sm { margin-top: 8px; font-size: 13px; }

select.dialog-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Danger Zone */
.danger-zone {
  margin-top: 28px;
  border: 1px solid #f87171;
  border-radius: var(--radius);
  overflow: hidden;
}
.danger-zone-label {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 5px 14px;
}
.dark .danger-zone { border-color: #7f1d1d; }
.dark .danger-zone-label { background: #450a0a; color: #fca5a5; }
.danger-zone-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
}
.danger-zone-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}
.danger-zone-desc {
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.4;
}

/* Confirm dialog always on top of other modals */
#confirm-overlay { z-index: 250; }

/* Colour swatches (new board) */
.colour-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.colour-swatch {
  width: 36px;
  height: 28px;
  border-radius: var(--radius);
  border: 3px solid transparent;
  transition: transform .1s, border-color .1s;
}
.colour-swatch:hover { transform: scale(1.1); }
.colour-swatch--active { border-color: var(--text) !important; }

/* ─────────────────────────────────────────────
   Toast notifications
───────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  color: #fff;
  background: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  max-width: 320px;
}
.toast--visible { opacity: 1; transform: translateY(0); }
.toast--error { background: var(--danger); }
.toast--success { background: #61bd4f; }

/* ─────────────────────────────────────────────
   Sortable DnD helpers
───────────────────────────────────────────── */
.sortable-ghost { opacity: .4; }
.sortable-drag { box-shadow: 0 6px 20px rgba(0,0,0,.3); }

/* List drag ghost */
.list.sortable-ghost { opacity: .4; background: rgba(9,30,66,.08); }

/* ─────────────────────────────────────────────
   Board settings modal
───────────────────────────────────────────── */
.dialog--settings {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}

.settings-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}
.settings-section:first-of-type { border-top: none; margin-top: 0; }

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

/* Background tabs */
.settings-bg-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.settings-tab {
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  background: rgba(0,0,0,.06);
  transition: background .12s, color .12s;
}
html.dark .settings-tab { background: rgba(255,255,255,.07); }
.settings-tab:hover { background: rgba(0,0,0,.1); color: var(--text); }
html.dark .settings-tab:hover { background: rgba(255,255,255,.12); }
.settings-tab--active { background: var(--kanbam-blue); color: #fff; }
.settings-tab--active:hover { filter: brightness(1.1); }

.settings-tab-panel { padding-top: 4px; }

/* Overlay row */
.settings-overlay-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.settings-overlay-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.settings-overlay-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.overlay-slider {
  flex: 1;
  accent-color: var(--kanbam-blue);
  cursor: pointer;
}
.overlay-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 36px;
  text-align: right;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--kanbam-blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-switch input:disabled + .toggle-slider { opacity: .4; cursor: not-allowed; }

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
}
.settings-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.settings-toggle-desc {
  font-size: 12px;
  color: var(--text-subtle);
  margin-left: 2px;
}

/* Mods section */
.settings-mod-item {
  padding: 10px 0;
}
.settings-mod-item + .settings-mod-item {
  border-top: 1px solid var(--border);
}
.settings-mod-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.settings-mod-info {
  flex: 1;
}
.settings-mod-info .settings-toggle-label {
  margin-bottom: 2px;
}
.settings-mod-info .settings-toggle-desc {
  margin-left: 0;
  line-height: 1.4;
}


/* Labels list */
.settings-labels-list { margin-bottom: 12px; }
.settings-label-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.settings-label-item:last-child { border-bottom: none; }
.settings-label-swatch {
  width: 24px; height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}
.settings-label-name { flex: 1; font-size: 14px; }

.settings-add-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom colours */
.settings-custom-colours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.settings-empty {
  font-size: 13px;
  color: var(--text-subtle);
  padding: 4px 0;
}

/* ─────────────────────────────────────────────
   Archived cards modal
───────────────────────────────────────────── */
.archived-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.archived-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,.02);
}
html.dark .archived-card-item { background: rgba(255,255,255,.03); }
.archived-card-cover {
  width: 8px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.archived-card-info { flex: 1; min-width: 0; }
.archived-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archived-card-meta { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }
.archived-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─────────────────────────────────────────────
   Pexels photo/video search
───────────────────────────────────────────── */
.pexels-disabled {
  font-size: 13px;
  color: var(--text-subtle);
  padding: 8px 0;
}
.pexels-disabled code {
  background: rgba(0,0,0,.06);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.pexels-search {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.pexels-search .dialog-input { flex: 1; }

.pexels-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.pexels-thumb {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color .12s, transform .1s;
}
.pexels-thumb:hover { border-color: var(--kanbam-blue); transform: scale(1.02); }

.pexels-thumb--video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.2);
}
.pexels-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  pointer-events: none;
}

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 600px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-sidebar { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 16px; margin-top: 8px; }
  .modal-main { padding-right: 0; }
  .header-search-input { width: 120px; }
  .header-search-input:focus { width: 160px; }
}

/* ─── View Toggle ─────────────────────────────── */

.view-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background .15s, color .15s;
}

.view-toggle-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.view-toggle-btn--active {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.view-toggle-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* ─── Table View ──────────────────────────────── */

.table-view-container {
  padding: 16px 4px 40px;
  min-height: 200px;
}

.table-scroll-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  background: var(--card-bg);
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-header-row {
  background: var(--list-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-subtle);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  user-select: none;
}

.table-th:nth-child(1) { width: auto; min-width: 180px; }
.table-th:nth-child(2) { width: 120px; }
.table-th:nth-child(3) { width: 160px; }
.table-th:nth-child(4) { width: 110px; }
.table-th:nth-child(5) { width: 85px; }
.table-th:nth-child(6) { width: 110px; }
.table-th:nth-child(7) { width: 110px; }

.table-th--sortable { cursor: pointer; }

.table-th--sortable:hover {
  color: var(--text);
  background: var(--border);
}

.sort-indicator { margin-left: 4px; font-size: 11px; }
.sort-indicator--idle { color: var(--border); }
.sort-indicator--active { color: var(--kanbam-blue); }

.table-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}

.table-row:hover { background: var(--page-bg); }

.table-row:focus-visible {
  outline: 2px solid var(--kanbam-blue);
  outline-offset: -2px;
}

.table-row:last-child { border-bottom: none; }

.table-cell {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-cell--title { white-space: normal; }

.table-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-cover-swatch {
  flex-shrink: 0;
  width: 28px;
  height: 20px;
  border-radius: 3px;
  display: inline-block;
}

.table-cover-swatch--empty { background: transparent; }

.table-card-title {
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.table-cell--list { color: var(--text-subtle); }

.table-labels { display: flex; flex-wrap: wrap; gap: 4px; }

.table-label-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.table-label-overflow {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-subtle);
}

.table-cell--checklist { text-align: center; }

.table-checklist-badge {
  font-size: 12px;
  color: var(--text-subtle);
  background: var(--list-bg);
  padding: 2px 7px;
  border-radius: 10px;
}

.table-due { font-size: 13px; color: var(--text-subtle); }

.table-due--overdue {
  color: #eb5a46;
  font-weight: 600;
}

.table-empty { padding: 48px 16px; text-align: center; }

.table-empty-text { font-size: 14px; color: var(--text-subtle); }

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

html.dark .table-label-chip { opacity: 0.9; }
html.dark .table-row:hover { background: rgba(255,255,255,.04); }

/* ─── Calendar View ──────────────────────────── */

.calendar-view-container {
  padding: 16px 4px 40px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.cal-nav-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.cal-nav-btn:hover { background: rgba(255,255,255,0.35); }
.cal-nav-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cal-month-label {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  min-width: 160px;
  text-align: center;
}

.cal-empty {
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  padding: 8px 0 16px;
}

.cal-grid {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.cal-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--list-bg);
  border-bottom: 2px solid var(--border);
}

.cal-day-header {
  padding: 8px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-subtle);
}

.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 100px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  vertical-align: top;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell--outside {
  background: var(--page-bg);
}

.cal-cell--outside .cal-day-num {
  color: var(--border);
}

.cal-cell--today {
  box-shadow: inset 0 0 0 2px var(--kanbam-blue);
}

.cal-cell--today .cal-day-num {
  background: var(--kanbam-blue);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  text-align: center;
}

.cal-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--list-bg);
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  width: 100%;
  transition: background .1s;
  overflow: hidden;
}

.cal-chip:hover { background: var(--border); }
.cal-chip:focus-visible { outline: 2px solid var(--kanbam-blue); outline-offset: 1px; }

.cal-chip--hidden { display: none; }
.cal-chip--visible { display: flex; }

.cal-chip-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.cal-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Multi-day spanning chips */
.cal-chip--span {
  background: var(--kanbam-blue); /* overridden inline per card colour */
  color: #fff;
  border-radius: 0; /* overridden inline per position */
  height: 20px;
  padding: 0 5px;
  min-height: 0;
}

.cal-chip--span:hover { filter: brightness(1.1); background: inherit; }

.cal-chip-title--span {
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.cal-overflow {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 1px 5px;
  text-align: left;
  width: 100%;
}

.cal-overflow:hover { color: var(--kanbam-blue); }

/* Dark mode */
html.dark .cal-cell { background: var(--card-bg); }
html.dark .cal-cell--outside { background: var(--page-bg); }
html.dark .cal-chip { background: rgba(255,255,255,.07); color: var(--text); }
html.dark .cal-chip:hover { background: rgba(255,255,255,.13); }

/* ─── Timeline View ─────────────────────────────────────────────────────────── */

.timeline-view-container {
  padding: 16px 4px 40px;
  min-height: 400px;
  background: var(--card-bg);
  border-radius: 8px;
}

.tl-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tl-nav-btn {
  background: var(--list-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s;
}
.tl-nav-btn:hover { background: var(--border); }

.tl-today-btn {
  font-size: 12px;
  padding: 4px 10px;
}

.tl-range-label {
  font-size: 13px;
  color: var(--text-subtle);
  min-width: 200px;
}

.tl-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--text-subtle);
  font-size: 14px;
}

/* Single scrollable container — labels are sticky inside it */
.tl-main {
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.tl-grid-inner {
  display: block;
}

/* Header rows (month + day) */
.tl-header-row {
  display: flex;
  align-items: stretch;
  background: var(--list-bg);
  border-bottom: 1px solid var(--border);
}

.tl-header-stub {
  flex: 0 0 200px;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--list-bg);
  border-right: 1px solid var(--border);
}

.tl-month-header,
.tl-day-header {
  display: flex;
  align-items: center;
  flex: 1;
}

.tl-month-cell {
  height: 24px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 6px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.tl-day-cell {
  flex: 0 0 32px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-subtle);
  border-right: 1px solid rgba(0,0,0,.06);
  box-sizing: border-box;
}

.tl-day-cell--today {
  color: var(--kanbam-blue);
  font-weight: 700;
}

.tl-day-cell--weekend {
  background: rgba(0,0,0,.03);
}

/* Groups */
.tl-group {
  margin-bottom: 0;
}

.tl-group-header {
  display: flex;
  align-items: center;
  height: 30px;
  background: var(--list-bg);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.tl-group-label-stub {
  flex: 0 0 200px;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--list-bg);
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
}

.tl-group-bar-area {
  background: var(--list-bg);
}

.tl-group-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-subtle);
  padding: 0 8px;
}

/* Card rows */
.tl-row {
  display: flex;
  align-items: center;
  height: 36px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.tl-row:hover { background: color-mix(in srgb, var(--card-bg) 85%, var(--list-bg) 15%); }

.tl-row-label {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  box-sizing: border-box;
  position: sticky;
  left: 0;
  z-index: 3;
  background: inherit;
  border-right: 1px solid var(--border);
}

.tl-label-swatch {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.tl-label-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-assigned {
  font-size: 10px;
  color: var(--text-subtle);
  white-space: nowrap;
}

.tl-row-bars {
  position: relative;
}

.tl-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--kanbam-blue);
  opacity: 0.35;
  z-index: 1;
  pointer-events: none;
  transform: translateX(-50%);
}

.tl-bar {
  position: absolute;
  top: 6px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s, filter 0.15s;
  z-index: 2;
  box-sizing: border-box;
  min-width: 8px;
}

.tl-bar:hover {
  opacity: 1;
  filter: brightness(1.1);
}

.tl-bar:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.tl-bar--overdue {
  opacity: 0.7;
  border: 2px solid #e53935;
}

.tl-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  pointer-events: none;
}

html.dark .tl-day-cell--weekend { background: rgba(255,255,255,.03); }
html.dark .tl-group-bar-area { background: var(--list-bg); }

/* ─── Dashboard View ─────────────────────────────────────────────────────────── */

.dashboard-view-container {
  padding: 16px 4px 40px;
  min-height: calc(100vh - var(--header-height));
}

/* Summary stat tiles */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.dash-stat {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  border-left: 4px solid var(--kanbam-blue);
}

.dash-stat--danger  { border-left-color: #e53935; }
.dash-stat--warning { border-left-color: #fb8c00; }
.dash-stat--success { border-left-color: #43a047; }

.dash-stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 5px;
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* Chart grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.dash-panel--full {
  width: 100%;
  box-sizing: border-box;
}

.dash-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.dash-chart {
  min-height: 80px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-subtle);
  font-size: 13px;
}

/* Donut + legend */
.dash-donut-wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.dash-donut-svg {
  flex: 1;
  width: 100%;
  height: 100%;
}

.dash-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.dash-legend-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dash-legend-label {
  color: var(--text);
  white-space: nowrap;
}

.dash-legend-count {
  font-weight: 700;
  color: var(--text);
  font-size: 16px;
  flex-shrink: 0;
}

/* Checklist progress bars */
.dash-progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-progress-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px 52px;
  align-items: center;
  gap: 10px;
}

.dash-progress-label {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.dash-progress-bar-fill {
  height: 100%;
  background: var(--kanbam-blue);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.dash-progress-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.dash-progress-count {
  font-size: 10px;
  color: var(--text-subtle);
  text-align: right;
}

/* Responsive — stack on narrow viewports */
@media (max-width: 720px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-progress-row { grid-template-columns: 120px 1fr 36px 44px; }
}

/* Dark mode */
html.dark .dash-stat,
html.dark .dash-panel { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
