/* ════════════════════════════════════════
   TOKENS DE COR  (light / dark)
════════════════════════════════════════ */
:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface2: #ececea;
  --border: #ddd;
  --border2: #ccc;
  --text: #1a1a1a;
  --text2: #666;
  --text3: #aaa;
  --drag-col: #dce8f5;
  --btn-hover: #f0f0ee;
  --accent: #5b21b6;
  --accent-hover: #4c1d95;
  --accent-fill: #5b21b6;

  --logo-line: #c8cadf;
  --logo-dot1: #4a63e0;
  --logo-dot2: #7a5fe0;
  --logo-dot3: #9d55e0;

  --danger: #dc2626;
  --danger-muted: #991b1b;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;
  --success: #16a34a;
  --success-muted: #166534;
  --success-bg: #dcfce7;
  --success-border: #86efac;
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.06);
  --warning-border: rgba(217, 119, 6, 0.4);
  --info: #0f766e;
  --info-bg: #0f766e1a;
  --info-border: #0f766e33;

  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #111110;
  --surface: #1c1c1a;
  --surface2: #252523;
  --border: #333;
  --border2: #444;
  --text: #e8e8e5;
  --text2: #a1a1aa;
  --text3: #8b8b8b;
  --drag-col: #1a2a3a;
  --btn-hover: #2a2a28;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-fill: #6d28d9;

  --logo-line: #4a4d6e;
  --logo-dot1: #5b7cff;
  --logo-dot2: #8a72ff;
  --logo-dot3: #b06bff;

  --danger: #f87171;
  --danger-muted: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --danger-border: #7f1d1d;
  --success: #4ade80;
  --success-muted: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.1);
  --success-border: #166534;
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.08);
  --warning-border: rgba(251, 191, 36, 0.35);
  --info: #2dd4bf;
  --info-bg: #2dd4bf1a;
  --info-border: #2dd4bf33;

  color-scheme: dark;
}

/* ════════════════════════════════════════
   SCROLLBAR
════════════════════════════════════════ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--border2);
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.15s;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-fill);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove outline para mouse/touch, mantém para teclado */
:focus:not(:focus-visible) {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition:
    background 0.2s,
    color 0.2s;
}

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
header {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 {
  font-size: 18px;
  font-weight: 500;
}
/* Marca (logo) — SVG inline que segue as cores do tema via --logo-* */
.brand-mark {
  display: block;
  flex-shrink: 0;
}
.header-icon {
  width: 30px;
  height: 30px;
}
.subtitle {
  font-size: 13px;
  color: var(--text2);
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 18px;
  padding: 6px;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
  display: flex;
  align-items: center;
}
.header-icon-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}

.theme-btn {
  font-size: 13px;
  padding: 6px 14px;
  border: 0.5px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.theme-btn:hover {
  background: var(--btn-hover);
}

/* ════════════════════════════════════════
   BARRA DE PESSOAS
════════════════════════════════════════ */
.people-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  flex-wrap: wrap;
}
.person-chip {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 99px;
  border: 0.5px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
  font-weight: 400;
}
.person-chip:hover {
  background: var(--btn-hover);
}
.person-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 500;
}
.person-chip .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.add-person-btn {
  border-style: dashed;
  color: var(--text3);
}
.add-person-btn:hover {
  color: var(--text);
}

.person-picker-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
  padding: 6px;
  z-index: 500;
  min-width: 210px;
  max-height: 300px;
  overflow-y: auto;
}
[data-theme="dark"] .person-picker-dropdown {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.person-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  user-select: none;
}
.person-picker-item:hover {
  background: var(--btn-hover);
}
.person-picker-empty {
  padding: 14px 12px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  line-height: 1.5;
}

/* ════════════════════════════════════════
   CONTAINER / FILTROS / BOARD
════════════════════════════════════════ */
.container {
  position: relative;
  padding: 20px 24px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.board-toolbar-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: none;
  color: var(--text2);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.board-toolbar-add-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.view-mode-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
}
.view-mode-toggle button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text2);
  cursor: pointer;
}
.view-mode-toggle button:hover {
  background: var(--surface2);
}
.view-mode-toggle button.active {
  background: var(--accent-fill);
  color: #fff;
}

.filter-bar {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.filter-bar span {
  font-size: 12px;
  color: var(--text2);
}
.filter-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.filter-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 500;
}
.filter-btn.add-filter-btn {
  border-style: dashed;
  color: var(--text3);
  background: transparent;
}
.filter-btn.add-filter-btn:hover {
  background: transparent;
  color: var(--text);
}
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--surface2);
  color: var(--text2);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}
.filter-clear-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--danger-bg);
  color: var(--danger-muted);
  border: 0.5px solid var(--danger-border);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.filter-clear-btn:hover {
  background: var(--danger-border);
  color: var(--text);
}

/* ════════════════════════════════════════
   COLUNAS / BOARD
════════════════════════════════════════ */
.col {
  background: var(--surface2);
  border-radius: 12px;
  padding: 10px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  transition: background 0.15s;
}
.col > .col-footer {
  margin-top: auto;
  padding-top: 6px;
}

.col.drag-target {
  background: var(--drag-col);
}
.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.col-title-input {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: none;
  border: none;
  border-bottom: 1px solid var(--accent);
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  font-family: inherit;
  outline: none;
}
.col-edit-title-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}
.col:hover .col-edit-title-btn {
  opacity: 1;
}
.col-edit-title-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.col-count {
  font-size: 12px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  color: var(--text2);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
/* Pior prazo entre os cards não concluídos da coluna/linha — mesma linguagem de
   cor dos date-label (ver _colUrgency) — pra dar uma sinalizada sem abrir o card. */
.col-count.count-urgent {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.col-count.count-tomorrow {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: transparent;
}

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.1s;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.card:active {
  cursor: grabbing;
}
.card.dragging {
  opacity: 0.4;
}

/* Capa do card (primeira imagem anexada) — mostra a imagem inteira (contain) */
.card-cover {
  /* extende até a borda do card, ignorando o padding interno */
  margin: -10px -12px 10px;
  background: var(--surface2);
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  overflow: hidden;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  pointer-events: none; /* não interfere no drag/click do card */
}
.card.card-has-cover .card-title {
  margin-top: 0;
}
.card-cover-bg {
  height: 36px;
}

.card-title {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}
.card-desc {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 7px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text2);
  border: 0.5px solid var(--border);
}
.card-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 500;
}
.card-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  margin-left: auto;
  flex-shrink: 0;
}
.date-label {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  /* Empurra o grupo de botões (concluir/arquivar/excluir) pra ponta direita do
     card, separado das badges (prioridade/checklist/data/anexo/avatar) que
     ficam a esquerda dentro do mesmo .card-meta. */
  margin-left: auto;
}
.act-btn {
  font-size: 12px;
  color: var(--text3);
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background 0.1s;
}
.act-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.act-btn.del:hover {
  background: var(--danger-bg);
  color: var(--danger-muted);
}
.empty-col {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  padding: 2rem 0;
}

/* ── Aba Arquivadas (Config.) ── */
.archive-restore-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 7px;
  border: 0.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.archive-restore-btn:hover {
  background: var(--btn-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* ════════════════════════════════════════
   SELETOR DE CATEGORIA (chips multi-select)
════════════════════════════════════════ */
.cat-picker-wrap {
  position: relative;
}
.cat-picker-btn {
  font-size: 13px;
  padding: 0 12px;
  height: 36px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s;
  width: 100%;
}
.cat-picker-btn:hover {
  background: var(--btn-hover);
}
.cat-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-width: 280px;
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: 10px;
  padding: 8px;
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  flex-wrap: wrap;
  gap: 5px;
}
.cat-picker-wrap.open .cat-dropdown {
  display: flex;
}
.cat-toggle-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  transition:
    opacity 0.1s,
    transform 0.1s;
  white-space: nowrap;
}
.cat-toggle-chip:hover {
  opacity: 0.75;
}
.cat-toggle-chip:active {
  transform: scale(0.95);
}
.cat-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 28px;
}

/* ════════════════════════════════════════
   MODAIS
════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
/* Blindagem contra extensões de browser que injetam `display: block !important`
   em elementos com onclick. Especificidade (0,2,0) + !important para ganhar. */
.modal-overlay:not(.open) {
  display: none !important;
}
.modal-overlay.open {
  display: flex !important;
}
.modal {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  margin: 16px;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--border);
  font-weight: 500;
  font-size: 15px;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 18px;
  padding: 2px;
  border-radius: 4px;
}
.modal-close:hover {
  color: var(--text);
  background: var(--btn-hover);
}
.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 82vh;
  overflow-y: auto;
}
.modal-body label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  margin-top: 4px;
}
.modal-body input[type="text"],
.modal-body input[type="date"],
.modal-body input[type="password"],
.modal-body select,
.modal-body textarea {
  font-size: 14px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  resize: vertical;
}
.modal-body textarea {
  min-height: 90px;
}
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--text2);
}
.modal-body input[type="file"] {
  font-size: 13px;
  color: var(--text2);
  border: 1px dashed var(--border2);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface2);
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 0.5px solid var(--border);
}
.modal-footer button {
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s;
}
.modal-footer button:hover {
  background: var(--btn-hover);
}
.btn-secondary {
  opacity: 0.7;
}
.btn-primary {
  background: var(--accent-fill);
  color: #fff;
  border-color: var(--accent-fill);
}
.btn-primary:hover {
  background: var(--accent-fill);
  opacity: 0.9;
}

/* Botão Salvar do card acende quando há edição pendente (markEditDirty) */
#edit-save-btn.dirty {
  background: var(--accent-fill);
  color: #fff;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.15);
}
#edit-save-btn.dirty:hover {
  background: var(--accent-fill);
  opacity: 0.9;
}
[data-theme="dark"] #edit-save-btn.dirty {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

/* Feedback de "não fechei" ao clicar fora do card com edição pendente */
@keyframes modalShake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(3px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }
  40%,
  60% {
    transform: translateX(6px);
  }
}
.modal.shake {
  animation: modalShake 0.4s ease;
}

/* ── Seletor de cor ── */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.selected {
  border-color: var(--text);
}

/* ── Tags ── */
.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 28px;
}
.tag-removable {
  font-size: 11px;
  padding: 2px 8px 2px 10px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text2);
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.tag-removable button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 12px;
  padding: 0;
  line-height: 1;
}
.tag-removable button:hover {
  color: var(--danger-muted);
}
.tag-input-row {
  display: flex;
  gap: 6px;
}
.tag-input-row input {
  flex: 1;
}
.tag-input-row button {
  padding: 6px 12px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.tag-input-row button:hover {
  background: var(--btn-hover);
}
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.suggestion-tag {
  cursor: pointer;
  transition: opacity 0.1s;
}
.suggestion-tag:hover {
  opacity: 0.7;
}

/* ════════════════════════════════════════
   SETTINGS DRAWER
════════════════════════════════════════ */
.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 400;
}
.settings-overlay.open {
  display: block;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 0.5px solid var(--border);
  z-index: 401;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.12);
}
.settings-drawer.open {
  transform: translateX(0);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 0.5px solid var(--border);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.settings-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 6px;
}
.settings-close-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}

/* Corpo em duas colunas: navegação vertical agrupada + painel de conteúdo */
.settings-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

.settings-nav {
  width: 168px;
  flex-shrink: 0;
  border-right: 0.5px solid var(--border);
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
}
.settings-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  padding: 0 10px 5px;
}
.stab {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  transition:
    background 0.15s,
    color 0.15s;
}
.stab i {
  font-size: 15px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.stab:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.stab.active {
  background: var(--accent-fill);
  color: #fff;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  min-width: 0;
}

.stab-panel {
  display: none;
}
.stab-panel.active {
  display: block;
}

.settings-hint {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 12px;
  line-height: 1.5;
}
.settings-hint strong {
  color: var(--text2);
}

.settings-add-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-add-form label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.settings-add-form input[type="text"] {
  font-size: 14px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-family: inherit;
  width: 100%;
}
.settings-add-form input:focus {
  border-color: var(--accent);
}
.settings-add-form button {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
}
.settings-add-form button:hover {
  opacity: 0.85;
}
.settings-inline-row {
  display: flex;
  gap: 8px;
}
.settings-inline-row input {
  flex: 1;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 0.5px solid var(--border);
}
.settings-row:last-child {
  border-bottom: none;
}
.settings-row input[type="text"] {
  flex: 1;
  font-size: 13px;
  font-family: inherit;
  border: 0.5px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  background: transparent;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.settings-row input[type="text"]:hover {
  border-color: var(--border2);
  background: var(--surface2);
}
.settings-row input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface2);
}

.settings-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.settings-order-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.settings-order-btns button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1;
  font-family: inherit;
}
.settings-order-btns button:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.settings-order-btns button:disabled {
  opacity: 0.2;
  cursor: default;
}
.settings-empty {
  font-size: 13px;
  color: var(--text3);
  padding: 6px 0;
}

.settings-reset-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0.5px dashed var(--border2);
  background: none;
  color: var(--text2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.settings-reset-layout:hover {
  background: var(--btn-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.settings-tag-chip {
  font-size: 11px;
  padding: 3px 10px 3px 12px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text2);
  border: 0.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px;
}
.settings-tag-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 12px;
  padding: 0;
  line-height: 1;
}
.settings-tag-chip button:hover {
  color: var(--danger-muted);
}
.settings-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.settings-subsection-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
/* indicador de drop abaixo (virar filho) */
.col.col-drop-below {
  box-shadow: 0 4px 0 var(--accent) !important;
}

/* ════════════════════════════════════════
   TASK PANEL OVERLAY
════════════════════════════════════════ */
.task-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 89;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.task-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ════════════════════════════════════════
   TASK PANEL (centralizado)
════════════════════════════════════════ */
.task-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 460px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.3, 0.64, 1),
    opacity 0.18s;
}
.task-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.task-panel-header {
  background: var(--accent-fill);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px 16px 0 0;
  user-select: none;
}
.task-panel-header span {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}
.task-panel-actions {
  display: flex;
  gap: 4px;
}
.tpanel-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.1s;
}
.tpanel-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.task-panel-body {
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 0 0 16px 16px;
  max-height: calc(90vh - 60px);
  overflow-y: auto;
}
.task-panel-body input[type="text"],
.task-panel-body input[type="date"],
.task-panel-body input[type="time"],
.task-panel-body select,
.task-panel-body textarea {
  font-size: 14px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.task-panel-body input[type="text"]:focus,
.task-panel-body input[type="date"]:focus,
.task-panel-body input[type="time"]:focus,
.task-panel-body select:focus,
.task-panel-body textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.task-panel-body textarea {
  resize: vertical;
  min-height: 72px;
}
.fp-row {
  display: flex;
  gap: 8px;
}
.fp-row > * {
  flex: 1;
  min-width: 0;
}
.fp-row .cat-picker-wrap {
  flex: 1;
}
.fp-row .cat-picker-btn {
  height: 38px;
}
.fp-submit {
  background: var(--accent-fill);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    opacity 0.15s,
    background 0.2s;
  margin-top: 2px;
}
.fp-submit:hover {
  opacity: 0.88;
}

/* Abas de modo (única / recorrente) */
.fp-mode-tabs {
  display: flex;
  gap: 0;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.fp-mode-tab {
  flex: 1;
  font-size: 12px;
  font-family: inherit;
  padding: 7px 10px;
  border: none;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    background 0.15s,
    color 0.15s;
  font-weight: 400;
}
.fp-mode-tab + .fp-mode-tab {
  border-left: 0.5px solid var(--border);
}
.fp-mode-tab:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.fp-mode-tab.active {
  background: var(--accent-fill);
  color: #fff;
  font-weight: 500;
}

/* Label inline no painel */
.fp-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Campos de recorrência: flex column com gap */
#fp-recurring-extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Visibilidade por modo */
.task-panel:not(.mode-recurring) #fp-recurring-extra {
  display: none;
}
.task-panel.mode-recurring #fp-date {
  display: none;
}
.task-panel.mode-recurring #fp-date-row {
  display: block;
} /* person full-width */

/* dias da semana dentro do painel (tamanho compacto) */
#fp-days {
  gap: 4px;
}
#fp-days .day-chip {
  padding: 4px 8px;
  font-size: 11px;
}

/* submit button no modo recorrente com cor diferente */
.task-panel.mode-recurring .fp-submit {
  background: #0f6e56;
  box-shadow: 0 2px 10px rgba(15, 110, 86, 0.3);
}

/* ════════════════════════════════════════
   BARRA DE PROGRESSO DO CHECKLIST
════════════════════════════════════════ */
.checklist-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}
.checklist-bar {
  height: 100%;
  background: var(--accent-fill);
  border-radius: 99px;
  transition: width 0.35s ease;
  min-width: 4px;
}
.checklist-bar.complete {
  background: var(--success);
}

/* ════════════════════════════════════════
   COR INDIVIDUAL DO CARD
════════════════════════════════════════ */
.card.card-colored {
  border-left: 3px solid var(--card-accent, var(--accent));
}

.card-color-picker {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.card-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s;
  flex-shrink: 0;
}
.card-color-swatch:hover {
  transform: scale(1.2);
}
.card-color-swatch.selected {
  border-color: var(--text);
}
.card-color-swatch.none {
  background: var(--surface2) !important;
  border: 1.5px dashed var(--border2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
}

/* ════════════════════════════════════════
   BOTÃO CONCLUIR NO CARD
════════════════════════════════════════ */
.act-btn.done-btn:hover {
  background: var(--success-bg);
  color: var(--success);
}
.act-btn.done-btn.active {
  background: var(--success-bg);
  color: var(--success);
}

/* ════════════════════════════════════════
   STATS DA EMPRESA (home screen)
════════════════════════════════════════ */
.co-stats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.stat-chip {
  font-size: 11px;
  color: var(--text3);
}
.stat-chip.overdue {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--danger-bg);
  color: var(--danger-muted);
  border: 0.5px solid var(--danger-border);
}
.stat-chip.empty {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface2);
  border: 0.5px solid var(--border);
  font-style: italic;
}

/* ════════════════════════════════════════
   FAB
════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(91, 33, 182, 0.4);
  z-index: 80;
  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(91, 33, 182, 0.5);
}
.fab.active {
  background: #374151;
  box-shadow: 0 4px 18px rgba(55, 65, 81, 0.4);
}

/* ════════════════════════════════════════
   BUSCA (HEADER)
════════════════════════════════════════ */
.header-search {
  flex: 1;
  max-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search .search-icon {
  position: absolute;
  left: 9px;
  font-size: 15px;
  color: var(--text3);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  font-size: 13px;
  padding: 6px 10px 6px 30px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.header-search input:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.header-search input::placeholder {
  color: var(--text3);
}
.header-search input.has-value {
  border-color: var(--accent);
  padding-right: 28px;
}
.search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  padding: 2px 3px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s;
}
.search-clear:hover {
  color: var(--text);
}

/* ════════════════════════════════════════
   ESTADOS DE DATA
════════════════════════════════════════ */
.date-label.date-urgent {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 99px;
  padding: 1px 7px;
}
.date-label.date-tomorrow {
  color: var(--warning);
  background: var(--warning-bg);
  border-radius: 99px;
  padding: 1px 7px;
}
.date-label.date-future {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 99px;
  padding: 1px 7px;
}
.date-label.date-done {
  color: var(--success-muted);
  background: var(--success-bg);
  border-radius: 99px;
  padding: 1px 7px;
}
/* date-urgent and date-tomorrow dark handled by CSS vars */
[data-theme="dark"] .date-label.date-future {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}
/* date-done dark handled by CSS vars */

/* ════════════════════════════════════════
   CARD CONCLUÍDO
════════════════════════════════════════ */
.card.card-done {
  border-left: 3px solid var(--success) !important;
  background: var(--success-bg);
  opacity: 0.9;
}

/* ════════════════════════════════════════
   SELETOR DE COR PERSONALIZADA
════════════════════════════════════════ */
.cw-swatch {
  background: #fff;
  border: 1.5px dashed var(--border2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cw-swatch i {
  color: var(--text3);
  font-size: 11px;
}
.cw-swatch.selected i {
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.4));
}
[data-theme="dark"] .cw-swatch {
  background: var(--surface2);
}

.card-color-swatch.cw-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.cw-modal {
  max-width: 268px;
  overflow: visible;
}
.cw-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px 16px;
}
#cw-canvas {
  touch-action: none;
  cursor: crosshair;
  display: block;
  border-radius: 50%;
}
.cw-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}
#cw-preview {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 0.5px solid var(--border2);
  transition: background 0.1s;
}
#cw-hex {
  flex: 1;
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cw-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  justify-content: flex-end;
}

/* ════════════════════════════════════════
   DRAG INDICATOR (reordenar dentro da coluna)
════════════════════════════════════════ */
.card.drag-above {
  border-top: 2px solid var(--accent);
}
.card.drag-below {
  border-bottom: 2px solid var(--accent);
}

/* ════════════════════════════════════════
   CHECKLIST / SUBTAREFAS
════════════════════════════════════════ */
.checklist-progress {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.checklist-progress.complete {
  color: var(--success);
}

.card-cl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
}
.card-cl-toggle:hover {
  color: var(--text);
}
.card-cl-toggle.complete {
  color: var(--success);
}
.card-cl-toggle span {
  font-weight: 500;
}

.card-att-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text3);
}
.card-att-badge span {
  font-weight: 500;
}

.card-cl-expanded {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.card-cl-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--text);
  transition: background 0.12s;
}
.card-cl-item:hover {
  background: var(--btn-hover);
}
.card-cl-box {
  cursor: pointer;
}
.card-cl-box:hover {
  border-color: var(--accent) !important;
}
.card-cl-item.done .card-cl-text {
  text-decoration: line-through;
  opacity: 0.45;
}
.card-cl-box {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--success);
}
.card-cl-item.done .card-cl-box {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.checklist-list {
  display: flex;
  flex-direction: column;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}
.checklist-item:last-child {
  border-bottom: none;
}
.checklist-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-fill);
  cursor: pointer;
  flex-shrink: 0;
}
/* Especificidade extra (id do container) pra vencer a regra genérica .modal-body input[type=text] */
#edit-checklist input.checklist-item-text {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 5px;
  margin: -3px -5px;
  cursor: text;
  transition:
    background 0.12s,
    border-color 0.12s;
}
#edit-checklist input.checklist-item-text:hover {
  background: var(--surface2);
}
#edit-checklist input.checklist-item-text:focus {
  background: var(--surface2);
  border-color: var(--accent);
  outline: none;
  cursor: text;
}
#edit-checklist input.checklist-item-text.done {
  text-decoration: line-through;
  color: var(--text3);
}
.checklist-item .del-check {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}
.checklist-item .del-check:hover {
  color: var(--danger-muted);
  background: var(--danger-bg);
}
.checklist-add-row {
  display: flex;
  gap: 6px;
}
.checklist-add-row input {
  flex: 1;
}
.checklist-add-row button {
  padding: 6px 12px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.checklist-add-row button:hover {
  background: var(--btn-hover);
}

/* color dot clicável (troca de cor por rotação) */
.settings-color-dot.clickable {
  cursor: pointer;
  transition:
    transform 0.12s,
    opacity 0.12s;
}
.settings-color-dot.clickable:hover {
  transform: scale(1.25);
  opacity: 0.8;
}

/* ════════════════════════════════════════
   COLUNAS — layout com grupos
════════════════════════════════════════ */
.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

/* cada stack ocupa espaço igual, mínimo 220px */
.board-col-stack {
  flex: 1 0 220px;
}

/* stack com coluna recolhida vira barra fina */
.board-col-stack:has(> .col.collapsed) {
  flex: 0 0 50px;
}

.col {
  min-width: 0;
  width: 100%;
}

/* ════════════════════════════════════════
   VISÃO DE LINHAS — opção extra de organização (ver setViewMode)
   Cada coluna vira uma faixa horizontal de altura fixa; os cards ficam lado a
   lado (scroll horizontal) em vez de empilhados verticalmente.
════════════════════════════════════════ */
.board-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-self: stretch;
  min-height: 0;
  overflow-x: auto; /* grupo de linhas largo demais rola só aqui dentro, não empurra a página toda pro lado */
}
.row-lane {
  background: var(--surface2);
  border-radius: 12px;
  padding: 10px;
  height: 210px;
  flex-shrink: 0;
  align-self: flex-start; /* encolhe pra caber só o conteúdo (não estica até o fim do board à toa) */
  min-width: 300px;
  max-width: min(
    100%,
    640px
  ); /* mostra ~2 cards; o resto rola na horizontal (ver .row-lane-cards) */
  display: flex;
  flex-direction: row; /* nome na lateral esquerda, descendo, em vez de em cima */
  transition: background 0.15s;
}
.row-lane.drag-target {
  background: var(--drag-col);
}
.row-lane:hover .col-drag-handle {
  opacity: 1;
}
.row-lane.col-dragging {
  opacity: 0.4;
}
.row-lane.row-drop-pair {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* duas (ou mais) linhas lado a lado — soltar no meio de uma linha pareia (ver rowDrop).
   O GRUPO em si também encolhe pra caber só o conteúdo (mesma lógica do .row-lane
   sozinho) — senão duas linhas vazias pareadas ficavam esticadas cobrindo a tela toda. */
.row-lane-group {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-self: flex-start;
  max-width: 100%;
}
/* cada linha do par encolhe pro PRÓPRIO conteúdo (não divide a largura igual com a
   parceira) — senão uma linha cheia de cards "puxava" a parceira vazia junto. */
.row-lane-group .row-lane {
  flex: 0 0 auto;
}
.row-lane-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  margin-right: 10px;
  padding-right: 10px;
  border-right: 0.5px solid var(--border);
  flex-shrink: 0;
}
.row-lane-header .col-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Espaço reservado é o MESMO que o .col-title usa (flex:1) — só dentro dele o
   input centraliza pelo próprio tamanho, sem invadir a alça/contador vizinhos. */
.row-lane-header .col-title-input-wrap {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 0;
}
.row-lane-header .col-title-input {
  writing-mode: vertical-rl;
  white-space: nowrap;
  height: auto;
  width: auto;
  max-height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(180deg);
}
.row-lane-header .col-drag-handle {
  opacity: 0.6;
}
.row-lane-header .col-count {
  writing-mode: horizontal-tb;
  transform: none;
}
.row-lane-cards {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.row-lane-cards .card {
  width: 230px;
  flex-shrink: 0;
  overflow-y: auto;
}
.row-add-actions {
  flex-shrink: 0;
  align-self: center; /* discreto, igual a visão de Colunas — não estica pra altura toda */
  margin-left: auto; /* gruda na ponta direita quando sobra espaço (poucos/nenhum card) */
  display: flex;
  flex-direction: column; /* templates embaixo do +, não do lado (ocupava espaço horizontal à toa) */
  align-items: center;
  gap: 2px;
}
.row-add-btn,
.row-template-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition:
    background 0.15s,
    color 0.15s;
}
.row-add-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.row-template-btn:hover {
  background: var(--btn-hover);
  color: var(--accent);
}
.row-inline-add {
  flex-shrink: 0;
  width: 230px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row-inline-add .col-inline-input {
  flex: 1;
  min-height: 0;
  resize: none;
}

/* Formulário inline de "adicionar coluna/linha" — só aparece enquanto ativo
   (ver addingNewCol); o botão-gatilho fica na toolbar (#board-toolbar-add-btn),
   não disputa espaço de coluna no board. */
.add-col-stack {
  display: flex;
  align-items: flex-start;
}
.row-lane.add-row-lane {
  height: auto;
  min-height: 54px;
  background: none;
  padding: 8px;
}
.row-lane.add-row-lane .add-col-inline {
  width: 100%;
}
.add-col-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.add-col-inline .col-inline-input {
  flex: 1;
  min-height: 0;
  height: 36px;
  resize: none;
  padding: 6px 10px;
}
.add-col-inline .col-inline-actions {
  flex-shrink: 0;
}

/* drag handle da coluna */
.col-drag-handle {
  cursor: grab;
  color: var(--text3);
  font-size: 15px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
  user-select: none;
}
.col:hover .col-drag-handle {
  opacity: 1;
}
.col-drag-handle:active {
  cursor: grabbing;
}

/* estados de drag da coluna */
.col.col-dragging {
  opacity: 0.4;
}
.col.col-drop-left {
  box-shadow: -3px 0 0 var(--accent);
}
.col.col-drop-right {
  box-shadow: 3px 0 0 var(--accent);
}
.col.col-drop-above {
  box-shadow: 0 -4px 0 var(--accent) !important;
}
.col.col-drop-pair {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* botão de recolher */
.col-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition:
    opacity 0.15s,
    background 0.1s;
  margin-left: auto;
  flex-shrink: 0;
}
.col:hover .col-collapse-btn {
  opacity: 1;
}
.col-collapse-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}

/* ─── pilha vertical ─── */
.board-col-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-col-stack .col {
  width: 100%;
  min-width: 0;
}

/* ─── fileira horizontal dentro da pilha ─── */
.board-col-row {
  display: flex;
  gap: 6px;
  align-items: start;
}
.board-col-row > .col {
  flex: 1;
  min-width: 0;
}

/* ════════════════════════════════════════
   COLUMN FOOTER & TEMPLATE PICKER
════════════════════════════════════════ */
.col-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 2px;
}
.col-add-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  text-align: left;
}
.col-add-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.col-inline-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.col-inline-input {
  width: 100%;
  resize: none;
  min-height: 60px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.col-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.col-inline-submit {
  background: var(--accent-fill);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.col-inline-submit:hover {
  opacity: 0.88;
}
.col-inline-cancel {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s;
}
.col-inline-cancel:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.col-template-btn {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 6px 7px;
  color: var(--text3);
  cursor: pointer;
  font-size: 13px;
  transition:
    background 0.15s,
    color 0.15s;
}
.col-template-btn:hover {
  background: var(--btn-hover);
  color: var(--accent);
}

.template-col-picker {
  display: none;
  position: fixed;
  z-index: 1200;
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: 12px;
  width: 230px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.tpl-pick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 0.5px solid var(--border);
}
.tpl-pick-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
}
.tpl-pick-close:hover {
  color: var(--text);
  background: var(--btn-hover);
}
.tpl-pick-list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.tpl-pick-empty {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  padding: 12px 0;
}
.tpl-pick-card {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition:
    background 0.12s,
    border-color 0.12s;
}
.tpl-pick-card:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
}
.tpl-pick-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.tpl-pick-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpl-pick-card {
  position: relative;
}
.tpl-pick-card-edit {
  cursor: default;
}
.tpl-pick-card-edit:hover {
  background: var(--surface2);
  border-color: var(--border);
}
.tpl-pick-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 2px;
}
.tpl-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  background: var(--accent-fill);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
}
.tpl-pick-check {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.tpl-pick-footer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-top: 0.5px solid var(--border);
}
.tpl-pick-new {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--text2);
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s;
}
.tpl-pick-new:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.tpl-pick-edit {
  width: 100%;
  padding: 7px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s;
}
.tpl-pick-edit:hover {
  background: var(--btn-hover);
}

#fp-template-row select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
}

/* coluna recolhida*/
.col.collapsed {
  width: 44px;
  min-width: 0;
  min-height: 120px;
  padding: 8px 0 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.col.collapsed .col-header {
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  padding: 0;
  gap: 0;
  width: 100%;
  cursor: pointer;
}
.col.collapsed .col-title {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.col.collapsed .col-count {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.5;
  line-height: 1;
  padding-top: 6px;
}
/* esconde tudo que não interessa */
.col.collapsed .col-drag-handle {
  display: none;
}
.col.collapsed .col-collapse-btn {
  display: none;
}
.col.collapsed .col-edit-title-btn {
  display: none;
}
.col.collapsed > :not(.col-header) {
  display: none;
}

/* ════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════ */
#login-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 650;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
#login-screen.active {
  display: flex;
}
.login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  max-width: 520px;
  width: 100%;
}
.login-logo {
  width: 64px;
  height: 64px;
}
.login-title {
  font-size: 22px;
  font-weight: 600;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.login-form input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.login-form input:focus {
  border-color: var(--accent);
}
.login-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-password-wrap input {
  padding-right: 40px;
  width: 100%;
  box-sizing: border-box;
}
.login-pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 15px;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.login-pw-toggle:hover {
  color: var(--text);
}
.login-error {
  font-size: 12px;
  color: #ef4444;
  min-height: 16px;
  text-align: center;
}
.login-submit {
  padding: 10px;
  border-radius: 8px;
  background: var(--accent-fill);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  width: 100%;
}
.login-submit:hover {
  opacity: 0.88;
}

/* ── Chip do usuário no home header ── */
.home-user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 99px;
  border: 0.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-size: 12px;
  color: var(--text2);
  transition:
    border-color 0.12s,
    background 0.12s;
}
.home-user-chip:hover {
  border-color: var(--text3);
  background: var(--btn-hover);
}
.user-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.user-chip-creator {
  color: var(--text3);
  font-size: 11px;
  margin-left: 2px;
}

/* ── Avatar pequeno (modal usuários / acesso) ── */
.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.user-role-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(91, 33, 182, 0.1);
  color: var(--accent);
  font-weight: 500;
}
[data-theme="dark"] .user-role-badge {
  background: rgba(196, 181, 253, 0.12);
  color: #c4b5fd;
}
.user-role-badge.central {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}
[data-theme="dark"] .user-role-badge.central {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

/* ── Seletor de role no modal Novo Usuário ── */
.role-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.role-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  transition: all 0.12s ease;
}
.role-option:hover {
  background: var(--btn-hover);
}
.role-option input {
  display: none;
}
.role-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(91, 33, 182, 0.08);
  color: var(--accent);
}
[data-theme="dark"] .role-option:has(input:checked) {
  border-color: #c4b5fd;
  background: rgba(196, 181, 253, 0.1);
  color: #c4b5fd;
}
.role-option i {
  font-size: 14px;
}

/* ── Mini "criado por" abaixo do nome de usuário ── */
.user-list-createdby {
  font-size: 10.5px;
  color: var(--text3);
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.user-list-createdby i {
  font-size: 10px;
}

/* ── Tabs Users/Auditoria ── */
.users-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  width: fit-content;
}
.users-tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}
.users-tab:hover {
  color: var(--text);
}
.users-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .users-tab.active {
  color: #c4b5fd;
}
.users-tab i {
  font-size: 13px;
}

/* ── Painel de auditoria ── */
.audit-section {
  margin-bottom: 20px;
}
.audit-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.audit-section-title i {
  color: var(--accent);
}
.audit-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.audit-admin-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}
.audit-admin-name {
  font-size: 13px;
  font-weight: 600;
}
.audit-stats {
  font-size: 11px;
  color: var(--text3);
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.audit-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.audit-user-row .user-avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 9px;
}
.audit-user-row-info {
  flex: 1;
  min-width: 0;
}
.audit-user-meta {
  font-size: 10.5px;
  color: var(--text3);
}
.audit-empty {
  font-size: 12px;
  color: var(--text3);
  padding: 8px 0;
  text-align: center;
}

/* ── Seção de adicionar usuário no modal ── */
.users-add-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Linhas de acesso no modal empresa ── */
.user-access-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  margin-bottom: 2px;
}
.user-access-row:hover {
  background: var(--btn-hover);
}
.user-access-row.active {
  background: rgba(91, 33, 182, 0.06);
}
[data-theme="dark"] .user-access-row.active {
  background: rgba(196, 181, 253, 0.08);
}
.user-access-row span {
  flex: 1;
  font-size: 13px;
}
.user-access-toggle {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
}
.user-access-row.active .user-access-toggle {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: #fff;
}
[data-theme="dark"] .user-access-row.active .user-access-toggle {
  background: #c4b5fd;
  border-color: #c4b5fd;
  color: #1c1c1a;
}

/* ── Dots de usuários no card de empresa ── */
.co-user-dots {
  display: flex;
  gap: -4px;
  margin-top: 6px;
}
.co-user-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  border: 1.5px solid var(--surface);
  margin-right: -4px;
  cursor: default;
}

/* ════════════════════════════════════════
   HOME SCREEN
════════════════════════════════════════ */
#home-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 600;
  flex-direction: column;
  overflow-y: auto;
}
#home-screen.active {
  display: flex;
}

/* ── Tela dedicada de gerenciamento de usuários ── */
#users-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 620;
  flex-direction: column;
  overflow-y: auto;
}
#users-screen.active {
  display: flex;
}

.users-mgmt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Linha compacta de usuário */
.user-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
  user-select: none;
}
.user-list-row:hover {
  border-color: var(--accent);
  background: var(--btn-hover);
}
.user-list-info {
  flex: 1;
  min-width: 0;
}
.user-list-name {
  font-size: 14px;
  font-weight: 500;
}
.user-list-username {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}
.user-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text2);
  background: var(--surface2, rgba(0, 0, 0, 0.04));
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nota admin dentro do modal de edição */
.user-mgmt-admin-note {
  font-size: 12px;
  color: var(--text2);
  background: rgba(91, 33, 182, 0.06);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
[data-theme="dark"] .user-mgmt-admin-note {
  background: rgba(167, 139, 250, 0.1);
}
.user-mgmt-empty {
  font-size: 12px;
  color: var(--text3);
  padding: 10px;
  text-align: center;
}

/* Grid de empresas (usado no modal-edit-user) */
.user-company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

/* Botão destrutivo no footer do modal */
.btn-danger {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: transparent;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}
.user-company-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2, var(--bg));
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s,
    transform 0.08s;
  user-select: none;
}
.user-company-row:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.user-company-row.active {
  border-color: var(--accent);
  background: rgba(91, 33, 182, 0.08);
}
[data-theme="dark"] .user-company-row.active {
  background: rgba(167, 139, 250, 0.12);
  border-color: #a78bfa;
}
.user-company-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface);
}
.user-company-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-company-toggle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 11px;
  flex-shrink: 0;
}
.user-company-row.active .user-company-toggle {
  background: var(--accent-fill);
  color: #fff;
  border-color: var(--accent-fill);
}
[data-theme="dark"] .user-company-row.active .user-company-toggle {
  background: #a78bfa;
  border-color: #a78bfa;
}

/* Color picker compacto na tela de usuários */
.user-mgmt-section .color-picker {
  gap: 6px;
}
.user-mgmt-section .color-swatch {
  width: 22px;
  height: 22px;
}

/* Header sticky com sombra ao rolar */
#users-screen .home-header {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}

.home-header {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.home-header h1 {
  font-size: 18px;
  font-weight: 500;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header-actions {
  display: flex;
  gap: 8px;
}

.home-body {
  flex: 1;
  padding: 40px 32px;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.home-section-header h2 {
  font-size: 15px;
  font-weight: 600;
}

/* ── Seção por tipo de quadro (Empresas / Pessoal) ── */
.board-section {
  margin-bottom: 36px;
}
.board-section:last-child {
  margin-bottom: 8px;
}
.board-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.board-section-title i {
  font-size: 14px;
  color: var(--accent);
}
.board-section-title .count {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text3);
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.company-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px;
  cursor: pointer;
  transition:
    box-shadow 0.15s,
    transform 0.12s,
    border-color 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.company-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: var(--border2);
}
.company-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.company-card-color {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.company-card-info {
  flex: 1;
  min-width: 0;
}
.company-card-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.company-card-razao {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-card-cnpj {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}
.company-card-time {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.company-card-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.company-card:hover .company-card-actions {
  opacity: 1;
}

/* ── Tile "adicionar" ao final de cada seção ── */
.company-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 100px;
  border: 1.5px dashed var(--border2);
  border-radius: 16px;
  background: none;
  color: var(--text3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.company-card-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 33, 182, 0.05);
}

.add-company-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 0.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s;
}
.add-company-btn:hover {
  background: var(--btn-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* ════════════════════════════════════════
   TIMER (header kanban)
════════════════════════════════════════ */
.timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  padding: 5px 12px;
  border: 0.5px solid var(--border);
  border-radius: 99px;
  background: var(--surface2);
  white-space: nowrap;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.timer-display.running {
  color: var(--accent);
  border-color: rgba(91, 33, 182, 0.4);
  background: rgba(91, 33, 182, 0.06);
}
.timer-display.paused {
  color: var(--warning);
  border-color: var(--warning-border);
  background: var(--warning-bg);
}
[data-theme="dark"] .timer-display.running {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.35);
  background: rgba(196, 181, 253, 0.08);
}
.timer-pause-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  padding: 0 0 0 4px;
  display: flex;
  align-items: center;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.timer-pause-btn:hover {
  opacity: 1;
}
.timer-display.hidden {
  display: none;
}

/* ════════════════════════════════════════
   TOGGLE TIPO DE QUADRO (modal empresa/pessoal)
════════════════════════════════════════ */
.co-type-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.co-type-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.co-type-opt:hover {
  background: var(--btn-hover);
}
.co-type-opt.active {
  background: rgba(91, 33, 182, 0.08);
  color: var(--accent);
  border-color: var(--accent);
}

/* Modal de confirmação — compacto */
.confirm-modal {
  max-width: 360px;
}
/* Modal de import tem 3 botões com rótulos longos — não cabem numa linha só
   nos 360px padrão do .confirm-modal, então ganha mais largura e quebra linha. */
#modal-import-mode .modal {
  max-width: 420px;
}
#modal-import-mode .modal-footer {
  flex-wrap: wrap;
}
.import-preview-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text2);
}
.import-preview-list b {
  color: var(--text);
}
.ip-new {
  color: var(--success);
  font-weight: 600;
}
.import-preview-hint {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
  border-top: 0.5px solid var(--border);
  padding-top: 8px;
}
.import-preview-empty {
  font-size: 13px;
  color: var(--text3);
}
.confirm-modal .modal-header {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* modal de empresa precisa ficar acima do #home-screen (z-index 600) */
#modal-company {
  z-index: 700;
}

/* modais de usuário precisam ficar acima do #users-screen (z-index 620) */
#modal-new-user {
  z-index: 720;
}
#modal-edit-user {
  z-index: 720;
}

/* colorwheel precisa ficar acima de todos os painéis (settings: 401, company: 700) */
#modal-colorwheel {
  z-index: 800;
}

/* modal de recorrentes precisa ficar acima do settings drawer (z-index 401) */
#modal-recurring {
  z-index: 450;
}

/* confirm precisa ficar acima de TUDO — pode ser chamado de qualquer tela/modal
   (home: 600, users: 620, modal-edit-user: 720, modal-colorwheel: 800) */
#modal-confirm {
  z-index: 900;
}

/* modal de perfil precisa ficar acima das telas principais (home: 600, users: 620) */
#modal-profile {
  z-index: 720;
}

/* modal de editar tempo (mesma camada dos outros modais de usuário) */
#modal-edit-time {
  z-index: 720;
}
.edit-time-info {
  font-size: 12.5px;
  color: var(--text2);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface2);
  border: 0.5px solid var(--border);
  margin-bottom: 10px;
}
.edit-time-info strong {
  color: var(--text);
  font-weight: 600;
}

/* ════════════════════════════════════════
   PAINEL DE TEMPOS (tab "Tempos" na users-screen)
════════════════════════════════════════ */

/* Toolbar do topo: usuário + período + chip do user selecionado */
.times-toolbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.times-toolbar-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px;
  min-width: 160px;
}
.times-toolbar-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.times-toolbar-select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.times-toolbar-select:hover {
  border-color: var(--border2);
}
.times-toolbar-select:focus {
  outline: none;
  border-color: var(--accent);
}
.times-custom-range {
  min-width: 140px;
}
input.times-toolbar-select {
  font-family: inherit;
}
input.times-toolbar-select::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  filter: invert(0);
}
[data-theme="dark"]
  input.times-toolbar-select::-webkit-calendar-picker-indicator {
  filter: invert(1);
}
.times-user-pill {
  margin-left: auto;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.times-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.times-user-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px;
  line-height: 1.2;
}
.times-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.times-user-tag {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Summary: 3 stats no topo */
.times-summary {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.times-summary-stat {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.times-summary-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.times-summary-label i {
  font-size: 13px;
  color: var(--accent);
}
[data-theme="dark"] .times-summary-label i {
  color: #c4b5fd;
}
.times-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.times-summary-sub {
  font-size: 12px;
  color: var(--text3);
  font-weight: 400;
}

/* Lista de empresas */
.times-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
}
.time-company-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.time-company-block:hover {
  border-color: var(--border2);
}
.time-company-block.expanded {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .time-company-block.expanded {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Header da empresa (clicável) — usar !important pra blindar contra resets */
.time-company-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: background 0.12s;
}
.time-company-header:hover {
  background: var(--btn-hover);
}
.time-company-block.expanded .time-company-header {
  background: var(--surface2);
  border-bottom: 0.5px solid var(--border);
}
.time-company-chevron {
  font-size: 14px;
  color: var(--text3);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.time-company-block.expanded .time-company-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}
[data-theme="dark"] .time-company-block.expanded .time-company-chevron {
  color: #c4b5fd;
}
.time-company-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.06);
}
[data-theme="dark"] .time-company-color {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.time-company-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.time-company-bar {
  flex: 1;
  height: 4px;
  min-width: 40px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.time-company-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
  opacity: 0.7;
}
.time-company-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.time-company-total.zero {
  color: var(--text3);
  font-weight: 500;
}

/* Body com linhas de dia (quando expandido) */
.time-company-body {
  display: flex !important;
  flex-direction: column !important;
  background: var(--surface);
}
.time-day-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-top: 0.5px solid var(--border);
  font-size: 13px;
  transition: background 0.1s;
}
.time-day-row:first-child {
  border-top: none;
}
.time-day-row:hover {
  background: var(--btn-hover);
}
.time-day-label {
  min-width: 110px;
  color: var(--text2);
  font-weight: 500;
  flex-shrink: 0;
}
.time-day-bar {
  flex: 1;
  height: 4px;
  min-width: 40px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.time-day-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
  opacity: 0.5;
}
.time-day-row:hover .time-day-bar-fill {
  opacity: 0.85;
}
.time-day-row.empty .time-day-bar-fill {
  opacity: 0;
}
.time-day-value {
  min-width: 80px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.time-day-value.zero {
  color: var(--text3);
  font-weight: 400;
}
.time-edit-btn {
  background: none;
  border: 0.5px solid var(--border);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--text3);
  font-size: 12px;
  display: inline-flex !important;
  align-items: center;
  flex-shrink: 0;
  transition: all 0.12s ease;
}
.time-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 33, 182, 0.06);
}
[data-theme="dark"] .time-edit-btn:hover {
  background: rgba(196, 181, 253, 0.1);
  border-color: #c4b5fd;
  color: #c4b5fd;
}

/* Empty state */
.times-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.times-empty i {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.6;
}

/* Botões de exportar (CSV/JSON) */
.times-export-group {
  display: flex !important;
  flex-direction: row !important;
  gap: 6px;
  align-items: center;
}
.times-export-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.times-export-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 33, 182, 0.06);
}
[data-theme="dark"] .times-export-btn:hover {
  background: rgba(196, 181, 253, 0.1);
  border-color: #c4b5fd;
  color: #c4b5fd;
}
.times-export-btn i {
  font-size: 14px;
}

/* ════════════════════════════════════════
   PAINEL DE RELATÓRIO
════════════════════════════════════════ */
.report-summary {
  grid-template-columns: repeat(4, 1fr) !important;
}

.report-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.report-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
}
.report-section-title i {
  color: var(--accent);
  font-size: 14px;
}
[data-theme="dark"] .report-section-title i {
  color: #c4b5fd;
}

/* Tabela cruzada */
.report-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.report-table th,
.report-table td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 0.5px solid var(--border);
  white-space: nowrap;
}
.report-table thead th {
  background: var(--surface2);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text2);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}
.report-table tbody tr:hover {
  background: var(--btn-hover);
}
.report-table tbody tr:last-child td,
.report-table tbody tr:last-child th {
  border-bottom: none;
}

.report-th-user {
  text-align: left !important;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}
.report-table thead .report-th-user {
  background: var(--surface2);
}
.report-table tbody tr:hover .report-th-user {
  background: var(--btn-hover);
}
.report-th-co {
  font-size: 11px;
  display: table-cell;
}
.report-th-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.report-th-total {
  background: rgba(91, 33, 182, 0.04) !important;
  color: var(--accent) !important;
}
[data-theme="dark"] .report-th-total {
  background: rgba(196, 181, 253, 0.06) !important;
  color: #c4b5fd !important;
}
.report-cell {
  font-weight: 500;
  color: var(--text);
}
.report-cell.zero {
  color: var(--text3);
  font-weight: 400;
}
.report-cell-total {
  font-weight: 700;
  background: rgba(91, 33, 182, 0.03);
}
[data-theme="dark"] .report-cell-total {
  background: rgba(196, 181, 253, 0.05);
}
.report-totals-row th,
.report-totals-row td {
  background: var(--surface2);
  font-weight: 700;
  border-top: 1px solid var(--border);
}
.report-totals-row .report-th-user {
  background: var(--surface2) !important;
}
.report-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
}
.report-user-name {
  font-weight: 500;
  color: var(--text);
}
.report-user-self {
  color: var(--text3);
  font-weight: 400;
  font-size: 11px;
}

/* Médias por dia trabalhado */
.report-avg-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.report-avg-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px;
}
.report-avg-col-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 5px;
  padding: 4px 0 8px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}
.report-avg-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.1s;
}
.report-avg-row:hover {
  background: var(--btn-hover);
}
.report-co-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.05);
}
.report-avg-meta {
  flex: 1;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  gap: 1px;
}
.report-avg-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-avg-sub {
  font-size: 11px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.report-avg-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
[data-theme="dark"] .report-avg-value {
  color: #c4b5fd;
}
.report-avg-suffix {
  font-size: 10.5px;
  color: var(--text3);
  font-weight: 400;
  margin-left: 3px;
}

/* Responsivo: telas estreitas */
@media (max-width: 720px) {
  .times-summary {
    grid-template-columns: 1fr;
  }
  .report-summary {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .times-toolbar-field {
    flex: 1;
    min-width: 0;
  }
  .times-user-pill {
    margin-left: 0;
    width: 100%;
  }
  .times-export-group {
    width: 100%;
  }
  .time-company-bar,
  .time-day-bar {
    display: none;
  }
  .time-day-label {
    min-width: 90px;
  }
  .report-avg-grid {
    grid-template-columns: 1fr;
  }
}
.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0 6px;
}
.profile-pw-error {
  font-size: 11.5px;
  color: var(--danger-muted);
  min-height: 14px;
  margin-top: 2px;
}

/* ── Modo recorrente no modal-edit ── */
.modal-rec-section {
  display: none !important;
}
.modal-rec-mode .modal-rec-section {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
}
.modal-rec-mode .card-detail-col-row {
  display: none;
}
.modal-rec-mode .cd-sidebar-section:has(.cd-actions) {
  display: none;
}
/* Em modo recorrência o prazo não faz sentido — é definido na hora que o card é criado. */
.modal-rec-mode .cd-sidebar-section:has(#edit-date) {
  display: none;
}

/* ── Modo template no modal-edit ── */
.modal-tpl-section {
  display: none !important;
}
.modal-tpl-mode .modal-tpl-section {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
}

.cd-rec-block {
  margin-bottom: 10px;
}
.cd-rec-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.rec-type-tabs-sm {
  gap: 4px;
}
.rec-type-tabs-sm .rec-type-tab {
  padding: 4px 8px;
  font-size: 11px;
  gap: 3px;
}

/* ════════════════════════════════════════
   DIAS DA SEMANA (tarefa recorrente)
════════════════════════════════════════ */
.days-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-chip {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: 0.5px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text2);
  user-select: none;
  margin-top: 0;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.day-chip input[type="checkbox"] {
  display: none;
}
.day-chip:has(input:checked) {
  background: var(--accent-fill);
  color: #fff;
  border-color: var(--accent-fill);
}

/* ════════════════════════════════════════
   LINHA DE TAREFA RECORRENTE (settings)
════════════════════════════════════════ */
.recurring-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 0;
}
.recurring-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.recurring-row-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.recurring-row-meta {
  font-size: 11px;
  color: var(--text3);
  padding-left: 22px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.recurring-inactive .recurring-row-title {
  opacity: 0.4;
}
.recurring-inactive .recurring-row-meta {
  opacity: 0.3;
}

/* ── Seletor de tipo de recorrência ── */
.rec-type-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rec-type-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  font-size: 12px;
  color: var(--text2);
  background: var(--surface2);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  user-select: none;
}
.rec-type-tab input[type="radio"] {
  display: none;
}
.rec-type-tab:has(input:checked) {
  background: var(--accent-fill);
  color: #fff;
  border-color: var(--accent-fill);
}

/* ── Dias do mês (compact grid) ── */
.days-picker-month {
  gap: 4px;
}
.day-chip-sm {
  min-width: 30px;
  padding: 4px 6px;
  font-size: 11px;
  justify-content: center;
}

/* ── Toggle ativo/inativo (switch) ── */
.rec-toggle {
  position: relative;
  cursor: pointer;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  margin-right: 2px;
}
.rec-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.rec-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.rec-toggle-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text3);
  transition:
    left 0.18s,
    background 0.18s;
}
.rec-toggle input:checked + .rec-toggle-slider {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}
.rec-toggle input:checked + .rec-toggle-slider::before {
  left: 16px;
  background: #fff;
}

/* ════════════════════════════════════════
   MODAL ATALHOS DE TECLADO
════════════════════════════════════════ */
.modal-shortcuts-inner {
  max-width: 460px;
  width: 100%;
}
.shortcuts-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.shortcuts-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shortcuts-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-bottom: 2px;
}
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
}
.shortcut-row > span:last-child {
  color: var(--text2);
  margin-left: 6px;
}
.shortcut-row > span:not(:last-child) {
  color: var(--text3);
  font-size: 11px;
}
.shortcut-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text);
  border: 0.5px solid var(--border);
  border-bottom-width: 1.5px;
  border-radius: 4px;
}
.shortcuts-hint {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
  margin-top: 4px;
}

/* ════════════════════════════════════════
   MODAL TAREFAS RECORRENTES
════════════════════════════════════════ */
.modal-rec-mgmt-inner {
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.rec-mgmt-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rec-mgmt-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.rec-mgmt-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.15s;
}
.rec-mgmt-add-btn:hover {
  opacity: 0.82;
}
.rec-mgmt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rec-mgmt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text3);
  gap: 8px;
}
.rec-mgmt-empty p {
  margin: 0;
  font-size: 13px;
}

.rec-mgmt-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}
.rec-mgmt-card:hover {
  border-color: var(--accent);
}
.rec-mgmt-card--inactive {
  opacity: 0.55;
}

.rec-mgmt-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rec-mgmt-type-icon {
  font-size: 15px;
  color: var(--accent);
  flex-shrink: 0;
}
.rec-mgmt-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-mgmt-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rec-mgmt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text2);
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 99px;
  padding: 2px 8px;
}
.rec-mgmt-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rec-mgmt-cat {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid;
}
.rec-mgmt-inactive-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ════════════════════════════════════════
   TOAST
════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-theme="dark"] .toast {
  background: #e8e8e5;
  color: #1a1a1a;
}

/* ════════════════════════════════════════
   CARD DETAIL — modal Trello-like
════════════════════════════════════════ */
.modal-card-detail {
  max-width: 820px;
  width: 96vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Cabeçalho do card detail */
.card-detail-header {
  padding: 14px 18px 10px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.card-detail-header-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 5px;
}
.card-detail-title-input {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: inherit;
  padding: 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.2s;
  line-height: 1.3;
}
.card-detail-title-input:focus {
  border-bottom-color: var(--accent);
}
.card-detail-col-row {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 26px;
}
.col-sel-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 5px;
  transition: background 0.12s;
  position: relative;
  user-select: none;
}
.col-sel-wrap:hover {
  background: var(--btn-hover);
}
.col-sel-wrap span {
  font-size: 12px;
  color: var(--text2);
  transition: color 0.12s;
}
.col-sel-wrap:hover span {
  color: var(--text);
}
.col-sel-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: 9px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
  padding: 4px;
}
.col-sel-wrap.open .col-sel-dropdown {
  display: flex;
}
.col-sel-option {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
  white-space: nowrap;
}
.col-sel-option:hover {
  background: var(--btn-hover);
}
.col-sel-option.selected {
  color: var(--accent);
  font-weight: 600;
}

/* Corpo de duas colunas */
.card-detail-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.card-detail-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 18px;
  border-right: 0.5px solid var(--border);
}
.card-detail-sidebar {
  width: 210px;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

/* Inputs/selects/textareas dentro do card detail */
[data-theme="dark"] .card-detail-main input[type="date"],
[data-theme="dark"] .card-detail-main select,
[data-theme="dark"] .card-detail-sidebar input[type="date"],
[data-theme="dark"] .card-detail-sidebar select,
[data-theme="dark"] .modal-body input[type="date"],
[data-theme="dark"] .modal-body select,
[data-theme="dark"] .task-panel-body input[type="date"],
[data-theme="dark"] .task-panel-body select {
  color-scheme: dark;
}

.card-detail-main input[type="text"],
.card-detail-main input[type="date"],
.card-detail-main select,
.card-detail-main textarea,
.card-detail-sidebar input[type="text"],
.card-detail-sidebar input[type="date"],
.card-detail-sidebar input[type="time"],
.card-detail-sidebar input[type="number"],
.card-detail-sidebar select,
.card-detail-sidebar textarea {
  font-size: 13px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  resize: vertical;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.card-detail-sidebar select {
  appearance: auto;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
/* esconde as setinhas nativas do number — não combinam com o resto dos campos */
.card-detail-sidebar input[type="number"]::-webkit-inner-spin-button,
.card-detail-sidebar input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.card-detail-sidebar input[type="number"] {
  -moz-appearance: textfield;
}
.card-detail-main input:focus,
.card-detail-main select:focus,
.card-detail-main textarea:focus,
.card-detail-sidebar input:focus,
.card-detail-sidebar select:focus,
.card-detail-sidebar textarea:focus {
  border-color: var(--accent);
}
.card-detail-main textarea {
  min-height: 90px;
}

/* ════════════════════════════════════════
   EDITOR DE TEXTO RICO (descrição do card)
════════════════════════════════════════ */
.rte {
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  background: var(--surface2);
  overflow: hidden;
}
.rte-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1px;
  padding: 4px 6px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}
.rte-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--text2);
  font-size: 15px;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.rte-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.rte-btn.active {
  background: var(--accent-fill);
  color: #fff;
}
.rte-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 5px;
}

.rte-editor {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 10px 12px;
  min-height: 96px;
  outline: none;
  overflow-wrap: anywhere;
}
.rte-editor.is-empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
  pointer-events: none;
}
.rte-editor:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.rte-editor p {
  margin-bottom: 10px;
}
.rte-editor p:last-child {
  margin-bottom: 0;
}
.rte-editor strong,
.rte-editor b {
  font-weight: 700;
}
.rte-editor em,
.rte-editor i {
  font-style: italic;
}
.rte-editor del,
.rte-editor s {
  opacity: 0.6;
}
.rte-editor code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.rte-editor a {
  color: var(--accent);
  text-decoration: underline;
}
.rte-editor ul,
.rte-editor ol {
  margin: 0 0 10px 22px;
}
.rte-editor li {
  margin-bottom: 3px;
}
.rte-editor blockquote {
  border-left: 3px solid var(--border2);
  color: var(--text2);
  padding: 2px 0 2px 10px;
  margin: 0 0 10px 0;
}
.rte-editor hr {
  border: none;
  border-top: 0.5px solid var(--border2);
  margin: 12px 0;
}
.rte-editor h1,
.rte-editor h2,
.rte-editor h3 {
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 8px;
}
.rte-editor h1 {
  font-size: 19px;
}
.rte-editor h2 {
  font-size: 16px;
}
.rte-editor h3 {
  font-size: 14px;
}

/* Seções da coluna principal */
.card-detail-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.card-detail-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-detail-section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cd-checklist-count {
  font-size: 11px;
  color: var(--text3);
}
.cd-checklist-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

/* Seções da sidebar */
.cd-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cd-sidebar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Botões de ação da sidebar */
.cd-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cd-action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px;
  border: 0.5px solid var(--border);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s;
}
.cd-action-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.cd-action-btn.danger:hover {
  background: var(--danger-bg);
  color: var(--danger-muted);
  border-color: var(--danger-border);
}
.cd-action-btn.active {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.cd-action-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.cd-completed-at {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
}

/* Template mode — hide actions and col selector */
.modal-tpl-mode .card-detail-col-row {
  display: none;
}
.modal-tpl-mode .cd-sidebar-section:has(.cd-actions) {
  display: none;
}

/* Anexos */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface2);
  border: 0.5px solid var(--border);
}
.attachment-thumb {
  width: 56px;
  height: 42px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}
.attachment-icon {
  width: 56px;
  height: 42px;
  border-radius: 5px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text3);
  flex-shrink: 0;
}
.attachment-info {
  flex: 1;
  min-width: 0;
}
.attachment-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* Thumb clicável no modal de edição */
.attachment-thumb-clickable {
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.attachment-thumb-clickable:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Ícone PDF clicável: visual destacado em vermelho */
.attachment-icon-pdf {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
[data-theme="dark"] .attachment-icon-pdf {
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
}
.attachment-icon-pdf i {
  font-size: 24px;
}

/* Lightbox: imagem expandida em tela cheia */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 950; /* acima dos modais (modal-edit-user/profile = 720, colorwheel = 800, confirm = 900) */
  align-items: center;
  justify-content: center;
  padding: 40px 24px 56px;
  cursor: pointer;
  flex-direction: column;
  gap: 12px;
  animation: lightboxFadeIn 0.15s ease-out;
}
.lightbox-overlay.open {
  display: flex !important;
}
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.lightbox-overlay img,
.lightbox-overlay iframe {
  display: none;
}
.lightbox-overlay.mode-image #lightbox-img {
  display: block;
}
.lightbox-overlay.mode-pdf #lightbox-pdf {
  display: block;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  cursor: default;
  user-select: none;
  background: #1a1a1a;
}
.lightbox-overlay iframe {
  width: 95vw;
  height: 88vh;
  border: 0;
  border-radius: 6px;
  background: #1a1a1a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}
.lightbox-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
  max-width: 80vw;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Linha com nome do anexo + badge de capa */
.attachment-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.attachment-cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(91, 33, 182, 0.1);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.attachment-cover-badge i {
  font-size: 10px;
}
[data-theme="dark"] .attachment-cover-badge {
  background: rgba(196, 181, 253, 0.14);
  color: #c4b5fd;
}
.attachment-item.is-cover {
  border-color: var(--accent) !important;
  background: rgba(91, 33, 182, 0.03);
}
[data-theme="dark"] .attachment-item.is-cover {
  border-color: #c4b5fd !important;
  background: rgba(196, 181, 253, 0.05);
}

/* Anexo cujo arquivo sumiu do IndexedDB — sinaliza sem precisar clicar pra descobrir */
.attachment-item-missing {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}
.attachment-icon-missing {
  background: transparent;
  border: 1px dashed var(--danger-border);
  color: var(--danger-muted);
}
.attachment-missing-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--danger-muted);
}
.attachment-item-missing .attachment-meta {
  color: var(--danger-muted);
}

/* Menu de 3 pontinhos no anexo */
.att-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.att-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 16px;
  transition:
    background 0.12s,
    color 0.12s;
}
.att-menu-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}
.att-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  z-index: 10;
  flex-direction: column;
}
[data-theme="dark"] .att-menu {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}
.att-menu.open {
  display: flex;
}
.att-menu-item {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  width: 100%;
  transition: background 0.1s;
}
.att-menu-item:hover {
  background: var(--btn-hover);
}
.att-menu-item i {
  font-size: 14px;
  color: var(--text3);
}
.att-menu-item:hover i {
  color: var(--accent);
}
[data-theme="dark"] .att-menu-item:hover i {
  color: #c4b5fd;
}
.att-menu-danger {
  color: var(--danger);
}
.att-menu-danger:hover {
  background: var(--danger-bg);
}
.att-menu-danger i {
  color: var(--danger) !important;
}

/* Toggle "usar imagem como capa" no modal de edição do card */
.cover-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 0.5px dashed var(--border2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}
.cover-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}
.cover-toggle input {
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent-fill);
}
.cover-toggle i {
  font-size: 14px;
  color: var(--accent);
}
[data-theme="dark"] .cover-toggle:hover {
  border-color: #c4b5fd;
}
[data-theme="dark"] .cover-toggle i {
  color: #c4b5fd;
}

/* ── Capa do card: papel de parede + preview ── */
/* Capa só faz sentido em cards reais — some em template/recorrência */
.modal-tpl-mode .cd-card-only,
.modal-rec-mode .cd-card-only {
  display: none !important;
}

.wallpaper-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.wp-swatch {
  width: 30px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  background-size: cover;
  transition: transform 0.12s;
}
.wp-swatch:hover {
  transform: scale(1.12);
}
.wp-swatch.selected {
  border-color: var(--text);
}
.wp-swatch.none {
  background: var(--surface2);
  border: 1.5px dashed var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 11px;
}

.cover-preview {
  position: relative;
  height: 92px;
  margin-bottom: 4px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.cover-preview-fill {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.cover-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(2px);
  transition: background 0.12s;
}
.cover-preview-remove:hover {
  background: rgba(0, 0, 0, 0.75);
}
.cover-preview-edit {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(2px);
  transition: background 0.12s;
}
.cover-preview-edit:hover {
  background: rgba(0, 0, 0, 0.75);
}
.cover-upload-btn {
  margin-top: 9px;
  font-size: 12px;
  padding: 6px 12px;
}

/* ── Fundo tematizado do quadro (Config. → Aparência) ── */
.board-bg {
  /* Antes era position:fixed cobrindo a janela inteira (por baixo de tudo,
     inclusive do cabeçalho) - agora fica preso só a .container (a área do
     board), então nunca aparece atrás do cabeçalho/configurações. */
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.2s;
}
.wallpaper-picker-lg {
  margin-bottom: 10px;
}
.wallpaper-picker-lg .wp-swatch {
  width: 52px;
  height: 36px;
  border-radius: 7px;
}
#settings-bg-preview .cover-preview {
  margin: 10px 0 4px;
  border-radius: 10px;
}
.bg-opacity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bg-opacity-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent-fill);
}
.bg-opacity-row span {
  font-size: 12px;
  color: var(--text2);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 11px;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}
.link-btn:hover {
  color: var(--accent);
}
.cd-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text2);
  font-size: 13px;
  border: 0.5px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s;
  width: fit-content;
}
.cd-attach-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}

/* Card agora abre o detail ao clicar */
.card {
  cursor: pointer;
}
.card .card-title {
  cursor: pointer;
}

/* Responsivo: empilha colunas em telas pequenas */
@media (max-width: 600px) {
  .card-detail-body {
    flex-direction: column;
    overflow-y: auto;
  }
  .card-detail-main {
    border-right: none;
    border-bottom: 0.5px solid var(--border);
  }
  .card-detail-sidebar {
    width: 100%;
  }
  .modal-card-detail {
    max-width: 100%;
    width: 100%;
    border-radius: 12px;
  }
}

/* ════════════════════════════════════════
   RELATÓRIOS
════════════════════════════════════════ */
.modal-reports-inner {
  width: 680px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.reports-body {
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}
.rpt-section {
  background: var(--surface2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rpt-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 2px;
}
.rpt-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.rpt-stat-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.rpt-stat-card.success {
  border-color: var(--success-border);
  background: var(--success-bg);
}
.rpt-stat-card.danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}
.rpt-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.rpt-stat-card.success .rpt-stat-value {
  color: var(--success);
}
.rpt-stat-card.danger .rpt-stat-value {
  color: var(--danger-muted);
}
.rpt-stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}
.rpt-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 5px;
}
.rpt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}
.rpt-row-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  width: 130px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpt-row-label.rpt-done {
  color: var(--success);
}
.rpt-row-bar {
  flex: 1;
}
.rpt-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
.rpt-bar-fill {
  height: 6px;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.rpt-row-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.rpt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rpt-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}
.rpt-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rpt-timing-header {
  display: grid;
  grid-template-columns: 1fr 80px 110px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  padding: 0 4px 6px;
  border-bottom: 0.5px solid var(--border);
}
.rpt-timing-row {
  display: grid;
  grid-template-columns: 1fr 80px 110px;
  align-items: center;
  padding: 7px 4px;
  border-bottom: 0.5px solid var(--border);
  gap: 4px;
}
.rpt-timing-row:last-of-type {
  border-bottom: none;
}
.rpt-timing-count {
  font-size: 12px;
  color: var(--text2);
  text-align: center;
}
.rpt-timing-avg {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
}
.rpt-timing-avg.rpt-no-data {
  color: var(--text3);
  font-weight: 400;
}
.rpt-timing-note {
  font-size: 10px;
  color: var(--text3);
  margin: 6px 4px 0;
  line-height: 1.4;
}
@media (max-width: 600px) {
  .rpt-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rpt-two-col {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════
   RECORTE DE IMAGEM (capa do card / fundo do quadro)
   Modal com a imagem e um retângulo arrastável/redimensionável — o usuário
   escolhe a área antes de ela virar capa ou fundo. O truque do overlay escuro
   fora do retângulo é um box-shadow gigante (sem precisar de mais elementos).
════════════════════════════════════════ */
.modal-crop-inner {
  width: 720px;
  max-width: 96vw;
}
.crop-modal-body {
  align-items: center;
}
.crop-stage {
  position: relative;
  margin: 8px auto 0;
  background: #000;
  touch-action: none;
  user-select: none;
  border-radius: 8px;
  overflow: hidden;
}
.crop-stage img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.crop-box {
  position: absolute;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 1.5px solid #fff;
  border-radius: 50%;
  touch-action: none;
}
.crop-handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.crop-hint {
  font-size: 12px;
  color: var(--text2);
  text-align: center;
  margin-top: 10px;
}
