:root {
  --cream:         #fdfdfd;
  --ink:           #030203;
  --blue:          #69a3ff;
  --blue-light:    #e8f0ff;
  --salmon:        #ee897c;
  --salmon-light:  #fce9e7;
  --hotpink:       #fa5791;
  --purple:        #7a2e82;
  --purple-light:  #f0ddf2;
  --red:           #C8392B;
  --red-light:     #fce4e1;
  --yellow:        #b86e00;
  --yellow-light:  #fef3d8;
  --muted:         #7a7a8a;
  --border:        #e2dff0;
  --green:         #1a6645;
  --green-light:   #d4f0e4;
  --peach:         #fed5b7;
  --peach-light:   #fff4eb;
  --teal:          #1a7a7a;
  --teal-light:    #d4f0f0;
  --gold:          #8a6200;
  --gold-light:    #fff8d4;
  --mauve:         #a0527a;
  --mauve-light:   #f5e0ec;
  --rose:          #9a3060;
  --rose-light:    #fce8f3;
  --card-w:        300px;
  --radius:        12px;
  --shadow:        0 2px 10px rgba(3,2,3,0.07);
  --shadow-hover:  0 6px 24px rgba(3,2,3,0.13);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'DM Sans', sans-serif; background: #f4f2fb; color: var(--ink); display: flex; flex-direction: column; }
nav { flex-shrink: 0; }


/* btn-auth, auth-modal: injected by sh-auth-ui.js */


.sync-status { font-size: 11px; color: var(--muted); font-style: italic; opacity: 0; transition: opacity 0.4s; }
.sync-status.visible { opacity: 1; }

/* ── TOOLBAR ───────────────────────────────────────────────────── */
.toolbar {
  background: var(--cream); border-bottom: 1.5px solid var(--border);
  padding: 10px 24px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 54px; z-index: 99; flex-shrink: 0;
}
.toolbar-sep { width: 1px; height: 20px; background: var(--border); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--border); background: white; color: var(--muted);
  transition: all 0.15s;
}
.view-btn.active { background: var(--purple); color: white; border-color: var(--purple); }
.density-btn { font-size: 13px; padding: 5px 8px; }
.density-btn.active { background: var(--purple); color: white; border-color: var(--purple); }
.btn-add-card {
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--purple); color: white;
  display: flex; align-items: center; gap: 6px;
  transition: opacity 0.15s;
}
.btn-add-card:hover { opacity: 0.88; }
.btn-export {
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  background: white; color: var(--purple); border: 1.5px solid var(--purple);
  transition: all 0.15s; white-space: nowrap;
}
.btn-export:hover { background: var(--purple-light); }

.search-wrap {
  display: flex; align-items: center; gap: 6px;
  background: white; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 5px 10px; margin-left: auto;
}
.search-wrap input {
  border: none; outline: none; font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: var(--ink); background: transparent; width: 180px;
}
.search-wrap input::placeholder { color: var(--muted); font-style: italic; }
.sync-indicator { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── BOARD ─────────────────────────────────────────────────────── */
.board-wrap { overflow-x: auto; overflow-y: auto; padding: 20px; flex: 1; min-height: 0; scrollbar-width: auto; scrollbar-color: #b0a8c8 #e8e4f4; }
.board-wrap::-webkit-scrollbar { width: 16px; height: 16px; }
.board-wrap::-webkit-scrollbar-track { background: #e8e4f4; border-radius: 8px; }
.board-wrap::-webkit-scrollbar-thumb { background: #b0a8c8; border-radius: 8px; border: 3px solid #e8e4f4; }
.board-wrap::-webkit-scrollbar-thumb:hover { background: #9880b8; }
.board { display: flex; gap: 16px; align-items: flex-start; min-width: max-content; }

/* ── COLUMN ────────────────────────────────────────────────────── */
.column { width: var(--card-w); flex-shrink: 0; display: flex; flex-direction: column; gap: 0; }
.col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius) var(--radius) 0 0;
  border: 1.5px solid transparent; border-bottom: none;
}
.col-title { font-family: 'Playfair Display', serif; font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.col-count { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.45); padding: 2px 7px; border-radius: 20px; }
.col-body {
  flex: 1; min-height: 120px; background: white;
  border: 1.5px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background 0.15s;
}
.col-body.drag-over { background: #f0ebff; border-color: var(--purple); }

/* Column accent colours */
.col-feedback   .col-header { background: var(--blue-light);    border-color: var(--blue);    color: #1a3a7a; }
.col-kudos      .col-header { background: var(--green-light);   border-color: var(--green);   color: var(--green); }
.col-collab     .col-header { background: var(--teal-light);    border-color: var(--teal);    color: var(--teal); }
.col-tasks      .col-header { background: var(--purple-light);  border-color: var(--purple);  color: var(--purple); }
.col-skills     .col-header { background: var(--gold-light);    border-color: var(--gold);    color: var(--gold); }
.col-stats      .col-header { background: var(--salmon-light);  border-color: var(--salmon);  color: #7a3020; }
.col-milestones .col-header { background: var(--rose-light);    border-color: var(--rose);    color: var(--rose); }
.col-feedback   .col-body { border-color: var(--blue); }
.col-kudos      .col-body { border-color: var(--green); }
.col-collab     .col-body { border-color: var(--teal); }
.col-tasks      .col-body { border-color: var(--purple); }
.col-skills     .col-body { border-color: var(--gold); }
.col-stats      .col-body { border-color: var(--salmon); }
.col-milestones .col-body { border-color: var(--rose); }

/* ── ADD CARD INLINE ───────────────────────────────────────────── */
.add-card-inline { display: none; flex-direction: column; gap: 6px; padding: 8px; background: #f8f6ff; border: 1.5px dashed var(--border); border-radius: 8px; }
.add-card-inline.open { display: flex; }
.add-card-inline input { font-family: 'DM Sans', sans-serif; font-size: 13px; border: 1.5px solid var(--border); border-radius: 6px; padding: 6px 10px; outline: none; color: var(--ink); background: white; }
.add-card-inline input:focus { border-color: var(--purple); }
.add-card-btn-row { display: flex; gap: 6px; }
.btn-save-inline { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; padding: 4px 14px; border-radius: 20px; background: var(--purple); color: white; border: none; cursor: pointer; }
.btn-cancel-inline { font-family: 'DM Sans', sans-serif; font-size: 12px; padding: 4px 10px; border-radius: 20px; background: none; border: 1.5px solid var(--border); cursor: pointer; color: var(--muted); }
.btn-col-add { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 18px; opacity: 0; transition: opacity 0.15s; padding: 0 2px; line-height: 1; }
.column:hover .btn-col-add { opacity: 1; }
.btn-col-add:hover { color: var(--purple); }
.btn-col-delete { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; opacity: 0; transition: opacity 0.15s; padding: 0 2px; line-height: 1; }
.column:hover .btn-col-delete { opacity: 1; }
.btn-col-delete:hover { color: var(--red); }

/* ── CUSTOM COLUMN ─────────────────────────────────────────────── */
.col-custom .col-header { background: #eaeaff; border-color: #4848b0; color: #4848b0; }
.col-custom .col-body   { border-color: #4848b0; }

/* ── COLUMN DRAG & DROP ────────────────────────────────────────── */
.col-drag-handle { cursor: grab; opacity: 0; font-size: 13px; transition: opacity 0.15s; margin-right: 5px; user-select: none; flex-shrink: 0; }
.column:hover .col-drag-handle { opacity: 0.45; }
.col-header:active .col-drag-handle { cursor: grabbing; }
.col-dragging { opacity: 0.35; }
.col-drop-before { box-shadow: -3px 0 0 0 var(--purple); }
.col-drop-after  { box-shadow:  3px 0 0 0 var(--purple); }

.btn-col-add-new { display: none; } /* superseded by toolbar button */
.btn-add-col-toolbar {
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  background: white; color: var(--purple); border: 1.5px solid var(--purple);
  transition: all 0.15s; white-space: nowrap;
}
.btn-add-col-toolbar:hover { background: var(--purple-light); }
.add-col-toolbar-form { display: flex; align-items: center; gap: 6px; }
.col-add-input {
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 10px; outline: none; color: var(--ink); background: white; width: 100%;
}
.col-add-input-toolbar { width: 160px; }
.col-add-input:focus { border-color: var(--purple); }
.col-add-btn-row { display: flex; gap: 6px; }
.btn-save-col { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; padding: 5px 16px; border-radius: 8px; background: var(--purple); color: white; border: none; cursor: pointer; }
.btn-save-col:hover { background: #621870; }
.btn-cancel-col { font-family: 'DM Sans', sans-serif; font-size: 12px; padding: 5px 10px; border-radius: 8px; background: none; border: 1.5px solid var(--border); cursor: pointer; color: var(--muted); }
.btn-cancel-col:hover { border-color: var(--muted); }

/* ── CARD ──────────────────────────────────────────────────────── */
.card {
  background: var(--cream); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 13px;
  cursor: pointer; box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  user-select: none; position: relative;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card.dragging { opacity: 0.4; transform: rotate(1.5deg); }
.card.drag-placeholder { background: #f0ebff; border: 1.5px dashed var(--purple); box-shadow: none; opacity: 0.6; }
.card-title { font-weight: 600; font-size: 13.5px; line-height: 1.4; color: var(--ink); margin-bottom: 6px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; padding-right: 32px; }
.card-meta-left { display: flex; align-items: center; gap: 6px; }
.card-due { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.card-due.overdue { color: var(--red); font-weight: 600; }
.card-notes-preview { display: none; font-size: 12px; color: var(--muted); line-height: 1.5; margin: 5px 0 2px; padding: 0; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-move-btn { position: absolute; bottom: 8px; right: 8px; font-size: 13px; background: white; border: 1.5px solid var(--border); cursor: pointer; color: var(--muted); opacity: 0; transition: opacity 0.15s; padding: 3px 8px; border-radius: 6px; }
.card:hover .card-move-btn { opacity: 1; }
.card-move-btn:hover { background: var(--purple-light); border-color: var(--purple); color: var(--purple); }
.card-checklist-preview { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.move-popup { display: none; position: absolute; bottom: 0; right: 4px; transform: translateY(calc(100% + 4px)); background: white; border: 1.5px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-hover); z-index: 150; min-width: 190px; padding: 6px; }
.move-popup.open { display: block; }
.move-popup-item { font-size: 12px; padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.move-popup-item:hover { background: var(--purple-light); color: var(--purple); }
.move-popup-item.current { opacity: 0.4; cursor: default; pointer-events: none; }
.move-popup-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.move-popup-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 4px 10px 2px; }
.card-is-example { opacity: 0.8; }

/* ── TAGS ──────────────────────────────────────────────────────── */
.tag { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; white-space: nowrap; line-height: 1.4; display: inline-flex; align-items: center; gap: 3px; }
.tag-feedback-happy    { background: var(--green-light);  color: var(--green); }
.tag-feedback-clear    { background: var(--blue-light);   color: #1a3a7a; }
.tag-feedback-tough    { background: var(--salmon-light); color: #7a3020; }
.tag-feedback-promise  { background: var(--purple-light); color: var(--purple); }
.tag-feedback-team     { background: var(--teal-light);   color: var(--teal); }
.tag-feedback-fast     { background: var(--yellow-light); color: var(--yellow); }
.tag-feedback-exp      { background: var(--gold-light);   color: var(--gold); }
.tag-period            { background: var(--border);       color: var(--muted); }
.tag-custom            { background: var(--purple-light); color: var(--purple); }
.tag-learning          { background: var(--gold-light);   color: var(--gold); }

/* ── TAG PICKER ────────────────────────────────────────────────── */
.tag-groups-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tag-group { position: relative; border-radius: 8px; }
.tag-group.open { border: 1.5px solid var(--purple); border-radius: 8px; overflow: hidden; }
.tag-group-header {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; padding: 5px 10px; border-radius: 20px;
  background: white; border: 1.5px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  user-select: none; transition: all 0.12s; white-space: nowrap;
}
.tag-group-header:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }
.tag-group.open .tag-group-header { border: none; border-radius: 6px 6px 0 0; color: var(--purple); background: var(--purple-light); width: 100%; box-sizing: border-box; }
.tag-group-header.has-selection { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }
.tag-group-toggle { font-size: 9px; opacity: 0.6; transition: transform 0.2s; }
.tag-group.open .tag-group-toggle { transform: rotate(180deg); }
.tag-group-body { display: none; padding: 8px 6px 6px; background: white; }
.tag-group.open .tag-group-body { display: block; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-option { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; line-height: 1.4; display: inline-flex; align-items: center; gap: 3px; cursor: pointer; border: 1.5px solid transparent; transition: all 0.12s; opacity: 0.55; }
.tag-option.selected { opacity: 1; border-color: currentColor; }
.tag-option:hover { opacity: 0.85; }
.custom-tag-wrap { display: flex; gap: 6px; margin-top: 6px; }
.custom-tag-input { font-family: 'DM Sans', sans-serif; font-size: 12px; border: 1.5px solid var(--border); border-radius: 6px; padding: 4px 10px; outline: none; flex: 1; color: var(--ink); }
.custom-tag-input:focus { border-color: var(--purple); }
.btn-add-tag { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 6px; border: 1.5px solid var(--purple); background: white; color: var(--purple); cursor: pointer; }
.btn-add-tag:hover { background: var(--purple-light); }

/* ── EMPTY STATE ───────────────────────────────────────────────── */
.col-empty { text-align: center; color: var(--muted); font-style: italic; font-size: 12px; padding: 18px 10px; }

/* ── DENSITY ───────────────────────────────────────────────────── */
.density-compact .card-meta,
.density-compact .card-notes-preview { display: none !important; }
.density-compact .card { padding: 8px 10px; }
.density-compact .card-title { font-size: 12.5px; margin-bottom: 4px; }
.density-compact .card-tags { margin-bottom: 0; }
.density-comfortable .card { padding: 14px 15px; }
.density-comfortable .card-title { font-size: 15px; margin-bottom: 5px; }
.density-comfortable .card-tags { gap: 5px; margin-bottom: 8px; }
.density-comfortable .card-tags .tag { font-size: 12px; padding: 3px 9px; }
.density-comfortable .card-meta { font-size: 12.5px; margin-top: 6px; }
.density-comfortable .card-notes-preview { display: -webkit-box !important; }

/* ── LIST VIEW ─────────────────────────────────────────────────── */
.list-view { display: none; padding: 24px; max-width: 1200px; margin: 0 auto; flex: 1; min-height: 0; overflow-y: auto; }
.list-view.active { display: block; }
.board-wrap.list-mode { display: none; }
.list-section { margin-bottom: 28px; }
.list-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius) var(--radius) 0 0;
  font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; user-select: none;
  border: 1.5px solid transparent; border-bottom: none;
}
.list-section-header .toggle-icon { font-size: 11px; transition: transform 0.2s; margin-left: auto; }
.list-section-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.list-table-wrap { overflow-x: auto; border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.list-table { width: 100%; border-collapse: collapse; background: white; border: none; }
.list-table th { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 14px; text-align: left; background: #f8f6ff; border-bottom: 1.5px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
.list-table th:hover { background: #ede8f8; }
.sort-icon { margin-left: 5px; opacity: 0.4; font-size: 10px; }
.sort-icon.asc, .sort-icon.desc { opacity: 1; }
.list-table td { font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list-table tr:last-child td { border-bottom: none; }
.list-table tr { cursor: pointer; transition: background 0.1s; }
.list-table tr:hover td { background: #f8f6ff; }
.list-empty { padding: 16px; text-align: center; color: var(--muted); font-style: italic; font-size: 13px; background: white; }

/* ── STATS VIEW ─────────────────────────────────────────────────── */
.stats-view { flex: 1; min-height: 0; overflow-y: auto; padding: 28px; }
.stats-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; gap: 10px; }
.stats-empty-icon { font-size: 3rem; }
.stats-empty-title { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.stats-empty-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* Stat tile */
.stat-tile { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: box-shadow 0.15s, transform 0.15s; }
.stat-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-tile-top { display: flex; align-items: center; justify-content: space-between; }
.stat-tile-count { font-size: 11px; color: var(--muted); }
.stat-tile-avg-label { font-size: 11px; color: var(--muted); font-style: italic; }
.stat-tile-value { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900; color: var(--ink); line-height: 1; word-break: break-all; }
.stat-tile-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.stat-tile-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.stat-tile-meta { font-size: 11px; color: var(--muted); }

/* Stat type badges */
.stat-type-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.stat-type-count      { background: var(--blue-light);   color: #1a3a7a; }
.stat-type-percentage { background: var(--green-light);  color: var(--green); }
.stat-type-time       { background: var(--gold-light);   color: var(--gold); }
.stat-type-rating     { background: var(--purple-light); color: var(--purple); }
.stat-type-number     { background: #eaeaff;             color: #4848b0; }

/* Trend */
.stat-trend { font-size: 12px; font-weight: 600; }
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--muted); font-weight: 400; }

/* Add/Edit stat modal — type selector */
.stat-type-options { display: flex; flex-direction: column; gap: 5px; }
.stat-type-option { font-family: 'DM Sans', sans-serif; padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; background: white; color: var(--muted); transition: all 0.12s; text-align: left; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.stat-type-option:hover { border-color: var(--purple); background: var(--purple-light); }
.stat-type-option.selected { border-color: var(--purple); background: var(--purple-light); color: var(--purple); }
.stat-type-option-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.stat-type-option.selected .stat-type-option-label { color: var(--purple); }
.stat-type-option-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.stat-unit-target-row { display: flex; gap: 12px; }
.modal-label-note { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 10.5px; }

/* Stat detail modal */
.stat-detail-modal { background: var(--cream); border-radius: 18px; box-shadow: 0 20px 60px rgba(3,2,3,0.18); width: 100%; max-width: 580px; max-height: 88vh; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 20px; animation: modal-in 0.2s ease; }
.stat-detail-header { display: flex; flex-direction: column; gap: 6px; padding-right: 36px; }
.stat-detail-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-detail-name { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; color: var(--ink); }
.stat-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stat-detail-meta-item { font-size: 12px; color: var(--muted); }
.stat-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.stat-log-section { background: #f8f6ff; border-radius: 10px; padding: 14px 16px; }
.stat-log-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.stat-log-row .modal-input { font-size: 13px; }
.btn-log-stat { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: 8px; background: var(--purple); color: white; border: none; cursor: pointer; white-space: nowrap; transition: opacity 0.15s; flex-shrink: 0; }
.btn-log-stat:hover { opacity: 0.88; }
.stat-history-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 20px 0; font-style: italic; }
#statModalFooterMeta { display: flex; justify-content: flex-end; gap: 14px; margin-top: 4px; }
.stat-modal-footer-item { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Entry history list */
.stat-entry-list { display: flex; flex-direction: column; gap: 6px; }
.stat-entry-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: white; border: 1.5px solid var(--border); border-radius: 8px; }
.stat-entry-value { font-weight: 700; font-size: 14px; min-width: 64px; color: var(--ink); }
.stat-entry-period { font-size: 12px; color: var(--muted); min-width: 80px; }
.stat-entry-note { flex: 1; font-size: 12px; color: var(--muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-entry-delete { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; opacity: 0; transition: opacity 0.15s; padding: 0 4px; line-height: 1; flex-shrink: 0; }
.stat-entry-row:hover .stat-entry-delete { opacity: 1; }
.stat-entry-delete:hover { color: var(--red); }

/* ── MODAL ─────────────────────────────────────────────────────── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(3,2,3,0.35); z-index: 200; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--cream); border-radius: 18px; box-shadow: 0 20px 60px rgba(3,2,3,0.18); width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; animation: modal-in 0.2s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { padding: 20px 24px 12px; border-bottom: 1.5px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.modal-header-top { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.modal-col-badge { font-family: 'Playfair Display', serif; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.modal-title-input { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: var(--ink); border: none; border-bottom: 2px solid var(--border); outline: none; background: transparent; width: 100%; min-height: 2em; resize: none; line-height: 1.5; padding: 4px 0 6px; display: block; transition: border-color 0.15s; overflow: hidden; }
.modal-title-input:focus { border-bottom-color: var(--purple); }
.modal-title-input::placeholder { color: var(--muted); font-style: italic; font-weight: 400; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--border); color: var(--ink); }
.modal-tag-strip { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.modal-tag-strip:empty { display: none; }
.modal-body { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-section-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.modal-input { font-family: 'DM Sans', sans-serif; font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 12px; outline: none; color: var(--ink); background: white; width: 100%; }
.modal-input:focus { border-color: var(--purple); }
.modal-textarea { font-family: 'DM Sans', sans-serif; font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 12px; outline: none; color: var(--ink); background: white; width: 100%; resize: vertical; min-height: 90px; }
.modal-textarea:focus { border-color: var(--purple); }
.checklist-items { display: flex; flex-direction: column; gap: 5px; }
.checklist-item { display: flex; align-items: center; gap: 8px; }
.checklist-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--purple); flex-shrink: 0; }
.checklist-item-text { font-family: 'DM Sans', sans-serif; font-size: 13px; border: none; border-bottom: 1px solid var(--border); outline: none; background: transparent; flex: 1; padding: 2px 0; color: var(--ink); }
.checklist-item-text.done { text-decoration: line-through; color: var(--muted); }
.checklist-item-del { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; flex-shrink: 0; }
.checklist-item-del:hover { color: var(--red); }
.btn-add-checklist { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; color: var(--purple); background: none; border: none; cursor: pointer; padding: 0; margin-top: 4px; text-align: left; }
.btn-add-checklist:hover { text-decoration: underline; }
.modal-links { display: flex; flex-direction: column; gap: 6px; }
/* Embedded link card */
.link-embed {
  display: flex; align-items: stretch; gap: 0;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: white; overflow: hidden;
  text-decoration: none; color: var(--ink);
  transition: border-color 0.14s, box-shadow 0.14s;
  position: relative;
}
.link-embed:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(105,163,255,0.15); }
.link-embed-favicon {
  width: 36px; flex-shrink: 0; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-light);
  border-right: 1.5px solid var(--border);
  border-radius: 8px 0 0 8px;
}
.link-embed-favicon img { width: 20px; height: 20px; object-fit: contain; display: block; }
.link-embed-body { flex: 1; padding: 7px 10px; min-width: 0; }
.link-embed-label { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-embed-url { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.link-embed-actions { display: flex; align-items: center; gap: 2px; padding-right: 8px; flex-shrink: 0; }
.link-embed-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 5px; border-radius: 5px; line-height: 1; transition: background 0.1s, color 0.1s; }
.link-embed-btn:hover { background: var(--border); color: var(--ink); }
.link-embed-btn.del:hover { background: var(--red-light); color: var(--red); }
/* Edit row (shown when editing a link) */
.modal-link-row { display: flex; gap: 6px; align-items: center; background: #f8f6ff; border: 1.5px solid var(--purple); border-radius: 10px; padding: 8px 10px; }
.modal-link-row input { font-family: 'DM Sans', sans-serif; font-size: 12px; border: 1.5px solid var(--border); border-radius: 6px; padding: 5px 10px; outline: none; flex: 1; color: var(--ink); background: white; }
.modal-link-row input:focus { border-color: var(--purple); }
.modal-link-row .link-del { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 4px; }
.modal-link-row .link-del:hover { color: var(--red); }
.modal-link-row .link-save { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--purple); color: white; border: none; cursor: pointer; white-space: nowrap; }
.btn-add-link { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; color: var(--purple); background: none; border: none; cursor: pointer; padding: 0; margin-top: 2px; text-align: left; }
.btn-add-link:hover { text-decoration: underline; }
.modal-link-display { display: flex; flex-wrap: wrap; gap: 5px; }
.modal-link-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: var(--blue-light); color: #1a3a7a; padding: 3px 8px; border-radius: 20px; text-decoration: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-link-chip:hover { background: #cfdeff; }
.modal-move-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.modal-move-select { font-family: 'DM Sans', sans-serif; font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; outline: none; flex: 1; background: white; cursor: pointer; }
.modal-move-select:focus { border-color: var(--purple); }
.btn-move-card { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; padding: 6px 18px; border-radius: 20px; background: var(--purple); color: white; border: none; cursor: pointer; }
.btn-move-card:hover { background: #621870; }
.btn-delete-card { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--red); background: none; border: none; cursor: pointer; margin-top: 8px; padding: 0; text-align: left; }
.btn-delete-card:hover { text-decoration: underline; }

/* ── BOARD SWITCHER ─────────────────────────────────────────────── */
.board-switcher { position: relative; }
.board-switcher-btn {
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 8px; cursor: pointer;
  background: var(--purple-light); color: var(--purple);
  border: 1.5px solid var(--purple); transition: all 0.12s;
  max-width: 200px;
}
.board-switcher-btn:hover { background: #e0d4f5; }
#boardSwitcherLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.board-switcher-caret { font-size: 10px; flex-shrink: 0; transition: transform 0.15s; }
.board-switcher.open .board-switcher-caret { transform: rotate(180deg); }
.board-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: white; border: 1.5px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-hover); min-width: 220px; z-index: 200;
  overflow: hidden; animation: modal-in 0.15s ease;
}
.board-switcher.open .board-dropdown { display: block; }
.board-dropdown-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; font-size: 13px; cursor: pointer;
  transition: background 0.1s; gap: 8px;
}
.board-dropdown-item:hover { background: var(--purple-light); }
.board-dropdown-item.active { font-weight: 700; color: var(--purple); background: var(--purple-light); }
.board-dropdown-item-info { flex: 1; min-width: 0; overflow: hidden; }
.board-dropdown-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-dropdown-item-desc { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.board-dropdown-item.active .board-dropdown-item-desc { color: var(--purple); opacity: 0.7; }
.board-dropdown-item-count { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.board-dropdown-footer {
  border-top: 1.5px solid var(--border); padding: 6px 8px;
  display: flex; gap: 4px;
}
.board-dropdown-footer button {
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; font-weight: 600;
  flex: 1; padding: 5px 8px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--border); background: white; color: var(--muted);
  transition: all 0.12s; white-space: nowrap;
}
.board-dropdown-footer button:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }

/* ── MANAGE BOARDS MODAL ────────────────────────────────────────── */
.manage-boards-modal {
  background: var(--cream); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(3,2,3,0.18);
  width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto;
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
  animation: modal-in 0.2s ease;
}
.manage-boards-modal h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; }
.manage-boards-list { display: flex; flex-direction: column; gap: 8px; }
.manage-board-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; background: white; transition: border-color 0.12s;
}
.manage-board-row.active-board { border-color: var(--purple); background: var(--purple-light); }
.manage-board-row-info { flex: 1; min-width: 0; overflow: hidden; }
.manage-board-row-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-board-row-desc { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.manage-board-row-count { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.manage-board-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.manage-board-btn { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; cursor: pointer; border: 1.5px solid var(--border); background: white; color: var(--muted); transition: all 0.12s; }
.manage-board-btn:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }
.manage-board-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.manage-board-new { display: flex; gap: 8px; margin-top: 4px; }
.manage-board-new input { font-family: 'DM Sans', sans-serif; font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 12px; outline: none; flex: 1; color: var(--ink); }
.manage-board-new input:focus { border-color: var(--purple); }
.manage-board-new button { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: 8px; background: var(--purple); color: white; border: none; cursor: pointer; white-space: nowrap; }
.manage-board-new button:hover { background: #621870; }

/* ── NEW BOARD MODAL ─────────────────────────────────────────────── */
.btn-create-board { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; padding: 10px; border-radius: 10px; background: var(--purple); color: white; border: none; cursor: pointer; width: 100%; margin-top: 4px; transition: background 0.12s; }
.btn-create-board:hover { background: #621870; }

/* ── DELETE COLUMN MODAL ────────────────────────────────────────── */
.delete-col-msg { font-size: 13px; color: var(--muted); line-height: 1.65; }
.delete-col-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-delete-col-cancel { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 10px; cursor: pointer; flex: 1; background: white; color: var(--muted); border: 1.5px solid var(--border); transition: background 0.12s; }
.btn-delete-col-cancel:hover { background: #f4f2fb; }
.btn-delete-col-confirm { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 10px; cursor: pointer; flex: 1; background: var(--red); color: white; border: none; transition: all 0.12s; }
.btn-delete-col-confirm:hover:not(:disabled) { background: #a02e22; }
.btn-delete-col-confirm:disabled { background: #e0b0ab; cursor: not-allowed; }

/* ── EXPORT MODAL ───────────────────────────────────────────────── */
.export-modal {
  background: var(--cream); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(3,2,3,0.18);
  width: 100%; max-width: 480px;
  padding: 28px 28px 24px;
  display: flex; flex-direction: column; gap: 10px;
  animation: modal-in 0.2s ease;
}
.export-modal-header { margin-bottom: 6px; }
.export-modal-header h2 { font-family: 'Playfair Display', serif; font-size: 1.35rem; margin-bottom: 6px; }
.export-modal-header p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.export-option {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: white;
  cursor: pointer; transition: all 0.14s;
}
.export-option:hover { border-color: var(--purple); background: var(--purple-light); }
.export-option:hover .export-option-arrow { color: var(--purple); transform: translateX(3px); }
.export-option-icon { font-size: 22px; flex-shrink: 0; width: 34px; text-align: center; }
.export-option-body { flex: 1; }
.export-option-title { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.export-option-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.export-option-arrow { font-size: 16px; color: var(--muted); transition: all 0.14s; flex-shrink: 0; }
.export-section-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.export-section-divider::before, .export-section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.export-section-divider span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.export-share-url-wrap { display: flex; gap: 8px; margin-top: 4px; }
.export-share-url-input {
  font-family: 'DM Sans', sans-serif; font-size: 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 10px; flex: 1; outline: none; color: var(--muted);
  background: #f8f6ff;
}
.btn-copy-url {
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700;
  padding: 7px 16px; border-radius: 8px;
  background: var(--purple); color: white; border: none; cursor: pointer;
  white-space: nowrap;
}
.btn-copy-url:hover { background: #621870; }

/* ── PRINT STYLES ───────────────────────────────────────────────── */
@media print {
  nav, .toolbar, .modal-backdrop, .auth-modal-backdrop,
  .export-modal-backdrop, #exportModalBackdrop, .card-move-btn,
  .btn-col-add, .btn-col-delete, .add-card-inline { display: none !important; }
  body { background: white !important; }
  .board-wrap { overflow: visible !important; padding: 0 !important; }
  .board { min-width: 0 !important; flex-wrap: wrap !important; gap: 12px !important; }
  .column { width: 220px !important; page-break-inside: avoid; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .list-view { padding: 0 !important; }
}

