/* ============================================================
   Modern Light CRM — v11
   Inspired by Notion/Linear/Asana. Clean, spacious, premium feel.
   ============================================================ */

*,
*::before,
*::after {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

:root {
  /* Accent — indigo to violet */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-2: #7c3aed;
  --accent-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --accent-grad-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);

  /* Surfaces */
  --bg: #f5f7fb;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-hover: #f1f5f9;

  /* Text */
  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;
  --text-on-accent: #ffffff;

  /* Borders */
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --border-soft: #f1f5f9;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 28px -6px rgba(15, 23, 42, .12), 0 4px 10px -2px rgba(15, 23, 42, .06);
  --shadow-xl: 0 24px 60px -12px rgba(15, 23, 42, .25), 0 8px 24px -8px rgba(15, 23, 42, .15);

  /* Priority colors */
  --p-high: #ef4444;
  --p-med: #f59e0b;
  --p-low: #10b981;

  /* Legacy aliases (used by inline classes in JS) */
  --trello-blue: #4f46e5;
  --trello-blue-hover: #4338ca;
  --trello-dark: #0f172a;
  --trello-gray: #64748b;
  --trello-gray-light: rgba(15, 23, 42, 0.05);
  --list-bg: #eef1f7;
  --list-bg-hover: #e2e8f0;
  --card-bg: #ffffff;
  --card-shadow: var(--shadow-sm);
  --modal-shadow: var(--shadow-xl);
}

/* ---------- Body ---------- */
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-1);
  background: var(--bg);
}
body.has-board-bg {
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
/* Light tint over board background so olive/custom image stays visible */
body.has-board-bg .board-bg {
  background: linear-gradient(180deg, rgba(15, 23, 42, .12) 0%, rgba(15, 23, 42, .22) 100%);
}
body.has-board-bg .board-header {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
/* Lists pop as frosted-glass panels on top of the board image */
body.has-board-bg .trello-list {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(255, 255, 255, .6);
  box-shadow: 0 10px 32px rgba(15, 23, 42, .22), 0 2px 6px rgba(15, 23, 42, .12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.has-board-bg .trello-list-count {
  background: rgba(15, 23, 42, .06);
  border-color: transparent;
}
body.has-board-bg .trello-add-list {
  background: rgba(255, 255, 255, .35);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.has-board-bg .trello-add-list:hover {
  background: rgba(255, 255, 255, .65);
  color: var(--accent);
  text-shadow: none;
}

.board-bg {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.board-header {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-1);
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.board-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
}
.board-title svg { color: var(--accent); }
.board-header-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.board-header-right { display: flex; align-items: center; gap: 10px; }

/* Header text overrides (was white, now dark) */
.board-header #headerUserName { color: var(--text-2) !important; font-weight: 500; }

/* Board switcher */
.board-switcher { position: relative; }
.board-switch-btn {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.board-switch-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}
.board-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 100;
  padding: 6px;
}
.board-dropdown.hidden { display: none !important; }
.board-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  border-radius: 6px;
  transition: background .12s;
}
.board-dropdown-item:hover { background: var(--surface-3); }
.board-dropdown-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.board-dropdown-item.add-board { color: var(--accent); font-weight: 600; }
.board-dropdown-actions {
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 4px;
}

/* Search */
.search-bar-wrap { position: relative; flex: 1; max-width: 360px; }
.search-input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-shadow: var(--shadow-xs);
}
.search-input::placeholder { color: var(--text-4); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 100;
}
.search-results.hidden { display: none !important; }
.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border-soft);
}
.search-result-item:hover { background: var(--surface-3); }
.search-result-item:last-child { border-bottom: none; }

/* Header buttons */
.board-actions { display: flex; gap: 8px; align-items: center; }
.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
  box-shadow: var(--shadow-xs);
}
.header-icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.header-icon-btn:active { transform: scale(0.96); }
.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #ef4444, #ec4899);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(239, 68, 68, .35);
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 460px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  z-index: 1100;
  overflow: hidden;
}
.notification-dropdown.hidden { display: none !important; }
.notification-dropdown-header {
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.notif-setup-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.notif-setup-btn:hover { background: var(--surface-3); color: var(--text-1); }
.notification-dropdown-list { max-height: 400px; overflow-y: auto; }
.notification-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
  font-size: 13px;
  transition: background .12s;
}
.notification-item:hover { background: var(--surface-2); }
.notification-item:last-child { border-bottom: none; }

/* Profile avatar */
.profile-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color .15s, transform .1s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.profile-avatar-btn:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.profile-avatar-btn:active { transform: scale(0.96); }
.user-avatar, .user-avatar-initial { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--accent-grad);
}

/* Header text-buttons (Trash/Add Member/Logout) — override JS inline styles */
.board-header .trello-sidebar-btn {
  margin: 0;
  width: auto;
  padding: 8px 14px;
  background: var(--surface) !important;
  color: var(--text-2) !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, color .15s;
}
.board-header .trello-sidebar-btn:hover {
  background: var(--surface-2) !important;
  border-color: var(--border-2);
  color: var(--text-1) !important;
}
.board-header #logoutBtn:hover {
  border-color: #fecaca;
  color: #dc2626 !important;
  background: #fef2f2 !important;
}

/* ============================================================
   LISTS (columns)
   ============================================================ */
.trello-lists {
  display: flex;
  flex: 1 1 auto;
  gap: 14px;
  padding: 20px;
  overflow-x: auto;
  overflow-y: visible;
  min-height: 320px;
  align-items: flex-start;
}
.trello-list {
  flex: 0 0 300px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.trello-list:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}
.trello-list-header {
  padding: 14px 12px 12px 16px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.trello-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex: 1;
}
.trello-list-count {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  border-radius: 11px;
  border: 1px solid var(--border);
}
.trello-list-delete {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.trello-list-delete:hover { background: #fef2f2; color: #dc2626; }
.trello-list-cards {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 6px;
  min-height: 1px;
}
.trello-add-card {
  padding: 10px 12px;
  margin: 0 4px 10px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s, color .12s;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed transparent;
}
.trello-add-card:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border-2);
}

/* ============================================================
   CARDS
   ============================================================ */
.trello-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .15s, transform .12s, border-color .15s;
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.trello-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--accent);
}
.trello-card-cover {
  background-size: cover !important;
  background-position: center !important;
}
.trello-card-label {
  height: 6px;
  border-radius: 3px;
  margin-bottom: 10px;
  width: 48px;
}
.trello-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.trello-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
  align-items: center;
  margin-top: 8px;
}
.trello-card-meta svg { flex-shrink: 0; opacity: .8; }
.trello-card-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.dragging { opacity: .9; transform: rotate(2deg) scale(1.02); box-shadow: var(--shadow-xl); }
.drop-zone {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  min-height: 48px;
}
.trello-member-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--surface);
  margin-left: -4px;
}

/* Scrollbars */
.trello-lists::-webkit-scrollbar,
.trello-list-cards::-webkit-scrollbar { height: 10px; width: 8px; }
.trello-lists::-webkit-scrollbar-track,
.trello-list-cards::-webkit-scrollbar-track { background: transparent; }
.trello-lists::-webkit-scrollbar-thumb,
.trello-list-cards::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 6px;
}
.trello-lists::-webkit-scrollbar-thumb:hover,
.trello-list-cards::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* Add list */
.trello-add-list {
  flex: 0 0 300px;
  background: rgba(255, 255, 255, .5);
  border: 1px dashed var(--border-2);
  border-radius: 14px;
  padding: 14px 12px;
  min-height: 48px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trello-add-list:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

/* Empty board state */
.empty-board-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 50vh;
  color: var(--text-2);
}
.empty-board-icon { font-size: 64px; margin-bottom: 12px; opacity: 0.7; }
.empty-board-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.empty-board-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-3);
  max-width: 480px;
  line-height: 1.55;
}
.empty-board-text strong { color: var(--accent); font-weight: 600; }
.empty-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.empty-board-switch {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .28);
  transition: filter .15s, transform .1s;
}
.empty-board-switch:hover { filter: brightness(1.06); }
.empty-board-switch:active { transform: translateY(1px); }
body.has-board-bg .empty-board-state { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
body.has-board-bg .empty-board-title,
body.has-board-bg .empty-board-text,
body.has-board-bg .empty-board-text strong { color: #fff; }

/* List drag */
.list-drag-handle { cursor: grab; user-select: none; }
.list-drag-handle:active { cursor: grabbing; }
.list-drag-grip {
  display: inline-block;
  color: var(--text-4);
  font-size: 14px;
  margin-right: 6px;
  letter-spacing: -2px;
  font-weight: 700;
  cursor: grab;
}
.list-drag-grip:active { cursor: grabbing; }
.trello-list.list-dragging { opacity: 0.45; }
.trello-list.list-drop-before { box-shadow: -4px 0 0 0 var(--accent); }
.trello-list.list-drop-after  { box-shadow:  4px 0 0 0 var(--accent); }

/* ============================================================
   CARD MODAL — NEW LAYOUT
   ============================================================ */
.card-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 60px;
  overflow-y: auto;
}
.card-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 1180px;
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Cover image */
.cmodal-cover {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-3);
  position: relative;
}
.cmodal-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.18) 100%);
}

/* Top action bar */
.cmodal-topbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 5;
}
.cmodal-iconbtn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .1s;
  box-shadow: var(--shadow-sm);
}
.cmodal-iconbtn:hover { background: #fff; color: var(--text-1); }
.cmodal-iconbtn:active { transform: scale(0.94); }

/* Title section */
.cmodal-titlewrap {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.cmodal-priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.cmodal-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.025em;
  line-height: 1.25;
  padding-right: 60px;
}
.cmodal-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 2px;
}
.cmodal-subtitle svg { color: var(--text-4); }
.cmodal-subtitle span { color: var(--text-2); font-weight: 600; }

/* Properties strip */
.cmodal-properties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 18px 32px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cprop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cprop-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cprop-value { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cprop-members { gap: 4px; }
.cprop-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  box-shadow: var(--shadow-xs);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cprop-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
.cprop-chip svg { flex-shrink: 0; color: var(--text-3); }
.cprop-chip:hover svg { color: var(--accent); }
.cprop-chip-select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Body grid: main + side (comments column wider) */
.cmodal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1.2fr);
  gap: 24px;
  padding: 28px 32px 32px;
  align-items: start;
}
.cmodal-main { min-width: 0; }
.cmodal-side {
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 18px 18px;
}
.cmodal-side .csection { margin-bottom: 20px; }
.cmodal-side .csection-comments {
  margin-bottom: 16px;
}

/* Section */
.csection { margin-bottom: 26px; }
.csection:last-child { margin-bottom: 0; }
.csection-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.csection-icon { color: var(--accent); flex-shrink: 0; }
.csection-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  flex: 1;
}
.csection-count {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.csection-action {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.csection-action:hover { background: var(--surface-3); color: var(--accent); }
.csection-chevron {
  color: var(--text-3);
  font-size: 14px;
  transition: transform .15s;
}
.csection-head-toggle { cursor: pointer; user-select: none; }
.csection-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--text-4);
  font-size: 13px;
  font-style: italic;
}
.csection-add-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 1px dashed var(--border-2);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  margin-top: 8px;
}
.csection-add-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.csection-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  margin-top: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.csection-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}

/* Description */
.card-desc-display {
  background: var(--surface-2);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  min-height: 42px;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
}
.card-desc-display:empty::before {
  content: 'Add a more detailed description...';
  color: var(--text-4);
  font-style: italic;
}
.card-desc-display p { margin: 0 0 8px; }
.card-desc-display p:last-child { margin-bottom: 0; }
.card-desc-display ul,
.card-desc-display ol { padding-left: 22px; margin: 0 0 8px; }
.card-desc-display h1,
.card-desc-display h2,
.card-desc-display h3 {
  font-weight: 700;
  color: var(--text-1);
  margin: 8px 0 4px;
  letter-spacing: -0.01em;
}
.card-desc-display h1 { font-size: 18px; }
.card-desc-display h2 { font-size: 16px; }
.card-desc-display h3 { font-size: 14px; }
.card-desc-display a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}
.card-desc-display blockquote {
  border-left: 3px solid var(--accent);
  padding: 6px 12px;
  color: var(--text-2);
  margin: 8px 0;
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}
.card-desc-display pre,
.card-desc-display code {
  background: var(--surface-3);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-1);
}
.card-desc-display pre { padding: 12px; white-space: pre-wrap; }
.card-desc-display img { max-width: 100%; border-radius: 8px; }
#cardDescEditor { background: var(--surface); min-height: 160px; }
.ql-editor { min-height: 160px; font-size: 14px; }
.ql-toolbar.ql-snow,
.ql-container.ql-snow { border-color: var(--border); }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; background: var(--surface-2); }
.ql-container.ql-snow { border-radius: 0 0 8px 8px; }

/* Attachments grid */
.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: none;
}
.attachments-scroll { max-height: 400px; overflow-y: auto; padding-right: 2px; }
.attachments-scroll::-webkit-scrollbar { width: 8px; }
.attachments-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.attachment-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.attachment-block:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.attachment-block .flex-shrink-0 { display: block; width: 100%; }
.attachment-block img,
.attach-thumb {
  width: 100% !important;
  height: 90px !important;
  max-width: 100% !important;
  max-height: 90px !important;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-3);
}
.attachment-block .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attachment-block .name {
  font-weight: 600;
  color: var(--text-1);
  font-size: 12px;
  text-decoration: none;
}
.attachment-block .name:hover { color: var(--accent); }
.attachment-block .remove {
  color: var(--text-4);
  font-size: 11px;
  cursor: pointer;
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
}
.attachment-block .remove:hover { color: #ef4444; text-decoration: underline; }

/* Checklist */
.checklist-progress {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 3px;
  transition: width .25s ease;
}
.checklist-items { display: flex; flex-direction: column; gap: 4px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.checklist-item:hover { background: var(--surface-2); }
.checklist-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  cursor: pointer;
  accent-color: var(--accent);
}
.checklist-text {
  font-size: 14px;
  color: var(--text-1);
  flex: 1;
  transition: color .15s, text-decoration .15s;
}
.checklist-text.done {
  color: var(--text-4);
  text-decoration: line-through;
}

/* Comments */
.csection-comments .comment-bar { margin-bottom: 12px; position: relative; }
.comment-bar {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: visible;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
  position: relative;
}
.comment-bar textarea { border-radius: 12px 12px 0 0; }
.comment-bar-actions { border-radius: 0 0 11px 11px; }
.comment-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.comment-bar textarea {
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 14px;
  color: var(--text-1);
  background: transparent;
  font-family: inherit;
}
.comment-bar textarea::placeholder { color: var(--text-4); }
.comment-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 10px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  gap: 8px;
}
.comment-attach-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.comment-attach-label:hover { background: var(--surface-3); color: var(--accent); }
.comment-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.comment-attach-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--accent-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.comment-attach-inline:hover { background: #ddd6fe; }
.comment-attach-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.comment-attach-media {
  margin-top: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.comment-attach-media audio { display: block; }

.comments-scroll {
  max-height: min(62vh, 560px);
  min-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-desc-display {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.card-desc-display::-webkit-scrollbar,
.comments-scroll::-webkit-scrollbar { width: 6px; }
.card-desc-display::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.comments-scroll::-webkit-scrollbar { width: 6px; }
.comments-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex: 1; min-width: 0; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.comment-name { font-weight: 600; color: var(--text-1); font-size: 13px; }
.comment-date { font-size: 11px; color: var(--text-4); }
.comment-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.comment-actions button {
  font-size: 11px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.edit-comment-btn { color: var(--accent); }
.edit-comment-btn:hover { background: var(--accent-soft); }
.delete-comment-btn { color: #ef4444; }
.delete-comment-btn:hover { background: #fef2f2; }
.comment-text {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.55;
}

/* Activity */
.notification-activity-bar {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 10px;
}
.activity-item {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid var(--border-soft);
}
.activity-user { color: var(--accent); font-weight: 600; flex-shrink: 0; }
.activity-text { color: var(--text-2); flex: 1; }
.activity-date { color: var(--text-4); font-size: 11px; flex-shrink: 0; }

/* Delete card button */
.btn-delete-card {
  width: 100%;
  padding: 10px 14px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, border-color .15s;
}
.btn-delete-card:hover { background: #fee2e2; border-color: #fca5a5; }

/* ============================================================
   MEMBERS / DROPDOWNS
   ============================================================ */
.member-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-xs);
}
.member-chip-img { width: 100%; height: 100%; object-fit: cover; }
.member-chip-initial { background: var(--accent-grad); color: #fff; }
.add-member-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.add-member-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.member-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.member-dropdown.hidden { display: none !important; }
.member-role-select { background: #fff; cursor: pointer; }
.member-role-select:hover { background: var(--surface-3); }
.member-name-input {
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.member-name-input:hover { border-color: #c7d2fe; }
.member-name-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .12);
}
.member-name-input:disabled { opacity: .7; cursor: wait; }

/* @mention */
.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  min-width: 240px;
  max-width: 320px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.mention-dropdown.hidden { display: none !important; }
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-1);
  text-align: left;
  border-radius: 6px;
}
.mention-item:hover,
.mention-item.focused { background: var(--accent-soft); color: var(--accent); }
.mention-avatar,
.mention-initial { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.mention-avatar { object-fit: cover; }
.mention-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.mention-tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 6px;
  font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .28);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 16px rgba(79, 70, 229, .38);
}
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: filter .15s;
}
.btn-danger:hover { filter: brightness(1.06); }

/* Legacy modal styles (still referenced by JS for other modals) */
.trello-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 0 80px;
  overflow-y: auto;
}
.trello-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 768px;
  max-width: 96vw;
  min-height: 400px;
  position: relative;
  border: 1px solid var(--border);
}
.trello-modal-wide { width: 960px; }
.trello-modal-header { padding: 16px 48px 14px 20px; position: relative; }
.trello-modal-close,
.copy-card-link {
  position: absolute;
  top: 10px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .12s, color .12s;
}
.trello-modal-close { right: 10px; }
.copy-card-link { right: 50px; font-size: 16px; }
.trello-modal-close:hover,
.copy-card-link:hover { background: var(--surface-3); color: var(--text-1); }
.trello-modal-title { font-size: 20px; font-weight: 700; color: var(--text-1); }
.trello-modal-sublabel { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.trello-modal-body { display: flex; gap: 20px; padding: 20px; }
.trello-modal-main { flex: 1; min-width: 0; }
.trello-modal-sidebar { width: 184px; flex-shrink: 0; }

.trello-section { margin-bottom: 24px; }
.trello-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.trello-section-content { font-size: 14px; color: var(--text-1); }
.trello-desc {
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.trello-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: background .12s, border-color .12s;
}
.trello-sidebar-btn:hover { background: var(--surface-3); border-color: var(--border-2); }

.trello-member-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: var(--shadow-xs);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Add to card chips (legacy, kept for compatibility) */
.add-to-card-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.add-to-card-chip {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.add-to-card-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
.add-to-card-chip[type="button"],
.add-to-card-chip select { appearance: none; }
select.add-to-card-chip {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 360px;
}
.toast-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.toast-info { background: var(--accent-grad); color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40%) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.confirm-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: 28px;
  border: 1px solid var(--border);
}
.confirm-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; }
.confirm-message { margin: 0 0 22px; font-size: 14px; color: var(--text-2); line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-actions button {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: filter .15s, transform .1s;
}
.confirm-actions button:active { transform: translateY(1px); }
.confirm-cancel { background: var(--surface-3); color: var(--text-1); }
.confirm-cancel:hover { background: var(--border); }
.confirm-ok { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .28); }
.confirm-ok:hover { filter: brightness(1.06); }
.confirm-ok.danger { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 12px rgba(239, 68, 68, .35); }
.confirm-ok.danger:hover { filter: brightness(1.06); }
.board-pwd-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
  outline: none;
}
.board-pwd-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .14); }
.board-pwd-err { color: #dc2626; font-size: 13px; margin: 0 0 12px; }
.board-pwd-err.hidden { display: none; }

/* ============================================================
   TRASH MODAL
   ============================================================ */
.trash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}
.trash-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}
.trash-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 16px 16px 0 0;
}
.trash-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.trash-count {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
}
.trash-modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.trash-modal-close:hover { background: var(--surface-3); color: var(--text-1); }
.trash-modal-body { padding: 16px 24px 22px; overflow-y: auto; }
.trash-note {
  font-size: 12px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.trash-empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 36px 0; }
.trash-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s;
}
.trash-item:hover { border-color: var(--border-2); }
.trash-item-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.trash-item-info { flex: 1; min-width: 0; padding-left: 6px; }
.trash-item-title { font-size: 14px; font-weight: 600; color: var(--text-1); word-break: break-word; }
.trash-item-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.trash-item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.trash-item-actions button {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter .15s;
}
.trash-restore { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.trash-restore:hover { filter: brightness(1.08); }
.trash-restore:disabled { opacity: .5; cursor: wait; }
.trash-purge { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.trash-purge:hover { filter: brightness(1.08); }
.trash-purge:disabled { opacity: .5; cursor: wait; }
@media (max-width: 480px) {
  .trash-item { flex-direction: column; align-items: stretch; }
  .trash-item-actions { flex-direction: row; }
}

/* ============================================================
   WELCOME / LOGIN CELEBRATION
   ============================================================ */
#loginWrap.fade-out {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79, 70, 229, 0.35), rgba(15, 23, 42, 0.92));
  opacity: 0;
  transition: opacity 0.35s ease;
}
.welcome-overlay.hidden { display: none; }
.welcome-overlay.welcome-visible,
.welcome-overlay:not(.hidden) {
  display: flex;
  opacity: 1;
}
.welcome-overlay-board { z-index: 15000; }
.welcome-overlay.welcome-fade-out {
  opacity: 0;
  transition: opacity 0.55s ease;
}

.welcome-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
.confetti-square { width: 10px; height: 10px; border-radius: 2px; }
.confetti-rect { width: 8px; height: 14px; border-radius: 2px; }
.confetti-circle { width: 10px; height: 10px; border-radius: 50%; }

@keyframes confetti-fall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) translateX(var(--drift, 0)) rotate(var(--rot, 180deg)); opacity: 0.3; }
}

.welcome-card {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 48px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  max-width: 420px;
  width: calc(100% - 32px);
}
.welcome-card-animate {
  animation: welcome-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes welcome-pop {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.welcome-check {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}
.welcome-check-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.welcome-check-ring circle {
  fill: none;
  stroke: #10b981;
  stroke-width: 4;
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  animation: welcome-ring 0.7s ease forwards 0.15s;
}
@keyframes welcome-ring {
  to { stroke-dashoffset: 0; }
}
.welcome-check-tick {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 36px;
  height: 36px;
  color: #10b981;
  opacity: 0;
  transform: scale(0.5);
  animation: welcome-tick 0.4s ease forwards 0.55s;
}
@keyframes welcome-tick {
  to { opacity: 1; transform: scale(1); }
}

.welcome-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}
.welcome-title span { color: #4f46e5; }
.welcome-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 0 16px;
}
.welcome-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.welcome-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f46e5;
  animation: welcome-dot 1.2s ease-in-out infinite;
}
.welcome-dots span:nth-child(2) { animation-delay: 0.15s; }
.welcome-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes welcome-dot {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.trash-modal-wide { max-width: 560px; }
.trash-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3, #64748b);
  margin: 12px 0 8px;
}
.trash-section-label:first-child { margin-top: 0; }

/* ============================================================
   LOGIN PAGE (premium split layout + background image)
   ============================================================ */
body.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  color: #0f172a;
  overflow-x: hidden;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.login-bg-image {
  position: absolute;
  inset: 0;
  background-color: #0f172a;
  background-image: url('../assets/login-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  animation: login-bg-zoom 24s ease-in-out infinite alternate;
}

@keyframes login-bg-zoom {
  from { transform: scale(1.04); }
  to { transform: scale(1.1); }
}

.login-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 27, 75, 0.78) 42%, rgba(0, 82, 204, 0.55) 100%);
}

.login-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}
.login-bg-glow-1 {
  width: 420px;
  height: 420px;
  background: #6366f1;
  top: -120px;
  right: 10%;
  animation: login-glow-drift 12s ease-in-out infinite alternate;
}
.login-bg-glow-2 {
  width: 360px;
  height: 360px;
  background: #0ea5e9;
  bottom: -80px;
  left: 5%;
  animation: login-glow-drift 14s ease-in-out infinite alternate-reverse;
}

@keyframes login-glow-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(30px, -20px); }
}

.login-layout {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 1320px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px clamp(24px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: center;
  padding: 0;
  color: #fff;
  width: 100%;
}

.login-brand-inner {
  max-width: 440px;
  width: 100%;
  animation: login-fade-up 0.7s ease both;
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.45);
  margin-bottom: 28px;
}

.login-brand-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 16px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.login-brand-tagline {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 32px;
  max-width: 380px;
}

.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.login-feature-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #a5f3fc;
}

.login-brand-footer {
  position: fixed;
  left: clamp(24px, 5vw, 72px);
  bottom: 28px;
  z-index: 2;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  animation: login-fade-up 0.7s ease 0.15s both;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 100%;
  padding: 0;
}

.login-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 36px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: login-fade-up 0.65s ease 0.1s both;
}

.login-card-header {
  margin-bottom: 28px;
}

.login-card-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: #0f172a;
}

.login-card-header p {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.login-input-wrap input {
  width: 100%;
  padding: 14px 44px 14px 44px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input-wrap input::placeholder {
  color: #94a3b8;
}

.login-input-wrap input:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.login-input-wrap input:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.login-toggle-pwd {
  position: absolute;
  right: 10px;
  padding: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.login-toggle-pwd:hover {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
}

.login-submit {
  margin-top: 4px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #0052cc 100%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
  filter: brightness(1.05);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-submit-arrow {
  transition: transform 0.2s;
}

.login-submit:hover:not(:disabled) .login-submit-arrow {
  transform: translateX(3px);
}

.login-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-error.hidden { display: none; }

@keyframes login-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 32px 24px 48px;
    gap: 28px;
    min-height: 100vh;
    justify-content: center;
  }
  .login-brand {
    align-self: auto;
    text-align: center;
    align-items: center;
  }
  .login-brand-inner {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .login-brand-title,
  .login-brand-tagline {
    text-align: center;
  }
  .login-brand-footer {
    position: static;
    display: block;
    margin-top: 24px;
    text-align: center;
    width: 100%;
  }
  .login-features { display: none; }
  .login-brand-tagline {
    margin-bottom: 0;
    font-size: 0.95rem;
  }
  .login-brand-title { font-size: 1.75rem; }
  .login-main {
    align-self: auto;
    width: 100%;
  }
  .login-card {
    max-width: 100%;
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .login-layout { padding: 24px 18px 36px; }
  .login-logo { width: 48px; height: 48px; margin-bottom: 16px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .cmodal-body { grid-template-columns: 1fr; gap: 20px; padding: 22px 22px 26px; }
  .cmodal-titlewrap { padding: 22px 22px 18px; }
  .cmodal-properties { padding: 16px 22px; }
  .cmodal-title { font-size: 22px; padding-right: 50px; }
}
@media (max-width: 768px) {
  .board-header {
    padding: 10px 12px;
    gap: 10px;
    align-items: stretch;
  }
  .board-header-left {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .board-header-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .board-header #headerUserName {
    display: none;
  }
  .board-actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 6px;
  }
  .board-actions::-webkit-scrollbar { display: none; }
  .board-header .trello-sidebar-btn,
  .board-header .task-portal-header-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 11px !important;
    font-size: 12px !important;
  }
  .search-bar-wrap {
    max-width: none;
    width: 100%;
    flex-basis: auto;
    order: unset;
  }
  .board-switch-btn {
    width: 100%;
    justify-content: space-between;
  }
  .board-title { font-size: 15px; }
  .trello-lists {
    padding: 12px;
    gap: 10px;
    min-height: 280px;
  }
  .trello-list {
    flex: 0 0 min(88vw, 300px);
    max-height: calc(100dvh - 220px);
  }
  .tp-header-pill { display: none; }
}

@media (max-width: 640px) {
  .board-filters { flex-basis: 100%; overflow-x: auto; }
  .trello-list { flex: 0 0 min(92vw, 280px); }
  .cmodal-properties { grid-template-columns: 1fr 1fr; }
  .cmodal-cover { height: 140px; }
  .cmodal-title { font-size: 20px; }
  .header-icon-btn,
  .profile-avatar-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .board-header-right > .flex.items-center {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .board-header { padding: 8px 10px; }
  .board-title span { font-size: 14px; }
  .cmodal-properties { grid-template-columns: 1fr; }
  .cmodal-body { padding: 16px; }
}

/* Board filters */
.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.board-filter-chip {
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .75);
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.board-filter-chip:hover { background: #fff; border-color: rgba(0, 82, 204, .35); }
.board-filter-chip.active {
  background: #0052cc;
  border-color: #0052cc;
  color: #fff;
}
.board-filter-count {
  opacity: .85;
  font-weight: 500;
}
.shortcuts-help-btn {
  font-weight: 700;
  font-size: 14px;
  min-width: 32px;
}

/* Due date highlights on cards */
.trello-card.due-overdue { box-shadow: inset 0 0 0 2px rgba(235, 90, 70, .45); }
.trello-card.due-today { box-shadow: inset 0 0 0 2px rgba(242, 214, 0, .55); }
.trello-card.due-soon { box-shadow: inset 0 0 0 2px rgba(97, 189, 79, .35); }
.trello-due-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.due-badge-overdue { background: #eb5a46; color: #fff; }
.due-badge-today { background: #f2d600; color: #172b4d; }
.due-badge-soon { background: #e4f7e8; color: #216e4e; }
.due-badge-normal { color: inherit; }

.btn-duplicate-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #dfe1e6;
  background: #f4f5f7;
  color: #172b4d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-duplicate-card:hover { background: #ebecf0; }
.btn-duplicate-card:disabled { opacity: .6; cursor: wait; }

/* Keyboard shortcuts modal */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.shortcuts-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
  max-width: 360px;
  width: 100%;
  padding: 20px 22px;
}
.shortcuts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.shortcuts-modal-header h3 { font-size: 18px; font-weight: 700; color: #172b4d; margin: 0; }
.shortcuts-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}
.shortcuts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shortcuts-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.shortcuts-list li:last-child { border-bottom: none; }
.shortcuts-list kbd {
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

/* ============================================================
   TASK PORTAL (time tracking)
   ============================================================ */
body.task-portal-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}
body.task-portal-page.has-board-bg .board-bg {
  background: #f1f5f9;
}

.tp-app {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
.tp-loading, .tp-error { padding: 48px; text-align: center; color: #64748b; }

.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.tp-header-left { display: flex; align-items: center; gap: 16px; }
.tp-back {
  color: #4f46e5;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.tp-back:hover { text-decoration: underline; }
.tp-title { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.tp-header-right { display: flex; align-items: center; gap: 12px; }
.tp-user-pill {
  font-size: 13px;
  color: #64748b;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 999px;
}
.tp-btn-ghost {
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.tp-btn-ghost:hover { background: #f8fafc; }

.task-portal-header-btn {
  background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600 !important;
}
.task-portal-header-btn:hover {
  filter: brightness(1.08);
  color: #fff !important;
}
.task-portal-header-btn.tp-header-active {
  cursor: default;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.35);
}

.tp-header-pill {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px solid #c7d2fe;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.tp-page-body { flex: 1; overflow: auto; padding-bottom: 40px; }

.tp-page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 32px;
  box-sizing: border-box;
}
.tp-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 24px;
  align-items: start;
}
.tp-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
.tp-panel .tp-panel-title { margin: 0 0 6px; }
.tp-panel .tp-panel-sub { margin: 0 0 20px; }

/* Team live — slim bar above grid */
.tp-team-live-bar {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.tp-team-live-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tp-team-live-label {
  font-size: 13px;
  font-weight: 800;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tp-team-live-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.tp-live-none {
  font-size: 13px;
  color: #94a3b8;
}
.tp-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 12px;
  max-width: 100%;
}
.tp-live-chip.is-self {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.tp-live-chip strong { color: #0f172a; font-weight: 700; }
.tp-live-chip-task {
  color: #64748b;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-live-chip .tp-live-elapsed {
  font-weight: 800;
  color: #4f46e5;
}

/* Report date filters + calendar */
.tp-report-filters { margin-bottom: 20px; }
.tp-date-pick {
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.tp-date-pick-hint {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tp-cal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.tp-cal-field {
  flex: 1 1 160px;
  min-width: 0;
}
.tp-cal-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.tp-cal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  min-height: 44px;
}
.tp-cal-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.tp-range-block {
  margin-bottom: 14px;
}
.tp-range-block-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tp-range-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.tp-range-sep {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  padding-bottom: 12px;
  flex-shrink: 0;
}
.tp-range-example {
  margin: 8px 0 0;
  font-size: 12px;
  color: #94a3b8;
}
.tp-cal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tp-cal-divider::before,
.tp-cal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.tp-cal-or {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  padding-bottom: 12px;
  flex-shrink: 0;
}
.tp-cal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tp-date-show-btn,
.tp-date-reset-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: none;
}
.tp-date-show-btn {
  background: #4f46e5;
  color: #fff;
}
.tp-date-show-btn:hover { filter: brightness(1.05); }
.tp-date-reset-btn {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.tp-range-label {
  margin: 12px 0 0;
  font-size: 13px;
  color: #64748b;
}
.tp-range-label strong { color: #4f46e5; }

@media (max-width: 560px) {
  .tp-cal-row { flex-direction: column; align-items: stretch; }
  .tp-cal-or { padding: 0; text-align: center; }
}

.tp-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* Admin live strip */
.tp-live-strip {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}
.tp-live-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tp-live-strip-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tp-live-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: tp-live-dot 1.5s ease infinite;
}
@keyframes tp-live-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.tp-live-strip-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tp-live-strip-body .tp-live-empty {
  margin: 0;
  padding: 8px 0 0;
  font-size: 13px;
  color: #94a3b8;
  text-align: left;
}
.tp-live-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tp-live-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}
.tp-live-card.is-self {
  background: linear-gradient(90deg, #eef2ff, #f8fafc);
  border-color: #c7d2fe;
}
.tp-live-card-body {
  flex: 1;
  min-width: 0;
}
.tp-live-card-body strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
}
.tp-live-card-body span {
  display: block;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-live-card .tp-live-elapsed {
  font-size: 13px;
  font-weight: 800;
  color: #4f46e5;
  flex-shrink: 0;
}

/* Tracker — centered card */
.tp-tracker-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 28px 28px 32px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 48px rgba(15, 23, 42, 0.08);
}
.tp-tracker-head {
  text-align: center;
  margin-bottom: 24px;
}
.tp-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}
.tp-page-lead {
  margin: 6px 0 0;
  font-size: 14px;
  color: #64748b;
}
.tp-timer-zone {
  margin-top: 8px;
}
.tp-task-picker { margin-bottom: 20px; }
.tp-timer-ring {
  position: relative;
  overflow: hidden;
  margin: 0 0 20px;
  padding: 36px 16px 32px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: center;
}
.tp-timer-pulse {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 40%, rgba(99, 102, 241, 0.12), transparent 65%);
}
.tp-timer-ring.is-running .tp-timer-pulse { opacity: 1; }
.tp-timer-ring.is-running {
  border-color: #818cf8;
  background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 100%);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
  animation: none;
}
.tp-timer-display {
  font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #0f172a;
  line-height: 1;
}
.tp-timer-ring.is-running .tp-timer-display { color: #4f46e5; }
.tp-timer-task {
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
  padding: 0 12px;
  word-break: break-word;
}
.tp-timer-actions { max-width: 320px; margin: 0 auto; }
.tp-btn-start, .tp-btn-stop {
  width: 100%;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tp-btn-start {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}
.tp-btn-start:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4); }
.tp-btn-stop {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}
.tp-btn-stop:hover { transform: translateY(-1px); }
.tp-hint-live {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: #4f46e5;
  font-weight: 600;
}

/* Reports — full width below tracker */
.tp-reports-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 24px 24px 28px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}
.tp-section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tp-section-lead {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.tp-stats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tp-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.tp-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.tp-stat-card-primary {
  background: linear-gradient(145deg, #eef2ff, #fff);
  border-color: #c7d2fe;
}
.tp-stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #4f46e5;
  line-height: 1.2;
}
.tp-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.tp-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 0 0 12px;
}
.tp-period-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}
.tp-period-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}
.tp-period-btn.active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.tp-team-live-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tp-live-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.tp-live-filter input { accent-color: #4f46e5; }
.tp-live-count {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 6px 12px;
  border-radius: 999px;
}
.tp-team-live-list {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.tp-live-empty {
  margin: 0;
  padding: 24px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}
.tp-live-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 2fr auto;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.tp-live-row:last-child { border-bottom: none; }
.tp-live-row.is-self { background: linear-gradient(90deg, rgba(238, 242, 255, 0.9), transparent); }
.tp-live-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tp-live-user strong { font-size: 14px; display: block; }
.tp-live-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tp-live-you {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4f46e5;
  background: #eef2ff;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}
.tp-live-task { min-width: 0; }
.tp-live-task-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-live-board {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.tp-live-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tp-live-pulse {
  color: #10b981;
  font-size: 10px;
  animation: tp-live-blink 1.2s ease-in-out infinite;
}
@keyframes tp-live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.tp-live-elapsed {
  font-size: 14px;
  font-weight: 800;
  color: #4f46e5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tp-panel-premium {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.02),
    0 20px 48px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tp-search-section,
.tp-search-hint-item {
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-soft, #e2e8f0);
}
.tp-search-hint-item {
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
}
.tp-search-hit {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1, #0f172a);
  line-height: 1.4;
}
.tp-search-hit .tp-search-hit-list {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}

.tp-picker-search-wrap {
  position: relative;
  margin-top: 6px;
}
.tp-picker-search-wrap .tp-picker-input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tp-picker-search-wrap .tp-picker-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  outline: none;
}
.tp-picker-search-wrap .tp-task-picker-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
}
.tp-picker-search-wrap .tp-task-picker-dropdown.hidden {
  display: none !important;
}

.tp-select-hint {
  margin: 12px 0 0;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
}
.tp-select-hint.hidden { display: none !important; }
.tp-task-picker.tp-shake { animation: tp-shake 0.45s ease; }
@keyframes tp-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.tp-change-task {
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.tp-change-task:hover { background: #eef2ff; }
.tp-inline-accent { color: #4f46e5; font-weight: 600; }
.tp-selected-time {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4f46e5;
}
.tp-selected-chip-live { border-color: #4f46e5; background: linear-gradient(135deg, #eef2ff, #faf5ff); }

.tp-panel-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.tp-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tp-panel-hero .tp-panel-title { margin: 0 0 4px; }
.tp-panel-hero .tp-panel-sub { margin: 0; }

.tp-task-picker { position: relative; margin-bottom: 8px; }
.tp-task-picker.is-locked { opacity: 0.92; pointer-events: none; }
.tp-picker-search-row { margin-bottom: 10px; }
.tp-picker-search { position: relative; max-width: none; }
.tp-picker-search .search-input,
.tp-picker-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.tp-picker-search .search-input:focus,
.tp-picker-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
}
.tp-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.tp-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.tp-search-clear:hover { background: #cbd5e1; }

.tp-task-picker-dropdown {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tp-task-picker-dropdown.collapsed { display: none; }
.tp-picker-dropdown-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tp-picker-results {
  overflow-y: auto;
  max-height: 240px;
  padding: 6px;
}
.tp-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}
.tp-picker-item:hover { background: #f1f5f9; }
.tp-picker-item.active { background: #eef2ff; }
.tp-picker-item-main { min-width: 0; flex: 1; }
.tp-picker-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-picker-list-name {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}
.tp-picker-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.tp-time-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}
.tp-time-badge.has-time {
  background: #eef2ff;
  color: #4f46e5;
}
.tp-session-badge {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}
.tp-picker-empty {
  padding: 20px 14px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}
.tp-selected-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.tp-selected-chip-live {
  border-color: #818cf8;
  background: #eef2ff;
}
.tp-selected-chip-body { flex: 1; min-width: 0; }
.tp-selected-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
  margin-bottom: 4px;
}
.tp-selected-chip strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-selected-sub {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.tp-selected-clear {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.8);
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.tp-selected-clear:hover { background: #fff; color: #0f172a; }
.tp-picker-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

.tp-timer-ring { position: relative; overflow: hidden; }
.tp-timer-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.08), transparent 70%);
}
.tp-timer-ring.is-running .tp-timer-pulse {
  animation: tp-pulse 2.5s ease-in-out infinite;
  opacity: 1;
}
@keyframes tp-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.02); opacity: 1; }
}

.tp-stat-card-primary {
  background: linear-gradient(145deg, #eef2ff, #fff);
  border-color: #c7d2fe;
}
.tp-stat-card-primary .tp-stat-value { font-size: 1.5rem; }

.tp-jump-task {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tp-jump-task:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1);
}

.tp-label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.tp-input, .tp-select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
  background: #f8fafc;
}
.tp-input:focus, .tp-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
}
.tp-filter-row { margin-bottom: 20px; }
.tp-btn-icon { font-size: 14px; }
.tp-hint { font-size: 12px; color: #64748b; margin-top: 12px; text-align: center; }

.tp-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 0 0 12px;
}
.tp-muted { font-weight: 500; color: #94a3b8; }
.tp-table-wrap { overflow-x: auto; margin-bottom: 24px; }
.tp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tp-table th, .tp-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.tp-table th { color: #64748b; font-weight: 700; font-size: 11px; text-transform: uppercase; }

.tp-task-stats { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; max-height: 280px; overflow-y: auto; }
.tp-task-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}
.tp-task-stat-info strong { display: block; font-size: 14px; }
.tp-task-stat-info span { font-size: 12px; color: #64748b; }
.tp-task-stat-time { font-weight: 800; color: #4f46e5; white-space: nowrap; }

.tp-sessions { max-height: 320px; overflow-y: auto; }
.tp-session-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.tp-session-row strong { display: block; }
.tp-session-user { display: block; font-size: 12px; color: #4f46e5; }
.tp-session-date { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }
.tp-session-dur { font-weight: 700; color: #0f172a; white-space: nowrap; }
.tp-empty { color: #94a3b8; font-size: 14px; padding: 16px 0; }

.tp-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tp-toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  animation: tp-toast-in 0.3s ease;
}
.tp-toast-success { background: #10b981; color: #fff; }
.tp-toast-error { background: #ef4444; color: #fff; }
@keyframes tp-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE — Board + Task Portal (consolidated)
   ============================================================ */
@media (max-width: 960px) {
  .tp-page-wrap { padding: 16px 16px 24px; }
  .tp-grid { grid-template-columns: 1fr; gap: 16px; }
  .tp-panel { padding: 20px 18px; }
  .tp-shell { padding: 16px 16px 0; gap: 16px; }
  .tp-tracker-card { padding: 22px 18px 26px; }
  .tp-reports-card { padding: 20px 18px 24px; }
  .tp-stats-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .tp-period-tabs { width: 100%; }
  .tp-period-btn { flex: 1; text-align: center; }
  .tp-stat-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .tp-stat-card { padding: 12px 8px; }
  .tp-stat-value { font-size: 1.1rem; }
  .tp-table-wrap { margin: 0 -4px; }
  .tp-session-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .tp-task-stat-row { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .tp-page-wrap { padding: 12px 12px 20px; }
  .tp-shell { padding: 12px 12px 0; }
  .tp-tracker-card { border-radius: 20px; padding: 20px 16px 24px; }
  .tp-page-title { font-size: 1.3rem; }
  .tp-timer-display { font-size: 2.75rem; }
  .tp-cal-input { font-size: 16px; }
  .tp-live-chip-task { max-width: 120px; }
  .tp-picker-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .member-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .member-row > .flex.items-center.gap-1 {
    flex-wrap: wrap;
    width: 100%;
  }
  #userModal .flex.gap-4.mb-4 {
    flex-direction: column !important;
  }
  #userModal .max-w-2xl {
    max-width: calc(100vw - 24px) !important;
    margin: 12px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
  #addListModal .max-w-sm,
  #profileModal .max-w-md {
    max-width: calc(100vw - 24px) !important;
  }
}

@media (max-width: 480px) {
  .tp-stat-cards { grid-template-columns: 1fr; }
  .tp-stat-card-primary .tp-stat-value { font-size: 1.35rem; }
  .tp-btn-start, .tp-btn-stop {
    padding: 14px 16px;
    font-size: 15px;
  }
  .tp-toast-wrap {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .tp-toast { text-align: center; }
  .tp-live-count { font-size: 11px; padding: 5px 10px; }
  .board-actions .trello-sidebar-btn {
    padding: 7px 9px !important;
    font-size: 11px !important;
  }
  .task-portal-header-btn { font-size: 11px !important; }
}

@media (max-width: 380px) {
  .board-title svg { width: 16px; height: 16px; }
  .tp-period-btn { font-size: 11px; padding: 8px 6px; }
}
