/* ============ RESET & BASE ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root { 
  --trello-blue: #0079bf;
  --trello-blue-dark: #0067a3;
  --trello-green: #5aac44;
  --trello-green-dark: #519839;
  --text-dark: #172b4d;
  --text-gray: #5e6c84;
  --bg-light: #ffffff;
  --bg-hover: rgba(9, 30, 66, 0.08);
  --board-bg: #0079bf;
  --list-bg: #ebecf0;
  --border-radius: 3px;
  --shadow-1: 0 1px 0 rgba(9, 30, 66, 0.25);
  --shadow-2: 0 1px 6px rgba(9, 30, 66, 0.2);
  --shadow-3: 0 8px 16px -4px rgba(9, 30, 66, 0.25);
  --danger: #eb5a46;
  --danger-hover: #cf513d;
}
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text-dark);
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
input, textarea {
  font-family: inherit;
  font-size: inherit;
}
.hidden {
  display: none !important;
}

/* ============ HEADER ============ */
.app-header {
  height: 44px;
  background: var(--trello-blue-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 12px;
}
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 4px;
  color: #fff;
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
  transition: background 0.15s ease, width 0.2s ease;
}
.search-input::placeholder {
  color: rgba(255, 255, 255, 0.85);
}
.search-input:focus {
  background: #fff;
  color: var(--text-dark);
}
.search-input:focus::placeholder {
  color: var(--text-gray);
}
.search-results {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  max-height: 400px;
  overflow-y: auto;
  z-index: 300;
  padding: 6px;
}
.search-results-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-gray);
  padding: 6px 8px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dark);
}
.search-result-item:hover {
  background: var(--bg-hover);
}
.search-result-item .sri-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  font-size: 13px;
}
.search-result-item .sri-info {
  min-width: 0;
  flex: 1;
}
.search-result-item .sri-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-item .sri-sub {
  font-size: 11px;
  color: var(--text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-results-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-gray);
  font-size: 13px;
}
.search-highlight {
  background: #fff3cd;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 1px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-btn {
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.15);
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius);
}
.logo:hover {
  background: rgba(255, 255, 255, 0.15);
}
.logo-box {
  width: 22px;
  height: 22px;
  background: #fff;
  color: var(--trello-blue-dark);
  font-weight: 800;
  font-size: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
}
.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.4);
  margin: 0 4px;
}
.header-board-name {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 5px 8px;
  border-radius: var(--border-radius);
  width: 160px;
}
.header-board-name::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.header-board-name:focus {
  background: #fff;
  color: var(--text-dark);
  outline: none;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e4f0f6;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* ============ VIEWS ============ */
.view {
  display: block;
}
.view.hidden {
  display: none;
}
main {
  height: calc(100vh - 44px);
}

/* ============ ATTACHMENTS ============ */
.attachments-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.attachment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attachments-empty {
  color: #5e6c84;
  font-size: 13px;
  padding: 6px 0;
}
.attachment-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f4f5f7;
  border-radius: 6px;
  padding: 10px;
  flex-wrap: wrap;
}
.attachment-icon {
  font-size: 22px;
  line-height: 1;
}
.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.attachment-name {
  font-weight: 600;
  font-size: 14px;
  color: #172b4d;
  word-break: break-all;
}
.attachment-meta {
  font-size: 12px;
  color: #5e6c84;
}
.attachment-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.attachment-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #dfe1e6;
}
.attachment-preview.media {
  background: #000;
  max-height: 260px;
  margin-top: 8px;
}
.attachment-preview.media.audio {
  background: transparent;
  height: 40px;
}
.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 10px;
  background: #f4f5f7;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-gray);
}
.upload-progress-bar {
  flex: 1;
  height: 6px;
  background: #dfe1e6;
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--trello-blue);
  border-radius: 3px;
  transition: width 0.2s ease;
}
.upload-progress-text {
  white-space: nowrap;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-small {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}
.btn-danger.btn-small {
  background: #eb5a46;
  color: #fff;
}
.btn-danger.btn-small:hover {
  background: #cf513d;
}
.btn-rename.btn-small {
  background: #f2f6fa;
  color: #172b4d;
  border: 1px solid #dfe1e6;
}
.btn-rename.btn-small:hover {
  background: #e3e9f0;
}

/* ============ DASHBOARD ============ */
.dashboard {
  height: 100%;
  overflow-y: auto;
}
.dashboard-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}
.dashboard-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.title-t {
  color: var(--trello-blue);
}
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.board-tile {
  background-color: var(--trello-blue);
  color: #fff;
  border-radius: var(--border-radius);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: var(--shadow-1);
  position: relative;
}
.board-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.board-tile .tile-tasks-count {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}
.board-tile .tile-badges {
  display: flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
}
.board-tile-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
}
.board-tile:hover .board-tile-delete {
  display: flex;
}
.board-tile-delete:hover {
  background: rgba(0, 0, 0, 0.45);
}
.create-board-tile {
  background: #f1f2f4;
  color: var(--text-gray);
  border-radius: var(--border-radius);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s ease;
}
.create-board-tile:hover {
  background: #e4e6e8;
}

/* ============ BOARD VIEW ============ */
.board {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--board-bg);
  transition: background-color 0.3s ease;
}
.board-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  position: relative;
}
.board-title-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--border-radius);
  width: 260px;
}
.board-title-input:hover {
  background: rgba(255, 255, 255, 0.2);
}
.board-title-input:focus {
  background: #fff;
  color: var(--text-dark);
  outline: none;
}
.board-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.board-action-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  padding: 7px 12px;
  border-radius: var(--border-radius);
  font-size: 13px;
  font-weight: 600;
}
.board-action-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}
#delete-board-btn:hover {
  background: rgba(255, 60, 60, 0.5);
}
.filter-panel {
  position: absolute;
  top: 42px;
  right: 200px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  padding: 12px;
  width: 220px;
  z-index: 60;
  max-height: 400px;
  overflow-y: auto;
}
.filter-panel h4 {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-section {
  margin-bottom: 12px;
}
.filter-section h4 {
  margin-bottom: 6px;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: pointer;
}
.filter-option:hover {
  background: var(--bg-hover);
}
.filter-option input {
  accent-color: var(--trello-blue);
  cursor: pointer;
}
.filter-option label {
  flex: 1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-option .f-count {
  font-size: 11px;
  color: var(--text-gray);
  background: #f1f2f4;
  border-radius: 10px;
  padding: 1px 6px;
}
.filter-clear {
  display: block;
  width: 100%;
  text-align: center;
  background: #ffebe6;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.filter-clear:hover {
  background: var(--danger);
  color: #fff;
}
.bg-panel {
  position: absolute;
  top: 42px;
  right: 110px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  padding: 12px;
  width: 210px;
  z-index: 60;
}
.bg-panel h4 {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.bg-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s ease;
}
.bg-swatch:hover {
  transform: scale(1.08);
}
.bg-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--trello-blue);
}

/* ============ LISTS ============ */
.lists-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 8px 8px;
}
.lists-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 4px 16px;
  min-height: 100%;
}
.list {
  width: 272px;
  max-height: 100%;
  background: var(--list-bg);
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-1);
}
.list.dragging {
  opacity: 0.4;
}
.list.drag-over {
  box-shadow: 0 0 0 2px var(--trello-blue);
}
.list-header {
  padding: 10px 12px 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.list-header[draggable="true"] {
  cursor: grab;
}
.list-header[draggable="true"]:active {
  cursor: grabbing;
}
.list-drag-grip {
  color: var(--text-gray);
  font-size: 14px;
  padding: 0 2px;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.list-header:not([draggable="true"]) .list-drag-grip {
  display: none;
}
.list-title-text {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
}
.list-title-text:hover {
  background: var(--bg-hover);
}
.list-title-input {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
  border: 2px solid var(--trello-blue);
  border-radius: 6px;
  padding: 4px 6px;
  width: 100%;
  outline: none;
}
.list-menu-btn {
  color: var(--text-gray);
  padding: 4px 6px;
  border-radius: 6px;
}
.list-menu-btn:hover {
  background: var(--bg-hover);
}
.list-cards {
  padding: 4px 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 10px;
  max-height: calc(100vh - 210px);
}
.list-cards.drag-over {
  background: rgba(9, 30, 66, 0.08);
  border-radius: 8px;
}
.list-add-card-btn {
  padding: 8px 12px;
  color: var(--text-gray);
  font-size: 13px;
  border-radius: 0 0 12px 12px;
  text-align: left;
  width: 100%;
}
.list-add-card-btn:hover {
  background: var(--bg-hover);
  color: var(--text-dark);
}
.add-card-form {
  padding: 4px 8px 8px;
}
.add-card-form textarea {
  width: 100%;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 8px 10px;
  resize: none;
  height: 60px;
  font-size: 13px;
  outline: none;
}
.add-card-form textarea:focus {
  border-color: var(--trello-blue);
}
.add-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.btn-green {
  background: var(--trello-green);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 13px;
}
.btn-green:hover {
  background: var(--trello-green-dark);
}
.btn-cancel-icon {
  color: var(--text-gray);
  font-size: 18px;
  padding: 4px;
}
.btn-cancel-icon:hover {
  color: var(--text-dark);
}
.add-list-wrap {
  width: 272px;
  flex-shrink: 0;
}
.add-list-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.add-list-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}
.add-list-form {
  background: var(--list-bg);
  border-radius: 12px;
  padding: 8px;
}
.add-list-form input {
  width: 100%;
  border: 2px solid var(--trello-blue);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  margin-bottom: 6px;
}

/* ============ CARDS ============ */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: background 0.1s ease;
  position: relative;
}
.card:hover {
  background: #f7f8f9;
}
.card.dragging {
  opacity: 0.4;
  transform: rotate(3deg);
}
.card.drag-over {
  box-shadow: 0 0 0 2px var(--trello-blue);
}
.card[draggable="true"] {
  cursor: grab;
}
.card[draggable="true"]:active {
  cursor: grabbing;
}
.card-drop-indicator {
  height: 4px;
  background: var(--trello-blue);
  border-radius: 2px;
  margin: 2px 0 6px;
  box-shadow: 0 0 4px rgba(0, 121, 191, 0.5);
  flex-shrink: 0;
  animation: drop-indicator-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes drop-indicator-pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}
.list-cards.drag-over {
  background: rgba(9, 30, 66, 0.08);
  border-radius: 8px;
  min-height: 40px;
}
.card-labels {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.card-label {
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 2px 6px;
  line-height: 1.4;
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-label.full {
  border-radius: 4px;
  font-size: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
}
.card-title {
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 6px;
  word-wrap: break-word;
}
.card-creator {
  font-size: 11px;
  color: var(--text-gray);
  margin-bottom: 4px;
}
/* ============ SPRINT 18 — CHILD TASKS (card-level) ============ */
.card-child {
  border-left: 3px solid var(--trello-blue);
  border-radius: 8px 4px 4px 8px;
}
.part-of-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-gray);
  background: rgba(9, 30, 66, 0.06);
  border-radius: 10px;
  padding: 1px 8px;
  margin-bottom: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.part-of-chip:hover {
  color: var(--trello-blue);
  background: rgba(0, 121, 191, 0.1);
}
.card-progress-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dark);
  background: #e4e6ea;
  border-radius: 10px;
  padding: 1px 8px;
  margin: 2px 4px 4px 0;
}
.card-progress-badge.complete {
  color: #fff;
  background: var(--trello-green);
}
.no-access-msg {
  width: 272px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.card-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  width: fit-content;
  margin-top: 4px;
}
.card-countdown.overdue {
  background: var(--danger);
  color: #fff;
}
.card-countdown.due-soon {
  background: #f5c041;
  color: #253858;
}
.card-countdown.ok {
  background: var(--trello-green);
  color: #fff;
}
.card-countdown .zzz-icon {
  font-size: 12px;
}
.delete-card-small {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(9, 30, 66, 0.1);
  border-radius: 4px;
  color: var(--text-gray);
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
}
.card:hover .delete-card-small {
  display: flex;
}
.delete-card-small:hover {
  background: var(--danger);
  color: #fff;
}

/* ============ MODALS ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
  overflow-y: auto;
}
.modal {
  background: #f4f5f7;
  border-radius: 8px;
  width: 640px;
  max-width: 95%;
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-3);
}
.modal.small {
  width: 320px;
}
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--text-gray);
  font-size: 18px;
  padding: 6px;
  border-radius: 50%;
  z-index: 10;
}
.modal-close-btn:hover {
  background: var(--bg-hover);
}
.modal-heading {
  font-size: 18px;
  margin-bottom: 16px;
}
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-gray);
  margin: 12px 0 6px;
}
.modal-input {
  width: 100%;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}
.modal-input:focus {
  border-color: var(--trello-blue);
}
.btn-block {
  width: 100%;
  margin-top: 16px;
}
.bg-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.bg-picker .bg-swatch {
  width: 44px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 6px;
}
.bg-picker .bg-swatch.active {
  border-color: var(--trello-blue);
}

/* ============ CARD MODAL ============ */
.modal-title-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-icon {
  font-size: 20px;
  padding-top: 4px;
}
.modal-title-wrap {
  flex: 1;
}
.modal-title-input {
  width: 100%;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  resize: none;
  outline: none;
  overflow: hidden;
}
.modal-title-input:hover, .modal-title-input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--trello-blue);
}
.modal-in-list {
  font-size: 13px;
  color: var(--text-gray);
  padding: 0 6px;
}
.modal-in-list a {
  color: var(--trello-blue);
  text-decoration: underline;
  cursor: pointer;
}
.modal-body {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
.modal-main {
  flex: 1;
  min-width: 0;
}
.modal-section {
  margin-bottom: 20px;
}
.section-title {
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.desc-text {
  background: rgba(9, 30, 66, 0.04);
  border-radius: 4px;
  padding: 10px;
  color: var(--text-gray);
  cursor: pointer;
  min-height: 40px;
}
.desc-text:hover {
  background: rgba(9, 30, 66, 0.08);
}
.desc-input {
  width: 100%;
  min-height: 90px;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 10px;
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.desc-input:focus {
  border-color: var(--trello-blue);
}
/* ============ WYSIWYG EDITOR (Quill) ============ */
#desc-editor .ql-toolbar {
  border: 1px solid #dfe1e6;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  background: #f4f5f7;
  font-family: inherit;
}
#desc-editor .ql-toolbar.ql-snow {
  padding: 8px;
}
#desc-editor .ql-container {
  font-family: inherit;
  font-size: 14px;
}
#desc-editor .ql-container.ql-snow {
  border: 1px solid #dfe1e6;
}
#desc-editor .ql-editor {
  min-height: 160px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dark);
  word-break: break-word;
  border-radius: 0 0 3px 3px;
}
#desc-editor .ql-editor:focus {
  border-color: var(--trello-blue);
}
#desc-editor .ql-editor h2,
#desc-editor .ql-editor h3,
#desc-editor .ql-editor h4 {
  margin: 8px 0 4px;
}
#desc-editor .ql-editor p {
  margin: 4px 0;
}
#desc-editor .ql-editor ul,
#desc-editor .ql-editor ol {
  margin: 4px 0;
  padding-left: 20px;
}
#desc-editor .ql-editor li {
  margin: 2px 0;
}
#desc-editor .ql-editor a {
  color: var(--trello-blue);
  text-decoration: underline;
}
#desc-editor .ql-editor.ql-blank::before {
  color: #a5adba;
  font-style: normal;
  left: 14px;
  right: 14px;
}
#desc-editor:focus-within .ql-container.ql-snow {
  border-color: var(--trello-blue);
}
.desc-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

/* ============ CARD ACTIVITY ============ */
.card-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-activity-empty {
  color: var(--text-gray);
  font-size: 13px;
  font-style: italic;
  padding: 8px 0;
}
.card-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(9, 30, 66, 0.1);
}
.card-activity-row:last-child {
  border-bottom: none;
}
.card-activity-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(0, 121, 191, 0.12);
  border-radius: 6px;
}
.card-activity-body {
  min-width: 0;
  flex: 1;
}
.card-activity-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-dark);
  overflow-wrap: break-word;
}
.card-activity-time {
  font-size: 11px;
  color: var(--text-gray);
  margin-top: 2px;
}

/* ============ CHECKLIST ============ */
.checklist-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  background: #f1f2f4;
  border-radius: 10px;
  padding: 2px 8px;
}
.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: var(--shadow-1);
}
.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--trello-green);
  cursor: pointer;
  flex-shrink: 0;
}
.checklist-item-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-dark);
  word-break: break-word;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.checklist-item-text:hover {
  background: var(--bg-hover);
}
.checklist-item-text.done {
  text-decoration: line-through;
  color: var(--text-gray);
}
.checklist-item-actions {
  display: flex;
  gap: 4px;
}
.checklist-del {
  color: var(--text-gray);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
}
.checklist-del:hover {
  background: var(--danger);
  color: #fff;
}
.checklist-add {
  display: flex;
  gap: 6px;
  align-items: center;
}
.checklist-add .modal-input {
  flex: 1;
  margin: 0;
  padding: 6px 10px;
  font-size: 13px;
}
.checklist-empty {
  color: var(--text-gray);
  font-size: 13px;
  padding: 4px 0 8px;
}

/* ============ STAR / FAVOURITE ============ */
.board-tile .star-btn {
  position: absolute;
  top: 6px;
  right: 34px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.1s ease, background 0.1s ease;
  z-index: 2;
}
.board-tile:hover .star-btn {
  opacity: 1;
}
.board-tile .star-btn:hover {
  background: rgba(255, 255, 255, 0.45);
}
.board-tile .star-btn.active {
  color: #ffd700;
  opacity: 1;
}
.board-tile .star-btn.active:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============ COMMENTS ============ */
#comments-list {
  margin-bottom: 12px;
}
.comments-empty {
  color: var(--text-gray);
  font-style: italic;
  padding: 8px 0;
}
.comment-row {
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
  position: relative;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-meta {
  font-size: 12px;
  color: var(--text-gray);
}
.comment-meta strong {
  color: var(--text-dark);
}
.comment-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dark);
  word-break: break-word;
}
.comment-body p {
  margin: 3px 0;
}
.comment-body ul,
.comment-body ol {
  margin: 4px 0;
  padding-left: 20px;
}
.comment-body a {
  color: var(--trello-blue);
  text-decoration: underline;
}
.comment-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--text-gray);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
}
.comment-delete:hover {
  background: var(--danger);
  color: #fff;
}
.comment-edited {
  color: var(--text-gray);
  font-size: 11px;
}
.comment-history-toggle {
  background: var(--bg-hover);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-gray);
  margin-left: 4px;
}
.comment-history-toggle:hover {
  background: rgba(9, 30, 66, 0.15);
}
.comment-history {
  border-left: 3px solid var(--bg-hover);
  margin: 8px 0 4px;
  padding-left: 10px;
}
.history-entry {
  margin-bottom: 8px;
}
.history-meta {
  font-size: 11px;
  color: var(--text-gray);
  margin-bottom: 2px;
}
.history-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dark);
  word-break: break-word;
  border: 1px dashed var(--bg-hover);
  border-radius: 4px;
  padding: 6px 8px;
  background: #fafbfc;
}
.history-body p {
  margin: 2px 0;
}
.comment-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.comment-action-btn {
  font-size: 11px;
  color: var(--text-gray);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-hover);
}
.comment-action-btn:hover {
  background: rgba(9, 30, 66, 0.15);
  color: var(--text-dark);
}
.comment-action-btn.danger:hover {
  background: var(--danger);
  color: #fff;
}
#comments-editor-wrap .ql-toolbar {
  border: 1px solid #dfe1e6;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  background: #f4f5f7;
}
#comments-editor-wrap .ql-container.ql-snow {
  border: 1px solid #dfe1e6;
  font-size: 13px;
}
#comments-editor-wrap .ql-editor {
  min-height: 60px;
  max-height: 150px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}
#comments-editor-wrap .ql-editor.ql-blank::before {
  color: #a5adba;
  font-style: normal;
}

/* ============ COUNTDOWN ============ */
.modal-countdown-box {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow-1);
}
.countdown {
  font-weight: 600;
  font-size: 13px;
}
.countdown.big {
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-dark);
}
.countdown-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.countdown-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-gray);
}
.countdown-status-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.countdown.overdue .countdown-status-text {
  color: var(--danger);
}
.countdown.due-soon .countdown-status-text {
  color: #d9a514;
}
.countdown.ok .countdown-status-text {
  color: var(--trello-green);
}
.countdown-units {
  display: flex;
  align-items: center;
  gap: 6px;
}
.countdown .time-part {
  background: #f4f5f7;
  border: 1px solid #e4e6ea;
  color: var(--text-dark);
  border-radius: 6px;
  padding: 5px 7px;
  min-width: 34px;
  text-align: center;
  transition: background 0.15s ease;
}
.countdown .time-part:hover {
  background: #e9ebee;
}
.countdown .time-part span {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1;
  letter-spacing: 0.5px;
}
.countdown .time-part small {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-gray);
  letter-spacing: 0.8px;
  margin-top: 3px;
}
.countdown.overdue .time-part {
  background: #fdecea;
  border-color: #f5c6c0;
}
.countdown.overdue .time-part span {
  color: var(--danger);
}
.countdown.due-soon .time-part {
  background: #fff8e1;
  border-color: #f5e0a4;
}
.countdown.due-soon .time-part span {
  color: #b8860b;
}
.countdown.ok .time-part {
  background: #eaf6ed;
  border-color: #c9e8d0;
}
.countdown.ok .time-part span {
  color: var(--trello-green-dark);
}
.countdown-colon {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-gray);
}
.modal-due-absolute {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-gray);
  border-top: 1px solid #e4e6ea;
  padding-top: 8px;
}
.modal-due-absolute.overdue {
  color: var(--danger);
  font-weight: 600;
}
.modal-due-absolute.due-soon {
  color: #b8860b;
  font-weight: 600;
}
.modal-due-absolute.completed {
  color: #0067a3;
  font-weight: 600;
}
#modal-countdown {
  color: var(--text-gray);
  font-weight: 600;
  font-size: 14px;
}
/* ============ COMPLETE / REOPEN ============ */
.complete-btn-wrap {
  margin-top: 10px;
  border-top: 1px solid #e4e6ea;
  padding-top: 10px;
  display: flex;
  justify-content: center;
}
.complete-btn-wrap:empty {
  display: none;
}
.btn-complete {
  background: linear-gradient(180deg, #4bbf6b, #3a9e55);
  border: 1px solid #2e8a48;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(58, 158, 85, 0.35);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-complete:hover {
  background: linear-gradient(180deg, #52c974, #42ad60);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(58, 158, 85, 0.45);
}
.btn-complete:active {
  transform: translateY(0);
}
.btn-reopen {
  background: linear-gradient(180deg, #0079bf, #0067a3);
  border: 1px solid #005f94;
  box-shadow: 0 2px 6px rgba(0, 121, 191, 0.35);
}
.btn-reopen:hover {
  background: linear-gradient(180deg, #0f87c9, #0072ab);
  box-shadow: 0 4px 10px rgba(0, 121, 191, 0.45);
}
.countdown.completed .time-part {
  background: #eef6fc;
  border: 1px dashed #9dc6e8;
}
.countdown.completed .time-part span,
.countdown.completed .time-part small {
  color: #0067a3;
}
.countdown.completed .countdown-status-text {
  color: #0079bf;
}
.countdown .completed-badge {
  background: #4bbf6b;
  color: #fff;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-countdown.completed {
  background: #eef6fc;
  color: #0067a3;
  border: 1px dashed #9dc6e8;
}
.card-countdown.completed .zzz-icon {
  font-size: 12px;
}
.card-label.full.complete-label {
  background: #4bbf6b;
  width: auto;
}

/* ============ MODAL SIDEBAR ============ */
.modal-sidebar {
  width: 160px;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-btn {
  display: block;
  width: 100%;
  background: #fff;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  margin-bottom: 6px;
  box-shadow: var(--shadow-1);
  color: var(--text-dark);
}
.sidebar-btn:hover {
  background: #f7f8f9;
}
.sidebar-btn.danger {
  color: var(--danger);
}
.sidebar-btn.danger:hover {
  background: var(--danger);
  color: #fff;
}
.due-input-wrap {
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
}
.due-input-wrap input {
  width: 100%;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}
.due-input-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 7px 12px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 13px;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

/* ============ ASSIGNEE ============ */
.assignee-picker {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-2);
  margin-bottom: 8px;
  position: relative;
}
.assignee-picker h4 {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 8px;
}
.assignee-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: pointer;
}
.assignee-row:hover {
  background: var(--bg-hover);
}
.assignee-row .member-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assignee-check {
  color: var(--trello-green);
  font-weight: 800;
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.card-assignees {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.card-assignee {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

/* ============ LABELS ============ */
.label-picker {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-2);
  margin-bottom: 8px;
  position: relative;
}
.label-picker h4 {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 8px;
}
.label-picker-close {
  position: absolute;
  top: 6px;
  right: 8px;
  color: var(--text-gray);
  font-size: 14px;
}
.label-colors {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.label-name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-dark);
  background: #fff;
}
.label-name-input:focus {
  border-color: var(--accent, #0079bf);
  outline: none;
}
.label-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}
.label-color-btn:hover {
  transform: scale(1.15);
}
.label-color-btn.active {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 2px #fff inset;
}

/* ============ SPRINT 18 — CHILD / RELATED POPOVERS + SECTIONS ============ */
.child-popover,
.related-popover {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-2);
  margin-bottom: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.child-popover h4,
.related-popover h4 {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 2px;
}
.popover-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.popover-actions {
  display: flex;
  gap: 6px;
}
.modal-part-of {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 4px;
}
.modal-part-of-link {
  color: var(--trello-blue);
  cursor: pointer;
  font-weight: 600;
}
.modal-part-of-link:hover {
  text-decoration: underline;
}
.child-task-list,
.related-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.child-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dark);
  border-left: 3px solid transparent;
}
.child-task-row:hover {
  background: var(--bg-hover);
  border-left-color: var(--trello-blue);
}
.child-task-check {
  flex-shrink: 0;
}
.child-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.child-task-meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-gray);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.related-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dark);
}
.related-row:hover {
  background: var(--bg-hover);
}
.related-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.related-chip.related { background: rgba(0, 121, 191, 0.15); }
.related-chip.blocks { background: rgba(235, 90, 70, 0.2); }
.related-chip.blocked_by { background: rgba(255, 159, 26, 0.2); }
.related-chip.duplicates { background: rgba(142, 110, 170, 0.2); }
.related-link-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.related-link-title:hover {
  color: var(--trello-blue);
  text-decoration: underline;
}

/* ============ SPRINT 19 — REPORTS + TRANSFER ============ */
.report-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.report-controls .email-field {
  flex: 0 0 160px;
}
.report-summary-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.report-chip {
  background: var(--bg-hover);
  color: var(--text-dark);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
}
.report-chip strong {
  color: var(--trello-blue);
}
.transfer-overlay .modal.small {
  max-width: 420px;
}
.transfer-user-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}
.transfer-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 13px;
}
.transfer-user-row:hover {
  background: var(--bg-hover);
}
.transfer-user-row .member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ LIST MENU POPOVER ============ */
.popover {
  position: fixed;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  padding: 10px;
  width: 220px;
  z-index: 300;
}
.popover h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #dfe1e6;
  margin-bottom: 8px;
}
.popover-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--text-dark);
  font-size: 13px;
}
.popover-item:hover {
  background: var(--bg-hover);
}
.popover-item.danger {
  color: var(--danger);
}
.popover-item.danger:hover {
  background: var(--danger);
  color: #fff;
}
.popover-item.add {
  color: var(--trello-green);
}
.popover-item.add:hover {
  background: var(--trello-green);
  color: #fff;
}

/* ============ EMAIL INVITE POPOVER ============ */
.invite-input {
  width: 100%;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  margin-bottom: 8px;
}

/* ============ USER MENU ============ */
.avatar-wrap {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e4f0f6;
  color: var(--trello-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
}
.user-menu {
  position: absolute;
  top: 42px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  width: 220px;
  z-index: 300;
  padding: 6px;
}
.user-menu-header {
  padding: 10px;
  border-bottom: 1px solid #dfe1e6;
  margin-bottom: 6px;
}
.user-menu-header .user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
}
.user-menu-header .user-email {
  font-size: 12px;
  color: var(--text-gray);
  word-break: break-all;
}

/* ============ NOTIFICATIONS PANEL ============ */
.notif-panel {
  position: absolute;
  top: 42px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  width: 320px;
  max-width: calc(100vw - 24px);
  z-index: 300;
  padding: 6px;
}.notif-panel .notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dark);
}
.notif-list {
  max-height: 300px;
  overflow-y: auto;
}
.notif-empty {
  text-align: center;
  color: var(--text-gray);
  font-size: 13px;
  padding: 18px 8px;
}

/* ============ SHORTCUTS POPOVER ============ */
.shortcuts-popover {
  position: absolute;
  top: 42px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  width: 340px;
  max-width: calc(100vw - 24px);
  z-index: 300;
  padding: 12px;
}
.shortcuts-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.shortcuts-table td {
  padding: 5px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-dark);
}
.shortcuts-table td:last-child {
  color: var(--text-gray);
}
.shortcuts-table tr:last-child td {
  border-bottom: none;
}
.shortcuts-table kbd {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-bottom-width: 2px;
  background: #f1f2f4;
  font-family: inherit;
  font-size: 11px;
  text-align: center;
  color: var(--text-dark);
}

/* ============ MEMBERS PANEL ============ */
.members-panel {
  position: absolute;
  top: 42px;
  right: 170px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-3);
  padding: 12px;
  width: 240px;
  z-index: 60;
}
.members-panel h4 {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-dark);
}
.member-row:hover {
  background: var(--bg-hover);
}
.member-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--trello-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}
.member-row .member-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-row .member-owner {
  font-size: 10px;
  color: #f5c041;
  font-weight: 700;
}
.member-row .member-remove {
  color: var(--text-gray);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
}
.member-row .member-remove:hover {
  background: var(--danger);
  color: #fff;
}
.invite-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dfe1e6;
  font-size: 11px;
  color: var(--text-gray);
}

/* ============ MOVE CARD ============ */
.move-select {
  width: 100%;
  margin-bottom: 6px;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text-dark);
  outline: none;
}
.move-select:focus {
  border-color: var(--trello-blue);
}
.sidebar-btn.add {
  color: var(--trello-green);
}
.sidebar-btn.add:hover {
  background: var(--trello-green);
  color: #fff;
}

/* ============ ATTACH URL MODAL ============ */
.attach-url-modal {
  padding: 20px;
}
.attach-url-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
}
.modal-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.modal-label-row .modal-label {
  margin: 0;
}
.modal-optional-tag {
  font-size: 11px;
  font-weight: 600;
  color: #a5adba;
  background: #f1f2f4;
  border-radius: 3px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.url-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f5f7;
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 14px;
}
.url-preview-icon {
  font-size: 20px;
}
.url-preview-info {
  min-width: 0;
}
.url-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.url-preview-domain {
  font-size: 12px;
  color: var(--text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-url-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.attach-url-error {
  background: #ffebe6;
  color: var(--danger);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  margin-top: 10px;
  display: none;
}
.attach-url-error.visible {
  display: block;
}
.attach-url-error::before {
  content: "âš  ";
}

/* ============ AUTH ============ */
.auth-overlay {
  background: rgba(9, 30, 66, 0.72);
}
.modal.auth {
  width: 360px;
  text-align: center;
  padding: 28px 24px;
}
.auth-heading {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 18px;
}
.auth-input {
  width: 100%;
  border: 2px solid #dfe1e6;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
  background: #fff;
}
.auth-input:focus {
  border-color: var(--trello-blue);
}
.auth-switch {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-gray);
}
.auth-link {
  color: var(--trello-blue);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.auth-forgot-row {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
}
.auth-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-gray);
  line-height: 1.5;
}
.auth-demo {
  margin-top: 16px;
  padding: 10px;
  background: #eef6fc;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-gray);
  text-align: left;
  line-height: 1.5;
}
.auth-error {
  background: #ffebe6;
  color: var(--danger);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 10px;
}
.dashboard-empty {
  background: #f1f2f4;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: var(--text-gray);
  margin-bottom: 16px;
  font-size: 14px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2c3e50;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  box-shadow: var(--shadow-3);
  font-size: 14px;
  z-index: 500;
  animation: toast-in 0.25s ease;
}
.toast.success {
  background: var(--trello-green);
}
.toast.error {
  background: var(--danger);
}
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============ SCROLLBARS ============ */
::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(9, 30, 66, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(9, 30, 66, 0.35);
}
.lists-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
}
.list-cards::-webkit-scrollbar {
  width: 6px;
}

/* ============ ADMIN DASHBOARD ============ */
.view.admin {
  min-height: calc(100vh - 48px);
  background: linear-gradient(135deg, #f4f5f7 0%, #ebecf0 100%);
}
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.admin-container .dashboard-title {
  font-size: 26px;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  margin: 18px 0;
  box-shadow: 0 1px 4px rgba(9, 30, 66, 0.12);
  flex-wrap: wrap;
}
.admin-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-gray);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.admin-tab:hover {
  background: rgba(9, 30, 66, 0.06);
  color: var(--text-dark);
}
.admin-tab.active {
  background: var(--trello-blue);
  color: #fff;
}
.admin-tab-content {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(9, 30, 66, 0.12);
}

/* Stat cards */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  border-top: 3px solid var(--accent, var(--trello-blue));
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(9, 30, 66, 0.15);
}
.stat-icon {
  font-size: 24px;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--text-gray);
}
.admin-active-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-gray);
  margin: 8px 0 0;
}

/* Charts */
.admin-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.admin-chart-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.1);
}
.admin-chart-card h3 {
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.chart-bar-label {
  min-width: 72px;
  text-align: right;
  color: var(--text-gray);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(9, 30, 66, 0.06);
  border-radius: 6px;
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  border-radius: 6px;
  min-width: 4px;
  transition: width 0.3s;
}
.chart-bar-count {
  min-width: 30px;
  color: var(--text-dark);
  font-weight: 600;
  text-align: right;
}
.chart-empty {
  color: var(--text-gray);
  font-size: 12px;
  padding: 12px 0;
  text-align: center;
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-toolbar .modal-input {
  flex: 1;
  min-width: 200px;
}

/* Tables */
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(9, 30, 66, 0.1);
  color: var(--text-gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(9, 30, 66, 0.07);
  vertical-align: middle;
}
.admin-table tr:hover td {
  background: rgba(9, 30, 66, 0.02);
}
.admin-empty {
  text-align: center;
  color: var(--text-gray);
  padding: 24px;
}
.admin-user-cell,
.admin-board-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-board-cell {
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  font-weight: 600;
  min-width: 150px;
}
.admin-board-cell .tile-badges {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 400;
}
.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-actions .btn-small {
  font-size: 11px;
  padding: 5px 8px;
}

/* Role / status badges */
.role-badge,
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.role-badge.admin {
  background: #f5e6cc;
  color: #9c6b1d;
}
.role-badge.user {
  background: #e4f0f6;
  color: var(--trello-blue);
}
.status-badge.active {
  background: #e3f6e3;
  color: #2e8b2e;
}
.status-badge.disabled {
  background: #fbe4e4;
  color: var(--danger);
}

/* Activity log */
.admin-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}
.admin-activity-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(9, 30, 66, 0.03);
  border-radius: 8px;
  align-items: flex-start;
}
.activity-content {
  flex: 1;
  min-width: 0;
}
.activity-text {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.4;
}
.activity-meta {
  font-size: 11px;
  color: var(--text-gray);
  margin-top: 2px;
}

/* Settings */
.admin-settings-card {
  background: #fff;
  border: 1px solid rgba(9, 30, 66, 0.08);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.admin-settings-card h3 {
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.admin-settings-desc {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 10px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.3s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.3s;
}
.switch input:checked + .slider {
  background: var(--trello-blue);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.btn-small.btn-rename {
  background: #f4f5f7;
  color: var(--text-dark);
  border: 1px solid rgba(9, 30, 66, 0.1);
}
.btn-small.btn-rename:hover {
  background: #e4e6ea;
}

/* ============ STORAGE USAGE (Sprint 6) ============ */
.storage-card {
  margin-top: 16px;
}
.admin-storage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.storage-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.storage-total-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--trello-blue);
}
.storage-total-label {
  font-size: 12px;
  color: var(--text-gray);
}
.storage-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.storage-box {
  flex: 1;
  min-width: 140px;
  background: var(--bg-hover, rgba(9, 30, 66, 0.06));
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.storage-box-value {
  font-size: 17px;
  font-weight: 700;
}
.storage-box-label {
  font-size: 11px;
  color: var(--text-gray);
}
.storage-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.storage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.storage-row-name {
  width: 150px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storage-row-track {
  flex: 1;
  height: 8px;
  background: var(--bg-hover, rgba(9, 30, 66, 0.08));
  border-radius: 8px;
  overflow: hidden;
}
.storage-row-fill {
  display: block;
  height: 100%;
  background: var(--trello-blue);
  border-radius: 8px;
}
.storage-row-size {
  width: 70px;
  text-align: right;
  color: var(--text-gray);
}

html[data-theme="dark"] .storage-row-track,
html[data-theme="dark"] .storage-box {
  background: #3d4a5c;
}

/* ============ ONBOARDING TOUR ============ */
.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, 0.45);
  z-index: 800;
}
.tour-shield {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 4px var(--trello-blue), 0 0 24px rgba(0, 121, 191, 0.6);
  z-index: 801;
  pointer-events: none;
  transition: all 0.25s ease;
}
.tour-tooltip {
  position: fixed;
  z-index: 802;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--bg-light, #fff);
  color: var(--text-dark, #172b4d);
  border-radius: 8px;
  box-shadow: var(--shadow-3, 0 8px 16px -4px rgba(9, 30, 66, 0.25));
  padding: 14px 16px 10px;
}
.tour-tooltip-inner {
  margin-bottom: 10px;
}
.tour-progress {
  height: 4px;
  border-radius: 4px;
  background: #e4e6ea;
  margin-bottom: 10px;
  overflow: hidden;
}
.tour-progress-fill {
  height: 100%;
  background: var(--trello-blue);
  border-radius: 4px;
  transition: width 0.25s ease;
}
.tour-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tour-text {
  font-size: 13px;
  color: var(--text-gray, #5e6c84);
  line-height: 1.5;
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tour-step-label {
  flex: 1;
  font-size: 12px;
  color: var(--text-gray, #5e6c84);
}
.tour-skip {
  font-size: 16px;
}
.tour-tooltip[data-side="bottom"] { transform: translateY(10px); }
.tour-tooltip[data-side="top"]    { transform: translateY(-10px); }

html[data-theme="dark"] .tour-tooltip {
  background: #2f3a4a;
  color: #e6e9ef;
}
html[data-theme="dark"] .tour-text {
  color: #b8c1cf;
}
html[data-theme="dark"] .tour-progress {
  background: #455063;
}
html[data-theme="dark"] .tour-shield {
  box-shadow: 0 0 0 4px #4ea8e0, 0 0 24px rgba(78, 168, 224, 0.6);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .logo-text {
    display: none;
  }
  .header-board-name {
    width: 100px;
    font-size: 14px;
  }
  .modal-body {
    flex-direction: column;
  }
  .modal-sidebar {
    width: 100%;
  }
  .board-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ============ DARK MODE ============ */
html[data-theme="dark"] {
  --text-dark: #e6e9ef;
  --text-gray: #b8c1cf;
  --bg-light: #1c2430;
  --bg-hover: rgba(255, 255, 255, 0.08);
  --list-bg: #2b3544;
  --board-bg: #16202b;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 6px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 8px 16px -4px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] body {
  background: #141b24;
  color: #e6e9ef;
}

/* Header stays dark on both themes, but keep its own vars */
html[data-theme="dark"] .search-input {
  color: #fff;
}
html[data-theme="dark"] .search-input:focus {
  background: #22303f;
  color: #e6e9ef;
}
html[data-theme="dark"] .board-title-input:focus {
  background: #22303f;
  color: #e6e9ef;
}

/* Views / dashboard */
html[data-theme="dark"] .dashboard {
  background: linear-gradient(180deg, #16202b 0%, #141b24 100%);
}
html[data-theme="dark"] .dashboard-empty,
html[data-theme="dark"] .checklist-progress {
  background: #2b3544;
  color: #b8c1cf;
}

/* Board view */
html[data-theme="dark"] .board {
  background: var(--board-bg);
}
html[data-theme="dark"] .board-title-input {
  color: #fff;
}
html[data-theme="dark"] .list {
  background: var(--list-bg);
}
html[data-theme="dark"] .list-title-text,
html[data-theme="dark"] .list-title-input {
  color: #e6e9ef;
}
html[data-theme="dark"] .list-add-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e6e9ef;
}
html[data-theme="dark"] .add-card-form textarea,
html[data-theme="dark"] .desc-input,
html[data-theme="dark"] .modal-input,
html[data-theme="dark"] .auth-input {
  background: #22303f;
  border-color: #3d4c5e;
  color: #e6e9ef;
}
html[data-theme="dark"] .add-card-form textarea::placeholder,
html[data-theme="dark"] .modal-input::placeholder {
  color: #8b96a6;
}

/* Cards */
html[data-theme="dark"] .card {
  background: #22303f;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .card:hover {
  background: #29394a;
}
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-creator {
  color: #e6e9ef;
}
html[data-theme="dark"] .list-cards.drag-over,
html[data-theme="dark"] .desc-text {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .desc-text:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Modals */
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal.auth {
  background: #22303f;
}
html[data-theme="dark"] .modal-title-input {
  color: #e6e9ef;
  background: transparent;
}
html[data-theme="dark"] .modal-title-input:hover,
html[data-theme="dark"] .modal-title-input:focus {
  background: #2b3544;
}
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .modal-heading,
html[data-theme="dark"] .auth-heading {
  color: #e6e9ef;
}
html[data-theme="dark"] .modal-countdown-box {
  background: #2b3544;
}
html[data-theme="dark"] .countdown .time-part {
  background: #2b3544;
  border-color: #3d4c5e;
  color: #e6e9ef;
}
html[data-theme="dark"] .countdown .time-part:hover {
  background: #35445a;
}
html[data-theme="dark"] .countdown.overdue .time-part {
  background: #4a2a26;
  border-color: #7a4a44;
}
html[data-theme="dark"] .countdown.due-soon .time-part {
  background: #45391d;
  border-color: #77652c;
}
html[data-theme="dark"] .countdown.due-soon .time-part span {
  color: #f5d565;
}
html[data-theme="dark"] .countdown.ok .time-part {
  background: #21412b;
  border-color: #3a6b4a;
}
html[data-theme="dark"] .modal-due-absolute,
html[data-theme="dark"] .modal-in-list,
html[data-theme="dark"] .countdown-colon {
  color: #b8c1cf;
}
html[data-theme="dark"] .modal-due-absolute {
  border-top-color: #3d4c5e;
}
html[data-theme="dark"] .complete-btn-wrap {
  border-top-color: #3d4c5e;
}

/* Checklist */
html[data-theme="dark"] .checklist-item,
html[data-theme="dark"] .comment-row {
  background: #2b3544;
}
html[data-theme="dark"] .checklist-item-text,
html[data-theme="dark"] .comment-body,
html[data-theme="dark"] .comment-meta strong {
  color: #e6e9ef;
}
html[data-theme="dark"] .history-body {
  background: #1c2430;
}

/* Comments editor */
html[data-theme="dark"] #comments-editor-wrap .ql-toolbar,
html[data-theme="dark"] #desc-editor .ql-toolbar {
  background: #2b3544;
  border-color: #3d4c5e;
}
html[data-theme="dark"] #comments-editor-wrap .ql-container.ql-snow,
html[data-theme="dark"] #desc-editor .ql-container.ql-snow {
  border-color: #3d4c5e;
  background: #22303f;
}
html[data-theme="dark"] #desc-editor .ql-editor,
html[data-theme="dark"] #comments-editor-wrap .ql-editor {
  color: #e6e9ef;
  background: #22303f;
}
html[data-theme="dark"] #desc-editor .ql-editor.ql-blank::before,
html[data-theme="dark"] #comments-editor-wrap .ql-editor.ql-blank::before {
  color: #8b96a6;
}

/* Panels & popovers */
html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .bg-panel,
html[data-theme="dark"] .members-panel,
html[data-theme="dark"] .assignee-picker,
html[data-theme="dark"] .label-picker,
html[data-theme="dark"] .user-menu,
html[data-theme="dark"] .notif-panel,
html[data-theme="dark"] .shortcuts-popover,
html[data-theme="dark"] .search-results,
html[data-theme="dark"] .popover {
  background: #22303f;
  border-color: #3d4c5e;
  color: #e6e9ef;
}
html[data-theme="dark"] .filter-panel h4,
html[data-theme="dark"] .bg-panel h4,
html[data-theme="dark"] .members-panel h4,
html[data-theme="dark"] .assignee-picker h4,
html[data-theme="dark"] .label-picker h4,
html[data-theme="dark"] .popover h4,
html[data-theme="dark"] .shortcuts-heading,
html[data-theme="dark"] .notif-heading {
  color: #e6e9ef;
}
html[data-theme="dark"] .popover-item,
html[data-theme="dark"] .filter-option label,
html[data-theme="dark"] .member-row,
html[data-theme="dark"] .search-result-item .sri-title {
  color: #e6e9ef;
}
html[data-theme="dark"] .shortcuts-table td {
  color: #e6e9ef;
  border-bottom-color: #3d4c5e;
}
html[data-theme="dark"] .shortcuts-table td:last-child {
  color: #9aa7b5;
}
html[data-theme="dark"] .shortcuts-table kbd {
  background: #2b3a4a;
  border-color: #4a5a6b;
  color: #e6e9ef;
}
html[data-theme="dark"] .popover-item:hover,
html[data-theme="dark"] .search-result-item:hover,
html[data-theme="dark"] .filter-option:hover {
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .search-result-item .sri-sub,
html[data-theme="dark"] .search-results-header {
  color: #b8c1cf;
}
html[data-theme="dark"] .user-menu-header .user-name {
  color: #e6e9ef;
}
html[data-theme="dark"] .user-menu-header .user-email {
  color: #b8c1cf;
}
html[data-theme="dark"] .invite-hint {
  border-top-color: #3d4c5e;
}
html[data-theme="dark"] .card-activity-icon {
  background: rgba(78, 168, 224, 0.2);
}

/* Attachment rows */
html[data-theme="dark"] .attachment-row {
  background: #2b3544;
}
html[data-theme="dark"] .attachment-name,
html[data-theme="dark"] .attachment-meta {
  color: #e6e9ef;
}

/* Sidebar & due input */
html[data-theme="dark"] .sidebar-btn,
html[data-theme="dark"] .due-input-wrap {
  background: #2b3544;
  color: #e6e9ef;
}
html[data-theme="dark"] .sidebar-btn:hover {
  background: #35445a;
}
html[data-theme="dark"] .due-input-wrap input {
  background: #22303f;
  border-color: #3d4c5e;
  color: #e6e9ef;
}
html[data-theme="dark"] .assignee-row,
html[data-theme="dark"] .label-color-btn {
  color: #e6e9ef;
}
html[data-theme="dark"] .label-name-input {
  background: #22303f;
  border-color: #3d4c5e;
  color: #e6e9ef;
}

/* Attach URL modal */
html[data-theme="dark"] .url-preview {
  background: #2b3544;
  border-color: #3d4c5e;
}
html[data-theme="dark"] .url-preview-title,
html[data-theme="dark"] .url-preview-domain {
  color: #e6e9ef;
}

/* Activity */
html[data-theme="dark"] .card-activity-row,
html[data-theme="dark"] .admin-activity-item {
  background: #2b3544;
  color: #e6e9ef;
}
html[data-theme="dark"] .card-activity-text,
html[data-theme="dark"] .card-activity-time,
html[data-theme="dark"] .admin-activity-item .activity-meta {
  color: #b8c1cf;
}

/* Move / sidebar buttons */
html[data-theme="dark"] .move-select {
  background: #22303f;
  border-color: #3d4c5e;
  color: #e6e9ef;
}

/* Sprint 18 — child tasks + related links (dark) */
html[data-theme="dark"] .child-popover,
html[data-theme="dark"] .related-popover {
  background: #2b3544;
}
html[data-theme="dark"] .child-task-row,
html[data-theme="dark"] .related-row {
  color: #e6e9ef;
}
html[data-theme="dark"] .child-task-row:hover,
html[data-theme="dark"] .related-row:hover {
  background: #35445a;
}
html[data-theme="dark"] .child-task-meta {
  color: #9aa7b8;
}
html[data-theme="dark"] .part-of-chip {
  color: #9aa7b8;
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .part-of-chip:hover {
  color: #5ba4d6;
  background: rgba(0, 121, 191, 0.25);
}
html[data-theme="dark"] .card-progress-badge {
  color: #e6e9ef;
  background: #3d4c5e;
}
html[data-theme="dark"] .card-progress-badge.complete {
  color: #fff;
  background: #4bbf6b;
}
html[data-theme="dark"] .modal-part-of {
  color: #9aa7b8;
}
html[data-theme="dark"] .modal-part-of-link {
  color: #5ba4d6;
}

/* Sprint 19 — reports + transfer (dark) */
html[data-theme="dark"] .report-chip {
  background: #2b3544;
  color: #e6e9ef;
}
html[data-theme="dark"] .transfer-user-row {
  color: #e6e9ef;
}
html[data-theme="dark"] .transfer-user-row:hover {
  background: #35445a;
}

/* Auth */
html[data-theme="dark"] .auth-demo {
  background: #2b3544;
  color: #b8c1cf;
}
html[data-theme="dark"] .auth-error {
  background: #4a2a26;
  color: #ff9d94;
}

/* Admin */
html[data-theme="dark"] .view.admin {
  background: linear-gradient(135deg, #1c2430 0%, #16202b 100%);
}
html[data-theme="dark"] .admin-tabs,
html[data-theme="dark"] .admin-tab-content,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .admin-chart-card {
  background: #22303f;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .admin-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e6e9ef;
}
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .admin-chart-card h3 {
  color: #e6e9ef;
}
html[data-theme="dark"] .admin-settings-card {
  background: #22303f;
  border-color: #3d4c5e;
}
html[data-theme="dark"] .admin-table th {
  color: #b8c1cf;
  border-bottom-color: #3d4c5e;
}
html[data-theme="dark"] .admin-table td {
  border-bottom-color: #2b3544;
  color: #e6e9ef;
}
html[data-theme="dark"] .admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .btn-small.btn-rename {
  background: #2b3544;
  color: #e6e9ef;
  border-color: #3d4c5e;
}
html[data-theme="dark"] .btn-small.btn-rename:hover {
  background: #35445a;
}
html[data-theme="dark"] .chart-empty {
  color: #8b96a6;
}
html[data-theme="dark"] .role-badge,
html[data-theme="dark"] .status-badge {
  background: #2b3544;
  color: #e6e9ef;
}

/* Scrollbars */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ================= EMAIL (Admin) ================= */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-weight: 600;
  color: var(--text, #172b4d);
}

.email-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.email-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #5e6c84);
}

.email-field .modal-input {
  width: 100%;
  box-sizing: border-box;
}

.email-field-sm {
  max-width: 120px;
}

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

.email-status {
  font-size: 13px;
  color: var(--muted, #5e6c84);
  font-weight: 600;
}

.admin-import-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e4e6ea;
  border-radius: 8px;
  background: #fafbfc;
}

.admin-import-result .import-result-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #006644;
}

.admin-import-result .import-result-summary {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #172b4d;
}

.admin-import-result .import-result-detail {
  margin: 0;
  font-size: 13px;
  color: #5e6c84;
}

html[data-theme="dark"] .admin-import-result {
  background: #1f2430;
  border-color: #2d3444;
}

html[data-theme="dark"] .admin-import-result .import-result-title { color: #7ee2a8; }
html[data-theme="dark"] .admin-import-result .import-result-summary { color: #e6edf3; }
html[data-theme="dark"] .admin-import-result .import-result-detail { color: #8b96a6; }


.email-log-item {
  padding: 10px 12px;
  border-bottom: 1px solid #e4e6ea;
}

.email-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.email-log-to {
  color: var(--muted, #5e6c84);
  font-size: 13px;
}

.email-log-error {
  margin-top: 6px;
  font-size: 12px;
  color: #bf2600;
  background: #ffebe6;
  border-radius: 4px;
  padding: 6px 8px;
  word-break: break-all;
}

.email-status-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.email-status-sent { background: #e3fcef; color: #006644; }
.email-status-failed { background: #ffebe6; color: #bf2600; }
.email-status-queued { background: #fff7e0; color: #9f6700; }

html[data-theme="dark"] .email-log-item {
  border-bottom-color: #2b3544;
}
html[data-theme="dark"] .email-log-to {
  color: #8b96a6;
}
html[data-theme="dark"] .email-log-error {
  background: rgba(191, 38, 0, 0.18);
  color: #ff8f73;
}
html[data-theme="dark"] .email-status-sent { background: #1f3a2b; color: #7ee2a8; }
html[data-theme="dark"] .email-status-failed { background: #3a1f1a; color: #ff9c86; }
html[data-theme="dark"] .email-status-queued { background: #3a3018; color: #ffd166; }
html[data-theme="dark"] .switch-row { color: #e6e9ef; }
html[data-theme="dark"] .email-field label { color: #8b96a6; }
html[data-theme="dark"] .email-status { color: #8b96a6; }

/* ============ RESPONSIVE (Mobile & Tablet) ============ */

/* ---- Tablet: 641-1024px ---- */
@media (max-width: 1024px) and (min-width: 641px) {
  .header-center {
    display: none;
  }
  .dashboard-inner {
    max-width: 100%;
  }
  .modal {
    width: 90%;
  }
}

/* ---- Phone: up to 640px ---- */
@media (max-width: 640px) {
  /* Header */
  .app-header {
    padding: 0 6px;
    gap: 4px;
    height: 48px;
  }
  .header-left {
    flex-shrink: 0;
  }
  .header-left #boards-btn {
    font-size: 0;
    width: 36px;
    justify-content: center;
    padding: 0;
  }
  .logo-box {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  .header-divider {
    display: none;
  }
  .header-board-name {
    width: 70px;
    font-size: 13px;
    padding: 4px 6px;
  }
  .header-center {
    flex: 1;
    padding: 0 2px;
    justify-content: flex-end;
  }
  .search-wrap {
    width: auto;
    max-width: none;
  }
  .search-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    max-width: 150px;
  }
  .search-results {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 52px;
    max-height: 60vh;
  }
  .header-right {
    gap: 2px;
    flex-shrink: 0;
  }
  .header-btn {
    padding: 4px 6px;
    font-size: 12px;
  }
  .header-btn#header-create-btn {
    font-size: 0;
    width: 36px;
    justify-content: center;
    padding: 0;
  }
  .header-btn#header-create-btn::before {
    content: "+";
    font-size: 20px;
    line-height: 1;
  }
  .avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .user-menu,
  .notif-panel,
  .shortcuts-popover {
    position: fixed;
    top: 52px;
    right: 8px;
    left: 8px;
    max-width: none;
    max-height: 60vh;
    overflow-y: auto;
  }

  /* Dashboard */
  .dashboard-inner {
    padding: 14px 10px 24px;
  }
  .dashboard-title {
    font-size: 20px;
    margin-bottom: 12px;
  }
  .tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .board-tile {
    min-height: 78px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .board-tile .tile-badges {
    font-size: 11px;
  }

  /* Board menu + actions */
  .board-menu {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
  }
  .board-menu-left {
    width: 100%;
  }
  .board-title-input {
    font-size: 15px;
    width: 100%;
  }
  .board-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .board-action-btn {
    font-size: 12px;
    padding: 5px 8px;
  }
  .bg-panel,
  .filter-panel,
  .members-panel {
    left: 6px;
    right: 6px;
    max-width: none;
  }

  /* Lists — slightly narrower cards on phones */
  .list {
    width: 240px;
  }
  .lists-scroll {
    padding: 0 4px 8px;
  }
  .lists-container {
    gap: 8px;
  }

  /* Modals */
  .overlay {
    padding: 0;
    align-items: stretch;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 14px;
    box-sizing: border-box;
  }
  .modal.small {
    width: 100%;
  }
  .modal-close-btn {
    top: 8px;
    right: 8px;
  }
  .modal-title-input {
    font-size: 16px;
  }
  .countdown.big {
    font-size: 28px;
  }
  .modal-sidebar {
    width: 100% !important;
  }
  .modal-body {
    flex-direction: column;
  }

  /* Admin */
  .admin-container {
    padding: 12px 8px;
  }
  .admin-tabs {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .admin-tab {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 10px;
  }
  .admin-toolbar {
    flex-wrap: wrap;
  }
  .admin-table-wrap {
    overflow-x: auto;
  }
  .admin-table {
    min-width: 520px;
  }
  .admin-tab-content .email-fields {
    grid-template-columns: 1fr;
  }
  .admin-charts-row {
    grid-template-columns: 1fr;
  }
  .stat-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Toast / onboarding */
  #toast {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }
  .tour-tooltip {
    max-width: calc(100vw - 24px);
  }
}

/* ---- Very small phones (<380px) ---- */
@media (max-width: 380px) {
  .search-input {
    max-width: 110px;
  }
  .tiles-grid {
    grid-template-columns: 1fr;
  }
  .stat-cards-grid {
    grid-template-columns: 1fr;
  }
}
