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

:root {
  /* Dark theme (default) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #3b4a63;
  --border: #475569;
  --border-light: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.15);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.15);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-hover: #cbd5e1;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .kpi-card {
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .kanban-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .kanban-card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

[data-theme="light"] .filters-bar {
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .view-tab {
  color: #334155;
}

[data-theme="light"] .view-tab.active {
  background: var(--accent);
  color: #ffffff;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LOGIN / RESET PAGE ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 1rem;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
  color: white;
}

.login-logo img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: none;
}

.login-error.visible { display: block; }

.login-success {
  background: var(--success-bg);
  color: var(--success);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.login-footer {
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.login-footer a {
  color: var(--accent);
  font-weight: 500;
}

.forgot-password-section {
  margin-top: 1.5rem;
  text-align: center;
}

.forgot-password-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 1.5rem;
}

.forgot-password-section h2 {
  margin-bottom: 0.375rem;
}

.forgot-password-section p {
  margin-bottom: 1.25rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== LAYOUT / HEADER ===== */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem clamp(1.25rem, 2.5vw, 3rem);
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo img {
  height: auto;
  max-height: 200px;
  width: auto;
  object-fit: contain;
}

.header-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.header-back-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== HEADER CENTER - PROJECT SELECTOR ===== */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.header-center .header-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.project-selector-wrapper {
  width: 100%;
  position: relative;
}

.project-selector-label {
  display: block;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.125rem;
  text-align: center;
}

.project-selector {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.project-selector:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
}

.project-selector:hover {
  border-color: var(--text-muted);
}

/* ===== HEADER RIGHT ===== */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===== USER MENU ===== */
.user-menu-wrapper {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  transition: all var(--transition);
}

.user-menu-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-display-name {
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 0.375rem;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.user-menu-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.user-menu-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.user-menu-item svg {
  flex-shrink: 0;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.125rem;
}
.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.refresh-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 36px;
  padding: 0 0.75rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  transition: all var(--transition);
}
.refresh-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.refresh-btn.loading svg {
  animation: spin 1s linear infinite;
}

.main-content {
  /* Padding lateral escala com a viewport: 1.5rem em telas normais,
     ate 3rem em ultrawide. Sem max-width: content ocupa toda a largura
     disponivel em vez de ficar limitado a 1600px. */
  padding: 1.5rem clamp(1.25rem, 2.5vw, 3rem);
  max-width: 100%;
  margin: 0 auto;
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Atividades e Consumo de Horas: mesmo padrao compacto para consistencia
   visual e caber em uma unica linha em telas wide (8 cards atividades,
   9 cards horas). */
.kpi-activities-grid,
.kpi-hours-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.625rem;
}
.kpi-activities-grid .kpi-card,
.kpi-hours-grid .kpi-card {
  padding: 0.75rem 0.875rem;
  gap: 0.625rem;
}
.kpi-activities-grid .kpi-icon,
.kpi-hours-grid .kpi-icon {
  width: 34px;
  height: 34px;
}
.kpi-activities-grid .kpi-icon svg,
.kpi-hours-grid .kpi-icon svg {
  width: 18px;
  height: 18px;
}
.kpi-activities-grid .kpi-value,
.kpi-hours-grid .kpi-value {
  font-size: 1.25rem;
}
.kpi-activities-grid .kpi-label,
.kpi-hours-grid .kpi-label {
  font-size: 0.75rem;
}

/* ===================== NOTIFICATIONS (sino + dropdown) ===================== */
.notif-wrapper {
  position: relative;
  display: inline-block;
}
.notif-bell {
  background: transparent;
  border: 1px solid var(--border, #cbd5e1);
  color: var(--text-secondary, #64748b);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.notif-bell:hover { background: var(--bg-hover, #f1f5f9); color: var(--text-primary); }
.notif-bell.has-urgent { color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary, #fff);
  font-variant-numeric: tabular-nums;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 2rem);
  max-height: 70vh;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* O atributo [hidden] do HTML e' anulado por display:flex/inline-flex acima,
   entao forcamos display:none quando hidden esta presente. */
.notif-dropdown[hidden],
.notif-attention-banner[hidden],
.notif-badge[hidden],
.follower-search-results[hidden],
.modal-followers-add[hidden] {
  display: none !important;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  gap: 0.5rem;
}
.notif-tabs {
  display: flex;
  gap: 0.25rem;
}
.notif-tab {
  background: transparent;
  border: none;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
}
.notif-tab:hover { background: var(--bg-hover, #f1f5f9); }
.notif-tab.active { background: var(--accent-light, #dbeafe); color: var(--accent, #3b82f6); font-weight: 600; }
.notif-header-actions {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}
.notif-mark-all,
.notif-close {
  background: transparent;
  border: 1px solid var(--border-light, #e2e8f0);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  font-size: 1rem;
  padding: 0;
}
.notif-mark-all:hover,
.notif-close:hover { background: var(--bg-hover, #f1f5f9); color: var(--text-primary); }
.notif-close { font-size: 1.25rem; }

.notif-list {
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}
.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 0.875rem;
}
.notif-group {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  cursor: pointer;
  transition: background 0.12s;
}
.notif-group:hover { background: var(--bg-hover, #f8fafc); }
.notif-group.urg-high { border-left: 3px solid #ef4444; }
.notif-group.urg-low { opacity: 0.85; }
.notif-group.no-access { cursor: not-allowed; opacity: 0.6; }
.notif-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
}
.notif-group-title {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  min-width: 0;
  flex: 1;
}
.notif-issue-key {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-project-name {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-unread-count {
  background: var(--accent, #3b82f6);
  color: #fff;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
}
.notif-group-header-right {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
/* Botao check — mesmo padrao visual do "Marcar todas" (notif-mark-all) */
.notif-mark-btn {
  background: transparent;
  border: 1px solid var(--border-light, #e2e8f0);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-mark-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border, #cbd5e1);
}
.notif-item-mark {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.125rem;
}
.notif-group-title.clickable { cursor: pointer; }

/* Footer do dropdown — toggle + botao testar lado a lado */
.notif-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.notif-test-btn {
  background: transparent;
  border: 1px solid var(--border-light, #e2e8f0);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
}
.notif-test-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary);
}
.notif-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.notif-item.read .notif-item-text { color: var(--text-secondary); }
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent, #3b82f6);
  margin-top: 0.4rem;
  flex-shrink: 0;
}
.notif-item-body { min-width: 0; flex: 1; }
.notif-item-text {
  color: var(--text-primary);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.125rem;
}
.notif-more {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  padding: 0.25rem;
}
.notif-dropdown-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-secondary, #f8fafc);
}
.notif-desktop-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* Banner "Precisa de voce" */
.notif-attention-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  margin-bottom: 0.875rem;
  color: var(--text-primary);
}
.notif-attention-icon { color: #ef4444; display: flex; }
.notif-attention-text { flex: 1; font-size: 0.875rem; }
.notif-attention-text strong { color: #ef4444; margin-right: 0.25rem; }
.notif-attention-cta {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 0.375rem 0.875rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.notif-attention-cta:hover { background: #dc2626; }
.notif-attention-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.notif-attention-close:hover { color: var(--text-primary); }

/* Modal — seguidores */
.modal-followers {
  border-top: 1px solid var(--border-light, #e2e8f0);
  padding: 0.625rem 1rem;
  background: var(--bg-secondary, #f8fafc);
}
.modal-followers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.modal-followers-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.modal-followers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
  min-height: 28px;
}
.follower-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.25rem 0.125rem 0.125rem;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 999px;
  font-size: 0.75rem;
}
.follower-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.follower-name { color: var(--text-primary); }
.follower-tag {
  font-size: 0.6rem;
  padding: 0.05rem 0.3rem;
  background: var(--bg-hover, #e2e8f0);
  color: var(--text-muted, #94a3b8);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.follower-tag.muted { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.follower-remove {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.125rem;
}
.follower-remove:hover { color: #ef4444; }
.modal-followers-add {
  position: relative;
  margin-top: 0.25rem;
}
.modal-followers-add input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 6px;
  background: var(--bg-primary, #fff);
  font-size: 0.8125rem;
}
.follower-search-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}
.follower-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.375rem 0.625rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-primary);
}
.follower-search-item:hover { background: var(--bg-hover, #f1f5f9); }
.follower-search-role {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
}

/* =========================================================
   Card: notificacoes nao lidas
   Sinalizacao em 3 camadas (de fora pra dentro):
   1. Borda lateral esquerda — sinal periferico primario
   2. Badge numerico ao lado da chave — quantidade exata
   3. Titulo em bold — reforco na leitura central
   ========================================================= */
.kanban-card { position: relative; }

/* Camada 1: borda lateral esquerda (azul para medium, vermelho para high)
   Usa pseudo-elemento posicionado mas clipado pelo border-radius do card.
   Sem overflow:hidden no card para nao cortar dropdowns/mini-modais. */
.kanban-card.has-unread-notif::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, #3b82f6);
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
  z-index: 2;
  pointer-events: none;
  animation: notif-pulse 2s ease-in-out infinite;
}
.kanban-card.has-urgent-notif::before {
  background: #ef4444;
  width: 4px;
}

@keyframes notif-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Camada 2: badge numerico colado na chave do card */
.card-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.375rem;
  min-width: 18px;
  height: 18px;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  vertical-align: middle;
}
.kanban-card.has-urgent-notif .card-notif-badge {
  background: #ef4444;
}

/* Camada 3: titulo em bold quando ha nao lidas */
.kanban-card.has-unread-notif .kanban-card-title {
  font-weight: 700;
}

/* Cleanup: o ::after antigo (bolinha superior direita) foi removido */

.kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.kpi-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.kpi-icon.total { background: var(--accent-light); color: var(--accent); }
.kpi-icon.open { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.progress { background: var(--info-bg); color: var(--info); }
.kpi-icon.done { background: var(--success-bg); color: var(--success); }

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.2s;
}

.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* KPI Balance negative state */
.kpi-balance-card.negative .kpi-value {
  color: var(--danger);
}

.kpi-balance-card.negative .kpi-icon {
  background: var(--danger-bg) !important;
  color: var(--danger) !important;
}

.kpi-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* ===== FILTERS ===== */
.filters-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 160px;
}

.filter-group label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.filter-date-range {
  min-width: 240px;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.date-range-inputs input {
  flex: 1;
  min-width: 0;
}

.date-separator {
  color: var(--text-muted);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.input-clearable {
  position: relative;
  display: flex;
  align-items: center;
}
.input-clearable input {
  flex: 1;
  padding-right: 1.75rem;
}
.input-clear-btn {
  position: absolute;
  right: 0.375rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.input-clear-btn.visible {
  opacity: 0.6;
  pointer-events: auto;
}
.input-clear-btn:hover {
  opacity: 1;
  color: var(--text-primary);
}

.date-range-inputs .input-clear-btn {
  position: static;
  flex-shrink: 0;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.active-filters:empty { display: none; }

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.filter-tag-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 1rem;
  line-height: 1;
}
.filter-tag-remove:hover { opacity: 1; }

/* ===== TABS ===== */
.view-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  width: fit-content;
}

.view-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.view-tab:hover { color: var(--text-primary); }

.view-tab.active {
  background: var(--accent);
  color: white;
}

/* ===== KANBAN ===== */
.kanban-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 400px;
}

.kanban-column {
  flex: 0 0 240px;
  min-width: 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.kanban-column-cli {
  border-top: 3px solid var(--warning);
}

.kanban-column-header {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
}

.kanban-column-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1.2;
}

.kanban-column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-column-stats {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.kanban-column-hours {
  font-size: 0.625rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.kanban-column-count {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.kanban-card-priority-edit {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.priority-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.kanban-column-body {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 600px;
}

.kanban-empty {
  text-align: center;
  padding: 2rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

.kanban-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.75rem;
  transition: all var(--transition);
  position: relative;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.kanban-column-cli .kanban-card {
  border-left: 3px solid var(--warning);
}

.kanban-card-clickable {
  cursor: pointer;
}

.kanban-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.kanban-card-key {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-copy-url {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0.6;
  transition: all 0.15s;
}
.btn-copy-url:hover {
  opacity: 1;
  color: var(--accent);
  background: var(--bg-hover);
}

.modal-issue-key {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.kanban-card-title {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
}

.kanban-card-hours,
.kanban-card-due,
.kanban-card-delivered,
.kanban-card-comments,
.kanban-card-attachments {
  font-size: 0.625rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.kanban-card-delivered {
  color: var(--success, #16a34a);
  background: var(--success-bg, rgba(22, 163, 74, 0.1));
  font-weight: 600;
}

.kanban-card-due.due-soon {
  color: var(--warning);
  background: var(--warning-bg);
}

/* Data de publicação no card (09/10/2026): destaca quando é nas próximas 24 horas */
.kanban-card-publish {
  font-size: 0.625rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}
.kanban-card-publish.pub-soon {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-weight: 600;
}
/* campos de data e de data e hora no tema escuro: o ícone nativo do calendário acompanha o tema (sumia no fundo escuro) */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"] { color-scheme: dark; }

.kanban-card-due.overdue {
  color: var(--danger);
  background: var(--danger-bg);
  font-weight: 600;
}

.kanban-card-comments {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.kanban-card-attachments {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--purple, #a855f7);
  background: var(--purple-bg, rgba(168, 85, 247, 0.15));
  font-weight: 600;
  font-size: 0.625rem !important;
  padding: 0.125rem 0.375rem !important;
  border-radius: 4px !important;
  line-height: 1.2;
}
.kanban-card-attachments svg { width: 11px; height: 11px; flex-shrink: 0; }
.kanban-card-comments svg { width: 11px; height: 11px; flex-shrink: 0; }

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card-assignee {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Card action pill buttons */
.kanban-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.kanban-action-pill {
  position: relative;
  /* flex-basis permite 2 por linha quando há 3+: cada um ocupa aprox (100-gap)/2 */
  flex: 1 1 calc(50% - 0.375rem);
  min-width: 0;
  padding: 0.375rem 0.375rem;
  border: none;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quando há só 1 ação, ocupa linha inteira. Quando há 2, lado a lado.
   Com 3+, faz quebra natural (2 por linha + 1 embaixo, ou o que couber). */
.kanban-card-actions .kanban-action-pill:only-child { flex-basis: 100%; }
.kanban-card-actions:has(.kanban-action-pill:nth-child(2):last-child) .kanban-action-pill { flex-basis: calc(50% - 0.1875rem); }

.kanban-action-pill .pill-label { display: block; }

.kanban-action-pill .pill-tooltip {
  display: none;
  position: fixed;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  pointer-events: none;
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
}

.kanban-action-pill:hover .pill-tooltip {
  display: block;
}

.pill-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.25);
}
.pill-success:hover { background: var(--success); color: white; border-color: var(--success); }

.pill-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.25);
}
.pill-danger:hover { background: var(--danger); color: white; border-color: var(--danger); }

.pill-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.25);
}
.pill-warning:hover { background: var(--warning); color: white; border-color: var(--warning); }

.pill-info {
  background: rgba(59,130,246,0.12);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.25);
}
.pill-info:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* Priority selector in card */
.kanban-priority-select,
.modal-priority-select {
  padding: 0.25rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
}

.kanban-priority-select:focus,
.modal-priority-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-light);
}

.modal-priority-select {
  font-size: 0.8125rem;
  padding: 0.375rem 0.5rem;
}

/* Inline comment modal */
.kanban-card-comment-modal {
  position: relative;
}

.kanban-card-comment-modal.visible {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.comment-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-modal-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.comment-modal-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.75rem;
  min-height: 50px;
  resize: vertical;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: inherit;
}

.comment-modal-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-light);
}

.comment-modal-buttons {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
}

.overdue-text {
  color: var(--danger);
  font-weight: 600;
}

.avatar {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== PRIORITY BADGES ===== */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.priority-highest { background: var(--danger-bg); color: var(--danger); }
.priority-high { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.priority-medium { background: var(--warning-bg); color: var(--warning); }
.priority-low { background: var(--info-bg); color: var(--info); }
.priority-lowest { background: var(--bg-tertiary); color: var(--text-muted); }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-todo { background: var(--bg-tertiary); color: var(--text-secondary); }
.status-inprogress { background: var(--accent-light); color: var(--accent); }
.status-done { background: var(--success-bg); color: var(--success); }
.status-default { background: var(--purple-bg); color: var(--purple); }

/* ===== TYPE ICONS ===== */
.type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.type-bug { background: #ef4444; color: white; }
.type-task { background: #3b82f6; color: white; }
.type-story { background: #22c55e; color: white; }
.type-epic { background: #a855f7; color: white; }
.type-subtask { background: #06b6d4; color: white; }
.type-default { background: var(--text-muted); color: white; }
/* Tipo custom desconhecido — usa o icone real do Jira como <img> */
.type-custom {
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-light, #e2e8f0);
  padding: 1px;
}
.type-custom img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}

/* ===== CHARTS ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.chart-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.chart-container {
  position: relative;
  height: 250px;
}

/* ===== TABLE ===== */
.table-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.table-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.table-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.table-wrapper {
  overflow-x: auto;
}

.issues-table {
  width: 100%;
  border-collapse: collapse;
}

.issues-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.issues-table th:hover { color: var(--text-secondary); }

.issues-table th .sort-icon {
  margin-left: 0.25rem;
  opacity: 0.3;
}

.issues-table th.sorted .sort-icon { opacity: 1; }

.issues-table td {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.issues-table tr {
  transition: background var(--transition);
  cursor: pointer;
}

.issues-table tbody tr:hover { background: var(--bg-tertiary); }

.issue-key-link {
  font-weight: 600;
  color: var(--accent);
}

.issue-title-cell {
  white-space: normal !important;
  max-width: 300px;
}

/* ===== MODAL (Issue detail) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden; /* contem o gradient + scrollbar do body */
}

/* Indicador de scroll inline — fica logo apos a descricao, dentro do .modal-body.
   Mostra texto explicito ("Ver anexos, comentarios e seguidores") + chevron.
   Posicionado no fluxo, rola junto com o conteudo: quando o usuario rola
   ate as proximas secoes, o botao some naturalmente da view. */
.modal-scroll-jump {
  display: none; /* habilitado via .visible quando ha overflow */
  width: 100%;
  margin: 0.5rem 0 1.25rem;
  padding: 0.625rem 1rem;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.modal-scroll-jump.visible { display: inline-flex; width: 100%; }
.modal-scroll-jump:hover {
  background: var(--accent-light, rgba(59, 130, 246, 0.12));
  color: var(--accent, #3b82f6);
  border-color: var(--accent, #3b82f6);
  border-style: solid;
}
.modal-scroll-jump:active { transform: translateY(1px); }
.modal-scroll-jump svg { transition: transform 0.2s ease; flex-shrink: 0; }
.modal-scroll-jump:hover svg { transform: translateY(2px); }
.modal-scroll-jump-label { line-height: 1.2; }
.modal-scroll-jump-hint { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; }

@media (max-width: 480px) {
  .modal-scroll-jump { padding: 0.625rem 0.75rem; font-size: 0.75rem; }
  .modal-scroll-jump-hint { display: none; } /* economiza linha em telas estreitas */
}

.modal-overlay.visible .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header-info {
  flex: 1;
  min-width: 0;
}

.modal-issue-key {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.modal-issue-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal-close {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  padding-bottom: 2.25rem; /* respiro extra para nao colar no gradient indicador */
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-gutter: stable; /* scrollbar sempre presente — afasta sensacao de "acabou aqui" */
}

.modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-meta-item label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.modal-description {
  margin-bottom: 1.5rem;
}

.modal-description h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.modal-description {
  position: relative;
}
.modal-description-content {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  /* Limita a altura da descricao para nao empurrar as proximas secoes
     (anexos, comentarios, seguidores) abaixo da fold. Calibrado para
     que em viewport ~720px o jump button apareça acima da dobra. */
  max-height: clamp(140px, 22vh, 220px);
  overflow: hidden;
  position: relative;
  transition: max-height 0.25s ease;
}
.modal-description-content.expanded {
  max-height: 70vh; /* gerenciado pelo body scroll */
  overflow-y: auto;
}
/* Gradient fade no fim da descricao colapsada — sinaliza "tem mais texto cortado" */
.modal-description.has-overflow:not(.expanded-state) .modal-description-content::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--bg-tertiary) 85%);
  pointer-events: none;
}
.modal-description-expand {
  display: none; /* habilitado pelo JS quando ha overflow */
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent, #3b82f6);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.modal-description.has-overflow .modal-description-expand { display: inline-flex; }
.modal-description-expand:hover {
  background: var(--accent-light, rgba(59, 130, 246, 0.1));
  border-color: var(--accent, #3b82f6);
}
.modal-description-expand svg { transition: transform 0.2s ease; flex-shrink: 0; }
.modal-description.expanded-state .modal-description-expand svg { transform: rotate(180deg); }
  max-height: 200px;
  overflow-y: auto;
}

.modal-section {
  margin-bottom: 1.5rem;
}

/* Separador sutil entre secoes (Anexos / Comentarios / Seguidores) — ajuda o usuario
   a perceber que ainda ha mais conteudo a explorar abaixo. */
.modal-section + .modal-section,
.modal-section + .modal-followers,
.modal-body > .modal-followers {
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
}

.modal-section h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* Comments */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.comments-list.has-scroll {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.comments-list:empty {
  display: none;
}

.comment-item {
  display: flex;
  gap: 0.75rem;
  position: relative;
  padding-left: 1.25rem;
}

.comment-timeline-dot {
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.comment-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 1.25rem;
  bottom: -0.5rem;
  width: 2px;
  background: var(--border-light);
}

.comment-content {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.comment-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.comment-author {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.comment-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.comment-body {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.comment-form {
  display: flex;
  gap: 0.5rem;
}

.comment-form textarea {
  flex: 1;
  min-height: 50px;
}

/* Modal confirm area (for action + comment) */
.modal-confirm-area {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-confirm-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Transition Actions */
.modal-actions {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-actions-left {
  display: flex;
  gap: 0.5rem;
}

.modal-actions-right a {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ===== NEW ISSUE MODAL ===== */
#newIssueModalOverlay .modal {
  max-width: 560px;
}

/* ===== FLOATING ACTION BUTTON (Nova Demanda) ===== */
.fab-new-issue {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  transition: all 0.2s ease;
  z-index: 90;
}

.fab-new-issue:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.fab-new-issue:active {
  transform: scale(0.95);
}

/* ===== VIEW SECTIONS ===== */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ===== LOADING ===== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.875rem;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== PROFILE PAGE ===== */
.profile-content {
  max-width: 640px;
}

.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.profile-card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-card-body {
  padding: 1.5rem;
}

.profile-card-body .btn {
  margin-top: 0.5rem;
}

/* Force password change banner */
.force-password-banner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  background: var(--warning, #f59e0b);
  color: #1a1a1a;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.force-password-banner svg {
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .user-display-name {
    display: none;
  }
}

@media (max-width: 768px) {
  .main-content { padding: 1rem; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-hours-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-activities-grid { grid-template-columns: repeat(3, 1fr); }

  .filters-row { flex-direction: column; }
  .filter-group { min-width: 100%; }

  .kanban-board { flex-direction: column; }
  .kanban-column { max-width: none; min-width: auto; }

  .charts-grid { grid-template-columns: 1fr; }

  .modal { max-height: 95vh; }
  .modal-meta { grid-template-columns: repeat(2, 1fr); }

  .header-title { font-size: 0.875rem; }
  .header-subtitle { display: none; }

  .header-center {
    display: none;
  }

  .app-header {
    padding: 0 1rem;
  }

  .user-display-name {
    display: none;
  }

  .fab-new-issue {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-hours-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-activities-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-meta { grid-template-columns: 1fr; }
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; text-align: center; }

  /* Modal: maximizar area util e reduzir padding */
  .modal-overlay { padding: 0.5rem; }
  .modal { max-height: 96vh; }
  .modal-header { padding: 1rem 1.125rem 0.75rem; }
  .modal-body { padding: 1rem 1.125rem 2rem; }
  .edit-panel { padding: 0.75rem 1.125rem; max-height: 70vh; }
  .modal-issue-title { font-size: 1rem; line-height: 1.3; }
  .edit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .modal-overlay { padding: 0.25rem; }
  .modal { border-radius: 8px; max-height: 98vh; }
  .modal-header { padding: 0.875rem 1rem 0.625rem; }
  .modal-body { padding: 0.875rem 1rem 2rem; }
  .edit-panel { padding: 0.625rem 1rem; }
}

/* ============ Attachments ============ */
.modal-attachments-section { margin-bottom: 1.25rem; }
.modal-attachments-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.modal-attachments-header h3 { margin: 0; }
.modal-attachments-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.modal-attachments-actions .btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.attachments-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.625rem; }
.attachments-empty { color: var(--text-muted); font-size: 0.875rem; padding: 0.5rem 0; }
.attachment-item { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 0.625rem 0.75rem; }
.attachment-row { display: flex; align-items: center; gap: 0.625rem; }
.attachment-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.875rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-name:hover { text-decoration: underline; }
.attachment-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.attachment-download-btn { color: var(--text-muted); padding: 0.25rem; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.attachment-download-btn:hover { color: var(--accent); background: var(--bg-primary); }
.attachment-preview { margin-top: 0.5rem; }
.attachment-preview audio { width: 100%; height: 36px; }
.attachment-preview .attachment-image { max-width: 100%; max-height: 240px; border-radius: 4px; display: block; }

/* ============ Audio Recorder ============ */
.audio-recorder-area { margin-top: 0.75rem; }
/* gravar áudio e anexar junto do comentário (pedido do Toni em 08/10/2026: na parte de Anexos ficava escondido) */
.cmt-midia { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; margin: 0.5rem 0 0.25rem; }
.cmt-midia-btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.cmt-midia .comment-hint { flex: 1 1 100%; font-size: 0.6875rem; color: var(--text-muted); }
.comment-form .audio-recorder-area { margin: 0.25rem 0 0.5rem; }
.audio-rec-box { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.625rem; }
.audio-rec-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.audio-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: recPulse 1.2s infinite; }
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.audio-rec-label { color: var(--text-primary); font-weight: 500; }
.audio-rec-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-family: monospace; color: var(--text-muted); }
.audio-rec-buttons { display: flex; gap: 0.5rem; justify-content: flex-end; }
.audio-rec-preview { display: flex; flex-direction: column; gap: 0.375rem; }
.audio-rec-preview audio { width: 100%; }
.audio-rec-filename { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }
.audio-rec-comment { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary); font-family: inherit; font-size: 0.875rem; resize: vertical; }

.comment-attachment { margin-top: 0.5rem; }
.comment-attachment .attachment-item { background: var(--bg-primary); }
.audio-rec-label-required { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 500; }

/* ============ Attachments thumbnails + toggle ============ */
.attachments-toggle { display: flex; align-items: center; gap: 0.375rem; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-primary); }
.attachments-toggle h3 { color: var(--text-primary); }
.attachments-toggle .attachments-caret { transition: transform 0.2s; color: var(--text-muted); }
.attachments-toggle[aria-expanded="true"] .attachments-caret { transform: rotate(90deg); }

/* Lista que envolve as miniaturas lado a lado com quebra natural */
.attachments-thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; }
.attachments-thumbs.collapsed { display: none !important; }

/* Cada miniatura — largura fixa, altura automática */
.attachment-thumb { width: 148px; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.5rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; transition: border-color 0.15s, background 0.15s; min-width: 0; }
.attachment-thumb:hover { border-color: var(--accent); }
.attachment-thumb-meta-top { font-size: 0.625rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }

.attachment-thumb-preview { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.375rem 0.25rem; background: none; border: 0; cursor: pointer; color: var(--text-primary); text-align: center; width: 100%; }
.attachment-thumb-preview:hover { background: var(--bg-primary); border-radius: 4px; }
.attachment-thumb-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.attachment-thumb-name { font-size: 0.6875rem; font-weight: 500; color: var(--text-primary); width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attachment-thumb-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; border-top: 1px solid var(--border); padding-top: 0.25rem; }
.attachment-thumb-size { font-size: 0.625rem; color: var(--text-muted); }
.attachment-thumb-download { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 0.125rem 0.25rem; border-radius: 3px; display: inline-flex; align-items: center; }
.attachment-thumb-download:hover { color: var(--accent); background: var(--bg-primary); }

/* Preview lightbox */
.attachment-preview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 1rem; }
.attachment-preview-box { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; max-width: 90vw; max-height: 90vh; width: 860px; display: flex; flex-direction: column; overflow: hidden; }
.attachment-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.attachment-preview-name { font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-actions { display: flex; align-items: center; gap: 0.5rem; }
.attachment-preview-close { background: none; border: 0; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 0.25rem; }
.attachment-preview-close:hover { color: var(--accent); }
.attachment-preview-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 1rem; min-height: 200px; background: var(--bg-secondary); }
.attachment-preview-img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 4px; }
.attachment-preview-audio { width: 100%; max-width: 600px; }
.attachment-preview-video { max-width: 100%; max-height: 75vh; }
.attachment-preview-iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.attachment-preview-text { width: 100%; max-height: 75vh; overflow: auto; white-space: pre-wrap; font-family: monospace; font-size: 0.8125rem; color: var(--text-primary); background: var(--bg-primary); padding: 1rem; border-radius: 4px; margin: 0; }
.attachment-preview-unsupported { text-align: center; color: var(--text-primary); padding: 2rem; }

/* ============ Rich Text Editor ============ */
.rich-editor { border: 1px solid var(--border); border-radius: 6px; background: var(--bg-primary); overflow: hidden; position: relative; }
.rich-editor:focus-within { border-color: var(--accent); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 0.125rem; padding: 0.375rem 0.5rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); align-items: center; }
.rich-toolbar button, .rich-toolbar .rich-select { background: none; border: 1px solid transparent; border-radius: 4px; padding: 0.25rem 0.5rem; cursor: pointer; color: var(--text-primary); font-size: 0.8125rem; line-height: 1; min-width: 1.75rem; }
.rich-toolbar button:hover, .rich-toolbar .rich-select:hover { background: var(--bg-primary); border-color: var(--border); }
.rich-toolbar .rich-select { font-size: 0.75rem; padding: 0.25rem 0.375rem; }
.rich-sep { display: inline-block; width: 1px; height: 18px; background: var(--border); margin: 0 0.25rem; }
.rich-content { min-height: 80px; padding: 0.625rem 0.75rem; color: var(--text-primary); outline: 0; font-size: 0.875rem; line-height: 1.5; max-height: 260px; overflow-y: auto; }
.rich-content:empty::before, .rich-editor.is-empty .rich-content::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.rich-content p { margin: 0 0 0.5rem 0; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content h2, .rich-content h3 { margin: 0.5rem 0 0.375rem 0; color: var(--text-primary); }
.rich-content h2 { font-size: 1.125rem; }
.rich-content h3 { font-size: 1rem; }
.rich-content ul, .rich-content ol { padding-left: 1.5rem; margin: 0.25rem 0; }
.rich-content blockquote { border-left: 3px solid var(--border); padding-left: 0.75rem; color: var(--text-muted); margin: 0.5rem 0; }
.rich-content pre { background: var(--bg-secondary); padding: 0.5rem 0.75rem; border-radius: 4px; font-family: monospace; font-size: 0.8125rem; overflow-x: auto; }
.rich-content a { color: var(--accent); }
.rich-content .rich-table, .rich-content table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
.rich-content .rich-table td, .rich-content .rich-table th, .rich-content table td, .rich-content table th { border: 1px solid var(--border); padding: 0.375rem 0.5rem; min-width: 40px; }
.rich-emoji-picker { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 0.125rem; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.3); max-width: 280px; z-index: 10; }
.emoji-btn { background: none; border: 0; font-size: 1.125rem; cursor: pointer; padding: 0.25rem; border-radius: 4px; }
.emoji-btn:hover { background: var(--bg-secondary); }

/* Comment form layout — send button below editor */
.comment-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.comment-form .rich-editor { width: 100%; }
.comment-form .comment-submit-row { display: flex; justify-content: flex-end; }

/* Editor de comentários — destaque visual com sombra + espaçamento generoso */
.comment-form { margin-top: 0.5rem; margin-bottom: 2rem; padding-bottom: 0.5rem; }
.comment-form .rich-editor { box-shadow: 0 6px 20px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25); border-color: var(--border); }
[data-theme="light"] .comment-form .rich-editor { box-shadow: 0 6px 20px rgba(15,23,42,0.18), 0 2px 6px rgba(15,23,42,0.10); }
.comment-form .comment-submit-row { margin-top: 0.625rem; }
.modal-section .comments-list { margin-top: 0.5rem; }
.activities-label {
  margin-top: 1.25rem;
  padding: 0.375rem 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light, var(--border));
  margin-bottom: 0.5rem;
}

/* --- UI mais enxuta dentro do card --- */
.modal { max-width: 760px; }
.modal-header { padding: 1rem 1.25rem 0.75rem; }
.modal-body { padding: 1rem 1.25rem; }
.modal-issue-key { font-size: 0.8125rem; }
.modal-issue-title { font-size: 1.0625rem; line-height: 1.3; }
.modal-meta { gap: 0.75rem 1.25rem; }
.modal-meta-item label { font-size: 0.6875rem; letter-spacing: 0.05em; }
.modal-meta-item span { font-size: 0.875rem; }
.modal-section h3 { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 0.5rem; }
.modal-description { margin-top: 1rem; }
.modal-description h3 { margin-bottom: 0.375rem; }
.modal-description-content { font-size: 0.875rem; line-height: 1.55; }
.comment-item { padding: 0.625rem 0; }
.comment-header { margin-bottom: 0.25rem; }
.comment-author { font-size: 0.8125rem; font-weight: 600; }
.comment-date { font-size: 0.6875rem; color: var(--text-muted); }
.comment-body { font-size: 0.8125rem; line-height: 1.5; }
.comment-body.rich-view p { margin: 0 0 0.25rem 0; }

/* As dicas da barra do editor saem em data-tip (js/rich-editor.js) e aparecem pela dica rápida (.ui-tip, por cima de
   tudo). As antigas, desenhadas aqui acima do botão, eram cortadas pela borda da caixa do comentário (23/10/2026). */

/* Renderização de comentários ADF na timeline */
.comment-body.rich-view { line-height: 1.5; }
.comment-body.rich-view p { margin: 0 0 0.375rem 0; }
.comment-body.rich-view p:last-child { margin-bottom: 0; }
.comment-body.rich-view h1, .comment-body.rich-view h2, .comment-body.rich-view h3,
.comment-body.rich-view h4, .comment-body.rich-view h5, .comment-body.rich-view h6 { margin: 0.375rem 0 0.25rem 0; }
.comment-body.rich-view h2 { font-size: 1rem; }
.comment-body.rich-view h3 { font-size: 0.9375rem; }
.comment-body.rich-view strong { font-weight: 700; }
.comment-body.rich-view em { font-style: italic; }
.comment-body.rich-view a { color: var(--accent); text-decoration: underline; }
.comment-body.rich-view a:hover { color: var(--accent-hover); }
.comment-body.rich-view ul, .comment-body.rich-view ol { padding-left: 1.25rem; margin: 0.25rem 0; }
.comment-body.rich-view blockquote { border-left: 3px solid var(--border); padding-left: 0.625rem; color: var(--text-muted); margin: 0.375rem 0; }
.comment-body.rich-view pre { background: var(--bg-primary); padding: 0.5rem 0.75rem; border-radius: 4px; font-family: monospace; font-size: 0.8125rem; overflow-x: auto; margin: 0.375rem 0; }
.comment-body.rich-view code { background: var(--bg-primary); padding: 0.0625rem 0.25rem; border-radius: 3px; font-family: monospace; font-size: 0.8125rem; }
.comment-body.rich-view pre code { background: none; padding: 0; }
.comment-body.rich-view hr { border: 0; border-top: 1px solid var(--border); margin: 0.5rem 0; }
.comment-body.rich-view .rich-view-table { border-collapse: collapse; margin: 0.375rem 0; }
.comment-body.rich-view .rich-view-table td, .comment-body.rich-view .rich-view-table th { border: 1px solid var(--border); padding: 0.25rem 0.5rem; }
.comment-body.rich-view .mention { color: var(--accent); font-weight: 500; }

/* Popover de link — substitui o prompt() nativo */
.rich-link-popover {
  position: absolute;
  z-index: 10001;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.5rem;
}
.rich-link-popover-row { display: flex; gap: 0.375rem; align-items: center; }
.rich-link-popover input {
  padding: 0.375rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  min-width: 220px;
  outline: none;
}
.rich-link-popover input:focus { border-color: var(--accent); }
.rich-link-popover .rich-link-ok {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.rich-link-popover .rich-link-ok:hover { background: var(--accent-hover); }
.rich-link-popover .rich-link-cancel {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.rich-link-popover .rich-link-cancel:hover { color: var(--text-primary); }

/* Listas na visualização (descrição + comentários) — bullets dentro do padding */
.rich-view ul, .rich-view ol { padding-left: 1.5rem; list-style-position: outside; }
.rich-view ul li, .rich-view ol li { margin: 0.125rem 0; }
.modal-description-content.rich-view { padding: 0.5rem 0.75rem; }
.modal-description-content.rich-view ul, .modal-description-content.rich-view ol { padding-left: 1.75rem; }

/* Espaçamento mais enxuto entre o form e a label Atividades */
.comment-form { margin-bottom: 0.75rem; padding-bottom: 0; }
.comment-form .comment-submit-row { margin-top: 0.5rem; }
.activities-label { margin-top: 0.75rem; padding: 0.25rem 0; }
.modal-section .comments-list { margin-top: 0.25rem; }

/* Comentários mais compactos (menos scroll) */
.comment-item { padding: 0.5rem 0; }
.comment-item + .comment-item { border-top: 1px solid var(--border-light, var(--border)); }
.comment-timeline-dot { top: 0.75rem; }
.comment-header { margin-bottom: 0.125rem; gap: 0.5rem; }

/* Anexos na criação de demanda — lista de arquivos em "staging" antes do submit */
.new-issue-attach-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.new-issue-files-list { display: flex; flex-direction: column; gap: 0.25rem; }
.new-issue-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.8125rem;
}
.new-issue-file-item svg { color: var(--text-muted); flex-shrink: 0; }
.new-issue-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-issue-file-size { color: var(--text-muted); font-size: 0.75rem; flex-shrink: 0; }
.new-issue-file-remove {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0 0.25rem;
  border-radius: 3px;
}
.new-issue-file-remove:hover { color: var(--danger); background: var(--bg-primary); }

/* ============ Edit panel (canManageTasks) ============ */
.edit-panel { padding: 1rem 1.25rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex: 1; min-height: 0; display: flex; flex-direction: column; }
.edit-panel-inner { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; min-height: 0; }
.edit-panel-inner > .edit-grid { overflow-y: auto; flex: 1; min-height: 0; padding-right: 0.25rem; scrollbar-gutter: stable; }
.edit-panel-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-secondary);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border-light);
  z-index: 3;
}

/* Quando o edit panel esta aberto, oculta a visualizacao normal abaixo
   — sem essa regra os campos Status/Prioridade/Tipo/Responsavel apareciam
   duplicados embaixo do formulario de edicao, confundindo o usuario. */
/* (regra antiga que escondia o modal-body inteiro na edição foi substituída:
   o formulário agora ocupa a coluna esquerda e a conversa continua visível) */
.modal.editing::after { display: none; }
.edit-panel-inner { display: flex; flex-direction: column; gap: 0.75rem; }
.edit-panel-header { display: flex; align-items: center; justify-content: space-between; }
.edit-panel-header strong { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.edit-panel-close { background: none; border: 0; color: var(--text-muted); font-size: 1.25rem; cursor: pointer; padding: 0 0.25rem; line-height: 1; }
.edit-panel-close:hover { color: var(--text-primary); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem 0.75rem; }
.edit-field { display: flex; flex-direction: column; gap: 0.25rem; }
.edit-field-full { grid-column: 1 / -1; }
.edit-field label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); display: flex; gap: 0.25rem; align-items: baseline; }
.edit-field .edit-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: 0.6875rem; }
.edit-field input, .edit-field select { padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary); font-size: 0.875rem; outline: none; }
.edit-field input:focus, .edit-field select:focus { border-color: var(--accent); }
.edit-panel-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ============ Kanban drag-and-drop ============ */
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-column.drop-target { background: var(--accent-light); outline: 2px dashed var(--accent); outline-offset: -6px; }

/* Tela de "sem projetos disponíveis" (usuário sem vínculos ativos) */
.no-projects-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  padding: 3rem 1.5rem;
}

/* Preview de PDF — embed + fallback */
.attachment-preview-pdf-wrap { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.attachment-preview-pdf-fallback { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.attachment-preview-pdf-fallback a { color: var(--accent); text-decoration: underline; }

/* ===== Spinners contextuais ===== */
/* Spinner inline centralizado (para preview, panels, etc.) */
.loading-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.loading-inline .spinner-lg {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Overlay translúcido sobre card enquanto faz transition (drag-drop) */
.kanban-card.transitioning { position: relative; pointer-events: none; }
.kanban-card.transitioning::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: inherit;
  z-index: 1;
}
.kanban-card.transitioning::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  z-index: 2;
}

/* Inline preview de imagem DENTRO do fluxo do texto do comentário.
   Estilo super enxuto: pequeno ícone (20px) + filename clicável,
   no mesmo padrão visual da seção Anexos mas bem menor para não
   bagunçar a leitura. */
.comment-inline-media {
  display: inline-flex !important;
  align-items: center;
  gap: 0.375rem;
  padding: 0.0625rem 0.375rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.2;
  vertical-align: middle;
  max-width: 100%;
  white-space: nowrap;
}
.comment-inline-media-img {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
}
.comment-inline-media-name {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  font-size: 0.75rem;
}
.comment-inline-media-name:hover { text-decoration: underline; }

/* Chip de imagem embutida no editor de comentário (antes de enviar) */
.rich-inline-image-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  background: var(--accent-light);
  border: 1px dashed var(--accent);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent);
  user-select: none;
}
.rich-inline-image-chip img {
  width: 20px; height: 20px; object-fit: cover; border-radius: 2px;
}

/* Image attacher (reutilizável nos RichEditor de descrição) */
.img-attacher { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.375rem; }
.img-attacher-actions { display: flex; gap: 0.5rem; align-items: center; }
.img-attacher-list { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.img-attacher-list:empty { display: none; }
.img-attacher-remove { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.25rem; }

/* Imagem inline em staging dentro do RichEditor (preview enquanto escreve) */
.rich-inline-staged-img {
  display: inline-block !important;
  max-height: 80px !important;
  max-width: 160px !important;
  width: auto !important;
  height: auto !important;
  vertical-align: middle;
  border: 1px dashed var(--accent);
  border-radius: 4px;
  padding: 2px;
  margin: 0 2px;
  cursor: default;
}

/* Qualquer <img> solto dentro do contenteditable (ex: paste cru do browser)
   fica limitado pra não estourar o layout enquanto o usuário compõe. */
.rich-content img { max-width: 160px !important; max-height: 80px !important; height: auto; }

.comment-hint { font-size: 0.6875rem; color: var(--text-muted); flex: 1; text-align: left; padding-left: 0.25rem; }

/* Hint discreto quando o autor interno difere do autor do Jira (token owner) */
.comment-jira-via {
  display: inline-block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 0.375rem;
}

/* Botões de excluir (canDelete) */
.comment-delete-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.comment-item:hover .comment-delete-btn { opacity: 0.7; }
.comment-delete-btn:hover { opacity: 1 !important; color: var(--danger); background: var(--danger-bg, rgba(239,68,68,0.15)); }

.attachment-thumb-delete {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
}
.attachment-thumb-delete:hover { color: var(--danger); background: var(--danger-bg, rgba(239,68,68,0.15)); }

/* ============ Contract side drawer ============ */
.contract-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 9500;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.contract-drawer-overlay.visible { opacity: 1; visibility: visible; }

.contract-drawer {
  width: 100%;
  max-width: 520px;
  height: 100%;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 30px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.contract-drawer-overlay.visible .contract-drawer { transform: translateX(0); }

.contract-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.contract-drawer-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 600;
}
.contract-drawer-header h3 svg { color: var(--accent); }

.contract-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contract-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contract-section-title {
  margin: 0;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-light, var(--border));
}

.contract-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem 0.875rem;
}
.contract-field { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.contract-field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.contract-field-value {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-word;
}
.contract-copy-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.contract-copy-btn:hover { color: var(--accent); background: var(--bg-secondary); }
.contract-field-hint { font-size: 0.6875rem; color: var(--text-muted); font-style: italic; }
.contract-empty-val { color: var(--text-muted); font-style: italic; }

.contract-rich {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  max-height: 280px;
  overflow-y: auto;
}
.contract-rich img { max-width: 100%; height: auto; border-radius: 4px; }

.contract-empty, .contract-empty-state {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1rem 0;
  text-align: center;
}

@media (max-width: 640px) {
  .contract-drawer { max-width: 100%; }
  .contract-fields-grid { grid-template-columns: 1fr; }
}

/* ============ Portal de Lista (cliente final) — acessível, mobile-first ============ */
#view-lista { padding: 0; }
.pl-wrap { max-width: 820px; margin: 0 auto; padding: 0.5rem 0 2rem; }
.pl-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem;
}
.pl-new {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: #fff; border: 0;
  font-size: 1.0625rem; font-weight: 700; cursor: pointer;
  padding: 0.875rem 1.375rem; border-radius: var(--radius, 10px);
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
  min-height: 52px; transition: filter .15s ease, transform .05s ease;
}
.pl-new:hover { filter: brightness(1.06); }
.pl-new:active { transform: translateY(1px); }
.pl-summary { font-size: 0.9375rem; color: var(--text-muted); font-weight: 600; }

.pl-group { margin-bottom: 1.5rem; }
.pl-group-head {
  display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.25rem 0.25rem 0.625rem; border-bottom: 2px solid var(--border-light, var(--border));
  margin-bottom: 0.75rem;
}
.pl-group-title { font-size: 1.125rem; font-weight: 800; color: var(--text-primary); }
.pl-group-count {
  font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary);
  background: var(--bg-tertiary, var(--bg-primary)); border: 1px solid var(--border);
  padding: 0.0625rem 0.5rem; border-radius: 999px;
}
.pl-group-hint { font-size: 0.8125rem; color: var(--text-muted); margin-left: auto; }

.pl-items { display: flex; flex-direction: column; gap: 0.625rem; }
.pl-card-wrap {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius, 10px); overflow: hidden;
  transition: border-color .15s ease;
}
.pl-card-wrap:hover { border-color: var(--accent); }
.pl-card {
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 0.875rem;
  background: transparent; border: none;
  padding: 1rem 1.125rem; min-height: 64px;
  transition: background .15s ease, transform .05s ease;
}
.pl-card:hover { background: var(--bg-hover, var(--bg-secondary)); }
.pl-card:active { transform: translateY(1px); }
.pl-card-main { flex: 1; min-width: 0; }

/* Ações direto no card (Aprovar/Reprovar/Dar retorno) */
.pl-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1.125rem 0.875rem; }
.pl-card-actions .pl-action {
  flex: 1 1 auto; min-height: 46px; padding: 0.6rem 1rem;
  border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; background: var(--accent); color: #fff;
  transition: filter .15s ease, transform .05s ease;
}
.pl-card-actions .pl-action:hover { filter: brightness(1.07); }
.pl-card-actions .pl-action:active { transform: translateY(1px); }
.pl-card-actions .pl-action-success { background: #16a34a; }
.pl-card-actions .pl-action-danger,
.pl-card-actions .pl-action-reject,
.pl-card-actions .pl-action-error { background: #dc2626; }
.pl-card-actions .pl-action-warning,
.pl-card-actions .pl-action-warn { background: #d97706; }
.pl-card-actions.confirming .pl-action { display: none; }

/* Confirmação inline (comentário obrigatório) */
.pl-confirm { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.pl-confirm-title { font-size: 0.9375rem; font-weight: 700; color: var(--text-primary); }
.pl-confirm-text {
  width: 100%; resize: vertical; min-height: 56px; font: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; padding: 0.625rem 0.75rem;
  background: var(--bg-primary); color: var(--text-primary);
}
.pl-confirm-btns { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.pl-confirm-btns button { min-height: 44px; padding: 0.5rem 1.1rem; border-radius: 10px; font-weight: 700; font-size: 0.9375rem; cursor: pointer; border: 1px solid var(--border); }
.pl-confirm-cancel { background: transparent; color: var(--text-secondary); }
.pl-confirm-ok { background: var(--accent); color: #fff; border-color: var(--accent); }
.pl-confirm-ok:disabled { opacity: .5; cursor: not-allowed; }
.pl-card-title {
  font-size: 1.0625rem; font-weight: 700; color: var(--text-primary);
  line-height: 1.35; margin-bottom: 0.375rem;
  /* até 2 linhas, sem cortar no meio da palavra */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pl-card-meta { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; }
.pl-status {
  font-size: 0.8125rem; font-weight: 700; padding: 0.1875rem 0.625rem; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.pl-status.pl-wait   { background: #fef3c7; color: #92400e; border-color: #fcd9a3; }
.pl-status.pl-doing  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.pl-status.pl-done   { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.pl-status.pl-cancel { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.pl-due { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; }
.pl-due-late { color: #dc2626; font-weight: 700; }
.pl-delivered { font-size: 0.8125rem; color: var(--success, #16a34a); font-weight: 600; white-space: nowrap; }
.pl-key { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.pl-card-arrow { color: var(--text-muted); flex-shrink: 0; }

/* destaque sutil do bloco "Aguardando você" (mais importante p/ o cliente) */
.pl-group.pl-wait .pl-group-title { color: #b45309; }

.pl-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.pl-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.pl-empty-title { font-size: 1.125rem; font-weight: 700; color: var(--text-secondary); }
.pl-empty-sub { font-size: 0.9375rem; margin-top: 0.25rem; }

@media (max-width: 600px) {
  .pl-new { width: 100%; justify-content: center; font-size: 1.125rem; min-height: 56px; }
  .pl-summary { width: 100%; }
  .pl-group-hint { width: 100%; margin-left: 0; }
  .pl-card { padding: 0.875rem 1rem; }
  .pl-card-title { font-size: 1.0625rem; }
}

/* ============================================================
   MODO PORTAL — cliente final / visão de Lista
   Ativado por body.portal-mode (app.js, quando a view ativa é "lista").
   Simplifica a barra de filtros e o card de detalhe (modal) para um
   público idoso / com baixa aderência a tecnologia: menos campos,
   fontes maiores, alvos de toque grandes, mobile-first.
   ============================================================ */

/* --- Barra de filtros: deixa só a busca, grande e centralizada --- */
body.portal-mode #filtersBar .filter-group:not(.filter-search-group),
body.portal-mode #filtersBar .filter-actions,
body.portal-mode #filtersBar .active-filters { display: none !important; }
body.portal-mode #filtersBar { background: transparent; border: none; box-shadow: none; padding: 0.25rem 0 0.5rem; }
body.portal-mode #filtersBar .filters-row { display: block; gap: 0; }
body.portal-mode .filter-search-group { width: 100%; max-width: 560px; margin: 0 auto; }
body.portal-mode .filter-search-group label { font-size: 1rem; font-weight: 700; }
body.portal-mode .filter-search-group #filterSearch {
  font-size: 1.0625rem; padding: 0.85rem 2.75rem 0.85rem 2.9rem; min-height: 52px; border-radius: 12px;
}
/* lupa e × dentro do campo grande (a lupa veio com a barra de filtros de 01/10) */
body.portal-mode .view-search-icon { left: 1rem; }
body.portal-mode .view-search-icon svg { width: 19px; height: 19px; }

/* --- Modal: esconde campos técnicos e o link interno do Jira --- */
body.portal-mode .modal-meta-item[data-field="priority"],
body.portal-mode .modal-meta-item[data-field="type"],
body.portal-mode .modal-meta-item[data-field="estimate"],
body.portal-mode .modal-meta-item[data-field="created"],
body.portal-mode .modal-meta-item[data-field="updated"],
body.portal-mode .btn-copy-url { display: none !important; }

/* --- Modal: mobile-first, fontes maiores, toques grandes --- */
body.portal-mode .modal { max-width: 620px; }
body.portal-mode .modal-issue-key { font-size: 0.8125rem; color: var(--text-muted); }
body.portal-mode .modal-issue-title { font-size: 1.3rem; line-height: 1.3; }
body.portal-mode .modal-meta { grid-template-columns: 1fr 1fr; gap: 1rem; }
body.portal-mode .modal-meta-item label { font-size: 0.8125rem; }
body.portal-mode .modal-section h3,
body.portal-mode .modal-description h3 { font-size: 1.1rem; }
body.portal-mode .modal-body { font-size: 1.0312rem; }
body.portal-mode .modal .btn { min-height: 44px; }

/* Trava qualquer overflow horizontal no detalhe (quebra palavras/links longos) */
body.portal-mode .modal { overflow: hidden; }
body.portal-mode .modal-body { overflow-x: hidden; }
body.portal-mode .modal-description-content,
body.portal-mode .comment-body,
body.portal-mode .rich-content,
body.portal-mode .modal-issue-title { overflow-wrap: anywhere; word-break: break-word; }

/* Portal em celular E tablet: modal em tela cheia, sem bordas nem scroll horizontal */
@media (max-width: 900px) {
  body.portal-mode .modal-overlay { padding: 0; }
  body.portal-mode .modal {
    width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: none;
  }
  body.portal-mode .modal-meta { grid-template-columns: 1fr; gap: 0.625rem; }
  body.portal-mode .modal-issue-title { font-size: 1.2rem; }
}

/* --- Modo portal: modal de detalhe — ações grandes empilhadas, sem link interno --- */
body.portal-mode .modal-actions { flex-direction: column; align-items: stretch; gap: 0.625rem; }
body.portal-mode .modal-actions-left { flex-direction: column; width: 100%; gap: 0.5rem; }
body.portal-mode .modal-actions-left .modal-transition-btn {
  width: 100%; min-height: 48px; font-size: 1rem; font-weight: 700; border-radius: 10px;
}
body.portal-mode .modal-actions-right { display: none; } /* "Abrir no Jira" é link interno */
body.portal-mode .modal-confirm-area { gap: 0.625rem; }
body.portal-mode .modal-confirm-title { font-size: 0.95rem; }
body.portal-mode .comment-modal-input,
body.portal-mode #modalConfirmComment { font-size: 1rem; min-height: 64px; }
body.portal-mode .comment-modal-buttons { gap: 0.5rem; flex-wrap: wrap; }
body.portal-mode .comment-modal-buttons .btn { min-height: 44px; }

/* ============================================================
   FIX responsividade do CABEÇALHO (raiz do overflow horizontal no mobile)
   O conteudo do .app-header estourava ~587px num viewport de 414px, o que
   no iOS expande o layout viewport e fazia o modal (width:100%) ser cortado.
   ============================================================ */
/* NAO usar overflow:hidden no .app-header: corta os dropdowns (usuario/sino)
   que abrem pra baixo. A largura ja e contida pela raiz (logo capado +
   header-right fixado na ultima coluna + min-width:0). */
.header-left, .header-right { min-width: 0; }
.header-logo img { max-height: 40px; }
.header-project-logo { max-width: 170px; overflow: hidden; flex-shrink: 1; min-width: 0; }
.header-project-logo img { max-height: 40px; width: auto; object-fit: contain; }

@media (max-width: 600px) {
  .header-project-logo { max-width: 110px; }
  /* botoes do header viram so-icone (some o texto "Atualizar"/"Contrato") */
  .refresh-btn, #btnContract { font-size: 0; gap: 0; padding: 0.5rem; }
  .refresh-btn svg, #btnContract svg { margin: 0; }
}

/* ============================================================
   PORTAL — cabeçalho e linha de controles mais limpos no mobile
   ============================================================ */
/* Logo não pode esticar e empurrar/sobrepor os itens da direita */
.header-logo img { max-width: 170px; }
@media (max-width: 600px) { .header-logo img { max-width: 130px; } }

/* No portal o cliente não precisa de "Atualizar" nem "Contrato" no header */
body.portal-mode #refreshBtn,
body.portal-mode #btnContract { display: none !important; }
body.portal-mode .header-right { gap: 0.5rem; }

/* Aba única escondida (app.js) → seletor de projeto ocupa a largura toda no mobile */
@media (max-width: 600px) {
  body.portal-mode .view-controls { grid-template-columns: 1fr !important; gap: 0.5rem; }
  body.portal-mode .view-controls .project-selector {
    width: 100% !important; min-width: 0 !important; justify-self: stretch !important;
  }
}

/* header-center some no mobile (display:none) e fazia o header-right cair na
   coluna central do grid, colando no logo. Fixa o header-right na ultima coluna. */
.header-right { grid-column: 3; }
/* Celular e tablet (17/10/2026): sem o centro, o "1fr auto 1fr" deixava só metade da largura para os botões da
   direita e eles espremiam (o "Atualizar" ficava com metade da largura). Agora a direita ocupa o que precisa e é o
   logo que cede quando falta espaço. */
@media (max-width: 768px) {
  .app-header { grid-template-columns: minmax(0, 1fr) 0 auto; }
  .header-right > * { flex-shrink: 0; }
  .header-left { padding-right: 0.75rem; } /* respiro entre o logo e o sino quando a tela é bem estreita (320 px) */
  /* o limite fica na caixa do logo (e a imagem ocupa a caixa): assim ele não sai do canto esquerdo */
  .header-logo { flex-shrink: 1; min-width: 0; max-width: 170px; }
  .header-logo img { max-width: 100%; }
}
@media (max-width: 600px) {
  .header-right { gap: 0.5rem; }
  .header-logo { max-width: 130px; }
}

/* Notificações: no mobile o dropdown (380px ancorado ao sino) vazava pra fora
   da tela. Fixa ele ocupando a largura da viewport, abaixo do header. */
@media (max-width: 600px) {
  .notif-dropdown {
    position: fixed;
    top: 64px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    max-height: 72vh;
  }
}

/* Imagem colada no comentário/descrição: thumbnail INLINE na posição do marcador
   (📷 nome), em tamanho legível; clique abre o lightbox. */
.comment-img-inline { display: inline-block; max-width: 100%; margin: 0.35rem 0; text-decoration: none; cursor: zoom-in; vertical-align: top; }
.comment-img-inline-img { display: block; max-width: 100%; max-height: 260px; width: auto; height: auto; border-radius: 6px; border: 1px solid var(--border, #e5e7eb); background: var(--bg-secondary, #f3f4f6); }
.comment-img-inline:hover .comment-img-inline-img { filter: brightness(0.96); }
.comment-img-inline-name { display: block; font-size: 0.72rem; color: var(--text-secondary, #6b7280); margin-top: 0.2rem; word-break: break-all; }


/* =====================================================================
   TIMELINE UNIFICADA (comentários + internos + ações) — 2026-09-12
   Um scroll só (o do modal); agrupada por dia; "ver anteriores".
   ===================================================================== */
.comments-list.has-scroll { max-height: none; overflow: visible; padding-right: 0; }
.tl-list { gap: 0; }
.tl-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-top: 0.75rem; flex-wrap: wrap;
}
.tl-toolbar .activities-label { margin: 0; padding: 0; }
.tl-filters { display: flex; gap: 0.25rem; }
.tl-filter {
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  font-size: 0.6875rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 999px;
  cursor: pointer; letter-spacing: 0.01em; transition: all 0.15s ease;
}
.tl-filter:hover { color: var(--text-primary); background: var(--bg-hover); }
.tl-filter.active { background: var(--accent-light); color: var(--accent); border-color: rgba(59,130,246,0.35); }
.tl-filter.tl-filter-internal.active { background: rgba(245,158,11,0.18); color: #d97706; border-color: rgba(245,158,11,0.45); }
.tl-filter-count { font-weight: 700; }

.tl-day {
  display: flex; align-items: center; gap: 0.75rem; margin: 0.875rem 0 0.375rem;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.tl-day::before, .tl-day::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.tl-day:first-child { margin-top: 0.25rem; }

.tl-item { display: flex; gap: 0.625rem; align-items: flex-start; }
.tl-item.tl-comment { padding: 0.375rem 0; }
.tl-item.tl-comment + .tl-item.tl-comment { border-top: 0; }
.tl-list .comment-item { padding-left: 0; }
.tl-list .comment-item::before { display: none; }
.tl-list .comment-timeline-dot { display: none; }
.tl-avatar {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%; font-size: 0.6875rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 0.125rem;
  background: var(--accent-light); color: var(--accent);
}
.tl-main { flex: 1; min-width: 0; }
.tl-list .comment-content { padding: 0.5rem 0.75rem 0.5625rem; border-radius: 10px; border-top-left-radius: 4px; }
.tl-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; min-height: 18px; }
.tl-head .comment-author { font-size: 0.8125rem; font-weight: 700; }
.tl-head .comment-date { margin-left: auto; font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.tl-head .comment-delete-btn { margin-left: 0; }
.tl-list .comment-body { font-size: 0.8125rem; line-height: 1.5; }
.tl-list .comment-body p:last-child { margin-bottom: 0; }

/* Comentário INTERNO: âmbar + cadeado. Só a equipe vê. */
.tl-internal .comment-content {
  background: rgba(245, 158, 11, 0.10);
  border-left: 3px solid #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}
[data-theme="light"] .tl-internal .comment-content { background: #fff7e6; }
.tl-avatar-internal { background: rgba(245,158,11,0.22); color: #b45309; }
.tl-badge-internal {
  display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.625rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: #b45309; background: rgba(245,158,11,0.18);
  border: 1px solid rgba(245,158,11,0.45); padding: 0.0625rem 0.4rem; border-radius: 999px; line-height: 1.3;
}
.tl-badge-mini { padding: 0.0625rem 0.3rem; margin-left: 0.25rem; vertical-align: middle; }
.tl-internal .comment-attachment .attachment-item { background: rgba(245,158,11,0.06); }

/* Ação (log): linha fina, ícone, hora à direita */
.tl-activity {
  align-items: center; gap: 0.5rem; padding: 0.25rem 0.25rem 0.25rem 0.375rem;
  font-size: 0.75rem; color: var(--text-secondary); line-height: 1.35;
}
.tl-activity + .tl-activity { margin-top: 0.0625rem; }
.tl-act-icon {
  width: 20px; height: 20px; min-width: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); color: var(--text-muted); margin-left: 4px;
}
.tl-act-move .tl-act-icon { color: var(--accent); background: var(--accent-light); }
.tl-act-create .tl-act-icon { color: var(--success); background: var(--success-bg); }
.tl-act-priority .tl-act-icon { color: var(--warning); background: var(--warning-bg); }
.tl-act-attach .tl-act-icon { color: #8b5cf6; background: rgba(139,92,246,0.15); }
.tl-act-delete .tl-act-icon { color: var(--danger); background: var(--danger-bg); }
.tl-act-text { flex: 1; min-width: 0; }
.tl-act-text b { color: var(--text-primary); font-weight: 600; }
.tl-act-text code { font-size: 0.6875rem; background: var(--bg-tertiary); padding: 0 0.3rem; border-radius: 4px; }
.tl-status {
  display: inline-block; font-size: 0.6875rem; font-weight: 600; padding: 0 0.4rem; border-radius: 4px;
  background: var(--bg-tertiary); color: var(--text-primary); white-space: nowrap;
}
.tl-status-new { background: var(--accent-light); color: var(--accent); }
.tl-act-time { font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.tl-activity-internal { opacity: 0.9; }

.tl-empty { padding: 1.25rem 0.5rem; text-align: center; font-size: 0.8125rem; color: var(--text-muted); }
.tl-show-older {
  display: block; width: 100%; margin: 0.625rem 0 0.25rem; padding: 0.5rem; border-radius: 8px;
  border: 1px dashed var(--border); background: transparent; color: var(--accent); font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.tl-show-older:hover { background: var(--accent-light); }

/* Composer: toggle "Comentário interno" (switch) e modo interno âmbar */
.tl-internal-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; user-select: none;
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); margin-right: auto;
}
.tl-internal-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.tl-switch {
  width: 30px; height: 17px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.15s ease; flex-shrink: 0;
}
.tl-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.tl-internal-toggle input:checked + .tl-switch { background: #f59e0b; }
.tl-internal-toggle input:checked + .tl-switch::after { transform: translateX(13px); }
.tl-internal-toggle input:checked ~ .tl-internal-toggle-label { color: #d97706; }
.tl-internal-toggle input:focus-visible + .tl-switch { box-shadow: 0 0 0 3px rgba(245,158,11,0.35); }
.comment-form.internal-mode .rich-editor { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.18); background: rgba(245,158,11,0.05); }
[data-theme="light"] .comment-form.internal-mode .rich-editor { background: #fffaf0; }
.comment-form.internal-mode #commentSubmit { background: #d97706; border-color: #d97706; }
.comment-form.internal-mode #commentSubmit:hover { background: #b45309; }
.comment-form .comment-submit-row { flex-wrap: wrap; }

/* =====================================================================
   NOTIFICAÇÕES — sino + painel (padrão Farma) + preferências
   ===================================================================== */
.notif-bell.has-unread { color: var(--text-primary); }
.notif-bell.ringing svg { animation: notif-ring 1.1s ease-in-out 1; transform-origin: 50% 0; }
@keyframes notif-ring {
  0% { transform: rotate(0); } 12% { transform: rotate(18deg); } 24% { transform: rotate(-16deg); }
  36% { transform: rotate(12deg); } 48% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); }
  72% { transform: rotate(-4deg); } 84% { transform: rotate(2deg); } 100% { transform: rotate(0); }
}
.notif-badge { box-shadow: 0 0 0 2px var(--bg-secondary); }
.notif-dropdown { width: 380px; max-width: calc(100vw - 2rem); border-radius: 12px; overflow: hidden; }
.notif-dropdown-header { padding: 0.75rem 1rem; }
.notif-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.notif-header-actions { display: flex; align-items: center; gap: 0.25rem; }
.notif-link-btn {
  background: transparent; border: none; color: var(--accent); font-size: 0.6875rem; font-weight: 600; cursor: pointer;
  padding: 0.25rem 0.5rem; border-radius: 6px;
}
.notif-link-btn:hover { background: var(--accent-light); }
.notif-icon-btn {
  background: transparent; border: none; color: var(--text-secondary); cursor: pointer; width: 28px; height: 28px;
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
}
.notif-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-icon-btn.notif-close { font-size: 1.25rem; }
.notif-tabs { padding: 0.375rem 0.75rem 0; border-bottom: 1px solid var(--border-light); gap: 0.25rem; }
.notif-tab { border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0.375rem 0.625rem 0.5rem; background: transparent; }
.notif-tab:hover { background: transparent; color: var(--text-primary); }
.notif-tab.active { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
.notif-list { max-height: 440px; overflow-y: auto; }
.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2.25rem 1rem; color: var(--text-muted);
  font-size: 0.8125rem; text-align: center;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background 0.12s ease; position: relative;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(59,130,246,0.07); }
.notif-item.unread:hover { background: rgba(59,130,246,0.13); }
.notif-item.urg-high { box-shadow: inset 3px 0 0 var(--danger); }
.notif-item.no-access { cursor: not-allowed; opacity: 0.6; }
.notif-item-icon {
  width: 32px; height: 32px; min-width: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  margin-top: 0.125rem; background: var(--bg-tertiary); color: var(--text-secondary);
}
.notif-item-icon.ic-default { background: var(--accent-light); color: var(--accent); }
.notif-item-icon.ic-comment { background: var(--accent-light); color: var(--accent); }
.notif-item-icon.ic-move { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.notif-item-icon.ic-urgent { background: var(--danger-bg); color: var(--danger); }
.notif-item-icon.ic-internal { background: rgba(245,158,11,0.18); color: #d97706; }
.notif-item.read .notif-item-icon { background: var(--bg-tertiary); color: var(--text-muted); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.notif-item-title .notif-issue-key { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.notif-item-title .notif-project-name { font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.notif-item.read .notif-issue-key { font-weight: 600; color: var(--text-secondary); }
.notif-item-title .notif-dot { position: static; width: 8px; height: 8px; margin-left: auto; flex-shrink: 0; background: var(--accent); }
.notif-item-text {
  font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.notif-item.unread .notif-item-text { color: var(--text-primary); }
.notif-item-meta { display: flex; align-items: center; gap: 0.625rem; margin-top: 0.25rem; font-size: 0.6875rem; color: var(--text-muted); }
.notif-open { color: var(--accent); font-weight: 600; }
.notif-item-mark {
  align-self: center; width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.notif-item-mark:hover { background: var(--accent-light); color: var(--accent); }

/* Preferências (dentro do painel) */
.notif-prefs { padding: 0.5rem 1rem 1rem; }
/* 26/11/2026: com "Avisos neste aparelho" as preferências passaram da altura do painel do sino (que corta o que sobra)
   e no celular a lista de aparelhos ficava pela metade, sem como rolar. As preferências rolam por dentro. */
.notif-prefs:not([hidden]) { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.notif-prefs-back {
  display: inline-flex; align-items: center; gap: 0.25rem; background: transparent; border: none; color: var(--text-primary);
  font-size: 0.8125rem; font-weight: 700; cursor: pointer; padding: 0.375rem 0; margin-bottom: 0.25rem;
}
.notif-prefs-back:hover { color: var(--accent); }
.notif-pref-group { padding: 0.625rem 0; border-top: 1px solid var(--border-light); }
.notif-pref-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; cursor: pointer; }
.notif-pref-label { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.notif-pref-label strong { font-size: 0.8125rem; color: var(--text-primary); }
.notif-pref-label small { font-size: 0.6875rem; color: var(--text-muted); }
.notif-switch { appearance: none; -webkit-appearance: none; width: 34px; height: 19px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.15s ease; margin: 0; }
.notif-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.notif-switch:checked { background: var(--accent); }
.notif-switch:checked::after { transform: translateX(15px); }
.notif-pref-sub { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.625rem; padding-left: 0.125rem; }
.notif-pref-sub.disabled { opacity: 0.45; pointer-events: none; }
.notif-pref-inline { display: flex; align-items: center; gap: 0.625rem; font-size: 0.75rem; color: var(--text-secondary); }
.notif-pref-inline span { width: 52px; }
.notif-pref-inline select { flex: 1; font-size: 0.75rem; padding: 0.3rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); }
.notif-pref-inline input[type="range"] { flex: 1; accent-color: var(--accent); }
.notif-pref-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.notif-pref-check input { accent-color: var(--accent); margin: 0; }
.notif-pref-sub .btn { align-self: flex-start; }

/* Header mais enxuto (2026-09-12): tema foi pro menu do usuário; Atualizar só ícone (title = tooltip) */
.refresh-btn.refresh-btn-icon { width: 36px; padding: 0; justify-content: center; gap: 0; }
.user-menu-item .user-menu-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; flex-shrink: 0; }

/* Selo da ação personalizada (Aprovar/Reprovar/...) no comentário e no log de ações */
.tl-action-badge {
  display: inline-flex; align-items: center; font-size: 0.6875rem; font-weight: 700; line-height: 1.3;
  padding: 0.0625rem 0.45rem; border-radius: 999px; background: var(--accent-light); color: var(--accent);
  border: 1px solid rgba(59,130,246,0.35); vertical-align: middle; white-space: nowrap;
}


/* =====================================================================
   LOTE UX 2026-09 (validação): hierarquia do card, rodapé compacto,
   header enxuto, modal em 2 colunas, filtros recolhíveis
   ===================================================================== */
/* 1) Card: título é o que se lê; chave vira secundária */
.kanban-card-title { font-size: 0.8125rem; font-weight: 500; color: var(--text-primary); line-height: 1.35; } /* negrito (700) fica só para card com não lida */
.kanban-card-key { color: var(--text-muted); font-weight: 500; }
.kanban-card:hover .kanban-card-key { color: var(--accent); }

/* 2) Seguidores: rodapé recolhido por padrão (clique no título abre) */
.modal-followers-toggle { background: transparent; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.modal-followers-toggle:hover { color: var(--text-primary); }
.followers-caret { transition: transform 0.15s ease; margin-left: 0.125rem; }
.modal-followers.collapsed .followers-caret { transform: rotate(-90deg); }
.modal-followers.collapsed .modal-followers-list,
.modal-followers.collapsed .modal-followers-add { display: none; }
.modal-followers.collapsed { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.modal-followers.collapsed .modal-followers-header { margin-bottom: 0; }

/* 3) Jump: pílula discreta em vez do botão largo tracejado */
.modal-scroll-jump.visible { display: inline-flex; width: auto; margin: 0 auto 1rem; padding: 0.375rem 0.875rem; font-size: 0.75rem; border-radius: 999px; }
.modal-scroll-jump { border-style: solid; }
.modal-scroll-jump-hint { display: none; }

/* 4) Header: com logo da empresa o título textual sai; Contrato só ícone (já tem .refresh-btn-icon) */
.app-header.has-logo .header-center { visibility: hidden; }

/* 5) Modal em 2 colunas em telas largas: detalhes à esquerda (fixos), conversa à direita */
@media (min-width: 1100px) {
  .modal { max-width: 1180px; }
  /* a tarefa aberta usa mais da tela (até 1320px) e a esquerda — dados, descrição, subtarefas, vínculos, checklists,
     anexos — fica com 65%; os comentários com 35% (pedido do Toni em 08/10/2026: as tabelas ainda cortavam) */
  #modalOverlay .modal { max-width: min(1320px, 94vw); }
  .modal-body { display: grid; grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); gap: 0 1.75rem; align-items: start; }
  /* barra de formatação do comentário mais justa, para caber na coluna de 35% */
  #modalOverlay .modal-col-right .rich-toolbar { gap: 0; padding: 0.3125rem 0.375rem; }
  #modalOverlay .modal-col-right .rich-toolbar button { padding: 0.25rem 0.3125rem; min-width: 1.5rem; }
  #modalOverlay .modal-col-right .rich-sep { margin: 0 0.125rem; }
  .modal-col-left { position: sticky; top: 0; max-height: calc(85vh - 190px); overflow-y: auto; padding-right: 0.25rem; }
  .modal-col-right { min-width: 0; border-left: 1px solid var(--border-light); padding-left: 1.75rem; }
  .modal-col-right .modal-section { margin-top: 0; }
  .modal-col-left .modal-section:last-child, .modal-col-left .modal-attachments-section { margin-bottom: 0.5rem; }
  .modal-scroll-jump { display: none !important; }
  .modal-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem 1rem; }
  .comment-form { margin-bottom: 0.75rem; }
}

/* 5b) Formulário em seções recolhíveis (alternativa C, escolhida pelo Toni em 07/10/2026): fichas dos campos principais
   no topo e cada parte numa linha que abre e fecha, com o resumo à direita (js/secoes.js) */
.fs-fichas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin: 0 0 0.75rem; }
.fs-fichas[hidden] { display: none; }
.fs-ficha { display: inline-flex; align-items: center; gap: 0.375rem; max-width: 100%; min-height: 30px; padding: 0.1875rem 0.625rem; border: 1px solid var(--border-light); border-radius: 999px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 0.75rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-ficha:hover, .fs-ficha:focus-visible { border-color: var(--accent); outline: none; }
.fs-ficha .status-badge { margin: 0; }
.fs-ficha .avatar { width: 20px; height: 20px; font-size: 0.5625rem; }
.fs-ficha-lab { color: var(--text-muted); }
.fs-card { margin: 0 0 0.5rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.fs-card[hidden] { display: none; }
.fs-head { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 42px; padding: 0.5rem 0.75rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary); font: inherit; font-size: 0.8125rem; font-weight: 600; text-align: left; cursor: pointer; }
.fs-head:hover { background: color-mix(in srgb, var(--bg-tertiary) 35%, transparent); }
.fs-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fs-car { flex: none; color: var(--text-muted); transition: transform 0.15s ease; }
.fs-card.is-open .fs-car { transform: rotate(90deg); }
.fs-tit { flex: none; }
.fs-resumo { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 0.375rem; min-width: 0; color: var(--text-muted); font-size: 0.75rem; font-weight: 500; }
.fs-resumo-txt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fs-resumo .vinc-pill { flex: none; }
.fs-corpo { padding: 0.25rem 0.75rem 0.75rem; }
.fs-corpo[hidden] { display: none; }
/* dentro do cartão o título de cada parte sai (o cabeçalho do cartão já diz); as ações de cada parte continuam */
.fs-corpo .modal-description > h3, .fs-corpo .sub-section > .sub-head .sub-title, .fs-corpo .ck-head-title, .fs-corpo #btnAttachmentsToggle { display: none; }
.fs-corpo .sub-section, .fs-corpo .ck-section, .fs-corpo .modal-description, .fs-corpo .modal-meta, .fs-corpo .modal-attachments-section { margin: 0; padding-top: 0; border-top: 0; }
.fs-corpo .sub-head, .fs-corpo .ck-head, .fs-corpo .modal-attachments-header { justify-content: flex-end; min-height: 0; }
.fs-destaque { animation: fsDestaque 1.4s ease; border-radius: var(--radius-xs); }
@keyframes fsDestaque { from { background: var(--accent-light); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .fs-car { transition: none; } .fs-destaque { animation: none; } }

/* 6) Filtros: contagem, toggle (só ≤ 900px) e barra recolhível */
.filter-count { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; align-self: center; padding-bottom: 0.25rem; }
.filters-toggle { display: none; align-items: center; gap: 0.5rem; background: transparent; border: none; color: var(--text-primary); font-family: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; padding: 0; }
.filters-toggle-badge:not(:empty) { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 0.35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 700; }
.filters-toggle-caret { margin-left: auto; transition: transform 0.15s ease; }
.filters-bar.collapsed .filters-toggle-caret { transform: rotate(-90deg); }
@media (max-width: 900px) {
  .filters-toggle { display: flex; width: 100%; }
  .filters-bar.collapsed .filters-row { display: none; }
  .filters-bar.collapsed .active-filters:empty { display: none; }
  .filters-bar.collapsed .active-filters { margin-top: 0.5rem; padding-top: 0.5rem; }
  .filters-bar { padding: 0.75rem 1rem; }
  .filters-toggle:not([aria-expanded="false"]) { margin-bottom: 0.75rem; }
}

/* 7) Mobile: timeline e composer respiram */
@media (max-width: 600px) {
  .tl-toolbar { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
  .tl-filters { flex-wrap: wrap; }
  .tl-head { flex-wrap: wrap; row-gap: 0.125rem; }
  .comment-form .comment-submit-row .comment-hint { display: none; }
  .tl-internal-toggle { margin-right: auto; }
  .modal-actions-left { flex-wrap: wrap; }
}


/* ux-mobile-fix: controles de visão em coluna única no celular (o seletor de 240px + 3 abas forçavam ~520px
   de largura e o navegador "afastava" a página inteira); botões do cabeçalho do card só ícone */
@media (max-width: 600px) {
  .view-controls { grid-template-columns: 1fr !important; gap: 0.5rem; }
  .view-controls .project-selector { width: 100% !important; min-width: 0 !important; justify-self: stretch !important; }
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; text-align: center; }
  .main-content, .kanban-board, .kpi-grid { max-width: 100%; }
  .modal-header .btn-sm { font-size: 0; gap: 0; padding: 0.45rem; }
  .modal-header .btn-sm svg { margin: 0; }
}


/* =====================================================================
   LOTE UX 2 (validação): formulário de edição no padrão do modal,
   filtro por tipo de data, estimativa interna
   ===================================================================== */
/* Edição: só o conteúdo da coluna esquerda dá lugar ao formulário; conversa segue à direita */
.modal.editing .modal-col-left > :not(#editPanel) { display: none !important; }
.modal.editing #btnEditIssue, .modal.editing #btnDeleteIssue, .modal.editing .modal-actions { display: none; }
@media (max-width: 1099px) { .modal.editing .modal-col-right, .modal.editing .modal-followers { display: none; } }
.edit-panel { padding: 0; background: transparent; border: 0; }
.edit-panel-inner { gap: 0.875rem; }
.edit-panel-inner > .edit-grid { overflow: visible; flex: none; padding-right: 0; }
.edit-panel-header { padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); }
.edit-panel-header strong { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.edit-panel-loading { display: flex; align-items: center; gap: 0.5rem; padding: 1.5rem 0; color: var(--text-muted); font-size: 0.8125rem; }
.edit-grid { gap: 0.75rem 1rem; }
.edit-group-title { grid-column: 1 / -1; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding-top: 0.625rem; margin-top: 0.125rem; border-top: 1px dashed var(--border-light); }
.edit-group-title:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.edit-field label { color: var(--text-secondary); }
.edit-field input, .edit-field select { height: 36px; padding: 0 0.625rem; border-radius: var(--radius-sm, 6px); font-size: 0.8125rem; background: var(--bg-primary); }
.edit-field input:focus, .edit-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.edit-field-internal input { border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.06); }
.edit-panel-actions { position: sticky; bottom: 0; padding: 0.75rem 0 0.125rem; margin-top: 0.25rem; border-top: 1px solid var(--border-light); background: var(--bg-secondary); }
@media (max-width: 600px) { .edit-grid { grid-template-columns: 1fr; } }

/* Estimativa interna: destaque discreto (âmbar, como tudo que é "só equipe") */
.modal-meta-internal label { color: #b45309; }
.modal-meta-internal > span { font-weight: 600; }
.kanban-card-estimate { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.6875rem; color: #b45309; background: rgba(245,158,11,0.14); padding: 0.0625rem 0.4rem; border-radius: 4px; }

/* Filtro de data: o rótulo vira um select (Data prevista / entregue / criação / atualização) */
.filter-date-label { display: flex; align-items: center; gap: 0.375rem; }
.filter-date-field { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; border: 0; background: transparent; padding: 0; cursor: pointer; appearance: auto; -webkit-appearance: menulist; max-width: 100%; }
.filter-date-field:focus { outline: none; color: var(--accent); }
.filter-date-label span { font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; text-transform: none; }

/* Form de edição: rótulos com dica em 2 linhas não desalinham mais os campos (input ancorado embaixo da linha) */
.edit-field { justify-content: flex-end; }
.edit-field label { line-height: 1.25; }
.edit-field .edit-hint { white-space: nowrap; }
.edit-field-internal label { color: #b45309; }

/* Garantia: chip no card e item no modal */
.kanban-card-warranty { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.6875rem; color: #0f766e; background: rgba(20,184,166,0.14); padding: 0.0625rem 0.4rem; border-radius: 4px; }
.kanban-card-warranty.overdue { color: var(--danger); background: var(--danger-bg); }
.warranty-info small { display: block; font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; }

/* ===== Nova demanda (form) ===== */
#newIssueModalOverlay .modal { max-width: 640px; }
.new-issue-kicker { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.125rem; }
.new-issue-body .edit-grid { gap: 0.875rem 1rem; }
.new-issue-editor [contenteditable] { min-height: 150px; }
.new-issue-dropzone { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.875rem 1rem; border: 1.5px dashed var(--border); border-radius: var(--radius-sm, 6px); background: var(--bg-secondary); color: var(--text-muted); font-size: 0.8125rem; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.new-issue-dropzone u { text-decoration-color: var(--accent); text-underline-offset: 2px; }
.new-issue-dropzone:hover, .new-issue-dropzone:focus-visible, .new-issue-dropzone.is-over { border-color: var(--accent); color: var(--accent); background: var(--accent-light); outline: none; }
.new-issue-files-list:not(:empty) { margin-top: 0.5rem; }
.new-issue-actions { justify-content: space-between; }
.new-issue-actions-right { display: flex; gap: 0.5rem; margin-left: auto; }
.new-issue-kbd { font-size: 0.6875rem; color: var(--text-muted); }
.new-issue-field-error input { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
@media (max-width: 640px) { .new-issue-kbd { display: none; } }

/* ===== Nova demanda (form v2): grade inteira em tela larga + urgência ===== */
#newIssueModalOverlay .modal-body { display: block; }
.edit-field[hidden] { display: none; }
.new-issue-body .edit-grid { width: 100%; }
.edit-field textarea { padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; line-height: 1.4; resize: vertical; min-height: 56px; }
.edit-field textarea:focus { border-color: var(--accent); outline: none; }
.edit-field label.new-issue-urgent-toggle { display: flex; align-items: center; gap: 0.5rem; height: 36px; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--bg-primary); font-size: 0.8125rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-primary); cursor: pointer; user-select: none; }
.edit-field label.new-issue-urgent-toggle:has(input:checked) { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.06); }
.new-issue-urgent-toggle input { accent-color: var(--danger); margin: 0; }
.new-issue-field-error textarea { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.tl-urgent-badge { display: inline-block; padding: 0 0.4rem; border-radius: 4px; background: rgba(239, 68, 68, 0.12); color: var(--danger); font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; vertical-align: middle; }

/* Texto sem espaços (URLs, hashes) quebra dentro do balão/descrição em vez de estourar o modal (overflow-wrap é herdado) */
.modal .modal-body { overflow-wrap: anywhere; }
.comment-body a, .modal-description a { word-break: break-all; }
.comment-body pre, .comment-body code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* =====================================================================
   LOTE 2026-10: popups no padrão, kanban (altura, arrasto, rolagem),
   rascunhos, atualização automática, configuração do card, capa e valor
   ===================================================================== */

/* ---------- Diálogos (substituem confirm/alert do navegador) ---------- */
.ui-dialog-overlay { z-index: 1200; }
.modal.ui-dialog { max-width: 440px; max-height: 88vh; display: flex; flex-direction: column; }
.modal.ui-dialog.ui-dialog-md { max-width: 560px; }
.modal.ui-dialog.ui-dialog-lg { max-width: 960px; }
.ui-dialog-header { align-items: center; gap: 0.75rem; padding: 1.125rem 1.25rem 0.875rem; }
.ui-dialog-title { font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
.ui-dialog-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-dialog-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ui-dialog-icon-warning { background: var(--warning-bg); color: var(--warning); }
.ui-dialog-icon-danger { background: var(--danger-bg); color: var(--danger); }
.ui-dialog-icon-info, .ui-dialog-icon-move { background: var(--accent-light); color: var(--accent); }
.ui-dialog-icon-success { background: var(--success-bg); color: var(--success); }
.ui-dialog-body { padding: 1rem 1.25rem 0.25rem; overflow-y: auto; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.55; }
.ui-dialog-body p { margin: 0 0 0.625rem; }
.ui-dialog-body p:last-child { margin-bottom: 0; }
.ui-dialog-muted { color: var(--text-muted); font-size: 0.8125rem; }
.ui-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 1rem 1.25rem 1.125rem; flex-wrap: wrap; }
.ui-dialog-actions-left, .ui-dialog-actions-right { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ui-dialog-actions-right { margin-left: auto; }
.ui-btn-danger-ghost { color: var(--danger) !important; border-color: transparent !important; }
.ui-btn-danger-ghost:hover { background: var(--danger-bg) !important; }
.ui-dialog-error { margin: 0.5rem 1.25rem 0; padding: 0.5rem 0.75rem; border-radius: var(--radius-xs); background: var(--danger-bg); color: var(--danger); font-size: 0.8125rem; }
.ui-dialog .btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite; }
.ui-shake { animation: ui-shake 0.32s ease; }
@keyframes ui-shake { 0%,100% { translate: 0; } 25% { translate: -6px; } 75% { translate: 6px; } }
.ui-field-label { display: block; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 0.375rem; }
.ui-req { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.ui-textarea { width: 100%; min-height: 96px; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.875rem; line-height: 1.5; resize: vertical; outline: none; }
.ui-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.ui-field-hint { margin-top: 0.375rem; font-size: 0.75rem; color: var(--text-muted); }
.ui-choice-list { display: flex; flex-direction: column; gap: 0.375rem; max-height: 52vh; overflow-y: auto; margin-bottom: 0.25rem; }
.ui-choice { display: flex; align-items: center; gap: 0.625rem; width: 100%; min-height: 44px; padding: 0.5rem 0.75rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ui-choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); }
.ui-choice:disabled { opacity: 0.55; cursor: default; }
.ui-choice-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ui-choice-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-choice-hint { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.ui-dialog-text { margin-bottom: 0.75rem !important; }
@media (max-width: 640px) {
  .ui-dialog-overlay { align-items: flex-end; padding: 0.5rem; }
  .modal.ui-dialog { max-width: none; border-radius: var(--radius) var(--radius) var(--radius-sm) var(--radius-sm); }
  .ui-dialog-actions .btn { min-height: 44px; }
}

/* ---------- Popups leves no mesmo padrão (menção, link, busca de seguidor, sino) ---------- */
.mention-popup {
  z-index: 10050; min-width: 240px; max-width: 340px; max-height: 280px; overflow-y: auto; padding: 0.25rem;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.mention-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.375rem 0.5rem; border: none; border-radius: var(--radius-xs); background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.mention-item.is-active, .mention-item:hover:not(.is-disabled) { background: var(--accent-light); }
.mention-item.is-disabled { cursor: not-allowed; opacity: 0.6; }
.mention-avatar { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-light); color: var(--accent); font-size: 0.625rem; font-weight: 700; }
.mention-item.is-disabled .mention-avatar { background: var(--bg-tertiary); color: var(--text-muted); }
.mention-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mention-name { font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-sub { font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-hint { margin: 0.25rem 0.25rem 0; padding: 0.375rem 0.25rem 0.125rem; border-top: 1px solid var(--border-light); font-size: 0.6875rem; color: var(--text-muted); }
.mention-chip { display: inline-block; padding: 0 0.3rem; border-radius: 4px; background: var(--accent-light); color: var(--accent); font-weight: 600; font-size: 0.9em; }
.rich-link-popover { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 0.5rem; }
.rich-link-popover input { border-radius: var(--radius-xs); padding: 0.4375rem 0.625rem; }
.rich-link-popover input:focus { box-shadow: 0 0 0 3px var(--accent-light); }
.rich-link-popover .rich-link-ok { padding: 0.4375rem 0.75rem; border-radius: var(--radius-xs); }
.rich-emoji-picker { background: var(--bg-secondary); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.emoji-btn:hover { background: var(--bg-tertiary); }
.follower-search-results { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 0.25rem; }
.follower-search-item { border-radius: var(--radius-xs); padding: 0.4375rem 0.625rem; }
.follower-search-item:hover { background: var(--accent-light); }
.notif-dropdown { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }

/* ---------- Toasts: cor por tipo (a classe usada é toast-success/-error/-info) ---------- */
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { border-left: 3px solid var(--accent); }
.toast-info .toast-icon { color: var(--accent); }
.toast-icon { display: inline-flex; flex-shrink: 0; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 1.125rem; line-height: 1; cursor: pointer; margin-left: auto; padding: 0 0.125rem; }
.toast-close:hover { color: var(--text-primary); }
.toast { color: var(--text-primary); transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.hiding { opacity: 0; transform: translateX(16px); }

/* ---------- Rascunhos e avisos dentro de modal ---------- */
.draft-banner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.875rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--accent-light); color: var(--text-primary); font-size: 0.8125rem; }
.draft-banner-sm { margin-bottom: 0.5rem; padding: 0.375rem 0.625rem; font-size: 0.75rem; }
.draft-banner-discard { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; white-space: nowrap; }
.draft-banner-discard:hover { text-decoration: underline; }
.live-stale-banner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 1.5rem; background: var(--warning-bg); color: var(--text-primary); font-size: 0.8125rem; border-bottom: 1px solid var(--border-light); }
.tl-item.tl-new { animation: tl-new 2.4s ease; border-radius: var(--radius-sm); }
@keyframes tl-new { 0%, 35% { background: var(--accent-light); } 100% { background: transparent; } }

/* ---------- Kanban: barra, altura máxima, rolagem e arrasto ---------- */
.kanban-wrap { position: relative; }
.kanban-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; min-height: 32px; }
.kanban-toolbar-hint { font-size: 0.75rem; color: var(--text-muted); }
.kanban-toolbar-actions { display: flex; align-items: center; gap: 0.375rem; margin-left: auto; }
.kanban-nav-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; transition: background 0.15s, color 0.15s; }
.kanban-nav-btn:hover:not(:disabled) { background: var(--bg-tertiary); color: var(--text-primary); }
.kanban-nav-btn:disabled { opacity: 0.35; cursor: default; }
.kanban-nav-btn[hidden] { display: none; }
.kanban-cfg-btn { gap: 0.375rem; }
.kanban-frame { position: relative; }
.kanban-frame::before, .kanban-frame::after { content: ''; position: absolute; top: 0; bottom: 1rem; width: 28px; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 0.2s; }
.kanban-frame::before { left: 0; background: linear-gradient(90deg, var(--bg-primary), transparent); }
.kanban-frame::after { right: 0; background: linear-gradient(270deg, var(--bg-primary), transparent); }
.kanban-frame.can-left::before, .kanban-frame.can-right::after { opacity: 1; }
@media (min-width: 769px) {
  .kanban-board { height: var(--kanban-h, auto); min-height: 380px; align-items: stretch; }
  .kanban-column { max-height: 100%; min-height: 0; }
  .kanban-column-body { max-height: none; min-height: 0; flex: 1 1 auto; overscroll-behavior-y: contain; }
}
.kanban-board.is-panning { cursor: grabbing; }
.kanban-board.is-panning * { cursor: grabbing !important; }
body.kanban-no-select, body.kanban-no-select * { user-select: none !important; -webkit-user-select: none !important; }
.kanban-card[data-draggable="1"] { cursor: grab; }
body.kanban-dragging, body.kanban-dragging * { cursor: grabbing !important; }
.kanban-card.drag-origin { opacity: 0.35; outline: 2px dashed var(--border); outline-offset: -2px; }
.kanban-drag-ghost { position: fixed !important; top: 0; left: 0; margin: 0 !important; z-index: 3000; pointer-events: none; opacity: 0.96; box-shadow: 0 18px 40px rgba(0,0,0,0.35) !important; border-color: var(--accent) !important; will-change: transform; transition: none !important; }
.kanban-column.drop-target { background: var(--accent-light); outline: 2px dashed var(--accent); outline-offset: -4px; }
.kanban-card-move-btn { display: none; }
@media (hover: none) and (pointer: coarse) {
  .kanban-card[data-draggable="1"] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .kanban-card-move-btn { display: inline-flex; position: absolute; top: 0.375rem; right: 0.375rem; z-index: 2; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-secondary); color: var(--text-secondary); }
  .kanban-card[data-draggable="1"] .kanban-card-header { padding-right: 2.25rem; }
}
.kanban-card-flash { animation: kanban-flash 2.2s ease; }
@keyframes kanban-flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent), var(--shadow); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Card: capa, valor, etiquetas, chips configuráveis, fonte ---------- */
.kanban-card-cover { margin: -0.75rem -0.75rem 0.625rem; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; overflow: hidden; background: var(--bg-secondary); max-height: 180px; }
.kanban-card-cover img { display: block; width: 100%; max-height: 180px; object-fit: contain; } /* arte inteira, sobra preenchida pela cor média (como no Trello) */
.kanban-card-cover.is-color { height: 34px; }
.kanban-card-header-right { display: inline-flex; align-items: center; gap: 0.375rem; margin-left: auto; }
.kanban-card-value { display: inline-flex; align-items: center; font-size: 0.6875rem; font-weight: 700; color: var(--success); background: var(--success-bg); padding: 0.0625rem 0.4rem; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kanban-column-value { font-size: 0.625rem; font-weight: 700; color: var(--success); background: var(--success-bg); padding: 0.125rem 0.375rem; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kanban-card-project { font-size: 0.625rem; color: var(--text-muted); margin: 0.25rem 0; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.kanban-card-labels { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.375rem; }
.kanban-card-label { font-size: 0.625rem; font-weight: 600; padding: 0.0625rem 0.4rem; border-radius: 999px; background: var(--purple-bg); color: var(--purple); }
.kanban-card-chip { font-size: 0.625rem; color: var(--text-muted); background: var(--bg-secondary); padding: 0.125rem 0.375rem; border-radius: 4px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.kanban-chip-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.5625rem; opacity: 0.85; }
.kanban-font-sm .kanban-card-title { font-size: 0.75rem; }
.kanban-font-sm .kanban-card { padding: 0.625rem; }
.kanban-font-sm .kanban-card-cover { margin: -0.625rem -0.625rem 0.5rem; }
.kanban-font-lg .kanban-card-title { font-size: 0.9375rem; line-height: 1.4; }
.kanban-font-lg .kanban-card-meta > span, .kanban-font-lg .kanban-card-value, .kanban-font-lg .kanban-card-key { font-size: 0.75rem !important; }

/* ---------- Diálogo "Configurar card" ---------- */
.cardcfg-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; }
.cardcfg-controls { max-height: 62vh; overflow-y: auto; padding-right: 0.25rem; }
.cardcfg-group { margin-bottom: 1rem; }
.cardcfg-group-title { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.375rem; }
.cardcfg-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.5rem; border: 1px solid var(--border-light); border-radius: var(--radius-xs); margin-bottom: 0.25rem; background: var(--bg-primary); }
.cardcfg-row.is-off { opacity: 0.6; }
.cardcfg-check { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; font-size: 0.8125rem; color: var(--text-primary); cursor: pointer; }
.cardcfg-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardcfg-check input, .cardcfg-mini input { accent-color: var(--accent); }
.cardcfg-mini { display: flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.cardcfg-move { width: 26px; height: 26px; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; font-size: 0.8125rem; }
.cardcfg-move:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.cardcfg-move:disabled { opacity: 0.35; cursor: default; }
.cardcfg-seg { display: flex; gap: 0.375rem; }
.cardcfg-seg button { flex: 1; padding: 0.4375rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.cardcfg-seg button.is-on { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 600; }
.cardcfg-sort { display: flex; gap: 0.375rem; }
.cardcfg-sort select { flex: 1; padding: 0.4375rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; }
.cardcfg-scope { padding: 0.5rem 0.625rem; border: 1px dashed var(--border); border-radius: var(--radius-xs); }
.cardcfg-preview { position: sticky; top: 0; align-self: start; }
.cardcfg-preview-col { flex: none; width: 100%; max-width: 280px; min-width: 0; }
/* Totais no topo da coluna: com muitos totais, descem para uma segunda linha à direita */
.kanban-column-header { flex-wrap: wrap; row-gap: 0.375rem; }
.kanban-column-stats { margin-left: auto; }
.kanban-column-hours.is-internal { color: #b45309; background: rgba(245,158,11,0.14); }
/* horas das tarefas-mãe que contam nas subtarefas, em outras colunas: linha discreta embaixo do topo da coluna */
.kanban-column-fora { order: 9; flex: 1 1 100%; min-width: 0; font-size: 0.6875rem; line-height: 1.3; color: var(--text-muted); }
.kanban-column-fora:empty { display: none; }
.kanban-column-header .kanban-column-fora { margin-right: -1.75rem; }
.kanban-card-hours.is-nas-filhas, .kanban-card-estimate.is-nas-filhas { background: none; color: var(--text-muted); box-shadow: none; outline: 1px dashed var(--border); outline-offset: -1px; }
.cardcfg-preview-col .kanban-column-body { max-height: none; }
.cardcfg-note { margin-top: 0.625rem; font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }
.cardcfg-hint { margin: 0.375rem 0 0; font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }
@media (max-width: 720px) {
  .cardcfg-grid { grid-template-columns: 1fr; }
  .cardcfg-preview { position: static; order: -1; }
  .cardcfg-controls { max-height: none; }
}

/* ---------- Valor (R$) no cabeçalho da tarefa ---------- */
.modal-value-chip { display: inline-flex; align-items: center; margin-left: 0.375rem; padding: 0.125rem 0.5rem; border-radius: 999px; border: 1px solid transparent; background: var(--success-bg); color: var(--success); font: inherit; font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: default; }
.modal-value-chip.is-editable { cursor: pointer; }
.modal-value-chip.is-editable:hover { border-color: var(--success); }
.modal-value-chip.is-empty { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); font-weight: 600; }
.modal-value-chip.is-empty:hover { color: var(--success); border-color: var(--success); }
.ui-input { width: 100%; height: 38px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.9375rem; outline: none; }
.ui-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* ---------- Capa: banner no detalhe, diálogo, nova demanda ---------- */
.modal-cover { position: relative; flex-shrink: 0; max-height: 200px; overflow: hidden; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-light); }
.modal-cover img { display: block; width: 100%; max-height: 200px; object-fit: contain; cursor: zoom-in; }
.modal-cover.is-color { height: 64px; }
.modal-cover-actions { position: absolute; right: 0.75rem; bottom: 0.625rem; display: flex; gap: 0.375rem; opacity: 0; transition: opacity 0.15s; }
.modal-cover:hover .modal-cover-actions, .modal-cover:focus-within .modal-cover-actions { opacity: 1; }
.modal-cover-actions .btn { background: var(--bg-secondary); box-shadow: var(--shadow); }
@media (hover: none) { .modal-cover-actions { opacity: 1; } }
.cover-section { margin-bottom: 1rem; }
.cover-drop { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 1rem; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-muted); font-size: 0.8125rem; cursor: pointer; text-align: center; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.cover-drop:hover, .cover-drop:focus-visible, .cover-drop.is-over { border-color: var(--accent); color: var(--accent); background: var(--accent-light); outline: none; }
.cover-drop u { text-underline-offset: 2px; }
.cover-att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.5rem; }
.cover-att { aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: var(--radius-xs); overflow: hidden; background: var(--bg-tertiary); cursor: pointer; }
.cover-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-att:hover { border-color: var(--accent); }
.cover-colors { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cover-color { width: 40px; height: 28px; border: 2px solid transparent; border-radius: var(--radius-xs); cursor: pointer; }
.cover-color:hover { border-color: var(--text-primary); }
.ui-dialog.is-busy .cover-drop, .ui-dialog.is-busy .cover-att, .ui-dialog.is-busy .cover-color { opacity: 0.55; pointer-events: none; }
.new-issue-cover { display: flex; align-items: center; gap: 0.5rem; }
.new-issue-cover-preview { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; padding: 0.375rem 0.5rem; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-primary); font-size: 0.8125rem; }
.new-issue-cover-preview[hidden] { display: none; }
.new-issue-cover-preview img { width: 56px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.new-issue-cover-preview .new-issue-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toasts no padrão dos diálogos (substitui os estilos anteriores) ---------- */
.toast-container { position: fixed; right: 1.25rem; bottom: calc(2rem + 56px + 0.875rem); top: auto; z-index: 2100; display: flex; flex-direction: column; align-items: flex-end; gap: 0.625rem; pointer-events: none; }
.toast { position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: flex-start; gap: 0.75rem; box-sizing: border-box; width: 360px; max-width: calc(100vw - 2rem); min-width: 0; padding: 0.75rem 0.625rem 0.875rem 0.875rem; background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-light); border-radius: 12px; box-shadow: 0 12px 32px -10px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(15, 23, 42, 0.08); font-size: 0.8125rem; line-height: 1.45; animation: toastIn 0.22s ease-out; transition: opacity 0.2s ease, transform 0.2s ease; }
.toast, .toast.success, .toast.error, .toast.info, .toast-success, .toast-error, .toast-info { border-left: 1px solid var(--border-light); }
.toast.hiding { opacity: 0; transform: translateX(14px); animation: none; }
.toast-icon { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-info .toast-icon { background: var(--accent-light, rgba(59, 130, 246, 0.15)); color: var(--accent); }
.toast-msg { flex: 1; min-width: 0; padding-top: 0.3rem; overflow-wrap: anywhere; }
.toast-close { width: 26px; height: 26px; min-width: 26px; display: inline-flex; align-items: center; justify-content: center; margin: 0 0 0 auto; padding: 0; border: none; border-radius: 6px; background: none; color: var(--text-muted); font-size: 1.125rem; line-height: 1; cursor: pointer; }
.toast-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; transform-origin: left center; opacity: 0.75; }
.toast-success .toast-bar { background: var(--success); }
.toast-error .toast-bar { background: var(--danger); }
.toast-info .toast-bar { background: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .toast-container { left: 1rem; right: 1rem; align-items: stretch; } .toast { width: auto; max-width: none; } }
/* Histórico: ação feita pela API pública */
.tl-via-api { display: inline-block; margin-left: 0.25rem; padding: 0 0.375rem; border-radius: 4px; background: var(--accent-light); color: var(--accent); font-size: 0.6875rem; font-weight: 600; white-space: nowrap; }

/* ===== Checklists nas tarefas (2026-10-01) ===== */
#ckLibraryMenuItem[hidden], .ck-section[hidden] { display: none !important; }

/* seção na tarefa */
.ck-section { margin: 0.25rem 0 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
/* coluna estreita do modal (2 colunas a partir de 1100px): escolha de modelo em uma coluna só */
.ck-section { container-type: inline-size; container-name: cksec; }
.ck-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.ck-head-title { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.ck-head-title svg { color: var(--text-muted); flex-shrink: 0; }
.ck-head-title > span:first-of-type { white-space: nowrap; }
.ck-head-sum { white-space: nowrap; font-size: 0.75rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-secondary); background: var(--bg-tertiary); padding: 0.125rem 0.5rem; border-radius: 999px; }
.ck-head-sum.is-complete { color: #4ade80; background: rgba(34, 197, 94, 0.16); }
[data-theme="light"] .ck-head-sum.is-complete { color: #15803d; }
.ck-add-btn { gap: 0.375rem; color: var(--accent); border-color: rgba(59, 130, 246, 0.45); }
.ck-add-btn:hover, .ck-add-btn.is-open { background: var(--accent-light); color: var(--accent); }
.ck-empty { padding: 0.875rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.8125rem; text-align: center; }
.ck-loading { border-style: solid; border-color: var(--border-light); }
.ck-lists { display: flex; flex-direction: column; gap: 0.75rem; }
.ck-lists:empty { display: none; }
.ck-list { border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 0.75rem 0.875rem; background: var(--bg-secondary); display: flex; flex-direction: column; gap: 0.5rem; }
.ck-list.is-internal { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.05); }
[data-theme="light"] .ck-list.is-internal { background: #fffaf0; }
.ck-list-head { display: flex; align-items: flex-start; gap: 0.75rem; }
.ck-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.ck-list-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem 0.5rem; }
.ck-list-title { font-weight: 600; font-size: 0.9375rem; color: var(--text-primary); overflow-wrap: anywhere; }
.ck-origin { font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }
.ck-badge { gap: 0.25rem; }
.ck-list-stats { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; flex-shrink: 0; }
.ck-pct { font-size: 1.0625rem; font-weight: 700; color: var(--text-primary); }
.ck-count { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.ck-list-stats.is-complete .ck-pct { color: #4ade80; }
[data-theme="light"] .ck-list-stats.is-complete .ck-pct { color: #15803d; }
.ck-menu-wrap { position: relative; flex-shrink: 0; }
.ck-icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: transparent; color: var(--text-secondary); cursor: pointer; padding: 0; flex-shrink: 0; }
.ck-icon-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.ck-icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.ck-icon-btn.is-danger:hover { color: var(--danger); border-color: rgba(239, 68, 68, 0.45); }
.ck-icon-sm { width: 28px; height: 28px; border-color: transparent; }
.ck-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 240px; padding: 0.375rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.ck-menu button { text-align: left; padding: 0.5rem 0.625rem; border: none; background: none; border-radius: var(--radius-xs); color: var(--text-primary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.ck-menu button:hover, .ck-menu button:focus-visible { background: var(--bg-tertiary); outline: none; }
.ck-menu button.is-danger { color: var(--danger); }
.ck-bar { height: 6px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.ck-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.25s ease; }
.ck-bar.is-complete span { background: var(--success); }
.ck-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ck-item { display: flex; align-items: center; gap: 0.625rem; min-height: 40px; padding: 0.25rem 0.125rem; border-bottom: 1px solid var(--border-light); }
.ck-item:last-child { border-bottom: none; }
.ck-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: #16a34a; cursor: pointer; margin: 0; }
.ck-check:disabled { cursor: default; }
.ck-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.0625rem; padding: 0.25rem 0; }
.ck-item-text { font-size: 0.875rem; line-height: 1.4; color: var(--text-primary); cursor: pointer; overflow-wrap: anywhere; }
.ck-check:disabled + .ck-item-body .ck-item-text { cursor: default; }
.ck-item.is-done .ck-item-text { color: var(--text-muted); text-decoration: line-through; }
.ck-item-meta { font-size: 0.6875rem; color: var(--text-muted); }
.ck-item-actions { display: inline-flex; gap: 0.125rem; opacity: 0; transition: opacity 0.15s ease; }
.ck-item:hover .ck-item-actions, .ck-item:focus-within .ck-item-actions { opacity: 1; }
@media (hover: none) { .ck-item-actions { opacity: 1; } }
.ck-input { flex: 1; min-width: 0; height: 36px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.875rem; }
[data-theme="light"] .ck-input { background: #ffffff; }
.ck-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.ck-input.is-invalid { border-color: var(--danger); }
.ck-input:disabled { opacity: 0.7; }
.ck-title-input { max-width: 340px; }
.ck-add-row { display: flex; align-items: center; gap: 0.5rem; }
.ck-add-item { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.375rem; height: 32px; padding: 0 0.625rem; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-tertiary); color: var(--text-secondary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.ck-add-item:hover { color: var(--text-primary); border-color: var(--border); }
.ck-link { border: none; background: none; padding: 0.25rem 0; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.ck-link:hover { text-decoration: underline; }
.ck-hidden-note { align-self: flex-start; }
.ck-hint { margin: 0; font-size: 0.75rem; line-height: 1.45; color: var(--text-muted); }

/* escolher modelo */
.ck-picker { border: 1px solid rgba(59, 130, 246, 0.45); border-radius: var(--radius-sm); background: var(--bg-secondary); box-shadow: var(--shadow-lg); overflow: hidden; }
.ck-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border-light); font-size: 0.875rem; color: var(--text-primary); }
.ck-picker-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ck-picker-left { padding: 0.75rem; border-right: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.ck-picker-right { padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--bg-primary); min-width: 0; }
[data-theme="light"] .ck-picker-right { background: #f8fafc; }
.ck-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; border-radius: var(--radius-xs); background: var(--bg-tertiary); }
.ck-tab { flex: 1; height: 30px; border: none; border-radius: 5px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0 0.5rem; }
.ck-tab.is-active { background: var(--bg-secondary); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.ck-tpl-list { display: flex; flex-direction: column; gap: 0.375rem; max-height: 260px; overflow-y: auto; }
.ck-tpl { text-align: left; width: 100%; padding: 0.5rem 0.625rem; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-secondary); color: var(--text-primary); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 0.125rem; }
.ck-tpl:hover { border-color: var(--border); }
.ck-tpl.is-selected { border-color: var(--accent); background: var(--accent-light); }
.ck-tpl-name { font-weight: 600; font-size: 0.875rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ck-tpl-meta { font-size: 0.75rem; color: var(--text-muted); }
.ck-preview-title { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.ck-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; max-height: 220px; overflow-y: auto; font-size: 0.8125rem; color: var(--text-secondary); }
.ck-preview li { display: flex; align-items: flex-start; gap: 0.5rem; }
.ck-preview-box { width: 13px; height: 13px; margin-top: 0.15rem; border: 1.5px solid var(--text-muted); border-radius: 3px; flex-shrink: 0; }
.ck-internal-opt { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; }
.ck-internal-opt input { width: 16px; height: 16px; accent-color: #d97706; flex-shrink: 0; }
.ck-picker-actions { margin-top: auto; padding-top: 0.5rem; display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ck-lib-link { margin-right: auto; }
.ck-picker-blank { padding: 0.875rem; display: flex; flex-direction: column; gap: 0.625rem; }
.ck-picker-blank .ck-input { flex: none; }
.ck-field-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
@media (max-width: 640px) {
  .ck-picker-body { grid-template-columns: 1fr; }
  .ck-picker-left { border-right: none; border-bottom: 1px solid var(--border-light); }
  .ck-add-row { flex-wrap: wrap; }
}

/* vem depois das regras do picker para ganhar na cascata */
@container cksec (max-width: 560px) {
  .ck-picker-body { grid-template-columns: 1fr; }
  .ck-picker-left { border-right: none; border-bottom: 1px solid var(--border-light); }
  .ck-tpl-list { max-height: 180px; }
}

/* histórico e card do kanban */
.tl-ck-ref { color: var(--text-muted); }
.kanban-card-checklist { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: var(--text-secondary); background: var(--bg-tertiary); padding: 0.0625rem 0.4rem; border-radius: 4px; }
.kanban-card-checklist.is-complete { color: #4ade80; background: rgba(34, 197, 94, 0.16); }
[data-theme="light"] .kanban-card-checklist.is-complete { color: #15803d; }

/* toast com ação ("Desfazer") */
.toast-action { align-self: center; margin-left: 0.25rem; padding: 0.3rem 0.625rem; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.toast-action:hover { background: var(--accent-light); }

/* biblioteca de modelos */
.ck-lib-overlay { z-index: 1100; }
.ck-lib { max-width: 1080px; width: 100%; height: min(86vh, 860px); max-height: 86vh; }
.ck-lib-header { align-items: center; }
.ck-lib-titles { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.ck-lib-kicker { font-size: 0.75rem; color: var(--text-muted); }
.ck-lib-titles h2 { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.ck-lib-header-right { display: flex; align-items: center; gap: 0.75rem; }
.ck-lib-project { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); }
.ck-lib-project select { height: 34px; padding: 0 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; max-width: 260px; }
[data-theme="light"] .ck-lib-project select { background: #ffffff; }
.ck-lib-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.ck-lib-body > .ck-empty { grid-column: 1 / -1; margin: 1.25rem; }
.ck-lib-side { border-right: 1px solid var(--border-light); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; min-height: 0; }
.ck-lib-new { align-self: stretch; gap: 0.375rem; }
.ck-lib-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.ck-lib-row { text-align: left; width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-primary); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 0.25rem; }
.ck-lib-row:hover { border-color: var(--border); }
.ck-lib-row.is-selected { border-color: var(--accent); background: var(--accent-light); }
.ck-lib-row.is-new { cursor: default; border-style: dashed; }
.ck-lib-row-top { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.ck-lib-row-name { font-weight: 600; font-size: 0.875rem; margin-right: auto; overflow-wrap: anywhere; }
.ck-lib-row-meta { font-size: 0.75rem; color: var(--text-muted); }
.ck-scope-badge { font-size: 0.6875rem; font-weight: 600; padding: 0.0625rem 0.45rem; border-radius: 999px; }
.ck-scope-badge.is-global { color: #c4b5fd; background: rgba(168, 85, 247, 0.18); }
.ck-scope-badge.is-project { color: #7dd3fc; background: rgba(14, 165, 233, 0.18); }
[data-theme="light"] .ck-scope-badge.is-global { color: #6d28d9; background: #ede9fe; }
[data-theme="light"] .ck-scope-badge.is-project { color: #075985; background: #e0f2fe; }
.ck-lib-editor { padding: 1.125rem 1.25rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.ck-lib-placeholder { margin: auto 0; }
.ck-lib-notice { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-sm); background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.8125rem; }
.ck-lib-field { display: flex; flex-direction: column; gap: 0.375rem; }
.ck-lib-field > label, .ck-lib-items-head, .ck-lib-fieldset legend { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.ck-lib-field > .ck-input { flex: none; height: 38px; }
.ck-lib-fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
.ck-lib-fieldset legend { padding: 0; margin-bottom: 0.375rem; }
.ck-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.ck-choice { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.625rem 0.75rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); cursor: pointer; }
.ck-choice input { margin-top: 0.2rem; accent-color: var(--accent); flex-shrink: 0; }
.ck-choice span { display: flex; flex-direction: column; gap: 0.125rem; font-size: 0.8125rem; color: var(--text-primary); }
.ck-choice small { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.ck-choice.is-on { border-color: var(--accent); background: var(--accent-light); }
.ck-choice.is-internal.is-on { border-color: #d97706; background: rgba(245, 158, 11, 0.1); }
.ck-choice.is-internal input { accent-color: #d97706; }
.ck-choice.is-disabled { cursor: not-allowed; opacity: 0.6; }
.ck-lib-items-head { display: flex; align-items: center; gap: 0.5rem; }
.ck-lib-count { font-size: 0.6875rem; padding: 0 0.4rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); }
.ck-lib-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.ck-lib-items li { display: flex; align-items: center; gap: 0.5rem; }
.ck-lib-n { width: 1.25rem; text-align: right; font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.ck-lib-item-actions { display: inline-flex; gap: 0.125rem; }
.ck-lib-foot { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ck-lib-foot .ck-hint { max-width: 440px; }
.ck-lib-actions { display: flex; gap: 0.5rem; margin-left: auto; }
@media (max-width: 760px) {
  .ck-lib { height: 92vh; max-height: 92vh; }
  .ck-lib-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ck-lib-side { border-right: none; border-bottom: 1px solid var(--border-light); max-height: 38vh; }
  .ck-choices { grid-template-columns: 1fr; }
  .ck-lib-header { flex-wrap: wrap; }
  .ck-lib-header-right { width: 100%; justify-content: space-between; }
}

/* ===== Kanban: rolagem com toque passa da coluna para a página (2026-10-01) ===== */
@media (min-width: 769px) and (pointer: coarse) { .kanban-column-body { overscroll-behavior: auto; } }

/* ===== Kanban: rolagem lateral (trackpad, Shift+roda, dedo) chega ao quadro (2026-10-01) ===== */
/* A coluna segura só o vertical; o lateral passa para o quadro, que o segura no fim (sem "voltar página"). */
.kanban-board { overscroll-behavior-x: contain; }

/* ===== Filtro de projetos por status (funil ao lado do seletor) — 2026-10-01 ===== */
.project-picker { display: flex; align-items: center; gap: 0.375rem; justify-self: center; min-width: 0; }
.project-picker .project-selector { min-width: 240px; }
.project-filter-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-secondary); cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.project-filter-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.project-filter-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.project-filter-btn.is-active { color: var(--accent); border-color: var(--accent); }
.project-filter-btn[hidden] { display: none; }
.project-filter-count { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center; }
.project-filter-count[hidden] { display: none; }
.project-filter-pop { position: fixed; z-index: 2500; width: 290px; max-width: calc(100vw - 24px); max-height: min(70vh, 520px); overflow: auto; background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 0.5rem; }
.pf-head { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0.25rem 0.375rem 0.5rem; }
.pf-row { display: flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.375rem; border-radius: var(--radius-xs); }
.pf-row:hover { background: var(--bg-tertiary); }
.pf-row label { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; cursor: pointer; font-size: 0.8125rem; padding: 0.125rem 0; }
.pf-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.pf-row.is-empty .pf-name { color: var(--text-muted); }
.pf-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.pf-dot.is-none { border: 1.5px dashed var(--text-muted); }
.pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-n { font-size: 0.75rem; color: var(--text-muted); min-width: 1.25rem; text-align: right; font-variant-numeric: tabular-nums; }
.pf-only { border: none; background: none; color: var(--accent); font-size: 0.75rem; font-weight: 600; cursor: pointer; padding: 0.125rem 0.375rem; border-radius: 4px; opacity: 0; }
.pf-row:hover .pf-only, .pf-only:focus-visible { opacity: 1; }
@media (hover: none) { .pf-only { opacity: 1; } }
.pf-arch { border-top: 1px solid var(--border-light); margin-top: 0.375rem; padding-top: 0.5rem; border-radius: 0; }
.pf-empty { font-size: 0.8125rem; color: var(--text-muted); padding: 0.25rem 0.375rem; }
.pf-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border-top: 1px solid var(--border-light); margin-top: 0.375rem; padding: 0.5rem 0.375rem 0.125rem; }
.pf-link { border: none; background: none; color: var(--accent); font-weight: 600; font-size: 0.8125rem; cursor: pointer; padding: 0; }
.pf-sum { font-size: 0.75rem; color: var(--text-muted); }
@media (max-width: 600px) {
  .view-controls .project-picker { width: 100%; justify-self: stretch; }
  .view-controls .project-picker .project-selector { flex: 1 1 auto; }
}

/* ===== Celular sem rolagem lateral: barra do quadro e "aguardando sua ação" (2026-10-01) ===== */
@media (max-width: 600px) {
  .kanban-toolbar { gap: 0.5rem; }
  .kanban-toolbar-hint { flex: 1 1 auto; min-width: 0; }
  .kanban-cfg-btn { font-size: 0; gap: 0; padding: 0.45rem; }
  #kpiKanbanAguardando .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.625rem; }
  #kpiKanbanAguardando .kpi-card { min-width: 0; padding: 0.875rem; gap: 0.625rem; }
  #kpiKanbanAguardando .kpi-icon { width: 38px; height: 38px; }
}

/* ===== Menu do usuário: itens à esquerda e numa linha só (2026-10-01) ===== */
.user-menu-dropdown { width: max-content; max-width: calc(100vw - 24px); }
.user-menu-item { text-align: left; white-space: nowrap; line-height: 1.25; }

/* ===== Filtros na barra única (busca + "Filtros" na linha das abas) e "aguardando" compacto — 2026-10-01 ===== */
.view-tools { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; justify-self: end; min-width: 0; }
.view-search { flex: 0 1 260px; min-width: 0; }
.view-search .input-clearable { position: relative; display: flex; align-items: center; }
.view-search-icon { position: absolute; left: 0.7rem; display: inline-flex; color: var(--text-muted); pointer-events: none; }
.view-search #filterSearch { width: 100%; height: 36px; box-sizing: border-box; padding: 0 2rem 0 2.1rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.8125rem; }
.view-search #filterSearch:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.filters-anchor { position: relative; flex: 0 0 auto; }
.filters-toggle { display: inline-flex; align-items: center; gap: 0.5rem; width: auto; height: 36px; margin: 0; padding: 0 0.75rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.filters-toggle:hover { border-color: var(--text-muted); }
.filters-toggle:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.filters-toggle[aria-expanded="true"] { border-color: var(--accent); }
.filters-toggle:not([aria-expanded="false"]) { margin-bottom: 0; }
.filters-toggle-badge:not(:empty) { background: #1d4ed8; }
.filters-bar { position: absolute; top: calc(100% + 8px); right: 0; z-index: 300; width: 560px; max-width: calc(100vw - 32px); box-sizing: border-box; margin: 0; padding: 1rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.filters-bar.collapsed { display: none; }
.filters-bar .filters-row { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; align-items: end; }
.filters-bar .filter-group { min-width: 0; }
.filters-bar .filter-date-range, .filters-bar .filter-project-group { grid-column: 1 / -1; }
.filters-sheet-head { display: none; }
.filters-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.875rem; padding-top: 0.75rem; border-top: 1px solid var(--border-light); }
.active-filters-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: -0.25rem 0 1rem; }
.active-filters-row[hidden] { display: none; }
.active-filters-label { font-size: 0.75rem; color: var(--text-muted); }
.active-filters-row .active-filters { margin: 0; padding: 0; border: none; }
.active-filters-row .filter-tag { color: #1e40af; background: #dbeafe; font-weight: 600; }
[data-theme="dark"] .active-filters-row .filter-tag { color: #bfdbfe; background: rgba(59, 130, 246, 0.22); }
.active-filters-clear { border: none; background: none; padding: 0.25rem; color: var(--accent); font-family: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.active-filters-row .filter-count { margin-left: auto; padding: 0; }
body:has(#view-kanban.active) .active-filters-row .filter-count { display: none; }
.kanban-toolbar-left { display: flex; align-items: center; gap: 0.625rem; min-width: 0; flex-wrap: wrap; }
.kanban-count { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.kanban-hint-icon { display: inline-flex; color: var(--text-muted); cursor: help; }
.kanban-hint-icon[hidden] { display: none; }
.kanban-await-pill { display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.75rem; border-radius: 999px; border: 1px solid rgba(245, 158, 11, 0.55); background: rgba(245, 158, 11, 0.12); color: #92400e; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.kanban-await-pill[hidden] { display: none; }
.kanban-await-pill b { display: inline-block; font-weight: 700; transition: transform 0.2s ease; }
[data-theme="dark"] .kanban-await-pill { color: #fcd34d; }
#view-kanban > .kanban-await-pill { display: none; }
body.portal-mode .filters-anchor, body.portal-mode .active-filters-row { display: none !important; }
@media (max-width: 900px) {
  .view-search { flex: 1 1 auto; }
}
@media (max-width: 600px) {
  .view-controls .view-tools { width: 100%; justify-self: stretch; }
  .view-search #filterSearch { height: 40px; font-size: 0.875rem; }
  .filters-toggle { height: 40px; }
  .filters-bar { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 86vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 0.75rem 1rem 1.25rem; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, 0.45); }
  .filters-bar .filters-row { grid-template-columns: 1fr; }
  .filters-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; font-size: 0.9375rem; font-weight: 700; color: var(--text-primary); }
  .filters-close { border: none; background: none; width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; color: var(--text-secondary); cursor: pointer; }
  .filters-pop-foot .btn { min-height: 44px; flex: 1 1 0; }
  body.filters-open { overflow: hidden; }
}

/* ===== Filtros na barra única: acertos (2026-10-01) ===== */
.view-search #filterSearch::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.kanban-await-pill { gap: 0.45rem; }
.kanban-await-text { white-space: nowrap; }
.filters-bar .filter-group label.filter-date-label { display: flex; align-items: center; gap: 0.375rem; }
.filters-bar .filter-date-field { width: auto; flex: 0 0 auto; height: auto; padding: 0 1.1rem 0 0; background-position: right center; }

/* ===== Duplicar tarefa (janela de escolhas) — 2026-10-02 ===== */
.dup-form { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 0.5rem; }
.dup-field { display: flex; flex-direction: column; gap: 0.375rem; }
.dup-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.dup-field input { height: 38px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-tertiary); color: var(--text-primary); font-family: inherit; font-size: 0.875rem; }
.dup-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.dup-list { display: flex; flex-direction: column; border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; }
.dup-opt { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.75rem; cursor: pointer; text-transform: none; letter-spacing: 0; }
.dup-opt + .dup-opt { border-top: 1px solid var(--border-light); }
.dup-opt:hover { background: var(--bg-tertiary); }
.dup-opt input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.dup-opt-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dup-opt-text b { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.dup-opt-text small { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-opt.is-locked { cursor: default; background: var(--bg-tertiary); }
.dup-opt.is-locked input { cursor: default; }
.dup-opt.is-empty { cursor: default; opacity: 0.55; }
.dup-opt.is-empty input { cursor: default; }
.dup-note { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.dup-remember { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; text-transform: none; letter-spacing: 0; }
.dup-remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.dup-remember small { color: var(--text-muted); }

/* ===== Ações em lote (seleção no quadro e na tabela + barra de ações) — 2026-10-02 ===== */
.kanban-card { position: relative; }
.kanban-card-select { position: absolute; left: -7px; top: 12px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 1.5px solid var(--border); border-radius: 6px; background: var(--bg-secondary); color: transparent; cursor: pointer; opacity: 0; transition: opacity 0.12s ease, background 0.12s ease, border-color 0.12s ease; box-shadow: var(--shadow); }
.kanban-card:hover .kanban-card-select, .kanban-card-select:focus-visible, body.bulk-mode .kanban-card-select, body.bulk-has-selection .kanban-card-select { opacity: 1; }
.kanban-card-select:hover { border-color: var(--accent); }
.kanban-card-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kanban-card-select[aria-checked="true"] { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.kanban-card.is-selected { outline: 2px solid #1d4ed8; outline-offset: 1px; }
@media (hover: none) { body:not(.bulk-mode):not(.bulk-has-selection) .kanban-card-select { display: none; } .kanban-card-select { width: 26px; height: 26px; left: -8px; } }
.kanban-select-btn.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.issues-table th.col-select, .issues-table td.col-select { width: 36px; padding-right: 0; text-align: center; }
.issues-table .col-select input { width: 16px; height: 16px; margin: 0; accent-color: #1d4ed8; cursor: pointer; }
.issues-table tr.is-selected td { background: var(--accent-light); }
.bulk-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 0.75rem; max-width: calc(100vw - 24px); padding: 0.5rem 0.5rem 0.5rem 1rem; background: #0f172a; color: #f1f5f9; border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35); }
[data-theme="dark"] .bulk-bar { background: #e8eefa; color: #0f172a; }
.bulk-count { font-size: 0.8125rem; white-space: nowrap; }
.bulk-count b { font-size: 0.9375rem; }
.bulk-actions { display: flex; align-items: center; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.bulk-actions::-webkit-scrollbar { display: none; }
.bulk-act { flex: 0 0 auto; height: 34px; padding: 0 0.75rem; border: none; border-radius: 9px; background: transparent; color: inherit; font-family: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bulk-act:hover:not(:disabled) { background: rgba(148, 163, 184, 0.22); }
.bulk-act:focus-visible { outline: 2px solid #70a7ff; outline-offset: 1px; }
.bulk-act:disabled { opacity: 0.4; cursor: not-allowed; }
.bulk-clear { flex: 0 0 auto; width: 34px; height: 34px; border: none; border-radius: 9px; background: rgba(148, 163, 184, 0.18); color: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.bulk-clear:hover { background: rgba(148, 163, 184, 0.32); }
.bulk-busy { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem 0.4rem 0; font-size: 0.8125rem; font-weight: 600; }
.bulk-pop { position: fixed; z-index: 901; width: 340px; max-width: calc(100vw - 24px); max-height: min(60vh, 460px); overflow-y: auto; box-sizing: border-box; padding: 0.875rem; background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.bulk-pop-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.75rem; }
.bulk-pop-title span { font-weight: 500; color: var(--text-muted); }
.bulk-pop-body { display: flex; flex-direction: column; gap: 0.625rem; }
.bulk-field { display: flex; flex-direction: column; gap: 0.375rem; }
.bulk-field-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.bulk-input { height: 36px; box-sizing: border-box; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-tertiary); color: var(--text-primary); font-family: inherit; font-size: 0.875rem; }
.bulk-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.bulk-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.bulk-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); margin: -0.125rem 0 0.25rem; cursor: pointer; }
.bulk-check input, .bulk-person input { width: 16px; height: 16px; margin: 0; accent-color: #1d4ed8; }
.bulk-hint { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.bulk-one { margin: 0.75rem 0 0; display: flex; gap: 0.375rem; align-items: flex-start; font-size: 0.75rem; line-height: 1.35; color: var(--text-secondary); }
.bulk-one span { color: var(--accent); font-weight: 700; }
.bulk-people { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.bulk-person { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.625rem; font-size: 0.8125rem; cursor: pointer; }
.bulk-person + .bulk-person { border-top: 1px solid var(--border-light); }
.bulk-person:hover { background: var(--bg-tertiary); }
.bulk-pop-error { margin-top: 0.625rem; padding: 0.45rem 0.625rem; border-radius: var(--radius-xs); background: var(--danger-bg); color: var(--danger); font-size: 0.8125rem; }
.bulk-pop-error[hidden] { display: none; }
.bulk-pop-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.875rem; padding-top: 0.75rem; border-top: 1px solid var(--border-light); }
body.bulk-has-selection .kanban-board, body.bulk-has-selection .table-wrapper { padding-bottom: 72px; }
@media (max-width: 600px) {
  .bulk-bar { left: 12px; right: 12px; transform: none; bottom: 12px; gap: 0.5rem; padding: 0.375rem 0.375rem 0.375rem 0.75rem; }
  .bulk-actions { flex: 1 1 auto; min-width: 0; }
  .bulk-pop { left: 12px !important; right: 12px; width: auto; }
}

/* ===== Ações em lote: caixinha no canto do card (não cobre o código) — 2026-10-02 ===== */
.kanban-card-select { top: -7px; left: -7px; }
@media (hover: none) { .kanban-card-select { top: -8px; left: -8px; } }

/* ===== Duplicar no card + selecionar a coluna inteira (ações em lote) — 2026-10-02 ===== */
.kanban-card-dup { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: none; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; opacity: 0; transition: opacity 0.12s ease, background 0.12s ease; }
.kanban-card:hover .kanban-card-dup, .kanban-card-dup:focus-visible { opacity: 1; }
.kanban-card-dup:hover { background: var(--bg-hover); color: var(--text-primary); }
.kanban-card-dup:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: none) { .kanban-card-dup { opacity: 1; width: 30px; height: 30px; } }
.kanban-column-header { position: relative; }
.kanban-col-select { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 1.5px solid var(--col, var(--border)); border-radius: 6px; background: var(--bg-secondary); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.12s ease, background 0.12s ease; box-shadow: var(--shadow); }
.kanban-col-select svg { display: none; }
.kanban-col-select[aria-checked="true"] .ck-on, .kanban-col-select[aria-checked="mixed"] .ck-mixed { display: block; }
.kanban-col-select[aria-checked="true"], .kanban-col-select[aria-checked="mixed"] { background: #1d4ed8; border-color: #1d4ed8; }
.kanban-column-header:hover .kanban-col-select, .kanban-col-select:focus-visible, body.bulk-mode .kanban-col-select, body.bulk-has-selection .kanban-col-select { opacity: 1; }
.kanban-column-header:hover .kanban-column-dot, body.bulk-mode .kanban-column-dot, body.bulk-has-selection .kanban-column-dot { opacity: 0; }
.kanban-col-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) { body:not(.bulk-mode):not(.bulk-has-selection) .kanban-col-select { display: none; } }

/* ===== Filtros num painel só (tarefas + projetos), "Manter filtros salvos", datas alinhadas e carregamento — 2026-10-02 ===== */
.project-filter-btn { display: none !important; }
.filters-section-title { margin: 0 0 0.625rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.filters-section-title small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.filters-section { margin-top: 0.875rem; padding-top: 0.875rem; border-top: 1px solid var(--border-light); }
.filters-section[hidden] { display: none; }
.filters-bar .filter-date-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.375rem; }
.filters-bar .filter-date-head .filter-date-label { margin: 0; }
.filters-bar .filter-date-clear { position: static; transform: none; width: auto; height: auto; padding: 0; border: none; background: none; color: var(--accent); font-family: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; opacity: 0; pointer-events: none; }
.filters-bar .filter-date-clear.visible { opacity: 1; pointer-events: auto; }
.filters-bar .date-range-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.filters-bar .date-range-inputs input { width: 100%; min-width: 0; box-sizing: border-box; }
.filters-bar .date-separator { display: none; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pf-chip { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.3rem 0.625rem; border-radius: 999px; border: 1px dashed var(--border); background: transparent; color: var(--text-muted); font-family: inherit; font-size: 0.8125rem; cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition); }
.pf-chip.is-on { border-style: solid; border-color: var(--border-light); background: var(--bg-tertiary); color: var(--text-primary); }
.pf-chip:not(.is-on) .pf-dot { opacity: 0.45; }
.pf-chip:hover { border-color: var(--accent); }
.pf-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pf-chip.is-empty.is-on { color: var(--text-muted); }
.pf-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.pf-dot.is-none { border: 1.5px dashed var(--text-muted); }
.pf-n { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pf-empty { font-size: 0.8125rem; color: var(--text-muted); }
.pf-arch-toggle { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.625rem; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500; }
.pf-arch-toggle[hidden] { display: none; }
.pf-arch-toggle input, .filters-persist input { width: 16px; height: 16px; margin: 0; accent-color: #1d4ed8; }
.filters-pop-foot { flex-wrap: wrap; }
.filters-persist { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500; margin: 0; }
.filters-pop-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.filter-tag-project { background: rgba(124, 58, 237, 0.12) !important; color: #6d28d9 !important; }
[data-theme="dark"] .filter-tag-project { color: #ddd6fe !important; background: rgba(139, 92, 246, 0.25) !important; }
/* carregamento: esqueleto do quadro */
.loading-overlay { display: none; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0.875rem; padding: 0 0 1rem; color: var(--text-muted); }
#dashboardContent.is-loading > .loading-overlay { display: flex; }
#dashboardContent.is-loading > .view-section, #dashboardContent.is-loading > .kpi-section, #dashboardContent.is-loading > .active-filters-row, #dashboardContent.is-loading > #notifAttentionBanner { display: none !important; }
.loading-head { display: inline-flex; align-items: center; gap: 0.625rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.loading-ring { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.loading-skeleton { display: flex; gap: 0.75rem; overflow: hidden; }
.sk-col { flex: 0 0 240px; display: flex; flex-direction: column; gap: 0.625rem; padding: 0.75rem; border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--bg-secondary); min-height: 420px; box-sizing: border-box; }
.sk-line, .sk-card { border-radius: 8px; background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 37%, var(--bg-tertiary) 63%); background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite; }
.sk-line { height: 12px; width: 55%; margin: 0.125rem 0 0.375rem; }
.sk-card { height: 86px; }
.sk-card.sk-short { height: 58px; }
@keyframes sk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk-line, .sk-card, .loading-ring { animation: none; } }
@media (max-width: 600px) {
  .loading-skeleton { flex-direction: column; }
  .sk-col { flex: none; min-height: 0; }
  .sk-col:nth-child(n+2) { display: none; }
  .filters-pop-actions { width: 100%; }
  .filters-pop-actions .btn { flex: 1 1 0; }
}

/* ===== Filtros: "Data prevista" do tamanho do texto (seta junto) — 2026-10-02 ===== */
.filters-bar .filter-date-field { field-sizing: content; max-width: 100%; }

/* =====================================================================
   PORTAL (Cliente Final) — padronização 02/10/2026
   Mesmo visual das outras telas (cores por etapa, botões, cards, tema escuro) sem perder a simplicidade:
   lista + detalhe em uma coluna + formulário enxuto. Só vale com body.portal-mode (aba "Lista (Portal)").
   ===================================================================== */
/* ação principal com contraste: a cor da marca é clara demais para texto branco (mesmo tom, mais escuro) */
body.portal-mode { --pl-cta: color-mix(in srgb, var(--accent) 60%, #0f2a66); --pl-cta-hover: color-mix(in srgb, var(--accent) 48%, #0f2a66); }
body.portal-mode .pl-new { background: var(--pl-cta); border-radius: 12px; box-shadow: 0 6px 16px color-mix(in srgb, var(--pl-cta) 30%, transparent); }
body.portal-mode .pl-new:hover { background: var(--pl-cta-hover); filter: none; }
body.portal-mode .btn-primary:not(:disabled) { background: var(--pl-cta); border-color: var(--pl-cta); }
body.portal-mode .btn-primary:not(:disabled):hover { background: var(--pl-cta-hover); border-color: var(--pl-cta-hover); }

/* topo alinhado com a lista: projeto + busca na mesma largura (no celular já empilha) */
@media (min-width: 601px) {
  body.portal-mode .view-controls { max-width: 820px; margin: 0 auto 1.25rem !important; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) !important; gap: 0.75rem; }
  body.portal-mode .view-controls .project-picker { justify-self: stretch; min-width: 0; }
  body.portal-mode .view-controls .project-selector { width: 100%; min-height: 52px; font-size: 1rem; border-radius: 12px; }
  body.portal-mode .view-tools { justify-self: stretch; min-width: 0; }
  body.portal-mode .view-search { flex: 1 1 auto; }
  body.portal-mode .filter-search-group { max-width: none; margin: 0; }
}

/* grupos: bolinha da cor da etapa (a mesma dos selos) */
body.portal-mode .pl-group-title { display: inline-flex; align-items: center; gap: 0.5rem; }
body.portal-mode .pl-group-title::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--pl-dot, #94a3b8); flex-shrink: 0; }
body.portal-mode .pl-group.pl-wait { --pl-dot: #f59e0b; }
body.portal-mode .pl-group.pl-doing { --pl-dot: #3b82f6; }
body.portal-mode .pl-group.pl-done { --pl-dot: #22c55e; }
body.portal-mode .pl-group.pl-cancel { --pl-dot: #94a3b8; }

/* cards no padrão do quadro: canto, sombra leve, destaque ao passar o mouse; "Aguardando você" com faixa âmbar */
body.portal-mode .pl-card-wrap { border-color: var(--border-light, var(--border)); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); transition: border-color .15s ease, box-shadow .15s ease; }
body.portal-mode .pl-card-wrap:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }
body.portal-mode .pl-group.pl-wait .pl-card-wrap { border-left: 4px solid #f59e0b; }
body.portal-mode .pl-card:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 12px; }
body.portal-mode .pl-card-actions .pl-action { border-radius: 10px; min-height: 48px; }
.pl-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.pl-chip svg { flex-shrink: 0; }

/* tema escuro: selos e destaques com fundo translúcido (como os selos do quadro) */
[data-theme="dark"] .pl-status.pl-wait   { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245, 158, 11, 0.38); }
[data-theme="dark"] .pl-status.pl-doing  { background: rgba(59, 130, 246, 0.18); color: #bfdbfe; border-color: rgba(59, 130, 246, 0.42); }
[data-theme="dark"] .pl-status.pl-done   { background: rgba(34, 197, 94, 0.16); color: #86efac; border-color: rgba(34, 197, 94, 0.36); }
[data-theme="dark"] .pl-status.pl-cancel { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.32); }
[data-theme="dark"] .pl-group.pl-wait .pl-group-title { color: #fbbf24; }
[data-theme="dark"] body.portal-mode .pl-card-wrap { box-shadow: none; }

/* detalhe: etapa com as mesmas cores da lista */
body.portal-mode .status-badge.pl-b-wait   { background: #fef3c7; color: #92400e; }
body.portal-mode .status-badge.pl-b-doing  { background: #dbeafe; color: #1e40af; }
body.portal-mode .status-badge.pl-b-done   { background: #d1fae5; color: #065f46; }
body.portal-mode .status-badge.pl-b-cancel { background: #f1f5f9; color: #475569; }
[data-theme="dark"] body.portal-mode .status-badge.pl-b-wait   { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
[data-theme="dark"] body.portal-mode .status-badge.pl-b-doing  { background: rgba(59, 130, 246, 0.18); color: #bfdbfe; }
[data-theme="dark"] body.portal-mode .status-badge.pl-b-done   { background: rgba(34, 197, 94, 0.16); color: #86efac; }
[data-theme="dark"] body.portal-mode .status-badge.pl-b-cancel { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }

/* detalhe no computador: uma coluna só (antes ficava espremido em duas colunas estreitas) */
@media (min-width: 901px) {
  body.portal-mode .modal:not(.modal-new-issue) { max-width: 760px; }
  body.portal-mode .modal:not(.modal-new-issue) .modal-body { display: block; }
  body.portal-mode .modal-col-left { position: static; max-height: none; overflow: visible; padding-right: 0; }
  body.portal-mode .modal-col-right { border-left: 0; padding-left: 0; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light, var(--border)); }
  body.portal-mode .modal-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.25rem; }
}
/* o cliente vê a capa, mas não troca nem remove; sem dica técnica de Ctrl+V */
body.portal-mode #btnCoverAdd, body.portal-mode #btnCoverChange, body.portal-mode #btnCoverRemove, body.portal-mode .comment-hint { display: none !important; }

/* editor só com o essencial: negrito, itálico, listas, imagem e emoji (sem estilo de parágrafo, sublinhado, tachado, link) */
body.portal-mode .rich-toolbar [data-cmd="formatBlock"],
body.portal-mode .rich-toolbar [data-cmd="underline"],
body.portal-mode .rich-toolbar [data-cmd="strikeThrough"],
body.portal-mode .rich-toolbar [data-cmd="createLink"],
body.portal-mode .rich-toolbar [data-cmd="unlink"],
body.portal-mode .rich-toolbar [data-cmd="removeFormat"],
body.portal-mode .rich-toolbar .rich-sep { display: none !important; }
body.portal-mode .rich-toolbar { flex-wrap: wrap; gap: 0.25rem; }
body.portal-mode .rich-toolbar button { min-width: 40px; min-height: 40px; font-size: 1rem; }
body.portal-mode .rich-content { font-size: 1rem; }

/* novo chamado: campos maiores, sem "Capa" nem atalho de teclado */
body.portal-mode .modal-new-issue { max-width: 720px; }
body.portal-mode .modal-new-issue .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
body.portal-mode .modal-new-issue .edit-field { min-width: 0; }
body.portal-mode .modal-new-issue .edit-field-full { grid-column: 1 / -1; }
body.portal-mode .modal-new-issue .edit-field > label:not(.new-issue-urgent-toggle) { flex-wrap: wrap; row-gap: 0.125rem; overflow-wrap: normal; font-size: 0.875rem; }
body.portal-mode .modal-new-issue .edit-hint { flex-basis: 100%; white-space: normal; font-size: 0.8125rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
body.portal-mode .modal-new-issue .edit-field input[type="text"],
body.portal-mode .modal-new-issue .edit-field select,
body.portal-mode .modal-new-issue .edit-field textarea { min-height: 48px; font-size: 1rem; }
body.portal-mode .modal-new-issue .edit-field label.new-issue-urgent-toggle { height: 48px; font-size: 1rem; }
body.portal-mode .modal-new-issue .new-issue-editor .rich-content { min-height: 150px; }
body.portal-mode .modal-new-issue .new-issue-dropzone { min-height: 56px; font-size: 0.9375rem; }
body.portal-mode .modal-new-issue .edit-field:has(#newIssueCoverBox), body.portal-mode .new-issue-kbd { display: none !important; }
body.portal-mode .modal-new-issue .new-issue-actions { flex-direction: row; align-items: center; justify-content: flex-end; }
body.portal-mode .modal-new-issue .new-issue-actions .btn { min-height: 48px; font-size: 1rem; padding: 0 1.25rem; }
/* no celular: tela cheia com o corpo rolando e os botões fixos embaixo (antes "Capa" ficava atrás dos botões) */
@media (max-width: 900px) {
  body.portal-mode .modal-new-issue { display: flex; flex-direction: column; }
  body.portal-mode .modal-new-issue .new-issue-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1rem 1.5rem; }
  body.portal-mode .modal-new-issue .edit-grid { grid-template-columns: minmax(0, 1fr); }
  body.portal-mode .modal-new-issue .new-issue-actions { padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-light, var(--border)); }
  body.portal-mode .modal-new-issue .new-issue-actions-right { width: 100%; }
  body.portal-mode .modal-new-issue .new-issue-actions-right .btn { flex: 1 1 0; }
}

/* carregamento no formato da lista (o esqueleto do quadro piscava antes da lista) */
body.portal-mode .loading-skeleton { flex-direction: column; max-width: 820px; margin: 0 auto; }
body.portal-mode .sk-col { flex: none; min-height: 0; border: 0; background: transparent; padding: 0; gap: 0.625rem; }
body.portal-mode .sk-col:not(:first-child) { display: none; }
body.portal-mode .sk-line { height: 52px; width: 240px; max-width: 100%; border-radius: 12px; margin-bottom: 0.75rem; }
body.portal-mode .sk-card, body.portal-mode .sk-card.sk-short { height: 76px; border-radius: 12px; }

/* PORTAL (Cliente Final) — ajustes finos 02/10/2026: seletor com o mesmo fundo da busca; garantia em 2 colunas */
body.portal-mode .view-controls .project-selector { background-color: var(--bg-secondary); }
@media (min-width: 901px) { body.portal-mode .modal-meta-item[data-field="warranty"] { grid-column: span 2; } }
/* data prevista passada só é "atraso" (vermelho) se a demanda ainda está aberta — igual à lista */
body.portal-mode .modal:has(.status-badge.pl-b-done, .status-badge.pl-b-cancel) .modal-meta .overdue-text:not(.warranty-info) { color: inherit; font-weight: inherit; }
/* fim: PORTAL ajustes finos */

/* "Todos os Projetos" para quem tem vários projetos (02/10/2026): nome do projeto no card da Lista; no portal o
   botão flutuante some (a Lista tem o "Abrir nova demanda", que pergunta em qual projeto) */
.pl-project { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); background: var(--bg-tertiary); border: 1px solid var(--border-light, var(--border)); padding: 0.125rem 0.5rem; border-radius: 999px; white-space: nowrap; }
body.portal-mode #btnNewIssue { display: none !important; }

/* Etiquetas (02/10/2026): chips, seletor, campo da tarefa, filtro, card, tabela, portal, lote e histórico */
.lbl-chip { --lc: #64748b; display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; line-height: 1.35; white-space: nowrap; vertical-align: middle; background: color-mix(in srgb, var(--lc) 16%, transparent); color: color-mix(in srgb, var(--lc) 72%, var(--text-primary)); border: 1px solid color-mix(in srgb, var(--lc) 42%, transparent); }
.lbl-chip-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lbl-chip.is-internal { border-style: dashed; }
:root:not([data-theme="light"]) .lbl-chip.is-dark { --lc: #cbd5e1 !important; }
.lbl-chip.is-sm { font-size: 0.6875rem; padding: 0.0625rem 0.4375rem; }
.lbl-chip.is-more { --lc: #64748b; }
.lbl-chip.is-none { --lc: #64748b; font-style: italic; }
.lbl-lock { flex: 0 0 auto; opacity: 0.85; }
.lbl-chip-x { border: 0; background: none; color: inherit; font: inherit; font-size: 0.95rem; line-height: 1; padding: 0 0 0 0.125rem; margin-right: -0.1875rem; cursor: pointer; opacity: 0.65; border-radius: 999px; }
.lbl-chip-x:hover, .lbl-chip-x:focus-visible { opacity: 1; }
.lbl-field { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; min-height: 1.75rem; }
.lbl-field .lbl-list { display: contents; }
.lbl-none[hidden] { display: none; }
.lbl-add { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.1875rem 0.625rem; border: 1px dashed var(--border); border-radius: 999px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; line-height: 1.35; cursor: pointer; }
.lbl-add:hover, .lbl-add[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.lbl-none { font-size: 0.8125rem; color: var(--text-muted); }
.modal-meta-item.modal-meta-labels { grid-column: 1 / -1; }
.modal-meta-item.modal-meta-labels span { font-size: inherit; }
.modal-meta-item.modal-meta-labels .lbl-chip { font-size: 0.8125rem; }
.kanban-card-labels { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.375rem 0 0.125rem; min-width: 0; }
.pl-card-labels { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.25rem 0 0.375rem; }
.issues-table th.col-labels { min-width: 170px; }
.issues-table td.col-labels { min-width: 170px; max-width: 260px; white-space: normal; }
.issues-table td.col-labels .lbl-chip { margin: 0.0625rem 0.1875rem 0.0625rem 0; }
.lbl-pop { position: fixed; z-index: 4000; width: 300px; max-width: calc(100vw - 16px); background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.lbl-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.625rem 0.75rem 0.375rem; font-size: 0.8125rem; font-weight: 700; }
.lbl-pop-done { border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 1.125rem; line-height: 1; cursor: pointer; padding: 0.125rem 0.375rem; border-radius: var(--radius-xs); }
.lbl-pop-done:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.lbl-pop-search { padding: 0 0.75rem 0.5rem; }
.lbl-pop-search[hidden], .lbl-pop-list[hidden], .lbl-pop-create[hidden] { display: none; }
.lbl-pop-search input { width: 100%; box-sizing: border-box; padding: 0.4375rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; }
.lbl-pop-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.lbl-pop-list { max-height: 280px; overflow-y: auto; padding: 0.25rem; border-top: 1px solid var(--border-light); overscroll-behavior: contain; }
.lbl-opt { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.4375rem 0.5rem; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-primary); font: inherit; font-size: 0.8125rem; text-align: left; cursor: pointer; }
.lbl-opt:hover, .lbl-opt.is-active { background: var(--bg-tertiary); }
.lbl-opt-check { flex: 0 0 18px; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); border-radius: 5px; color: #fff; box-sizing: border-box; }
.lbl-opt.is-on .lbl-opt-check { background: var(--accent); border-color: var(--accent); }
.lbl-opt .lbl-chip { flex: 0 1 auto; min-width: 0; }
.lbl-opt-count { margin-left: auto; padding-left: 0.5rem; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lbl-opt-special { font-style: italic; color: var(--text-secondary); }
.lbl-opt.is-create { color: var(--accent); font-weight: 600; }
.lbl-opt-plus { flex: 0 0 18px; text-align: center; font-size: 1rem; line-height: 1; }
.lbl-pop-empty { padding: 0.875rem 0.75rem; font-size: 0.8125rem; color: var(--text-muted); text-align: center; }
.lbl-pop-hint { padding: 0.5rem 0.75rem; border-top: 1px solid var(--border-light); font-size: 0.75rem; color: var(--text-muted); }
.lbl-pop-create { padding: 0.625rem 0.75rem 0.75rem; border-top: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 0.625rem; }
.lbl-create-title { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.lbl-create-colors { display: flex; flex-wrap: wrap; gap: 0.3125rem; padding: 4px; margin: -4px; }
.lbl-color { --lc: #64748b; width: 22px; height: 22px; border-radius: 999px; border: 0; background: var(--lc); cursor: pointer; padding: 0; }
.lbl-color.is-on { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px var(--lc); }
.lbl-color:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lbl-create-internal { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; }
.lbl-create-internal small { color: var(--text-muted); }
.lbl-create-err { font-size: 0.75rem; color: var(--danger); }
.lbl-create-err[hidden] { display: none; }
.lbl-create-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.lbl-pop-back { position: fixed; inset: 0; z-index: 3999; background: rgba(15, 23, 42, 0.45); }
.lbl-pop.is-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: 16px 16px 0 0; max-height: 78vh; padding-bottom: env(safe-area-inset-bottom); border-left: 0; border-right: 0; border-bottom: 0; }
.lbl-pop.is-sheet .lbl-pop-head { padding: 0.875rem 1rem 0.5rem; font-size: 0.9375rem; }
.lbl-pop.is-sheet .lbl-pop-done { font-size: 0.875rem; font-weight: 700; color: var(--accent); padding: 0.375rem 0.625rem; }
.lbl-pop.is-sheet .lbl-pop-search { padding: 0 1rem 0.625rem; }
.lbl-pop.is-sheet .lbl-pop-search input { font-size: 1rem; padding: 0.625rem 0.75rem; }
.lbl-pop.is-sheet .lbl-pop-list { max-height: none; flex: 1 1 auto; padding: 0.25rem 0.5rem; }
.lbl-pop.is-sheet .lbl-opt { padding: 0.75rem; font-size: 0.9375rem; }
.lbl-pop.is-sheet .lbl-opt .lbl-chip { font-size: 0.875rem; }
.lbl-pop.is-sheet .lbl-pop-hint { padding: 0.625rem 1rem; }
.lbl-pop.is-sheet .lbl-pop-create { padding: 0.75rem 1rem 1rem; }
.lbl-pop.is-sheet .lbl-create-colors { gap: 0.4375rem; }
.lbl-pop.is-sheet .lbl-color { width: 28px; height: 28px; }
.filters-labels .lf-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; flex-wrap: wrap; }
.filters-labels .lf-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; min-width: 0; }
.filters-labels .lf-list { display: contents; }
.lf-mode { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex: 0 0 auto; }
.lf-mode[hidden] { display: none; }
.lf-mode button { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.75rem; cursor: pointer; }
.lf-mode button.is-on { background: var(--accent); color: #fff; }
.tl-label { display: inline-block; padding: 0 0.4375rem; border-radius: 999px; background: var(--bg-tertiary); font-weight: 600; font-size: 0.92em; }
.bulk-seg { display: flex; gap: 1rem; margin-bottom: 0.625rem; font-size: 0.8125rem; }
.bulk-seg label { display: flex; align-items: center; gap: 0.375rem; cursor: pointer; }
.bulk-labels { display: flex; flex-direction: column; gap: 0.125rem; max-height: 220px; overflow-y: auto; }
.bulk-label { display: flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.125rem; cursor: pointer; font-size: 0.8125rem; }
.bulk-label small { margin-left: auto; color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }
@media (max-width: 640px) {
  .filters-labels .lf-row { align-items: flex-start; }
  .lbl-add { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }
}
/* fim: Etiquetas (02/10/2026) */

/* Selo do tipo com sigla e cor do admin (02/10/2026): largura acompanha a sigla (até 3 letras); sem cor = cinza */
.type-icon.type-sigla { width: auto; min-width: 20px; padding: 0 4px; background: #64748b; color: #fff; font-size: 0.625rem; letter-spacing: -0.01em; }
.type-icon[data-tip] { cursor: help; }
.ui-tip { position: fixed; z-index: 5000; max-width: 280px; padding: 0.3125rem 0.5625rem; border-radius: 6px; background: var(--text-primary); color: var(--bg-secondary); font-size: 0.75rem; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: var(--shadow-lg); pointer-events: none; }
/* fim: selo do tipo */

/* Senha: recuperar e criar (02/10/2026) — "Esqueci minha senha" na entrada e a tela do link do e-mail (reset.html) */
.login-card .login-sub { color: var(--text-secondary); margin: 0 0 1.5rem; font-size: 0.875rem; line-height: 1.55; }
.login-card form { text-align: left; }
.login-card .btn-lg { margin-top: 0.25rem; }
.login-msg { padding: 0.75rem 0.875rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.8125rem; line-height: 1.5; text-align: left; }
.login-msg.is-error { background: var(--danger-bg); color: var(--danger); }
.login-msg.is-ok { background: var(--success-bg); color: var(--success); }
.login-msg.is-info { background: var(--accent-light); color: var(--text-secondary); }
.login-links { margin-top: 1.25rem; font-size: 0.875rem; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.login-links a, .login-links button { color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }
.login-links a:hover, .login-links button:hover { text-decoration: underline; }
.pw-field { position: relative; }
.pw-field input { padding-right: 2.875rem; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--text-muted); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.pw-toggle:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 0.375rem 0.875rem; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }
.pw-rules span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.pw-rules span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.pw-rules span.ok { color: var(--success); }
.pw-rules span.ok::before { background: var(--success); }
.login-state { text-align: center; }
.login-state-icon { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.login-state-icon.ok { background: var(--success-bg); color: var(--success); }
.login-state-icon.err { background: var(--danger-bg); color: var(--danger); }
.login-state-icon.info { background: var(--accent-light); color: var(--accent); }
.login-who { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; border-radius: 999px; background: var(--bg-tertiary); font-size: 0.8125rem; color: var(--text-secondary); margin: -0.75rem 0 1.25rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .login-card { padding: 1.75rem 1.25rem; }
  .login-card input { font-size: 16px; }
}
/* fim: Senha: recuperar e criar (02/10/2026) */

/* ===== Topo do painel (02/10/2026) ===== */
/* Sem a barra de abas (só uma aba liberada): o seletor e as ferramentas ficam no lugar — colunas fixas no computador */
@media (min-width: 601px) {
  body:not(.portal-mode) .view-controls > .project-picker { grid-column: 2; grid-row: 1; }
  body:not(.portal-mode) .view-controls > .view-tools { grid-column: 3; grid-row: 1; }
}
/* Seletor de projetos (computador): lista do painel, sempre dentro da tela; no toque/celular fica o <select> nativo */
.pp-button { display: none; }
body.pp-on .project-picker > select.project-selector { display: none; }
body.pp-on .project-picker > .pp-button { display: flex; align-items: center; min-width: 240px; max-width: 420px; text-align: left; }
.pp-button[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.pp-button .pp-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-panel { position: fixed; z-index: 1300; display: flex; flex-direction: column; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.pp-search { padding: 0.5rem; border-bottom: 1px solid var(--border-light); }
.pp-search input { width: 100%; height: 34px; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font-family: inherit; font-size: 0.8125rem; }
.pp-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.pp-list { overflow-y: auto; padding: 0.25rem; overscroll-behavior: contain; }
.pp-group { padding: 0.625rem 0.625rem 0.25rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.pp-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.625rem; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary); font-family: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.pp-item .pp-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-item.is-active { background: var(--bg-hover); }
.pp-item.is-current { font-weight: 600; color: var(--accent); }
.pp-item .pp-check { margin-left: auto; flex: none; }
.pp-item[disabled] { opacity: 0.5; cursor: default; }
.pp-empty { padding: 0.875rem; color: var(--text-muted); font-size: 0.8125rem; text-align: center; }
/* Filtro rápido "Minhas" (responsável = quem está logado) */
.view-tools .mine-group { display: flex; flex: 0 0 auto; min-width: 0; margin: 0; } /* não herda o "100%" dos filtros no celular */
.mine-toggle { display: inline-flex; align-items: center; gap: 0.4rem; height: 36px; padding: 0 0.75rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mine-toggle:hover { border-color: var(--text-muted); }
.mine-toggle:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.mine-toggle.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mine-toggle.is-on:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
body.portal-mode .mine-group { display: none !important; }
@media (max-width: 600px) {
  .mine-toggle { padding: 0 0.625rem; }
  .mine-toggle span { display: none; }
}

/* Filtro de status dos projetos (painel "Filtros"): botão compacto + lista de marcar que abre ali mesmo (02/10/2026) */
.pf-ms-btn { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 38px; padding: 0 0.625rem 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-secondary); font-family: inherit; font-size: 0.8125rem; cursor: pointer; text-align: left; }
.pf-ms-btn:hover { border-color: var(--text-muted); }
.pf-ms-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.pf-ms-btn.is-on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-light); }
.pf-ms-lbl { color: var(--text-muted); }
.pf-ms-val { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-ms-btn svg { flex: 0 0 auto; color: var(--text-muted); transition: transform 0.15s ease; }
.pf-ms-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.pf-ms-list { flex: 1 1 100%; width: 100%; box-sizing: border-box; margin-top: 0.375rem; padding: 0.25rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-primary); max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.pf-ms-list .pf-row { cursor: pointer; font-size: 0.8125rem; color: var(--text-primary); min-height: 32px; }
.pf-ms-list .pf-name { flex: 1 1 auto; min-width: 0; }
.pf-ms-list .pf-foot { margin-top: 0.25rem; }

/* ---------- Subtarefas e épicos no Kanban (desenho de 16/10/2026: "Mostrar", resumo no cartão, família, colunas) ---------- */
/* "Mostrar: Épicos · Tarefas · Subtarefas" — botões que se somam (salvo por pessoa) */
.kanban-mostrar { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; }
.kanban-mostrar[hidden], .kanban-count[hidden] { display: none; }
.kanban-mostrar-lbl { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.kanban-mostrar-btn { --km-bg: var(--accent-light); --km-bd: color-mix(in srgb, var(--accent) 55%, transparent); --km-fg: #93c5fd; display: inline-flex; align-items: center; gap: 0.3rem; height: 28px; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.kanban-mostrar-btn .km-ck { display: none; }
.kanban-mostrar-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.kanban-mostrar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kanban-mostrar-btn.is-on { background: var(--km-bg); border-color: var(--km-bd); color: var(--km-fg); }
.kanban-mostrar-btn.is-on .km-ck { display: block; }
.kanban-mostrar-btn.is-epicos { --km-bg: rgba(168, 85, 247, 0.16); --km-bd: rgba(168, 85, 247, 0.5); --km-fg: #d8b4fe; }
.kanban-mostrar-btn.is-subtarefas { --km-bg: rgba(20, 184, 166, 0.16); --km-bd: rgba(20, 184, 166, 0.5); --km-fg: #5eead4; }
[data-theme="light"] .kanban-mostrar-btn.is-epicos { --km-bg: #f4ebff; --km-bd: #d6bbfb; --km-fg: #6941c6; }
[data-theme="light"] .kanban-mostrar-btn.is-tarefas { --km-bg: #eff6ff; --km-bd: #bfdbfe; --km-fg: #1d4ed8; }
[data-theme="light"] .kanban-mostrar-btn.is-subtarefas { --km-bg: #f0fdfa; --km-bd: #99f6e4; --km-fg: #0f766e; }
.kanban-mostrar-conta { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .kanban-mostrar-lbl, .kanban-mostrar-conta { display: none; }
  .kanban-mostrar-btn { padding: 0 0.5rem; }
}
/* "Abrir todas / Recolher todas" as subtarefas dos cartões (08/10/2026) */
.kanban-sub-todas { display: inline-flex; align-items: center; gap: 0.375rem; height: 28px; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.kanban-sub-todas[hidden] { display: none; }
.kanban-sub-todas:hover, .kanban-sub-todas:focus-visible { border-color: var(--accent); color: var(--text-primary); outline: none; }
.kanban-sub-todas .kst-ico { flex: none; display: none; }
/* os dois rótulos no mesmo lugar: o botão tem sempre a largura de "Recolher todas" (trocar não empurra nada) */
.kanban-sub-todas .kst-lbl { display: inline-grid; }
.kanban-sub-todas .kst-lbl > span { grid-area: 1 / 1; text-align: center; }
.kanban-sub-todas[data-acao="abrir"] [data-kst="recolher"], .kanban-sub-todas[data-acao="recolher"] [data-kst="abrir"] { visibility: hidden; }
.kanban-sub-todas[data-acao="abrir"] .kst-i-recolher, .kanban-sub-todas[data-acao="recolher"] .kst-i-abrir { display: none; }
/* se o texto fizer a barra ganhar uma linha: só o ícone (a dica diz o que faz) */
.kanban-sub-todas.is-compacto { width: 28px; padding: 0; justify-content: center; }
.kanban-sub-todas.is-compacto .kst-lbl { display: none; }
.kanban-sub-todas.is-compacto .kst-ico { display: block; }

/* cartão: épico (roxo), subtarefa solta (menor, com a mãe), rostos e o apagado que só situa */
.kanban-card-epic { color: #c4b5fd; background: var(--purple-bg); font-weight: 600; }
[data-theme="light"] .kanban-card-epic { color: #6941c6; background: #f4ebff; }
.kanban-card.is-epico { background: color-mix(in srgb, var(--purple) 12%, var(--bg-tertiary)); border-color: rgba(168, 85, 247, 0.45); }
.kanban-card.is-epico .kanban-card-title { color: #e9d5ff; }
[data-theme="light"] .kanban-card.is-epico { background: #faf5ff; border-color: #d6bbfb; }
[data-theme="light"] .kanban-card.is-epico .kanban-card-title { color: #3b1c6e; }
.kanban-card.is-sub { padding: 0.5rem 0.625rem; border-radius: 9px; }
.kanban-card.is-sub .kanban-card-header { margin-bottom: 0.25rem; }
.kanban-card.is-sub .kanban-card-title { font-size: 0.8125rem; font-weight: 600; }
.kanban-card.is-sub .kanban-card-meta { margin-top: 0.375rem; }
.kanban-card-quem { flex: none; background: color-mix(in srgb, var(--accent) 26%, transparent); color: #bfdbfe; }
[data-theme="light"] .kanban-card-quem { color: #1d4ed8; }
.kanban-font-sm .kanban-card.is-sub .kanban-card-title { font-size: 0.75rem; }
.kanban-card.is-sub .kanban-card-cover { margin: -0.5rem -0.625rem 0.5rem; }
.kanban-card-mae { display: block; width: fit-content; max-width: 100%; margin: 0 0 0.375rem; padding: 0.0625rem 0.375rem; border: 0; border-radius: 5px; background: rgba(97, 114, 243, 0.2); color: #c7d2fe; font: inherit; font-size: 0.6875rem; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.kanban-card-mae:hover, .kanban-card-mae:focus-visible { background: rgba(97, 114, 243, 0.34); outline: none; }
[data-theme="light"] .kanban-card-mae { background: #e0eaff; color: #3538cd; }
[data-theme="light"] .kanban-card-mae:hover { background: #c7d7fe; }
.kanban-card-people { display: inline-flex; align-items: center; flex: none; }
/* um ao lado do outro, com a mesma sigla forte das grades (sobrepostos, um cobria a sigla do outro: "BL" virava "B(") */
.kanban-card-people .avatar-xs { width: 20px; height: 20px; min-width: 20px; min-height: 20px; font-size: 0.5625rem; background: color-mix(in srgb, var(--accent) 26%, transparent); color: #bfdbfe; cursor: default; }
[data-theme="light"] .kanban-card-people .avatar-xs { color: #1d4ed8; }
.kanban-card-people .avatar-xs + .avatar-xs { margin-left: 2px; }
.kanban-card-people-more { margin-left: 3px; font-size: 0.625rem; font-weight: 700; color: var(--text-muted); }
.avatar.avatar-xs { width: 18px; height: 18px; min-width: 18px; min-height: 18px; font-size: 0.5rem; }
.kanban-card.is-context { opacity: 0.5; border-style: dashed; }
.kanban-card.is-context:hover { opacity: 0.85; }

/* resumo das filhas no pé do cartão (A): barra com a cor de cada uma e uma linha por filha */
.ksr { display: flex; flex-direction: column; gap: 6px; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-light); }
.ksr-head { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 0.75rem; text-align: left; cursor: pointer; }
.ksr-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ksr-head:hover .ksr-txt { color: var(--text-primary); }
.ksr-chev { flex: 0 0 12px; }
.ksr-bar { flex: 1 1 auto; display: flex; gap: 2px; height: 6px; min-width: 28px; }
.ksr-seg { flex: 1 1 0; min-width: 2px; border-radius: 3px; background: var(--c, #64748b); }
.ksr-seg.is-done { background: #22c55e; }
.ksr-seg.is-imp { background: #f79009; }
.ksr-seg.is-todo { background: #475569; }
[data-theme="light"] .ksr-seg.is-todo { background: #cbd5e1; }
/* o texto encolhe e quebra a linha no cartão estreito ("0 de 5 nesta sprint · recolhida" estourava o cartão de 210px) */
.ksr-txt { flex: 0 1 auto; min-width: 0; font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ksr.is-pronta .ksr-txt { color: #4ade80; }
[data-theme="light"] .ksr.is-pronta .ksr-txt { color: #067647; }
.ksr-head .kanban-card-people { margin-left: -2px; }
.ksr-rows { display: flex; flex-direction: column; gap: 6px; }
.ksr-row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: var(--text-primary); font: inherit; font-size: 0.78125rem; line-height: 17px; text-align: left; cursor: pointer; }
.ksr-row:hover .ksr-tit, .ksr-row:focus-visible .ksr-tit { color: var(--accent); }
.ksr-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.ksr-ico { flex: 0 0 12px; display: inline-flex; align-items: center; justify-content: center; }
.ksr-row.is-done .ksr-ico { color: #22c55e; }
.ksr-row.is-imp .ksr-ico { color: #f79009; }
.ksr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #64748b); }
.ksr-dot.is-fora { background: transparent; border: 1.5px dashed var(--text-muted); box-sizing: border-box; }
.ksr-tit { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ksr-row.is-done .ksr-tit, .ksr-row.is-fora .ksr-tit { color: var(--text-muted); text-decoration: line-through; }
.ksr-flag { font-weight: 600; color: #fdb022; text-decoration: none; display: inline-block; }
[data-theme="light"] .ksr-flag { color: #b54708; }
.ksr-flag.is-fora { color: var(--text-muted); }
.ksr-ini { flex: none; font-size: 10px; font-weight: 700; color: var(--text-muted); }
/* no épico, a barra é roxa (o que falta) e verde (o que ficou pronto) */
.ksr.is-epico .ksr-head, .ksr.is-epico .ksr-vazio { color: #d8b4fe; }
.ksr.is-epico .ksr-seg.is-todo { background: rgba(168, 85, 247, 0.4); }
[data-theme="light"] .ksr.is-epico .ksr-head, [data-theme="light"] .ksr.is-epico .ksr-vazio { color: #6941c6; }
[data-theme="light"] .ksr.is-epico .ksr-seg.is-todo { background: #d6bbfb; }
.ksr.is-vazio { font-size: 0.75rem; }
.kanban-font-lg .ksr-head, .kanban-font-lg .ksr-row { font-size: 0.8125rem; }
.kanban-font-sm .ksr-row { font-size: 0.71875rem; line-height: 15px; }

/* família em destaque (B): a faixa de cima, os cartões da família acesos e o resto apagado */
.kanban-familia { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem 0.625rem; margin: 0 0 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid rgba(97, 114, 243, 0.45); border-radius: 10px; background: rgba(97, 114, 243, 0.14); color: #c7d2fe; font-size: 0.8125rem; }
.kanban-familia[hidden] { display: none; }
[data-theme="light"] .kanban-familia { background: #eef4ff; border-color: #c7d7fe; color: #3538cd; }
.kf-cor { flex: none; width: 10px; height: 10px; border-radius: 3px; background: #6172f3; }
.kf-nome { min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.kf-nome:hover { text-decoration: underline; }
.kf-conta { color: #a5b4fc; }
[data-theme="light"] .kf-conta { color: #444ce7; }
.kf-limpar { margin-left: auto; padding: 0.125rem 0.25rem; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.kf-limpar:hover { text-decoration: underline; }
.kanban-board.tem-destaque .kanban-card.is-dim { opacity: 0.38; }
.kanban-board.tem-destaque .kanban-card.is-dim:hover { opacity: 0.75; }
.kanban-card.is-fam { border-color: #6172f3; box-shadow: 0 0 0 1px #6172f3, 0 4px 12px rgba(97, 114, 243, 0.22); }
[data-theme="light"] .kanban-card.is-fam { border-color: #6172f3; box-shadow: 0 0 0 1px #6172f3, 0 4px 12px rgba(97, 114, 243, 0.18); }

/* colunas que recolhem (decisão 14): a setinha no topo e a faixa estreita com o número e o nome */
/* fica no canto de cima, sempre no mesmo lugar (no meio do cabeçalho ele descia sozinho para a segunda linha) */
.kanban-column-header:has(.kanban-col-collapse) { padding-right: 2.5rem; }
.kanban-col-collapse { position: absolute; top: 0.625rem; right: 0.5rem; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; }
.kanban-col-collapse:hover, .kanban-col-collapse:focus-visible { color: var(--text-primary); border-color: var(--accent); outline: none; }
[data-theme="light"] .kanban-col-collapse { background: #ffffff; }
.kanban-column.is-collapsed { flex: 0 0 52px; width: 52px; min-width: 52px; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; overflow: hidden; }
.kanban-column.is-collapsed:hover { border-color: var(--accent); }
.kanban-column.is-collapsed:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kanban-col-strip-count { flex: none; min-width: 26px; padding: 2px 6px; box-sizing: border-box; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); text-align: center; font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: inset 0 -2px 0 var(--col, transparent); }
[data-theme="light"] .kanban-col-strip-count { background: #ffffff; }
.kanban-col-strip-name { min-height: 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-column.is-collapsed.drop-target { background: var(--accent-light); outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-column.is-collapsed.drop-target .kanban-col-strip-name, .kanban-column.is-collapsed.drop-target .kanban-col-strip-count { color: #93c5fd; }
[data-theme="light"] .kanban-column.is-collapsed.drop-target .kanban-col-strip-name, [data-theme="light"] .kanban-column.is-collapsed.drop-target .kanban-col-strip-count { color: #1d4ed8; }
.kanban-cols-abrir { display: inline-flex; align-items: center; gap: 0.375rem; height: 28px; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.kanban-cols-abrir b { color: var(--text-primary); }
.kanban-cols-abrir:hover, .kanban-cols-abrir:focus-visible { border-color: var(--accent); outline: none; }
.kanban-cols-abrir[hidden] { display: none; }
.kanban-drop-hint { position: fixed; right: 24px; bottom: 24px; z-index: 3001; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 48px); padding: 8px 14px; border-radius: 10px; background: #1e3a8a; color: #ffffff; font-size: 0.8125rem; font-weight: 600; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25); pointer-events: none; }
.kanban-drop-hint[hidden] { display: none; }
@media (max-width: 768px) {
  /* no celular as colunas ficam uma embaixo da outra: a recolhida vira uma barra deitada */
  .kanban-column.is-collapsed { flex: none; flex-direction: row; justify-content: flex-start; width: auto; min-width: 0; padding: 0.625rem 0.75rem; }
  .kanban-col-strip-name { writing-mode: horizontal-tb; transform: none; }
}
/* etapa (cor da coluna) em listas e diálogos */
.sub-etapa-chip { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 100%; padding: 0.0625rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, var(--c, #64748b) 20%, transparent); color: var(--text-primary); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-etapa-chip::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #64748b); }

/* tarefa aberta: caminho até o épico, "← Voltar para", campo da mãe e aviso */
.sub-trilha { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.375rem; margin: 0 0 0.5rem; font-size: 0.75rem; color: var(--text-muted); }
.sub-trilha-item, .sub-voltar { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 280px; padding: 0.125rem 0.4rem; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-tertiary); color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-trilha-item:hover, .sub-voltar:hover { color: var(--accent); border-color: var(--accent); }
.sub-voltar { color: var(--accent); }
.sub-trilha-tit { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.sub-trilha-ep { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 15px; height: 15px; border-radius: 4px; background: var(--purple); color: #fff; font-size: 0.5625rem; font-weight: 800; }
.sub-trilha-eu { font-weight: 700; color: var(--text-primary); }
.sub-campo { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; min-width: 0; }
.sub-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.sub-link:hover { text-decoration: underline; }
.sub-link-title { color: var(--text-primary); overflow-wrap: anywhere; }
.sub-acao { padding: 0.0625rem 0.4rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.6875rem; font-weight: 600; cursor: pointer; }
.sub-acao:hover { color: var(--accent); border-color: var(--accent); }
.sub-aviso { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid rgba(245, 158, 11, 0.45); background: var(--warning-bg); color: var(--text-primary); font-size: 0.8125rem; }
.sub-soma { color: var(--text-muted); font-size: 0.75em; font-weight: 400; }
.modal-meta-item .sub-etapa-chip { font-size: 0.625rem; }
.modal-meta-item .sub-acao { font-size: 0.6875rem; }
.modal-meta-item .sub-link-title { font-size: 0.875rem; }
.tl-auto { color: var(--text-muted); font-size: 0.75rem; }

/* seção "Subtarefas" / "Tarefas do épico" */
.sub-section { display: flex; flex-direction: column; gap: 0.625rem; margin: 0.25rem 0 1.25rem; container-type: inline-size; container-name: subsec; }
/* grade mais justa até 760px de largura (antes 640): em telas de ~1100–1270px a tabela passava da área e a coluna Sprint
   ficava cortada (o Toni viu na EXEMPLO-18 em 08/10/2026, com chaves longas como "EXEMPLO-19") */
@container subsec (max-width: 760px) {
  /* .sub-table na frente: a regra base do título (180px) vem depois no arquivo e anulava esta */
  .sub-table .sub-title-cell { min-width: 120px; }
  .sub-section .sub-table th, .sub-section .sub-table td { padding-left: 0.375rem; padding-right: 0.375rem; }
  /* a etapa pode quebrar em duas linhas ("LISTA DE / PENDENCIAS") em vez de empurrar a tabela para fora */
  .sub-section .sub-table .sub-etapa-chip { white-space: normal; line-height: 1.25; border-radius: 8px; padding-top: 0.125rem; padding-bottom: 0.125rem; }
}
.sub-section[hidden] { display: none; }
.sub-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.sub-title { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.sub-sum { padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.sub-head-actions { display: flex; align-items: center; gap: 0.375rem; }
.sub-menu-btn { min-width: 32px; justify-content: center; font-size: 1rem; line-height: 1; }
.sub-progress { display: flex; align-items: center; gap: 0.625rem; }
.sub-bar { display: flex; flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.sub-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--purple); transition: width 0.25s ease; }
.sub-bar-seg > span { border-radius: 0; }
.sub-seg.is-feita { background: var(--success); }
.sub-seg.is-andando { background: var(--accent); }
.sub-seg.is-fazer { background: var(--text-muted); }
.sub-progress-txt { flex: none; font-size: 0.75rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sub-hours { font-size: 0.8125rem; color: var(--text-secondary); }
.sub-hours strong { color: var(--text-primary); }
.sub-hours-own { color: var(--text-muted); }
.sub-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid rgba(34, 197, 94, 0.45); background: var(--success-bg); color: var(--text-primary); font-size: 0.8125rem; font-weight: 600; }
.sub-loading, .sub-empty { padding: 0.75rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.8125rem; text-align: center; }
.sub-table-wrap { overflow-x: auto; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.sub-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.sub-table th { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border-light); background: var(--bg-secondary); color: var(--text-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.sub-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.sub-table tr:last-child td { border-bottom: 0; }
.sub-row.is-done .sub-open { color: var(--text-secondary); }
.sub-row.is-canceled .sub-open { color: var(--text-muted); text-decoration: line-through; }
.sub-row.is-drop td { box-shadow: inset 0 2px 0 var(--accent); }
.sub-grip { width: 18px; color: var(--text-muted); font-size: 0.75rem; letter-spacing: -2px; user-select: none; }
.sub-row[draggable="true"] .sub-grip { cursor: grab; }
.sub-key { color: var(--text-muted); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.sub-title-cell { min-width: 180px; }
.sub-open { padding: 0; border: 0; background: none; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.sub-open:hover { color: var(--accent); }
.sub-resp { white-space: nowrap; }
.sub-resp .avatar, .sub-add-resp .avatar { display: inline-flex; vertical-align: middle; }
.sub-resp .avatar { margin-right: 0; }
/* o responsável nas grades da tarefa aberta (subtarefas e vínculos): só a sigla, maior e com contraste (a miúda e clarinha
   parecia erro); o nome aparece na hora ao passar o mouse ([data-tip]) */
.sub-resp .avatar.avatar-xs, .vinc-resp .avatar.avatar-xs { width: 22px; height: 22px; min-width: 22px; min-height: 22px; font-size: 0.5625rem; background: color-mix(in srgb, var(--accent) 26%, transparent); color: #bfdbfe; }
[data-theme="light"] .sub-resp .avatar.avatar-xs, [data-theme="light"] .vinc-resp .avatar.avatar-xs { color: #1d4ed8; }
.vinc-resp { flex: none; display: inline-flex; align-items: center; }
.sub-resp .avatar[data-tip], .vinc-resp .avatar[data-tip] { cursor: default; }
.sub-prazo, .sub-horas, .sub-num { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-prazo-depois { color: var(--warning); font-weight: 700; }
.sub-muted { color: var(--text-muted); }
.sub-sprint-btn { max-width: 160px; padding: 0.0625rem 0.4rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.75rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-sprint-btn:hover { color: var(--accent); border-color: var(--accent); }
.sub-add { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.sub-input { flex: 1 1 260px; min-width: 0; height: 36px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.875rem; }
.sub-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.sub-add-resp { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--text-secondary); font-size: 0.75rem; }
.sub-hint { margin: 0; color: var(--text-muted); font-size: 0.75rem; }

/* diálogos: concluir/cancelar com subtarefa aberta, excluir a mãe, escolher a mãe ou o épico, adicionar várias */
.sub-dlg-list { margin: 0 0 0.75rem; padding: 0; list-style: none; max-height: 220px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.sub-dlg-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.625rem; border-bottom: 1px solid var(--border-light); font-size: 0.8125rem; }
.sub-dlg-list li:last-child { border-bottom: 0; }
.sub-dlg-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-dlg-more { color: var(--text-muted); font-weight: 600; }
.sub-dlg-opts { display: flex; flex-direction: column; gap: 0.5rem; }
.sub-dlg-opt { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.sub-dlg-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.sub-dlg-opt.is-danger:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); }
.sub-dlg-opt input { flex: none; margin-top: 0.2rem; }
.sub-dlg-opt span { display: flex; flex-direction: column; gap: 0.125rem; }
.sub-dlg-opt strong { color: var(--text-primary); font-size: 0.875rem; }
.sub-dlg-opt small { color: var(--text-secondary); font-size: 0.75rem; }
.sub-dlg-check { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0; color: var(--text-primary); font-size: 0.8125rem; cursor: pointer; }
.sub-dlg-check[hidden] { display: none; }
.sub-dlg-check small { color: var(--text-muted); }
.sub-dlg-label { display: block; margin-bottom: 0.375rem; color: var(--text-secondary); font-size: 0.8125rem; font-weight: 600; }
.sub-dlg-note { margin: 0.75rem 0 0; color: var(--text-muted); font-size: 0.75rem; }
.sub-pick-search, .sub-varias-txt { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.875rem; }
.sub-pick-search { height: 36px; margin-bottom: 0.5rem; padding: 0 0.75rem; }
.sub-varias-txt { padding: 0.5rem 0.75rem; resize: vertical; }
.sub-pick-search:focus, .sub-varias-txt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.sub-pick-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.sub-pick-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.625rem; border: 0; border-bottom: 1px solid var(--border-light); background: none; color: var(--text-primary); font: inherit; font-size: 0.8125rem; text-align: left; cursor: pointer; }
.sub-pick-item:last-child { border-bottom: 0; }
.sub-pick-item:hover { background: var(--bg-tertiary); }
.sub-pick-item.is-selected { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent); }
.sub-pick-item.is-current, .sub-pick-item[disabled] { opacity: 0.55; cursor: default; }
.sub-pick-item[hidden] { display: none; }
.sub-pick-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-pick-tag { flex: none; padding: 0 0.375rem; border-radius: 4px; background: var(--purple-bg); color: #c4b5fd; font-size: 0.625rem; font-weight: 700; }
[data-theme="light"] .sub-pick-tag { color: #7e22ce; }
.sub-varias-grid { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 0.5rem; margin-top: 0.625rem; }
.sub-varias-grid label { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; }
.sub-varias-grid select, .sub-varias-grid input { min-width: 0; height: 34px; padding: 0 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; }
@media (max-width: 600px) {
  .sub-varias-grid { grid-template-columns: 1fr 1fr; }
  .sub-varias-grid label:first-child { grid-column: 1 / -1; }
  .sub-title-cell { min-width: 140px; }
}

/* Tabela: coluna "Mãe", progresso das subtarefas e "Lista | Em árvore" (árvore épico › tarefa › subtarefa, 16/10/2026) */
.table-header:has(.table-modo:not([hidden])) { justify-content: flex-start; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.table-modo { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-primary); }
.table-modo[hidden] { display: none; }
.table-modo button { height: 26px; padding: 0 0.625rem; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.table-modo button:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.table-modo button.is-on, .table-modo button.is-on:hover { background: var(--accent); color: #ffffff; }
.table-modo button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.table-arvore-barra { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; flex: 1 1 100%; }
.table-arvore-barra[hidden] { display: none; }
.table-arvore-conta { margin-right: auto; font-size: 0.8125rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.table-arvore-barra button { height: 28px; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.table-arvore-barra button:hover, .table-arvore-barra button:focus-visible { border-color: var(--accent); outline: none; }
.issues-table tr.tree-epico td { background: color-mix(in srgb, var(--purple) 9%, transparent); }
.issues-table tr.tree-epico td.issue-title-cell { font-weight: 700; color: #e9d5ff; }
[data-theme="light"] .issues-table tr.tree-epico td { background: #faf5ff; }
[data-theme="light"] .issues-table tr.tree-epico td.issue-title-cell { color: #3b1c6e; }
.issues-table tr.is-context td { opacity: 0.55; font-style: italic; }
.issues-table tr.tree-grupo td { padding-top: 0.625rem; padding-bottom: 0.625rem; background: var(--bg-primary); font-size: 0.8125rem; cursor: default; }
.table-subs.is-vazio { background: transparent; padding: 0; color: var(--text-muted); font-weight: 600; }
.table-selos { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; vertical-align: 1px; }
.issues-table th.col-mae, .issues-table td.col-mae { width: 1%; }
.issues-table td.issue-title-cell { min-width: 240px; }
.table-mae { color: var(--text-secondary); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.table-mae.is-epico { color: #c4b5fd; }
[data-theme="light"] .table-mae.is-epico { color: #7e22ce; }
.table-subs { display: inline-block; margin-left: 0.25rem; padding: 0 0.375rem; border-radius: 4px; background: var(--purple-bg); color: #c4b5fd; font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.table-subs.is-complete { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
[data-theme="light"] .table-subs { color: #7e22ce; }
[data-theme="light"] .table-subs.is-complete { color: #15803d; }
.tree-toggle { width: 20px; height: 20px; margin-right: 0.25rem; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); font-size: 0.75rem; line-height: 1; cursor: pointer; vertical-align: 1px; }
.tree-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ===================== Vínculos e impedimentos (fase 2) ===================== */
/* selos do cartão: impedida (vermelho), bloqueada por / bloqueia (âmbar) */
.vinc-pill { display: inline-flex; align-items: center; gap: 0.2rem; max-width: 100%; padding: 0.0625rem 0.4rem; border-radius: 999px; font-size: 0.625rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vinc-pill svg { flex: none; }
.vinc-pill-imp { background: var(--danger-bg); color: #fca5a5; }
.vinc-pill-imp.is-soft { font-weight: 600; }
.vinc-pill-bloq, .vinc-pill-bloqueia { background: var(--warning-bg); color: #fcd34d; }
.vinc-pill-bloqueia { font-weight: 600; }
[data-theme="light"] .vinc-pill-imp { color: #b91c1c; }
[data-theme="light"] .vinc-pill-bloq, [data-theme="light"] .vinc-pill-bloqueia { color: #b45309; }
/* os mesmos selos na grade de subtarefas da tarefa aberta (e nas tarefas do épico) */
.sub-trava { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; margin-left: 0.375rem; vertical-align: 0.0625rem; }
.sub-trava .vinc-pill { font-size: 0.6875rem; }

/* faixa no topo da tarefa */
.vinc-faixa { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 0.875rem; }
.vinc-faixa[hidden] { display: none; }
.vinc-faixa-item { display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.8125rem; line-height: 1.5; color: var(--text-primary); }
.vinc-faixa-item > svg { flex: none; }
.vinc-faixa-item.is-imp { background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.vinc-faixa-item.is-imp > svg { color: var(--danger); }
.vinc-faixa-item.is-bloq { background: var(--warning-bg); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); }
.vinc-faixa-item.is-bloq > svg { color: var(--warning); }
.vinc-faixa-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.vinc-faixa-item .btn { flex: none; }
.vinc-tag { display: inline-block; margin-left: 0.25rem; padding: 0 0.4rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.6875rem; font-weight: 600; white-space: nowrap; }

/* seção Vínculos (mesmo cabeçalho das subtarefas) */
.vinc-section .sub-head-actions .btn svg { margin-right: 0.25rem; vertical-align: -2px; }
.vinc-imp-btn { color: var(--danger) !important; }
.vinc-grupo { border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden; }
.vinc-grupo-tit { display: flex; align-items: center; gap: 0.4rem; padding: 0.4375rem 0.625rem; background: var(--bg-tertiary); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.vinc-g-bloqueada_por .vinc-grupo-tit, .vinc-g-bloqueia .vinc-grupo-tit { color: var(--warning); }
.vinc-g-relacionada .vinc-grupo-tit { color: #2dd4bf; }
[data-theme="light"] .vinc-g-bloqueada_por .vinc-grupo-tit, [data-theme="light"] .vinc-g-bloqueia .vinc-grupo-tit { color: #b45309; }
[data-theme="light"] .vinc-g-relacionada .vinc-grupo-tit { color: #0f766e; }
.vinc-linha { display: flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0.4375rem 0.625rem; border-top: 1px solid var(--border-light); font-size: 0.8125rem; }
.vinc-linha .sub-etapa-chip { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vinc-linha .avatar-xs { flex: none; }
.vinc-sem-resp { flex: none; width: 20px; }
.vinc-key-btn { flex: none; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.75rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.vinc-key-btn:hover { text-decoration: underline; }
.vinc-linha-tit { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.vinc-linha-tit small { color: var(--text-muted); font-size: 0.6875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vinc-open { max-width: 100%; padding: 0; border: 0; background: none; color: var(--text-primary); font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.vinc-open:hover { color: var(--accent); }
.vinc-linha.is-fechada .vinc-open { color: var(--text-secondary); }
.vinc-linha.is-oculta { color: var(--text-muted); }
.vinc-oculta-txt { flex: 1 1 auto; min-width: 0; color: var(--text-muted); font-style: italic; font-size: 0.75rem; }
.vinc-tirar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; }
.vinc-tirar:hover { background: var(--danger-bg); color: var(--danger); }
.vinc-vazio { margin: 0; color: var(--text-muted); font-size: 0.8125rem; }
.vinc-anteriores { display: flex; flex-direction: column; gap: 0.375rem; }
.vinc-ant-btn { align-self: flex-start; padding: 0.125rem 0; border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.vinc-ant-btn:hover { color: var(--text-primary); }
.vinc-ant-lista { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.vinc-ant-lista li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.5rem 0.625rem; border-top: 1px solid var(--border-light); font-size: 0.75rem; }
.vinc-ant-lista li:first-child { border-top: 0; }
.vinc-ant-quando { color: var(--text-secondary); font-weight: 700; font-variant-numeric: tabular-nums; }
.vinc-ant-motivo { flex: 1 1 200px; color: var(--text-primary); }
.vinc-ant-quem { flex: 1 1 100%; color: var(--text-muted); }

/* janelas */
.vinc-tipos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem 0.625rem; margin-bottom: 0.875rem; }
.vinc-tipo { padding: 0.5rem 0.625rem; }
.vinc-tipo strong { font-size: 0.8125rem; }
@media (max-width: 560px) { .vinc-tipos { grid-template-columns: minmax(0, 1fr); } }
.vinc-lbl-obs { margin-top: 0.875rem; }
.vinc-res { min-height: 52px; }
.vinc-res-msg { margin: 0; padding: 0.75rem; color: var(--text-muted); font-size: 0.8125rem; }
.vinc-res-item .sub-pick-title { display: flex; flex-direction: column; min-width: 0; }
.vinc-res-item .sub-pick-title small { color: var(--text-muted); font-size: 0.6875rem; font-weight: 500; }
.vinc-dup { margin-top: 0.625rem; }
.vinc-check { flex-wrap: nowrap; align-items: flex-start; }
.vinc-check input { flex: none; margin-top: 0.2rem; }
.vinc-check > span { flex: 1 1 auto; min-width: 0; line-height: 1.45; }
.vinc-trava-lista { border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 0.25rem; }
.vinc-trava-lista .vinc-linha:first-child { border-top: 0; }

/* lembrete depois de mover (segue o tema como os outros avisos; ícone âmbar; com Liberar · Desfazer) */
.toast-actions { display: flex; align-items: center; gap: 0.375rem; align-self: center; flex-wrap: wrap; }
.toast-actions .toast-action { margin-left: 0; }
.toast.toast-lembrete { display: grid; grid-template-columns: 28px minmax(0, 1fr) 26px; grid-template-areas: "icon msg close" ". acts ."; align-items: start; column-gap: 0.75rem; row-gap: 0.5rem; width: 440px; }
.toast.toast-lembrete .toast-icon { grid-area: icon; background: var(--warning-bg); color: #fcd34d; }
.toast.toast-lembrete .toast-msg { grid-area: msg; line-height: 1.5; }
.toast.toast-lembrete .toast-close { grid-area: close; margin: 0; }
.toast.toast-lembrete .toast-actions { grid-area: acts; justify-self: start; }
.toast.toast-lembrete .toast-bar { background: var(--warning); }
[data-theme="light"] .toast.toast-lembrete .toast-icon { color: #b45309; }
@media (max-width: 600px) { .toast.toast-lembrete { width: auto; } }

/* #CHAVE nos textos: link com a etapa ao vivo e o cartão ao passar o mouse */
.vinc-ref { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0 0.375rem; border-radius: 5px; background: var(--accent-light); color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; vertical-align: baseline; }
.vinc-ref:hover { text-decoration: underline; }
.vinc-ref.is-curto { padding: 0; background: transparent; }
.vinc-ref-etapa { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.35rem; border-radius: 999px; background: color-mix(in srgb, var(--c, #64748b) 22%, transparent); color: var(--text-primary); font-size: 0.625rem; font-weight: 700; }
.vinc-ref-etapa::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--c, #64748b); }
.vinc-cartao { position: fixed; z-index: 10060; width: 300px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; gap: 0.3rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); box-shadow: var(--shadow-lg); pointer-events: none; }
.vinc-cartao-key { color: var(--accent); font-size: 0.75rem; font-weight: 700; }
.vinc-cartao-key span { color: var(--text-muted); font-weight: 500; }
.vinc-cartao-tit { color: var(--text-primary); font-size: 0.875rem; font-weight: 700; line-height: 1.35; }
.vinc-cartao-meta { display: flex; align-items: center; gap: 0.375rem; color: var(--text-secondary); font-size: 0.75rem; }
.vinc-cartao-prazo { color: var(--text-muted); font-size: 0.75rem; }
.vinc-oferta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.625rem; padding: 0.5rem 0.75rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius-sm); background: var(--accent-light); color: var(--text-primary); font-size: 0.8125rem; }
.vinc-oferta > svg { flex: none; color: var(--accent); }
.vinc-oferta-txt { flex: 1 1 220px; min-width: 0; }

/* # nos editores: a lista de tarefas */
.rich-ref-popup { min-width: 300px; max-width: 420px; }
.rich-ref-item { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; }
.rich-ref-key { color: var(--accent); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.rich-ref-tit { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; }
.rich-ref-etapa { display: inline-flex; align-items: center; padding: 0 0.4rem; border-radius: 999px; background: color-mix(in srgb, var(--c, #64748b) 22%, transparent); color: var(--text-primary); font-size: 0.625rem; font-weight: 700; white-space: nowrap; }

/* ============================================================
   MARCA (08/10/2026) — logo com versão para o fundo escuro (system_config.company_logo_dark_url):
   o tema escolhe qual aparece. O filtro de inversão do CSS personalizado não vale para o logo escuro,
   que já vem com as cores certas.
   ============================================================ */
.logo-escuro { display: none; }
:root:not([data-theme="light"]) .tem-logo-escuro .logo-claro { display: none; }
:root:not([data-theme="light"]) .tem-logo-escuro .logo-escuro { display: inline-block; filter: none !important; }
/* Com logo, o nome da plataforma na entrada fica só para leitor de tela (o logo já diz o nome) */
.login-card.has-logo #loginTitle { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Slogan logo abaixo da marca na entrada (system_config.platform_tagline) */
.login-card .login-frase { margin: -1rem 0 1.25rem; font-size: 1rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.01em; }

/* ===== Horas (fase 2, 10/10/2026): seção na tarefa, cronômetro, card e tabela ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hr-section { margin: 0.25rem 0 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; container-type: inline-size; }
.hr-vazio { font-size: 0.8125rem; color: var(--text-muted); }
.hr-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.hr-total { font-size: 0.9375rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hr-total strong { color: var(--text-primary); font-size: 1.0625rem; }
.hr-passou { font-size: 0.75rem; font-weight: 700; color: #c2410c; background: rgba(249, 115, 22, 0.14); padding: 0.125rem 0.5rem; border-radius: 999px; }
.hr-barra { height: 8px; background: var(--bg-tertiary); border-radius: 999px; overflow: hidden; }
.hr-barra span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.hr-barra.is-passou span { background: #f97316; }
.hr-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.hr-chip { font-size: 0.75rem; font-variant-numeric: tabular-nums; padding: 0.1875rem 0.5625rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); }
.hr-chip-fat { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.hr-chip-ag { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.hr-chip-pe { background: rgba(249, 115, 22, 0.13); color: #c2410c; }
.hr-acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hr-btn-crono { border: 1px solid var(--border-light); display: inline-flex; align-items: center; gap: 0.375rem; }
.hr-crono { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; padding: 0.625rem 0.75rem; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-light, rgba(59, 130, 246, 0.08)); font-size: 0.8125rem; color: var(--text-secondary); }
.hr-crono .btn { margin-left: auto; }
.hr-crono .btn + .btn { margin-left: 0; }
.hr-crono-outra { border-color: var(--border-light); background: var(--bg-tertiary); }
.hr-crono-limite { border-color: #f97316; background: rgba(249, 115, 22, 0.08); }
.hr-relogio { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 700; font-size: 0.9375rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.hr-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.625rem 0.75rem; padding: 0.875rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-primary); }
.hr-form-tit { grid-column: 1 / -1; font-weight: 700; font-size: 0.875rem; color: var(--text-primary); }
.hr-campo { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); min-width: 0; }
.hr-campo input, .hr-campo select { width: 100%; box-sizing: border-box; font-size: 0.875rem; text-transform: none; letter-spacing: 0; font-weight: 400; }
.hr-campo-largo { grid-column: span 2; }
.hr-campo-todo { grid-column: 1 / -1; }
.hr-check { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.8125rem; color: var(--text-primary); align-self: end; padding-bottom: 0.5rem; }
.hr-check > span { white-space: nowrap; }
.hr-check small { color: var(--text-muted); }
.hr-check small.hr-dica-cor { flex-basis: 100%; color: var(--warning); }
.hr-erro { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--danger); background: var(--danger-bg); padding: 0.5rem 0.625rem; border-radius: var(--radius-sm); }
.hr-form-botoes { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 0.5rem; }
.hr-form-botoes .btn-ghost { border: 1px solid var(--border-light); }
.hr-tabela-box { position: relative; overflow-x: auto; max-width: 100%; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.hr-tabela { width: 100%; border-collapse: collapse; font-size: 0.8125rem; color: var(--text-primary); }
.hr-tabela th { text-align: left; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.hr-tabela td { padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--border-light); vertical-align: top; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hr-tabela tr:last-child td { border-bottom: 0; }
.hr-num { text-align: right; white-space: nowrap; }
.hr-quando { white-space: nowrap; }
.hr-quando small, .hr-sub { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.hr-agente { font-size: 0.6875rem; color: #1d4ed8; }
.hr-fat { color: #15803d; white-space: nowrap; }
.hr-int { color: var(--text-secondary); white-space: nowrap; }
.hr-tabela td.hr-o-que { min-width: 12rem; white-space: normal; color: var(--text-secondary); }
.hr-acoes-linha { white-space: nowrap; text-align: right; }
.hr-icone { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-muted); cursor: pointer; }
.hr-icone:hover { background: var(--bg-hover); color: var(--text-primary); }
.hr-icone-perigo:hover { color: var(--danger); }
.hr-nota { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.kanban-card-spent { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.6875rem; color: #1d4ed8; background: rgba(59, 130, 246, 0.12); padding: 0.0625rem 0.4rem; border-radius: 4px; font-variant-numeric: tabular-nums; }
.kanban-card-spent.is-passou { color: #c2410c; background: rgba(249, 115, 22, 0.15); font-weight: 600; }
.issues-table td.desvio-acima { color: #c2410c; font-weight: 600; }
[data-theme="dark"] .hr-chip-fat, [data-theme="dark"] .hr-fat { color: #4ade80; }
[data-theme="dark"] .hr-chip-ag, [data-theme="dark"] .hr-agente, [data-theme="dark"] .kanban-card-spent { color: #93c5fd; }
[data-theme="dark"] .hr-chip-pe, [data-theme="dark"] .hr-passou, [data-theme="dark"] .kanban-card-spent.is-passou, [data-theme="dark"] .issues-table td.desvio-acima { color: #fdba74; }
@media (max-width: 640px) {
  .hr-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-campo-largo { grid-column: 1 / -1; }
  .hr-crono .btn { margin-left: 0; }
}

/* ===== Minhas horas: a folha da semana (fase 2) ===== */
.folha-content { max-width: 1280px; display: flex; flex-direction: column; gap: 1rem; }
.folha-vazio { padding: 1.5rem; text-align: center; color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius); }
.folha-barra { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.folha-semana { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.folha-semana strong { font-size: 1rem; color: var(--text-primary); }
.folha-nav, .folha-btn { border: 1px solid var(--border-light); }
.folha-nav { min-width: 36px; }
.folha-acoes { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.folha-seg { display: inline-flex; border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; }
.folha-seg button { border: 0; background: transparent; padding: 0.375rem 0.75rem; font: inherit; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; }
.folha-seg button.is-on { background: var(--accent); color: #fff; font-weight: 600; }
.folha-crono .btn { margin-left: auto; }
.folha-corpo { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.folha-principal { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.folha-grade-box { position: relative; overflow-x: auto; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius); }
.folha-grade { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.8125rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.folha-grade th, .folha-grade td { padding: 0.5rem; border-bottom: 1px solid var(--border-light); text-align: center; white-space: nowrap; }
.folha-grade thead th { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.folha-grade .folha-col-tarefa { text-align: left; white-space: normal; min-width: 14rem; font-weight: 400; }
.folha-grade tbody .folha-col-tarefa { font-size: 0.8125rem; }
.folha-chave { font-weight: 700; }
.folha-titulo { color: var(--text-secondary); }
.folha-nova { color: var(--accent); }
.folha-grade .folha-num { text-align: right; }
.folha-grade .is-hoje { background: var(--accent-light, rgba(59, 130, 246, 0.08)); }
.folha-grade .is-sel { box-shadow: inset 0 0 0 2px var(--accent); }
.folha-grade tfoot th, .folha-grade tfoot td { font-weight: 700; border-bottom: 0; }
.folha-campo { width: 4.25rem; min-width: 4.25rem; max-width: none; height: 2rem; box-sizing: border-box; text-align: center; padding: 0 0.25rem; font: inherit; font-variant-numeric: tabular-nums; border: 1px solid var(--border-light); border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); }
.folha-campo:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light, rgba(59, 130, 246, 0.25)); }
.folha-campo::placeholder { color: var(--text-muted); }
.folha-valor { min-width: 4.25rem; height: 2rem; border: 1px dashed var(--border); border-radius: var(--radius-xs); background: transparent; color: var(--text-primary); font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; }
.folha-valor small { font-size: 0.6875rem; color: var(--text-muted); }
.folha-vaga { color: var(--text-muted); }
.folha-sem { color: var(--text-secondary); padding: 1.25rem !important; }
.folha-lado { display: flex; flex-direction: column; gap: 0.75rem; position: sticky; top: 1rem; }
.folha-caixa { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.875rem 1rem; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius); font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }
.folha-caixa strong { color: var(--text-primary); font-size: 0.875rem; }
.folha-caixa-suave { background: var(--bg-tertiary); border-color: transparent; }
.folha-item { display: flex; flex-direction: column; gap: 0.125rem; padding-top: 0.375rem; border-top: 1px solid var(--border-light); }
.folha-item small, .folha-dica { color: var(--text-muted); }
.folha-pessoa h2 { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.5rem; font-size: 0.9375rem; color: var(--text-primary); }
.folha-pessoa h2 small { font-weight: 400; color: var(--text-muted); }
.folha-pessoa-total { margin-left: auto; font-size: 0.8125rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.folha-busca { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.folha-busca input { width: 100%; box-sizing: border-box; }
.folha-achadas { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.75rem; max-height: 320px; overflow-y: auto; }
.folha-achadas > small { color: var(--text-muted); }
.folha-achada { text-align: left; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-primary); padding: 0.5rem 0.625rem; font: inherit; font-size: 0.8125rem; color: var(--text-primary); cursor: pointer; display: flex; flex-direction: column; gap: 0.125rem; }
.folha-achada:hover, .folha-achada:focus { border-color: var(--accent); outline: none; }
.folha-achada small { color: var(--text-muted); }
@media (max-width: 900px) {
  .folha-corpo { grid-template-columns: minmax(0, 1fr); }
  .folha-lado { position: static; }
}
@media (max-width: 640px) {
  .folha-crono .btn { margin-left: 0; }
  .folha-grade .folha-col-tarefa { min-width: 10rem; }
}

/* ===== Indicadores das horas apontadas e o consumo no contrato (fase 2) ===== */
#kpiSection3[hidden] { display: none !important; }
.hk-grade { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.hk-card { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.875rem 1rem; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius); min-width: 0; }
.hk-card.is-destaque { border: 2px solid var(--accent); }
.hk-rot { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.hk-card.is-destaque .hk-rot { color: var(--accent); }
.hk-val { font-size: 1.375rem; line-height: 1.2; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.hk-val.is-alerta { color: #c2410c; }
.hk-sub { font-size: 0.75rem; color: var(--text-muted); }
.hk-semanas { margin-top: 0.875rem; padding: 0.875rem 1rem; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius); }
.hk-semanas:empty { display: none; }
.hk-graf-cab { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-primary); }
.hk-leg { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--text-secondary); }
.hk-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.hk-leg i + i, .hk-leg i:not(:first-child) { margin-left: 0.5rem; }
.hk-pe, .hk-b-pe { background: #f59e0b; }
.hk-ag, .hk-b-ag { background: #3b82f6; }
.hk-graf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; align-items: end; height: 170px; margin-top: 0.75rem; }
.hk-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; min-width: 0; }
.hk-barra { display: flex; flex-direction: column; min-height: 2px; border-radius: 6px 6px 0 0; overflow: hidden; background: var(--bg-tertiary); }
.hk-barra span { display: block; min-height: 0; }
.hk-tot, .hk-sem { text-align: center; font-size: 0.6875rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hk-tot { padding-bottom: 0.25rem; }
.hk-sem { padding-top: 0.375rem; }
.hk-nota { margin: 0.5rem 0 0; font-size: 0.6875rem; color: var(--text-muted); }
[data-theme="dark"] .hk-val.is-alerta { color: #fdba74; }
@media (max-width: 1100px) { .hk-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hk-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hk-graf { gap: 0.375rem; } }
.contract-horas-base { margin: 0 0 0.625rem; font-size: 0.8125rem; color: var(--text-secondary); }
.contract-horas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.contract-horas-grid > div { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.625rem 0.75rem; background: var(--bg-tertiary); border-radius: var(--radius-sm); min-width: 0; }
.contract-horas-grid span { font-size: 0.75rem; color: var(--text-secondary); }
.contract-horas-grid b { font-size: 1.125rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.contract-horas-grid .is-negativo b { color: var(--danger); }
.contract-horas-linha { margin: 0.625rem 0 0; font-size: 0.8125rem; color: var(--text-secondary); }
.contract-horas-linha b { color: var(--text-primary); }
.contract-horas-linha small { color: var(--text-muted); }

/* Sprint › Gestão: horas apontadas (fase 2) */
.gs-hr-tab { width: 100%; border-collapse: collapse; font-size: 0.8125rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.gs-hr-tab th { text-align: left; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--border-light); }
.gs-hr-tab td { padding: 0.5rem; border-bottom: 1px solid var(--border-light); }
.gs-hr-tab tr:last-child td { border-bottom: 0; }
.gs-hr-tab .gs-num { text-align: right; white-space: nowrap; }
.gs-hr-ag { color: #1d4ed8; }
.gs-hr-pe { color: #c2410c; }
[data-theme="dark"] .gs-hr-ag { color: #93c5fd; }
[data-theme="dark"] .gs-hr-pe { color: #fdba74; }
.gs-hr-desv { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.75rem; font-size: 0.8125rem; color: var(--text-secondary); }
.gs-hr-desv > b { color: var(--text-primary); }
.gs-hr-d .gs-t-t { color: var(--text-primary); }

/* Entrega por etapa (fase 5): a seção Entrega da tarefa e os selos do cartão */
.ent-section { margin: 0.25rem 0 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.ent-vazio { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.ent-run { border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 0.75rem 0.875rem; display: grid; gap: 0.5rem; min-width: 0; }
.ent-run.is-falhou { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.ent-run.is-ok { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.ent-run-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.625rem; min-width: 0; }
.ent-estado { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 700; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); }
.ent-estado.is-ok { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.ent-estado.is-falhou { background: var(--danger-bg); color: #fca5a5; }
.ent-estado.is-espera { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
[data-theme="light"] .ent-estado.is-ok { color: #15803d; }
[data-theme="light"] .ent-estado.is-falhou { color: #b91c1c; }
[data-theme="light"] .ent-estado.is-espera { color: #1d4ed8; }
.ent-run-tit { font-weight: 700; font-size: 0.875rem; color: var(--text-primary); overflow-wrap: anywhere; }
.ent-run-quando { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.ent-destino { font-size: 0.8125rem; color: var(--text-secondary); }
.ent-erro { font-size: 0.8125rem; color: var(--danger); line-height: 1.45; overflow-wrap: anywhere; }
.ent-passos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ent-passo { display: flex; gap: 0.5rem; align-items: flex-start; min-width: 0; }
.ent-ic { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg-tertiary); color: var(--text-muted); margin-top: 1px; }
.ent-passo.is-ok .ent-ic { background: rgba(34, 197, 94, 0.18); color: #22c55e; }
.ent-passo.is-falhou .ent-ic { background: var(--danger-bg); color: var(--danger); }
.ent-passo.is-espera .ent-ic { background: rgba(59, 130, 246, 0.16); color: #3b82f6; }
.ent-passo.is-mao .ent-ic { background: rgba(249, 115, 22, 0.16); color: #f97316; }
.ent-passo-txt { min-width: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--text-primary); display: grid; gap: 0.25rem; }
.ent-detalhe { color: var(--text-secondary); overflow-wrap: anywhere; }
.ent-extra { font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }
.ent-links { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ent-link { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; font-weight: 600; padding: 0.0625rem 0.45rem; border-radius: 999px; border: 1px solid var(--border-light);
  color: var(--text-secondary); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-link:hover { color: var(--accent); border-color: var(--accent); }
.ent-acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ent-antigas > summary { cursor: pointer; font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.ent-antigas .ent-run { margin-top: 0.5rem; opacity: 0.85; }
.ent-pill-andamento { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
.ent-pill-falhou { background: var(--danger-bg); color: #fca5a5; }
[data-theme="light"] .ent-pill-andamento { color: #1d4ed8; }
[data-theme="light"] .ent-pill-falhou { color: #b91c1c; }
.ent-pill-andamento svg, .ent-pill-falhou svg { width: 10px; height: 10px; }

/* ==========================================================================
   Ferramentas e recursos (fase 7): seção da tarefa, editor, grade do projeto e o "falta acesso" do impedimento
   ========================================================================== */
.fr-muted { color: var(--text-muted); }
.fr-mono, .fr-var, .vinc-var { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fr-amb { display: inline-flex; align-items: center; padding: 0 0.4375rem; border-radius: 999px; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; background: var(--info-bg); color: var(--info); line-height: 1.6; }
.fr-amb-linha { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
#frAmb select { width: 100%; }
.fr-aviso { color: var(--danger); margin: 0.375rem 0 0; }
.fr-amb.is-prod { background: var(--danger-bg); color: var(--danger); }
.fr-selo { display: inline-flex; align-items: center; padding: 0 0.4375rem; border-radius: 999px; font-size: 0.625rem; font-weight: 700; white-space: nowrap; background: var(--accent-light); color: var(--accent); line-height: 1.6; }
.fr-selo.is-tarefa { background: var(--purple-bg); color: var(--purple); }
.fr-selo.is-off { background: var(--bg-tertiary); color: var(--text-muted); }
.fr-section { display: grid; gap: 0.625rem; }
.fr-grupo { display: grid; gap: 0.5rem; }
.fr-grupo-tit { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.fr-item { display: grid; gap: 0.375rem; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); }
.fr-item.is-tarefa { border-style: dashed; border-color: color-mix(in srgb, var(--purple) 45%, transparent); }
.fr-item-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; min-width: 0; }
.fr-item-nome { font-size: 0.875rem; color: var(--text-primary); }
.fr-item-tipo { font-size: 0.75rem; color: var(--text-muted); }
.fr-item-link { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.fr-item-link:hover { text-decoration: underline; }
.fr-item-acoes { margin-left: auto; display: inline-flex; gap: 0.25rem; }
.fr-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid transparent; border-radius: var(--radius-xs); background: none; color: var(--text-muted); cursor: pointer; }
.fr-ico:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border); }
.fr-item-nota { margin: 0; font-size: 0.8125rem; color: var(--text-primary); }
.fr-item-para { margin: 0; font-size: 0.8125rem; color: var(--text-secondary); }
.fr-item-campos { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.375rem; }
.fr-var, .fr-valor { display: inline-block; max-width: 100%; padding: 0.0625rem 0.4375rem; border-radius: var(--radius-xs); font-size: 0.75rem; overflow-wrap: anywhere; background: var(--success-bg); color: var(--text-primary); }
.fr-var.is-prod { background: var(--danger-bg); }
.fr-valor { background: var(--bg-tertiary); color: var(--text-secondary); }
.fr-copiar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-secondary); color: var(--text-muted); cursor: pointer; }
.fr-copiar:hover { color: var(--accent); border-color: var(--accent); }
.fr-item-status { font-size: 0.75rem; }
.fr-pronta, .fr-falta, .fr-sem-acesso { display: inline-flex; align-items: center; gap: 0.25rem; }
.fr-pronta { color: var(--success); }
.fr-falta { color: var(--warning); }
.fr-fora { color: var(--text-muted); }
/* dentro do diálogo, o parágrafo da linha não ganha a margem dos textos do diálogo */
.ui-dialog-body .fr-item-para, .ui-dialog-body .fr-item-nota { margin: 0; }
/* no cartão recolhível, o selo "sem acesso" já aparece no resumo do cabeçalho */
.fs-corpo .fr-section > .sub-head { display: none; }
.fr-sem-acesso { padding: 0.0625rem 0.5rem; border-radius: 999px; background: var(--warning-bg); color: var(--warning); font-size: 0.6875rem; font-weight: 700; }
.fr-acoes { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.fr-vazio, .fr-nota-sec { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
/* editor */
.fr-dlg .ui-field-label { margin-top: 0.125rem; }
.fr-aviso { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--text-primary); font-size: 0.8125rem; }
.fr-aviso svg { flex: none; color: var(--warning); margin-top: 0.125rem; }
.fr-grade2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.fr-escopo { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.75rem; }
.fr-pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.fr-pill { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem 0.25rem 0.5rem; min-height: 30px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-secondary); font-size: 0.8125rem; cursor: pointer; user-select: none; }
.fr-pill:has(input:checked) { background: var(--accent-light); border-color: var(--accent); color: var(--text-primary); }
.fr-pill:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.fr-campos { display: grid; gap: 0.5rem; }
.fr-campo { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "rot orig x" "val val val"; gap: 0.5rem; align-items: center; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fr-campo > .fr-campo-rot { grid-area: rot; }
.fr-campo > .fr-campo-orig { grid-area: orig; }
.fr-campo > .fr-campo-val { grid-area: val; }
.fr-campo > [data-tirar-campo] { grid-area: x; }
.fr-campo-orig { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.fr-seg { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }
.fr-campo-val { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.fr-campo-val select { flex: 0 1 42%; min-width: 9rem; }
.fr-campo-val input { flex: 1 1 auto; min-width: 0; }
.fr-sep { color: var(--text-muted); }
.fr-campos-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.5rem; }
.fr-escolher { display: grid; gap: 0.375rem; max-height: 44vh; overflow: auto; }
.fr-hist { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; font-size: 0.8125rem; }
.fr-hist li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.5rem; }
.fr-hist-q { color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* grade do projeto (menu do usuário) */
.fr-grade { display: grid; gap: 0.75rem; }
.fr-cofres { display: grid; gap: 0.375rem; }
.fr-cofre { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.8125rem; }
.fr-cofre .fr-mono { font-size: 0.6875rem; overflow-wrap: anywhere; }
.fr-cofres > .btn { justify-self: start; }
.fr-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.fr-busca { flex: 1 1 220px; max-width: 320px; }
.fr-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.fr-chip { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 28px; padding: 0 0.625rem; border-radius: 999px; border: 1px dashed var(--border); background: transparent; color: var(--text-muted); font-size: 0.75rem; cursor: pointer; }
.fr-chip.is-on { border-style: solid; background: var(--bg-tertiary); color: var(--text-primary); }
.fr-chip span { font-variant-numeric: tabular-nums; opacity: 0.8; }
.fr-lote { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; padding: 0.5rem 0.625rem; border-radius: var(--radius-sm); background: var(--accent-light); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-size: 0.8125rem; }
.fr-lote[hidden] { display: none; }
.fr-lista { display: grid; gap: 0.5rem; }
.fr-linha { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 0.625rem; align-items: start; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); }
.fr-linha.is-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--bg-primary)); }
.fr-linha.is-off { opacity: 0.6; }
.fr-linha-sel { margin-top: 0.1875rem; }
.fr-linha-main { display: grid; gap: 0.3125rem; min-width: 0; }
.fr-linha-acoes { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
/* impedimento: o tipo e o "falta acesso" */
.vinc-imp-tipos { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.75rem; }
.vinc-imp-tipo { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem 0.25rem 0.5rem; min-height: 30px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.8125rem; cursor: pointer; color: var(--text-secondary); }
.vinc-imp-tipo:has(input:checked) { border-color: var(--warning); background: var(--warning-bg); color: var(--text-primary); }
.vinc-acesso { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; }
.vinc-acesso[hidden], .vinc-acesso-nova[hidden], .vinc-cli-lbl[hidden] { display: none; }
.vinc-acesso-nova { display: grid; gap: 0.5rem; }
.vinc-var { font-size: 0.75rem; }
@media (max-width: 640px) {
  .fr-grade2 { grid-template-columns: minmax(0, 1fr); }
  .fr-campo { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "rot x" "orig orig" "val val"; }
  .fr-campo-val { flex-wrap: wrap; }
  .fr-campo-val select { flex: 1 1 100%; }
  .fr-campo-val .fr-sep { display: none; }
  .fr-cofre { grid-template-columns: auto minmax(0, 1fr); }
  .fr-cofre > :last-child { grid-column: 1 / -1; }
  .fr-linha { grid-template-columns: 20px minmax(0, 1fr); }
  .fr-linha-acoes { grid-column: 1 / -1; justify-content: flex-start; }
  .fr-hist li { grid-template-columns: minmax(0, 1fr); }
  .fr-busca { max-width: none; }
}

/* =====================================================================
   Comentário grande (decisão 13 do canvas 2yc56urGEfecXeX1j8SDqZ, 16/10/2026) — js/comentario-grande.js
   1) a caixa cresce com o texto até metade da tela e depois rola por dentro, com a barra de formatação em cima;
   2) "Expandir" abre o mesmo formulário grande sobre a tarefa (Recolher, Esc ou clique fora voltam);
   3) no celular, tocar na caixa abre em tela cheia: Voltar e Enviar no topo, formatação logo acima do teclado.
   ===================================================================== */
/* até metade da tela, só até onde cabe na janela da tarefa (o js mede e põe --cmt-max; nunca menos que 260 px) */
.comment-form .rich-content { max-height: var(--cmt-max, 50vh); }
/* o estilo do parágrafo não ocupa mais uma linha inteira (era o "select { width: 100% }" geral) */
.comment-form .rich-toolbar .rich-select { width: auto; }

/* "Expandir" / "Recolher" na ponta da barra de formatação */
.rich-toolbar .rich-expandir { display: inline-flex; align-items: center; gap: 0.3125rem; margin-left: auto; min-width: 0; padding: 0.1875rem 0.5rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 6px; background: var(--accent-light); color: var(--accent); font-size: 0.75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
#modalOverlay .modal-col-right .rich-toolbar .rich-expandir { min-width: 0; padding: 0.1875rem 0.5rem; }
/* no celular quem abre o grande é o toque na caixa: o botão sai */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) { .comment-form .rich-toolbar .rich-expandir { display: none; } }
.rich-toolbar .rich-expandir:hover { background: var(--accent-light); border-color: var(--accent); }
.rich-toolbar .rich-expandir:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* "Rascunho salvo" e o atalho do Enviar, à esquerda */
.comment-form .cmt-status { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 0; font-size: 0.75rem; color: var(--text-muted); }
.comment-form .cmt-atalho { display: none; }
.comment-form .cmt-rascunho:not([hidden]) + .cmt-atalho::before { content: '·'; margin-right: 0.25rem; }
@media (max-width: 600px) { .comment-form:not(.cmt-grande) .cmt-status { display: none; } }

/* 2) o comentário grande sobre a tarefa (é o próprio #commentForm, posto por cima) */
.cmt-grande-topo { display: none; }
#modalOverlay .modal:has(.comment-form.cmt-grande) { transform: none; transition: none; }   /* sem isso o "fixed" ficaria preso à janela da tarefa */
.comment-form.cmt-grande { position: fixed; z-index: 60; top: 4vh; bottom: 4vh; left: 0; right: 0; width: min(980px, 94vw); margin: 0 auto; padding: 0; gap: 0; display: flex; flex-direction: column; }
.comment-form.cmt-grande::before { content: ''; position: fixed; inset: 0; z-index: -2; background: rgba(15, 23, 42, 0.55); }
.comment-form.cmt-grande::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.comment-form.cmt-grande.internal-mode::after { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 24px 64px rgba(0, 0, 0, 0.35); }
.comment-form.cmt-grande .cmt-grande-topo { order: -1; display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border-light, var(--border)); }
.cmt-grande-voltar { display: none; }
.cmt-grande-tit { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 0.625rem; }
.cmt-grande-tit b { flex: none; font-size: 0.9375rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.cmt-grande-tit span { min-width: 0; font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmt-grande-esc { flex: none; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.comment-form.cmt-grande .draft-banner { margin: 0.625rem 1.25rem 0; }
.comment-form.cmt-grande #commentEditor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.comment-form.cmt-grande .rich-editor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border-width: 0 0 1px; border-radius: 0; box-shadow: none; }
.comment-form.cmt-grande .rich-toolbar,
#modalOverlay .modal-col-right .comment-form.cmt-grande .rich-toolbar { flex: none; gap: 0.125rem; padding: 0.5rem 1.25rem; }
.comment-form.cmt-grande .rich-content { flex: 1 1 auto; min-height: 0; max-height: none; padding: 1.125rem 1.375rem; font-size: 0.9375rem; line-height: 1.65; }
.comment-form.cmt-grande .cmt-midia { display: none; }
.comment-form.cmt-grande .audio-recorder-area { margin: 0.5rem 1.25rem 0; }
.comment-form.cmt-grande .comment-submit-row { margin: 0; padding: 0.75rem 1.25rem; }
.comment-form.cmt-grande .cmt-atalho { display: inline; }
.comment-form.cmt-grande:not(.is-celular) .cmt-status { order: -1; margin-right: auto; }
.comment-form.cmt-grande:not(.is-celular) .tl-internal-toggle { margin-right: 0.25rem; }

/* 3) celular: tela cheia, do tamanho da área acima do teclado (js mede o visualViewport) */
.comment-form.cmt-grande.is-celular { top: var(--cmt-vv-top, 0px); bottom: auto; height: var(--cmt-vv-h, 100dvh); width: 100%; margin: 0; }
.comment-form.cmt-grande.is-celular::before { display: none; }
.comment-form.cmt-grande.is-celular::after { border: 0; border-radius: 0; box-shadow: none; }
.comment-form.cmt-grande.is-celular.internal-mode::after { box-shadow: inset 0 3px 0 #f59e0b; }
.comment-form.cmt-grande.is-celular .cmt-grande-topo { flex-wrap: wrap; gap: 0.125rem 0.5rem; padding: 0.375rem 0.75rem 0.5rem; }
.comment-form.cmt-grande.is-celular .cmt-grande-voltar { display: inline-flex; align-items: center; gap: 0.125rem; min-height: 40px; padding: 0 0.5rem 0 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.comment-form.cmt-grande.is-celular .cmt-grande-tit { flex: 1 1 100%; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.75rem; color: var(--text-muted); }
.comment-form.cmt-grande.is-celular .cmt-grande-tit b,
.comment-form.cmt-grande.is-celular .cmt-grande-tit span { display: inline; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.comment-form.cmt-grande.is-celular .cmt-grande-tit span::before { content: ' · '; }
.comment-form.cmt-grande.is-celular .cmt-grande-esc { display: none; }
.comment-form.cmt-grande.is-celular .draft-banner { margin: 0.5rem 0.75rem 0; }
.comment-form.cmt-grande.is-celular .comment-submit-row { position: absolute; top: 0.375rem; right: 0.75rem; margin: 0; padding: 0; gap: 0.625rem; flex-wrap: nowrap; }
.comment-form.cmt-grande.is-celular .cmt-status { display: none; }
.comment-form.cmt-grande.is-celular .tl-internal-toggle { margin-right: 0; }
.comment-form.cmt-grande.is-celular .tl-internal-toggle-label { font-size: 0; }
.comment-form.cmt-grande.is-celular .tl-internal-toggle-label::after { content: 'Interno'; font-size: 0.8125rem; }
.comment-form.cmt-grande.is-celular #commentSubmit { min-height: 40px; padding: 0 1rem; font-size: 0.9375rem; }
.comment-form.cmt-grande.is-celular .rich-editor { border-width: 0; }
.comment-form.cmt-grande.is-celular .rich-toolbar { order: 2; flex-wrap: nowrap; overflow-x: auto; padding: 0.25rem 0.5rem; border-top: 1px solid var(--border); border-bottom: 0; }
.comment-form.cmt-grande.is-celular .rich-toolbar :is(.rich-select, [data-cmd="underline"], [data-cmd="strikeThrough"], [data-cmd="unlink"], [data-cmd="removeFormat"], .rich-sep, .rich-expandir) { display: none; }
.comment-form.cmt-grande.is-celular .rich-toolbar button { flex: none; min-width: 40px; min-height: 40px; font-size: 1rem; }
.comment-form.cmt-grande.is-celular .rich-content { padding: 0.875rem 1rem; font-size: 1rem; line-height: 1.55; }
.comment-form.cmt-grande.is-celular .rich-emoji-picker { top: auto; bottom: 52px; }

/* =====================================================================
   Modo TV: o painel de escolhas do botão do quadro (js/modo-tv.js); a TV em si fica em css/tv.css
   ===================================================================== */
.mtv { display: flex; flex-direction: column; gap: 1rem; }
.mtv [hidden] { display: none !important; }
.mtv-grupo { display: flex; flex-direction: column; gap: 0.4rem; }
.mtv-rot { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary, var(--text-muted)); }
.mtv small { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.mtv-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-primary); }
.mtv-seg label { flex: 1 1 0; position: relative; }
.mtv-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mtv-seg span { display: block; padding: 0.4rem 0.5rem; border-radius: 7px; text-align: center; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary, var(--text-primary)); cursor: pointer; }
.mtv-seg input:checked + span { background: var(--accent); color: #fff; }
.mtv-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.mtv-ck { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.875rem; color: var(--text-primary); cursor: pointer; }
.mtv-ck input[type="checkbox"], .mtv-ck input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.mtv-ck input[type="number"] { width: 3.5rem; padding: 0.2rem 0.35rem; text-align: center; font-size: 0.875rem; }
.mtv-linha { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.mtv-proj { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary); }
.mtv-proj b { font-size: 0.875rem; }
.mtv-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; flex: 1 1 auto; min-width: 0; }
.mtv-chips span { padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--bg-tertiary, var(--bg-secondary)); font-size: 0.75rem; font-weight: 600; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtv-lista { display: flex; flex-direction: column; gap: 0.4rem; max-height: 12rem; overflow-y: auto; padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: 8px; }
.mtv-duas { flex-direction: row; gap: 1rem; flex-wrap: wrap; }
.mtv-duas > * { flex: 1 1 12rem; display: flex; flex-direction: column; gap: 0.4rem; }
.mtv-duas select { width: 100%; padding: 0.45rem 0.6rem; }
.mtv-teclas { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.mtv-teclas kbd { padding: 0 0.35rem; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-weight: 600; }
body.modo-tv-ativo { overflow: hidden; }
/* no celular o Modo TV não faz sentido (e o 4º ícone apertava a barra do quadro) */
#btnModoTv[hidden] { display: none; }
@media (max-width: 600px) { #btnModoTv { display: none !important; } }
body.portal-mode #btnModoTv { display: none !important; }

/* ============================================================
   MODO DO CLIENTE — 19/10/2026
   Ativado por body.modo-cliente (app.js, pelo tipo de usuário: quem não é da equipe), em qualquer aba. A tarefa abre
   no formato simples do portal (uma coluna de até 760px, fontes e botões maiores, editor com o essencial, sem tipo,
   datas de criação, "Copiar link" nem os botões de capa). Prioridade e estimativa ficam: o cliente prioriza numa etapa
   e aprova o escopo pelas horas. O layout da aba Lista (só a busca, cartões grandes) continua só com body.portal-mode.
   ============================================================ */
body.modo-cliente .modal-meta-item[data-field="type"],
body.modo-cliente .modal-meta-item[data-field="created"],
body.modo-cliente .modal-meta-item[data-field="updated"],
body.modo-cliente .btn-copy-url { display: none !important; }
/* --- Modal: mobile-first, fontes maiores, toques grandes --- */
body.modo-cliente .modal { max-width: 620px; }
body.modo-cliente .modal-issue-key { font-size: 0.8125rem; color: var(--text-muted); }
body.modo-cliente .modal-issue-title { font-size: 1.3rem; line-height: 1.3; }
body.modo-cliente .modal-meta { grid-template-columns: 1fr 1fr; gap: 1rem; }
body.modo-cliente .modal-meta-item label { font-size: 0.8125rem; }
body.modo-cliente .modal-section h3,
body.modo-cliente .modal-description h3 { font-size: 1.1rem; }
body.modo-cliente .modal-body { font-size: 1.0312rem; }
body.modo-cliente .modal .btn { min-height: 44px; }

/* Trava qualquer overflow horizontal no detalhe (quebra palavras/links longos) */
body.modo-cliente .modal { overflow: hidden; }
body.modo-cliente .modal-body { overflow-x: hidden; }
body.modo-cliente .modal-description-content,
body.modo-cliente .comment-body,
body.modo-cliente .rich-content,
body.modo-cliente .modal-issue-title { overflow-wrap: anywhere; word-break: break-word; }

/* Portal em celular E tablet: modal em tela cheia, sem bordas nem scroll horizontal */
@media (max-width: 900px) {
  body.modo-cliente .modal-overlay { padding: 0; }
  body.modo-cliente .modal {
    width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: none;
  }
  body.modo-cliente .modal-meta { grid-template-columns: 1fr; gap: 0.625rem; }
  body.modo-cliente .modal-issue-title { font-size: 1.2rem; }
}

/* --- Modo portal: modal de detalhe — ações grandes empilhadas, sem link interno --- */
body.modo-cliente .modal-actions { flex-direction: column; align-items: stretch; gap: 0.625rem; }
body.modo-cliente .modal-actions-left { flex-direction: column; width: 100%; gap: 0.5rem; }
body.modo-cliente .modal-actions-left .modal-transition-btn {
  width: 100%; min-height: 48px; font-size: 1rem; font-weight: 700; border-radius: 10px;
}
body.modo-cliente .modal-actions-right { display: none; } /* "Abrir no Jira" é link interno */
body.modo-cliente .modal-confirm-area { gap: 0.625rem; }
body.modo-cliente .modal-confirm-title { font-size: 0.95rem; }
body.modo-cliente .comment-modal-input,
body.modo-cliente #modalConfirmComment { font-size: 1rem; min-height: 64px; }
body.modo-cliente .comment-modal-buttons { gap: 0.5rem; flex-wrap: wrap; }
body.modo-cliente .comment-modal-buttons .btn { min-height: 44px; }

/* detalhe no computador: uma coluna só (antes ficava espremido em duas colunas estreitas) */
@media (min-width: 901px) {
  body.modo-cliente #modalOverlay .modal:not(.modal-new-issue) { max-width: 760px; }
  body.modo-cliente .modal:not(.modal-new-issue) .modal-body { display: block; }
  body.modo-cliente .modal-col-left { position: static; max-height: none; overflow: visible; padding-right: 0; }
  body.modo-cliente .modal-col-right { border-left: 0; padding-left: 0; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light, var(--border)); }
  body.modo-cliente .modal-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.25rem; }
}
/* o cliente vê a capa, mas não troca nem remove; sem dica técnica de Ctrl+V */
body.modo-cliente #btnCoverAdd, body.modo-cliente #btnCoverChange, body.modo-cliente #btnCoverRemove, body.modo-cliente .comment-hint { display: none !important; }

/* editor só com o essencial: negrito, itálico, listas, imagem e emoji (sem estilo de parágrafo, sublinhado, tachado, link) */
body.modo-cliente .rich-toolbar [data-cmd="formatBlock"],
body.modo-cliente .rich-toolbar [data-cmd="underline"],
body.modo-cliente .rich-toolbar [data-cmd="strikeThrough"],
body.modo-cliente .rich-toolbar [data-cmd="createLink"],
body.modo-cliente .rich-toolbar [data-cmd="unlink"],
body.modo-cliente .rich-toolbar [data-cmd="removeFormat"],
body.modo-cliente .rich-toolbar .rich-sep { display: none !important; }
body.modo-cliente .rich-toolbar { flex-wrap: wrap; gap: 0.25rem; }
body.modo-cliente .rich-toolbar button { min-width: 40px; min-height: 40px; font-size: 1rem; }
body.modo-cliente .rich-content { font-size: 1rem; }

/* novo chamado: campos maiores, sem "Capa" nem atalho de teclado */
body.modo-cliente .modal-new-issue { max-width: 720px; }
body.modo-cliente .modal-new-issue .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
body.modo-cliente .modal-new-issue .edit-field { min-width: 0; }
body.modo-cliente .modal-new-issue .edit-field-full { grid-column: 1 / -1; }
body.modo-cliente .modal-new-issue .edit-field > label:not(.new-issue-urgent-toggle) { flex-wrap: wrap; row-gap: 0.125rem; overflow-wrap: normal; font-size: 0.875rem; }
body.modo-cliente .modal-new-issue .edit-hint { flex-basis: 100%; white-space: normal; font-size: 0.8125rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
body.modo-cliente .modal-new-issue .edit-field input[type="text"],
body.modo-cliente .modal-new-issue .edit-field select,
body.modo-cliente .modal-new-issue .edit-field textarea { min-height: 48px; font-size: 1rem; }
body.modo-cliente .modal-new-issue .edit-field label.new-issue-urgent-toggle { height: 48px; font-size: 1rem; }
body.modo-cliente .modal-new-issue .new-issue-editor .rich-content { min-height: 150px; }
body.modo-cliente .modal-new-issue .new-issue-dropzone { min-height: 56px; font-size: 0.9375rem; }
body.modo-cliente .modal-new-issue .edit-field:has(#newIssueCoverBox), body.modo-cliente .new-issue-kbd { display: none !important; }
body.modo-cliente .modal-new-issue .new-issue-actions { flex-direction: row; align-items: center; justify-content: flex-end; }
body.modo-cliente .modal-new-issue .new-issue-actions .btn { min-height: 48px; font-size: 1rem; padding: 0 1.25rem; }
/* no celular: tela cheia com o corpo rolando e os botões fixos embaixo (antes "Capa" ficava atrás dos botões) */
@media (max-width: 900px) {
  body.modo-cliente .modal-new-issue { display: flex; flex-direction: column; }
  body.modo-cliente .modal-new-issue .new-issue-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1rem 1.5rem; }
  body.modo-cliente .modal-new-issue .edit-grid { grid-template-columns: minmax(0, 1fr); }
  body.modo-cliente .modal-new-issue .new-issue-actions { padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-light, var(--border)); }
  body.modo-cliente .modal-new-issue .new-issue-actions-right { width: 100%; }
  body.modo-cliente .modal-new-issue .new-issue-actions-right .btn { flex: 1 1 0; }
}
@media (min-width: 901px) { body.modo-cliente .modal-meta-item[data-field="warranty"] { grid-column: span 2; } }
body.modo-cliente .modal:has(.status-badge.pl-b-done, .status-badge.pl-b-cancel) .modal-meta .overdue-text:not(.warranty-info) { color: inherit; font-weight: inherit; }
body.modo-cliente .status-badge.pl-b-wait   { background: #fef3c7; color: #92400e; }
body.modo-cliente .status-badge.pl-b-doing  { background: #dbeafe; color: #1e40af; }
body.modo-cliente .status-badge.pl-b-done   { background: #d1fae5; color: #065f46; }
body.modo-cliente .status-badge.pl-b-cancel { background: #f1f5f9; color: #475569; }
[data-theme="dark"] body.modo-cliente .status-badge.pl-b-wait   { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
[data-theme="dark"] body.modo-cliente .status-badge.pl-b-doing  { background: rgba(59, 130, 246, 0.18); color: #bfdbfe; }
[data-theme="dark"] body.modo-cliente .status-badge.pl-b-done   { background: rgba(34, 197, 94, 0.16); color: #86efac; }
[data-theme="dark"] body.modo-cliente .status-badge.pl-b-cancel { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
/* a Lista também: "uma coluna só" perdia para a largura do formulário da equipe (#modalOverlay .modal, 1320px) */
@media (min-width: 901px) { body.portal-mode #modalOverlay .modal:not(.modal-new-issue) { max-width: 760px; } }

/* ===== PDF piscando (19/10/2026) =====
   A janela da tarefa desfoca a tela inteira (backdrop-filter) e, atrás dela, os cards com aviso não lido pulsam sem parar:
   a cada quadro o navegador refazia o desfoque da tela toda (60 quadros por segundo, parado). Com um PDF grande aberto na
   prévia, a placa de vídeo ficava sem folga e a tela piscava. Com a tarefa aberta o pulso para (o quadro está desfocado
   atrás, ninguém o vê); com a prévia do anexo aberta, sai o desfoque. Medido: de 60 para 0,1 quadro por segundo. */
body:has(#modalOverlay.visible) .kanban-card.has-unread-notif::before { animation: none; }
body:has(#attachmentPreviewOverlay) .modal-overlay { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ===== FORMULÁRIO D (19/10/2026; canvas 6EzqprcwbGpsLbJCvM2F2m) — js/form-d.js =====
   A equipe na tela larga: abas à esquerda, o painel "Campos" à direita e, embaixo, o comentário com anexos, áudio e as
   decisões da etapa. Altura fixa: as abas e o painel rolam por dentro; o comentário fica sempre à vista. */
.fd-escondido { display: none !important; }
#modalOverlay .modal.form-d { max-width: min(1320px, 94vw); height: min(880px, 92vh); max-height: 92vh; }
.modal.form-d .modal-cover, .modal.form-d .modal-cover img { max-height: 140px; }
.modal.form-d .modal-header { padding: 1rem 1.5rem 0.875rem; }
.modal.form-d .modal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 0; padding: 0; overflow: hidden; scrollbar-gutter: auto; align-items: stretch; }
.modal.form-d .modal-col-left.fd-principal { position: static; display: flex; flex-direction: column; min-height: 0; max-height: none; overflow: hidden; padding: 0; }
.modal.form-d .fd-principal > .sub-aviso, .modal.form-d .fd-principal > .vinc-faixa { margin: 0.875rem 1.5rem 0; }
.modal.form-d .fd-principal > .vinc-faixa[hidden] { display: none; }
.modal.form-d.editing #editPanel { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.5rem; }
.modal.form-d .modal-col-right.fd-lateral { min-height: 0; overflow-y: auto; border-left: 1px solid var(--border-light); padding: 1rem 1.25rem 1.25rem; background: var(--bg-primary); }
.modal.form-d > .modal-followers:not(.fd-seguidores), .modal.form-d .modal-actions { display: none; }

/* ⋯ do cabeçalho */
.fd-mais { position: relative; display: inline-flex; }
.fd-mais-btn { padding: 0.3125rem 0.5rem; }
.fd-mais-menu { position: absolute; top: calc(100% + 0.375rem); right: 0; z-index: 30; width: 300px; padding: 0.375rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.fd-mais-menu[hidden] { display: none; }
.fd-mais-menu hr { border: 0; border-top: 1px solid var(--border-light); margin: 0.25rem 0.375rem; }
.fd-mais-item { display: flex; align-items: flex-start; gap: 0.625rem; width: 100%; padding: 0.5rem 0.625rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.fd-mais-item:hover, .fd-mais-item:focus-visible { background: var(--bg-hover); outline: none; }
.fd-mais-item svg { flex: none; margin-top: 0.125rem; color: var(--text-secondary); }
.fd-mais-item span { display: flex; flex-direction: column; min-width: 0; }
.fd-mais-item strong { font-size: 0.875rem; font-weight: 600; }
.fd-mais-item small { font-size: 0.75rem; color: var(--text-muted); }
.fd-mais-item.is-perigo strong, .fd-mais-item.is-perigo svg, .fd-mais-item.is-perigo small { color: var(--danger); }
.fd-mais-item.is-leve strong { font-weight: 500; color: var(--text-secondary); }

/* abas */
.fd-abas { display: flex; gap: 0.125rem; padding: 0 1rem; border-bottom: 1px solid var(--border-light); overflow-x: auto; scrollbar-width: thin; flex: none; }
.fd-aba { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.8125rem 0.5rem 0.6875rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-secondary); font: inherit; font-size: 0.9375rem; font-weight: 600; white-space: nowrap; cursor: pointer; position: relative; }
.fd-aba[hidden] { display: none; }
.fd-aba:hover { color: var(--text-primary); }
.fd-aba:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.fd-aba.is-ativa { color: var(--text-primary); border-bottom-color: var(--accent); }
.fd-aba-n { min-width: 1.375rem; padding: 0.0625rem 0.4375rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.fd-aba-n[hidden] { display: none; }
.fd-aba.is-ativa .fd-aba-n { background: var(--accent-light); color: var(--accent); }
.fd-aba.tem-novo::after { content: ''; position: absolute; top: 0.625rem; right: 0.125rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
.fd-paineis { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.5rem 1.25rem; }
.fd-painel[hidden] { display: none; }
.fd-painel > * + * { margin-top: 1rem; }
.fd-painel > .modal-description { margin-bottom: 0; }
.fd-painel .modal-attachments-section { margin: 0; }
.fd-painel .attachments-toggle .attachments-caret { display: none; }
.fd-painel .attachments-toggle { cursor: default; pointer-events: none; }
.fd-painel .attachments-toggle h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.fd-vazio { color: var(--text-muted); font-size: 0.875rem; }
.fd-painel[data-fd-painel="atividade"] .tl-toolbar { margin-top: 0; }

/* painel Campos */
.fd-campos-tit { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin: 0.125rem 0 0.625rem; }
.modal.form-d .modal-meta.fd-campos { display: flex; flex-direction: column; gap: 0; margin: 0; }
.modal.form-d .fd-campos .modal-meta-item { display: grid; grid-template-columns: 7.25rem minmax(0, 1fr); align-items: center; gap: 0.625rem; padding: 0.4375rem 0; min-height: 2.25rem; }
.modal.form-d .fd-campos .modal-meta-item[hidden] { display: none; }
.modal.form-d .fd-campos .modal-meta-item > label { margin: 0; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
.modal.form-d .fd-campos .modal-meta-item > label span { display: none; }
.modal.form-d .fd-campos .modal-meta-item > span, .modal.form-d .fd-campos .modal-meta-item > div { min-width: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.modal.form-d .fd-campos [data-field="created"], .modal.form-d .fd-campos [data-field="updated"] { display: none; }
.modal.form-d .fd-campos [data-field="status"] { order: 1; }
.modal.form-d .fd-campos [data-field="assignee"] { order: 2; }
.modal.form-d .fd-campos [data-field="reporter"] { order: 3; }
.modal.form-d .fd-campos [data-field="priority"] { order: 4; }
.modal.form-d .fd-campos [data-field="type"] { order: 5; }
.modal.form-d .fd-campos [data-field="parent"] { order: 6; }
.modal.form-d .fd-campos [data-field="sprint"] { order: 7; }
.modal.form-d .fd-campos [data-field="duedate"] { order: 8; }
.modal.form-d .fd-campos [data-field="publishdate"] { order: 9; }
.modal.form-d .fd-campos [data-field="resolutiondate"] { order: 10; }
.modal.form-d .fd-campos [data-field="warranty"] { order: 11; }
.modal.form-d .fd-campos [data-field="estimate"] { order: 12; }
.modal.form-d .fd-campos [data-field="internal-estimate"] { order: 13; }
.modal.form-d .fd-campos [data-field="labels"] { order: 14; }
.modal.form-d .fd-campos .status-badge { white-space: normal; }
.modal.form-d .fd-seguidores { margin: 0.875rem 0 0; padding: 0.875rem 0 0; border: 0; border-top: 1px solid var(--border-light); border-radius: 0; background: none; }
.fd-datas { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--text-muted); line-height: 1.45; }
.fd-datas:empty { display: none; }

/* comentário embaixo, em qualquer aba */
.fd-rodape { flex: none; border-top: 1px solid var(--border-light); padding: 0.75rem 1.5rem 0.875rem; background: var(--bg-primary); }
.fd-aguarda { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin-bottom: 0.625rem; padding: 0.4375rem 0.75rem; border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); border-radius: var(--radius-sm); background: var(--success-bg); color: var(--success); font-size: 0.875rem; }
.fd-aguarda svg { flex: none; }
.fd-aguarda strong { font-weight: 700; }
.fd-aguarda-dica { color: var(--text-primary); }
.fd-rodape:not(.is-aberto) .fd-aguarda { display: inline-flex; }
.fd-rodape:not(.is-aberto) .fd-aguarda-dica { display: none; }
.fd-linha { display: flex; align-items: flex-start; gap: 0.625rem; }
.fd-eu { flex: none; width: 2rem; height: 2rem; margin-top: 0.25rem; font-size: 0.6875rem; }
.fd-caixa { flex: 1; min-width: 0; position: relative; border-radius: var(--radius); }
.fd-caixa.is-soltando { outline: 2px dashed var(--accent); outline-offset: 2px; }
.modal.form-d .fd-caixa #commentForm { margin: 0; }
.modal.form-d .fd-caixa .cmt-midia, .modal.form-d .fd-caixa #audioRecorderArea, .modal.form-d .fd-caixa .comment-submit-row { display: none !important; }
.modal.form-d .fd-caixa .rich-toolbar .tl-internal-toggle { margin-left: auto; padding-left: 0.5rem; }
.modal.form-d .fd-caixa .rich-toolbar .tl-internal-toggle.fd-piscar { animation: fdPiscar 0.9s ease 2; border-radius: 6px; }
@keyframes fdPiscar { 50% { background: var(--warning-bg); box-shadow: 0 0 0 3px var(--warning-bg); } }
/* em repouso: uma linha, com o clipe e o microfone dentro do campo */
.fd-rodape:not(.is-aberto) .fd-caixa .rich-toolbar, .fd-rodape:not(.is-aberto) .fd-preparados, .fd-rodape:not(.is-aberto) .rich-expandir { display: none !important; }
.fd-rodape:not(.is-aberto) .fd-caixa .rich-content { min-height: 2.5rem; max-height: 2.5rem; overflow: hidden; padding: 0.5625rem 4.5rem 0.5625rem 0.875rem; white-space: nowrap; }
.fd-icones { position: absolute; top: 0.3125rem; right: 0.375rem; display: flex; gap: 0.125rem; }
.fd-rodape.is-aberto .fd-icones { display: none; }
.fd-ico { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 0; border-radius: 6px; background: none; color: var(--text-secondary); cursor: pointer; }
.fd-ico:hover { background: var(--bg-hover); color: var(--text-primary); }
.fd-rodape.is-aberto .fd-caixa .rich-content { min-height: 4.5rem; }
.fd-botoes { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; padding-left: 2.625rem; }
.fd-rodape:not(.is-aberto) .fd-botoes { display: none; }
.fd-midia { display: flex; gap: 0.5rem; }
.fd-midia .btn { display: inline-flex; align-items: center; gap: 0.375rem; border: 1px solid var(--border); }
.fd-enviar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.fd-linha > .fd-enviar { flex: none; margin-left: 0; padding-top: 0.125rem; }
.fd-enviar .cmt-status { font-size: 0.75rem; color: var(--text-muted); }
.fd-linha > .fd-enviar .cmt-atalho { display: none; }
.fd-enviar .fd-comentar { border: 1px solid var(--border); font-weight: 600; padding: 0.5rem 0.875rem; }
.fd-sep { width: 1px; height: 1.75rem; background: var(--border); }
.fd-enviar .fd-decisao { padding: 0.5rem 0.9375rem; font-size: 0.875rem; font-weight: 600; border-radius: var(--radius-sm); }
.fd-enviar .fd-decisao:disabled, .fd-enviar .fd-comentar:disabled { opacity: 0.55; cursor: not-allowed; }
.fd-pede { margin: 0.5rem 0 0 2.625rem; padding: 0.4375rem 0.75rem; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning); font-size: 0.8125rem; font-weight: 600; }
.fd-pede[hidden] { display: none; }
/* anexos e áudios que vão junto com o comentário */
.fd-preparados { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0.625rem 0.625rem; }
.fd-prep { display: flex; align-items: center; gap: 0.5rem; max-width: 16rem; padding: 0.375rem 0.375rem 0.375rem 0.5rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.fd-prep img { width: 2.25rem; height: 2.25rem; object-fit: cover; border-radius: 6px; flex: none; }
.fd-prep-ext { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 6px; background: var(--danger-bg); color: var(--danger); font-size: 0.625rem; font-weight: 800; flex: none; }
.fd-prep-txt { display: flex; flex-direction: column; min-width: 0; }
.fd-prep-nome { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-prep small { font-size: 0.6875rem; color: var(--text-muted); }
.fd-prep-x { flex: none; margin-left: auto; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 4px; background: none; color: var(--text-muted); font-size: 1.125rem; line-height: 1; cursor: pointer; }
.fd-prep-x:hover { background: var(--bg-hover); color: var(--text-primary); }
.fd-prep-audio { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.fd-prep-tocar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.fd-prep-onda { width: 3.5rem; height: 1rem; flex: none; background: repeating-linear-gradient(90deg, var(--info) 0 2px, transparent 2px 5px); -webkit-mask: linear-gradient(transparent 30%, #000 30% 70%, transparent 70%); opacity: 0.6; }
.fd-soltar { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: none; color: var(--text-muted); font: inherit; font-size: 0.75rem; line-height: 1.3; text-align: left; cursor: pointer; }
.fd-soltar:hover { border-color: var(--accent); color: var(--text-secondary); }
/* 20/10/2026 ("a barra de comentários invade e tampa qualquer possibilidade de abrir outras abas"): aberto, o texto cresce
   só até onde o form-d.js mediu (--fd-txt-max: sobram as abas e um pedaço do painel) e rola por dentro; os anexos rolam
   depois de duas fileiras; sem anexo, a área de soltar só aparece com um arquivo sendo arrastado para o comentário (ela
   ocupava uma linha inteira); recolhido, o botão de anexar mostra quantos arquivos esperam o envio */
@media (min-width: 600.02px) {
  .modal.form-d .fd-rodape.is-aberto .fd-caixa .comment-form:not(.cmt-grande) .rich-content { max-height: var(--fd-txt-max, 30vh); }
  .modal.form-d .fd-rodape.is-aberto .fd-caixa .comment-form:not(.cmt-grande) .fd-preparados { max-height: 7.25rem; overflow-y: auto; }
}
.fd-caixa:not(.is-soltando) .fd-preparados:not(.tem) { display: none; }
/* recolhido com várias linhas, só a primeira aparece (a segunda espiava pelo espaço de baixo do campo) */
.fd-rodape:not(.is-aberto) .fd-caixa .rich-content { clip-path: inset(0 0 0.5625rem 0); }
.fd-anexar { position: relative; }
.fd-rodape:not(.is-aberto) .fd-anexar[data-n]::after { content: attr(data-n); position: absolute; top: -0.25rem; right: -0.25rem; min-width: 1rem; height: 1rem; padding: 0 0.25rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.625rem; font-weight: 700; line-height: 1rem; text-align: center; font-variant-numeric: tabular-nums; }
.fd-pede.is-info { background: var(--accent-light); color: var(--text-primary); font-weight: 500; }
/* gravando: ponto vermelho, tempo, Parar e Descartar; Comentar e as decisões esperam */
.fd-gravacao { display: flex; align-items: center; gap: 0.625rem; margin: 0 0.625rem 0.625rem; padding: 0.5rem 0.75rem; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-size: 0.875rem; }
.fd-gravacao[hidden] { display: none; }
.fd-gravacao-ponto { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--danger); animation: recPulse 1.2s infinite; flex: none; }
.fd-gravacao-tempo { font-variant-numeric: tabular-nums; font-weight: 700; }
.fd-gravacao-dica { color: var(--text-secondary); font-size: 0.8125rem; }
.fd-gravacao .fd-parar { margin-left: auto; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: var(--bg-secondary); color: var(--danger); font-weight: 600; }
/* o botão "Formulário novo" no anterior (quem desligou o D) */
.fd-ligar { border: 1px dashed var(--border); flex: none; display: inline-flex; align-items: center; gap: 0.375rem; }
.fd-ligar svg { display: none; }
@media (max-width: 600px) { .fd-ligar { padding: 0.375rem; } .fd-ligar svg { display: block; } .fd-ligar span { display: none; } }
/* D: o campo ocupa a linha e as decisões descem quando não cabem; anexos e gravação dentro da mesma caixa do texto */
.fd-linha { flex-wrap: wrap; }
.fd-caixa { flex: 1 1 24rem; }
.fd-linha > .fd-enviar { margin-left: auto; }
.modal.form-d .fd-caixa #commentForm { gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); overflow: hidden; }
.modal.form-d .fd-caixa #commentForm:focus-within { border-color: var(--accent); }
.modal.form-d .fd-caixa .rich-editor { border: 0; border-radius: 0; }
.fd-icones { background: var(--bg-primary); padding-left: 0.25rem; }
.fd-enviar .cmt-atalho { display: none; }
.fd-enviar .fd-decisao.pill-success { background: var(--success); border-color: var(--success); color: #fff; }
.fd-enviar .fd-decisao.pill-success:hover:not(:disabled) { filter: brightness(0.93); }
.modal.form-d .modal-issue-title { font-size: 1.3125rem; font-weight: 700; line-height: 1.3; }

/* Subtópico (19/10/2026): Tab num item de lista vira lista dentro do item; cada nível com o seu marcador */
.rich-content ul ul, .rich-view ul ul { list-style-type: circle; margin: 0.125rem 0; }
.rich-content ul ul ul, .rich-view ul ul ul { list-style-type: square; }
.rich-content ol ol, .rich-view ol ol { list-style-type: lower-alpha; margin: 0.125rem 0; }
.rich-content ol ol ol, .rich-view ol ol ol { list-style-type: lower-roman; }
.rich-view li > p, .rich-content li > p { margin: 0; }

/* ===== Formulário D: visão geral na aba Detalhes e edição no lugar (19/10/2026) ===== */
/* descrição sem a caixa cinza e inteira (a aba rola por dentro) */
.modal.form-d .fd-painel .modal-description-content { background: none; padding: 0; border: 0; max-height: none !important; overflow: visible; font-size: 0.9375rem; line-height: 1.6; }
.modal.form-d .fd-painel .modal-description-content::after { display: none; }
.modal.form-d .fd-painel .modal-description-expand { display: none !important; }
.modal.form-d .fd-painel #modalDescription > h3 { display: flex; align-items: center; gap: 0.75rem; }
.fd-vazio { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.fd-link { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; }
.fd-link:hover { text-decoration: underline; }
.fd-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.fd-desc-editar { color: var(--text-secondary); font-weight: 500; }
.fd-geral { display: grid; gap: 1rem; }
.fd-sec-cab { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.fd-sec-tit { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.fd-ultima[hidden], .fd-resumo[hidden] { display: none; }
.fd-ultima-itens { display: grid; gap: 0.375rem; }
.fd-ultima-itens .fd-clone { cursor: pointer; margin: 0; border-radius: var(--radius-sm); }
/* comentário longo: 3 linhas e reticências (o resto na Atividade) */
.fd-ultima-itens .fd-clone .comment-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fd-ultima-itens .fd-clone .comment-body ul, .fd-ultima-itens .fd-clone .comment-body ol { margin: 0; }
.fd-ultima-itens .fd-clone:hover { filter: brightness(0.985); }
.fd-ultima-itens .fd-clone img, .fd-ultima-itens .fd-clone .attachment-thumb, .fd-ultima-itens .fd-clone .tl-atts { display: none; }
.fd-resumo { display: grid; border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; }
.fd-resumo-linha { display: flex; align-items: center; gap: 0.75rem; padding: 0.6875rem 0.875rem; border: 0; border-top: 1px solid var(--border-light); background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.fd-resumo-linha:first-child { border-top: 0; }
.fd-resumo-linha:hover { background: var(--bg-hover); }
.fd-resumo-linha strong { min-width: 7rem; font-weight: 600; }
.fd-resumo-txt { color: var(--text-secondary); }
.fd-resumo-txt em { font-style: normal; color: var(--danger); font-weight: 600; }
.fd-resumo-seta { margin-left: auto; color: var(--text-muted); font-size: 1.125rem; line-height: 1; }
.fd-mini { display: inline-flex; flex: none; white-space: nowrap; align-items: center; justify-content: center; min-width: 2rem; height: 1.5rem; padding: 0 0.375rem; border-radius: 5px; font-size: 0.625rem; font-weight: 800; letter-spacing: 0.02em; background: var(--bg-tertiary); color: var(--text-secondary); }
.fd-mini-pdf { background: var(--danger-bg); color: var(--danger); }
.fd-mini-img { background: var(--info-bg); color: var(--info); }
.fd-mini-aud { background: var(--purple-bg); color: var(--purple); }

/* campos que se editam no lugar: lápis ao passar o mouse; clique abre o seletor logo abaixo, dentro do painel */
.modal.form-d .fd-lateral { position: relative; }
.modal.form-d .fd-campos .fd-editavel { cursor: pointer; border-radius: var(--radius-sm); margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; }
.modal.form-d .fd-campos .fd-editavel:hover, .modal.form-d .fd-campos .fd-editavel:focus-visible { background: var(--bg-hover); outline: none; }
.modal.form-d .fd-campos .fd-editavel:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.modal.form-d .fd-campos .fd-editavel.is-editando { background: var(--accent-light); box-shadow: inset 0 0 0 1px var(--accent); }
.modal.form-d .fd-campos .fd-editavel > span, .modal.form-d .fd-campos .fd-editavel > div { display: flex; align-items: center; gap: 0.375rem; }
.fd-lapis { margin-left: auto; display: inline-flex; color: var(--text-muted); opacity: 0; transition: opacity 0.12s; }
.fd-editavel:hover .fd-lapis, .fd-editavel:focus-visible .fd-lapis, .fd-editavel.is-editando .fd-lapis { opacity: 1; }
.fd-pop { position: absolute; left: 0.875rem; right: 0.875rem; z-index: 40; display: flex; flex-direction: column; gap: 0.375rem; max-height: 20rem; padding: 0.375rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.fd-pop.is-salvando { opacity: 0.6; pointer-events: none; }
.fd-pop-carregando { display: flex; justify-content: center; padding: 0.75rem; }
.fd-pop-busca { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.625rem; height: 2.25rem; border: 1px solid var(--accent); border-radius: var(--radius-sm); color: var(--text-muted); box-shadow: 0 0 0 3px var(--accent-light); }
.fd-pop-busca input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text-primary); font: inherit; font-size: 0.875rem; }
.fd-pop-lista { display: flex; flex-direction: column; overflow-y: auto; }
.fd-pop-op { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.4375rem 0.5rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-primary); font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.fd-pop-op:hover, .fd-pop-op:focus-visible { background: var(--bg-hover); outline: none; }
.fd-pop-op.is-atual { background: var(--accent-light); font-weight: 600; }
.fd-pop-op small { color: var(--text-muted); font-weight: 400; }
.fd-pop-ok { margin-left: auto; color: var(--accent); font-weight: 700; }
.fd-pop-av { width: 1.5rem; height: 1.5rem; font-size: 0.5625rem; flex: none; }
.fd-pop-av.is-vazio { background: var(--bg-tertiary); color: var(--text-muted); }
.fd-pop-vazio { padding: 0.5rem; color: var(--text-muted); font-size: 0.8125rem; }
.fd-pop-campo { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.25rem; }
.fd-pop-campo input { height: 2.25rem; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.875rem; }
.fd-pop-campo input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.fd-pop-campo small { color: var(--text-muted); font-size: 0.75rem; }
.fd-pop-botoes { display: flex; justify-content: flex-end; gap: 0.375rem; }

/* título no cabeçalho */
.modal.form-d .modal-issue-title.fd-tit-editavel { cursor: text; border-radius: var(--radius-sm); margin-left: -0.375rem; padding: 0 0.375rem; }
.modal.form-d .modal-issue-title.fd-tit-editavel:hover { background: var(--bg-hover); }
.modal.form-d .modal-issue-title.fd-tit-editavel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.modal.form-d .modal-issue-title.fd-tit-edit { display: flex; align-items: center; gap: 0.5rem; padding: 0; margin: 0; background: none; cursor: default; }
.fd-tit-input { flex: 1; min-width: 0; height: 2.5rem; padding: 0 0.625rem; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 1.25rem; font-weight: 700; box-shadow: 0 0 0 3px var(--accent-light); outline: none; }

/* descrição em edição na aba Detalhes */
.fd-desc-edit { display: grid; gap: 0.5rem; }
.fd-desc-edit > h3 { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.fd-desc-edit .rich-editor { border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.fd-desc-edit .rich-content { min-height: 8rem; }
.fd-desc-botoes { display: flex; align-items: center; gap: 0.5rem; }
.fd-desc-botoes small { color: var(--text-muted); font-size: 0.75rem; }
.fd-vazio[hidden], .modal.form-d .fd-painel #modalDescription[hidden] { display: none; }
.fd-pop .fd-pop-busca input[type="search"] { height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none; -webkit-appearance: none; appearance: none; }

/* ===== Formulário D, parte 2 (19/10/2026, "na faixa mesmo"): tablet e celular =====
   Abaixo de 1100 px a tarefa vira uma coluna: o painel de campos vira a faixa "Campos" (o essencial à vista; o resto
   abre no botão, em duas colunas no tablet e numa no celular), as abas ficam presas no topo e rolam para o lado (‹ ›)
   e a tarefa inteira rola, com o comentário sempre embaixo. No celular as decisões ficam grandes acima do campo, o
   comentário abre em tela cheia e o ⋯ abre uma folha embaixo. */
.fd-abas-wrap { position: relative; flex: none; }
.fd-abas { position: relative; scrollbar-width: none; }
.fd-abas::-webkit-scrollbar { display: none; }
.fd-abas-seta { display: none; position: absolute; top: 0; bottom: 1px; z-index: 2; width: 2.75rem; padding: 0 0.375rem; border: 0; align-items: center; color: var(--text-secondary); cursor: pointer; }
.fd-abas-seta[data-dir="-1"] { left: 0; justify-content: flex-start; background: linear-gradient(90deg, var(--bg-secondary) 55%, transparent); }
.fd-abas-seta[data-dir="1"] { right: 0; justify-content: flex-end; background: linear-gradient(270deg, var(--bg-secondary) 55%, transparent); }
.fd-abas-wrap.tem-esq .fd-abas-seta[data-dir="-1"], .fd-abas-wrap.tem-dir .fd-abas-seta[data-dir="1"] { display: inline-flex; }
.fd-abas-seta:hover { color: var(--text-primary); }
.fd-faixa, .fd-tela-topo, .fd-mais-cancelar { display: none; }
/* a faixa "Campos" */
.fd-faixa-it { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; max-width: 100%; margin: 0 -0.375rem; padding: 0 0.375rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.fd-faixa-it:hover { background: var(--bg-hover); }
.fd-faixa-it:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fd-faixa-it > span { min-width: 0; }
.fd-faixa .status-badge { white-space: normal; text-align: left; font-size: 0.6875rem; padding: 0.1875rem 0.5625rem; border-radius: 999px; }
.fd-faixa .priority-badge { font-size: 0.6875rem; padding: 0.125rem 0.5rem; }
.fd-faixa .avatar { width: 1.375rem; height: 1.375rem; font-size: 0.5625rem; }
.fd-faixa-rot { color: var(--text-secondary); }
.fd-faixa-prev strong { font-weight: 600; }
.fd-faixa-prev.is-atrasada strong { color: var(--danger); }
.fd-faixa-sem { color: var(--text-muted); }
.fd-faixa-campos { margin-left: auto; display: inline-flex; align-items: center; gap: 0.375rem; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.fd-faixa-campos svg { transition: transform 0.15s ease; }
.modal.form-d.fd-campos-aberto .fd-faixa-campos { background: var(--accent-light); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.modal.form-d.fd-campos-aberto .fd-faixa-campos svg { transform: rotate(180deg); }

@media (max-width: 1099.98px) {
  #modalOverlay .modal.form-d { width: 100%; max-width: min(760px, 100%); height: min(940px, 94vh); max-height: 94vh; }
  .modal.form-d .modal-cover, .modal.form-d .modal-cover img { max-height: 112px; }
  .modal.form-d .modal-body { display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .modal.form-d .modal-col-left.fd-principal { display: contents; }
  .modal.form-d .fd-faixa { order: 1; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; padding: 0.5rem 1.375rem; border-bottom: 1px solid var(--border-light); background: var(--bg-primary); font-size: 0.8125rem; }
  .modal.form-d .fd-faixa-prev:has(.fd-faixa-sem) { display: none; }   /* sem data prevista: só nos Campos */
  .modal.form-d .modal-col-right.fd-lateral { order: 2; flex: none; display: none; min-height: auto; overflow: visible; border-left: 0; border-bottom: 1px solid var(--border-light); padding: 0.375rem 1.375rem 0.875rem; }
  .modal.form-d.fd-campos-aberto .modal-col-right.fd-lateral { display: block; }
  .modal.form-d .fd-principal > .sub-aviso, .modal.form-d .fd-principal > .vinc-faixa, .modal.form-d .fd-principal > #editPanel { order: 3; flex: none; }
  .modal.form-d .fd-abas-wrap { order: 4; position: sticky; top: 0; z-index: 5; background: var(--bg-secondary); }
  .modal.form-d .fd-paineis { order: 5; flex: 1 0 auto; min-height: 9rem; overflow: visible; padding: 1rem 1.375rem 1.25rem; }
  .modal.form-d .fd-rodape { order: 6; position: sticky; bottom: 0; z-index: 6; }
  .fd-campos-tit { display: none; }
  .modal.form-d .modal-meta.fd-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
  .modal.form-d .fd-campos .modal-meta-item { grid-template-columns: 6.5rem minmax(0, 1fr); min-height: 2.125rem; padding-top: 0.3125rem; padding-bottom: 0.3125rem; }
  .modal.form-d .fd-seguidores { margin-top: 0.5rem; padding-top: 0.625rem; }
}

@media (max-width: 600px) {
  #modalOverlay .modal.form-d { max-width: 100%; height: calc(100dvh - 1rem); max-height: calc(100dvh - 1rem); border-radius: 14px; }
  .modal.form-d .modal-header { padding: 0.625rem 0.625rem 0.625rem 1rem; gap: 0.5rem; }
  .modal.form-d .modal-issue-title { font-size: 1.0625rem; }
  .modal.form-d .fd-mais-btn, .modal.form-d #modalClose { min-width: 2.5rem; min-height: 2.5rem; justify-content: center; }
  .modal.form-d .fd-faixa { padding: 0.5rem 1rem; gap: 0.125rem 0.75rem; }
  .modal.form-d .fd-faixa-etapa { flex: 1 1 100%; justify-content: flex-start; }
  .modal.form-d .fd-faixa-prio { display: none; }
  .modal.form-d .fd-faixa-campos { padding: 0.3125rem 0.625rem; }
  .fd-resumo-linha .fd-mini { display: none; }
  .fd-resumo-linha strong { min-width: 0; }
  .modal.form-d .modal-col-right.fd-lateral { padding: 0.25rem 1rem 0.75rem; }
  .modal.form-d .modal-meta.fd-campos { grid-template-columns: minmax(0, 1fr); }
  .modal.form-d .fd-abas { padding: 0 0.5rem; }
  .modal.form-d .fd-aba { font-size: 0.875rem; padding: 0.75rem 0.5rem 0.625rem; }
  .modal.form-d .fd-paineis { padding: 0.875rem 1rem 1rem; }
  .modal.form-d .rich-expandir { display: none; }

  /* comentário em repouso: as decisões grandes ficam na caixa do "aguarda", acima do campo; o Comentar só aparece ao escrever */
  .modal.form-d .fd-rodape { padding: 0.5rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom, 0px)); }
  .modal.form-d .fd-eu { display: none; }
  .fd-rodape:not(.is-aberto) .fd-linha > .fd-enviar { display: none; }
  .fd-rodape:not(.is-aberto) .fd-caixa .rich-content { min-height: 2.75rem; max-height: 2.75rem; padding: 0.6875rem 5.5rem 0.6875rem 0.875rem; clip-path: inset(0 0 0.6875rem 0); }
  .modal.form-d .fd-ico { width: 2.5rem; height: 2.5rem; }
  .modal.form-d .fd-icones { top: 0.125rem; right: 0.125rem; }

  /* comentário aberto: tela cheia, do tamanho do que sobra acima do teclado */
  #modalOverlay .modal.form-d:has(.fd-rodape.is-aberto), #modalOverlay .modal.form-d:has(.fd-mais-menu:not([hidden])) { transform: none; transition: none; }
  .modal.form-d .fd-rodape.is-aberto { position: fixed; z-index: 60; left: 0; right: 0; top: var(--fd-vv-top, 0px); bottom: auto; height: var(--fd-vv-h, 100dvh); display: flex; flex-direction: column; padding: 0; border: 0; background: var(--bg-secondary); }
  .fd-rodape.is-aberto .fd-tela-topo { order: 1; display: flex; align-items: center; gap: 0.375rem; flex: none; min-height: 3.25rem; padding: 0.25rem 9.5rem 0.25rem 0.375rem; border-bottom: 1px solid var(--border-light); }
  .fd-tela-voltar { display: inline-flex; align-items: center; gap: 0.125rem; flex: none; min-height: 2.5rem; padding: 0 0.5rem 0 0.25rem; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
  .fd-tela-tit { min-width: 0; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fd-tela-tit b { color: var(--text-secondary); font-weight: 600; }
  .fd-rodape.is-aberto .fd-aguarda { order: 2; flex: none; margin: 0.5rem 0.75rem 0; font-size: 0.8125rem; }
  .fd-rodape.is-aberto .fd-pede { order: 3; margin: 0.5rem 0.75rem 0; }
  .fd-rodape.is-aberto .fd-linha { order: 4; flex: 1 1 auto; min-height: 0; padding: 0.5rem 0.75rem 0; }
  .fd-rodape.is-aberto .fd-caixa { display: flex; flex-direction: column; min-height: 0; height: 100%; flex-basis: 100%; }
  .modal.form-d .fd-rodape.is-aberto .fd-caixa #commentForm { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .fd-rodape.is-aberto #commentEditor, .fd-rodape.is-aberto .rich-editor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .fd-rodape.is-aberto .rich-content { flex: 1 1 auto; min-height: 6rem; max-height: none; overflow-y: auto; font-size: 1rem; }
  .fd-rodape.is-aberto .rich-toolbar { order: 2; border-top: 1px solid var(--border-light); border-bottom: 0; }
  .fd-rodape.is-aberto .rich-toolbar [data-cmd="formatBlock"], .fd-rodape.is-aberto .rich-toolbar [data-cmd="underline"], .fd-rodape.is-aberto .rich-toolbar [data-cmd="strikeThrough"],
  .fd-rodape.is-aberto .rich-toolbar [data-cmd="unlink"], .fd-rodape.is-aberto .rich-toolbar [data-cmd="emoji"], .fd-rodape.is-aberto .rich-toolbar [data-cmd="removeFormat"] { display: none; }
  .fd-rodape.is-aberto .fd-botoes { order: 5; flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; margin: 0; padding: 0.5rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom, 0px)); }
  .fd-rodape.is-aberto .fd-midia { gap: 0.5rem; }
  .fd-rodape.is-aberto .fd-soltar, .fd-rodape.is-aberto .fd-preparados:not(.tem) { display: none; }
  .fd-rodape.is-aberto .fd-midia .btn { flex: 1; justify-content: center; min-height: 2.5rem; }
  .fd-rodape.is-aberto .fd-enviar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.375rem; width: 100%; margin: 0; }
  .fd-rodape.is-aberto .fd-enviar .fd-sep, .fd-rodape.is-aberto .fd-enviar .cmt-status { display: none; }
  .fd-rodape.is-aberto .fd-enviar .fd-comentar { position: absolute; top: 0.5625rem; right: 0.75rem; max-width: 9rem; min-height: 2.25rem; }
  .fd-rodape.is-aberto .fd-enviar .fd-comentar:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* ⋯: folha embaixo, com o fundo escurecido e Cancelar */
  .fd-mais-menu { position: fixed; z-index: 70; left: 0.5rem; right: 0.5rem; top: auto; bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)); width: auto; padding: 0.5rem; border: 0; background: transparent; box-shadow: none; }
  .fd-mais-menu::before { content: ''; position: fixed; inset: 0; z-index: -2; background: rgba(15, 23, 42, 0.5); }
  .fd-mais-menu::after { content: ''; position: absolute; inset: 0; z-index: -1; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-secondary); box-shadow: var(--shadow-lg); }
  .fd-mais-item { align-items: center; min-height: 3rem; padding: 0.625rem 0.75rem; }
  .fd-mais-item small { display: none; }
  .fd-mais-item strong { font-size: 0.9375rem; }
  .fd-mais-cancelar { display: flex; justify-content: center; width: 100%; min-height: 2.75rem; margin-top: 0.5rem; border: 1px solid var(--border); font-weight: 600; }
}

/* ===== Formulário D (20/10/2026): as decisões da equipe dentro da caixa do "aguarda" =====
   Com o Comentar no meio das decisões a fileira quebrava em duas e confundia ("o botão Comentar numa linha e os demais
   em outra"). Agora: decidir na caixa verde; embaixo do campo só Anexar, Gravar áudio e Comentar. */
.fd-aguarda.fd-aguarda-equipe, .fd-rodape:not(.is-aberto) .fd-aguarda.fd-aguarda-equipe { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; }
.fd-aguarda-cab { display: flex; align-items: flex-start; gap: 0.5rem; flex: 1 1 16rem; min-width: 0; }
.fd-aguarda-cab svg { margin-top: 0.1875rem; }
.fd-aguarda-txt { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.fd-aguarda-equipe .fd-decisoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-left: auto; }
.fd-aguarda-equipe .fd-decisoes .fd-decisao { min-height: 2.25rem; padding: 0.4375rem 0.9375rem; border-radius: var(--radius-sm); font-size: 0.875rem; }
@media (max-width: 600px) {
  /* celular: as decisões grandes, lado a lado e do mesmo tamanho, embaixo do título */
  .fd-aguarda.fd-aguarda-equipe, .fd-rodape:not(.is-aberto) .fd-aguarda.fd-aguarda-equipe { padding: 0.5rem; gap: 0.5rem; font-size: 0.8125rem; }
  .fd-rodape:not(.is-aberto) .fd-aguarda.fd-aguarda-equipe { margin: 0 0 0.5rem; }
  .fd-aguarda-equipe .fd-decisoes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); flex: 1 1 100%; gap: 0.375rem; margin: 0; }
  .fd-aguarda-equipe .fd-decisoes .fd-decisao { min-height: 2.75rem; padding: 0 0.375rem; font-size: 0.8125rem; line-height: 1.2; }
}

/* ===== Formulário D, parte 3 (20/10/2026): o cliente =====
   Pelo tipo de usuário (body.modo-cliente). Uma coluna de até 760 px em qualquer tela, como o modo do cliente de antes:
   a etapa em palavras simples logo abaixo do título, os campos no topo de Detalhes (nome em cima, valor embaixo), a
   tarefa inteira rola com as abas presas no topo e, embaixo, as decisões grandes na caixa do "aguarda", junto do
   comentário, com Gravar áudio, Anexar e Enviar sempre à vista. */
#modalOverlay .modal.form-d.fd-cliente { width: 100%; max-width: min(760px, 100%); height: min(940px, 94vh); max-height: 94vh; }
#modalOverlay .modal.form-d.fd-cliente .modal-body { display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0; }
#modalOverlay .modal.form-d.fd-cliente .modal-col-left.fd-principal { display: contents; }
#modalOverlay .modal.form-d.fd-cliente .modal-col-right.fd-lateral, #modalOverlay .modal.form-d.fd-cliente .fd-faixa { display: none; }
#modalOverlay .modal.form-d.fd-cliente .fd-principal > .sub-aviso, #modalOverlay .modal.form-d.fd-cliente .fd-principal > .vinc-faixa { order: 3; flex: none; }
#modalOverlay .modal.form-d.fd-cliente .fd-abas-wrap { order: 4; position: sticky; top: 0; z-index: 5; background: var(--bg-secondary); }
#modalOverlay .modal.form-d.fd-cliente .fd-paineis { order: 5; flex: 1 0 auto; min-height: 9rem; overflow: visible; padding: 1rem 1.375rem 1.25rem; }
#modalOverlay .modal.form-d.fd-cliente .fd-rodape { order: 6; position: sticky; bottom: 0; z-index: 6; }
.modal.form-d.fd-cliente .fd-aba { font-size: 1rem; padding: 0.875rem 0.625rem 0.75rem; }
/* a etapa em palavras simples, com o nome real menor */
.fd-etapa-cliente { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.625rem; margin-top: 0.5rem; }
.fd-etapa-cliente .status-badge { font-size: 0.8125rem; padding: 0.25rem 0.75rem; border-radius: 999px; white-space: normal; text-align: left; }
.fd-etapa-real { font-size: 0.8125rem; color: var(--text-muted); }
/* campos no topo de Detalhes */
#modalOverlay .modal.form-d.fd-cliente .modal-meta.fd-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.875rem 1.25rem; margin: 0; padding: 0 0 1rem; border-bottom: 1px solid var(--border-light); }
#modalOverlay .modal.form-d.fd-cliente .fd-campos .modal-meta-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-height: 0; margin: 0; padding: 0; }
#modalOverlay .modal.form-d.fd-cliente .fd-campos .modal-meta-item > label { margin: 0; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
#modalOverlay .modal.form-d.fd-cliente .fd-campos .modal-meta-item[data-field="status"] { display: none; }
#modalOverlay .modal.form-d.fd-cliente .fd-campos .modal-meta-item[hidden] { display: none; }
.modal.form-d.fd-cliente .fd-seguidores { margin-top: 1.25rem; }
/* o comentário do cliente */
.fd-cliente .fd-eu, .fd-cliente .fd-icones, .fd-cliente .fd-sep { display: none; }
.fd-cliente .fd-aguarda, .fd-cliente .fd-rodape:not(.is-aberto) .fd-aguarda { display: grid; gap: 0.625rem; margin: 0 0 0.75rem; padding: 0.75rem; border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); border-radius: 12px; font-size: 0.9375rem; }
.fd-aguarda-tit { display: flex; align-items: center; gap: 0.5rem; }
.fd-cliente .fd-aguarda-dica, .fd-cliente .fd-rodape:not(.is-aberto) .fd-aguarda-dica { display: block; font-size: 0.8125rem; color: var(--text-secondary); }
.fd-decisoes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.5rem; }
.fd-decisoes .fd-decisao { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 0.75rem; border-radius: 10px; font-size: 0.9375rem; font-weight: 700; line-height: 1.2; text-align: center; white-space: normal; }
.fd-decisoes .fd-decisao.pill-success { background: var(--success); border-color: var(--success); color: #fff; }
.fd-decisoes .fd-decisao.pill-success:hover:not(:disabled) { filter: brightness(0.93); }
.fd-decisoes .fd-decisao:not(.pill-success) { background-color: var(--bg-secondary); border-width: 1.5px; border-color: color-mix(in srgb, currentColor 55%, transparent); }
.fd-decisoes .fd-decisao:not(.pill-success):hover:not(:disabled) { background-color: var(--bg-secondary); color: inherit; filter: brightness(0.97); }
.fd-decisoes .fd-decisao:disabled { opacity: 0.55; cursor: not-allowed; }
.fd-cliente .fd-rodape:not(.is-aberto) .fd-botoes { display: flex; }
.fd-cliente .fd-botoes { padding-left: 0; }
.fd-cliente .fd-rodape:not(.is-aberto) .fd-caixa .rich-content { padding-right: 0.875rem; }
.fd-cliente .fd-midia .btn { min-height: 2.75rem; font-size: 0.9375rem; }
.fd-cliente .fd-midia .fd-gravar { background: var(--accent-light); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: color-mix(in srgb, var(--accent) 55%, var(--text-primary)); font-weight: 600; }
.fd-cliente .fd-enviar .fd-comentar { min-height: 2.75rem; padding: 0 1.25rem; font-size: 0.9375rem; }
.fd-cliente .fd-enviar .fd-comentar:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 600px) {
  #modalOverlay .modal.form-d.fd-cliente { max-width: 100%; height: calc(100dvh - 1rem); max-height: calc(100dvh - 1rem); }
  /* o comentário aberto vira tela cheia também para o cliente (a regra de cima o prende embaixo) */
  #modalOverlay .modal.form-d.fd-cliente .fd-rodape.is-aberto { position: fixed; z-index: 60; left: 0; right: 0; top: var(--fd-vv-top, 0px); bottom: auto; height: var(--fd-vv-h, 100dvh); }
  #modalOverlay .modal.form-d.fd-cliente .fd-paineis { padding: 0.875rem 1rem 1rem; }
  .fd-cliente .fd-rodape .fd-aguarda { margin: 0 0 0.5rem; }
  .fd-cliente .fd-rodape.is-aberto .fd-aguarda { margin: 0.5rem 0.75rem 0; }
  /* Gravar áudio, Anexar e Enviar numa linha só */
  .fd-cliente .fd-sufixo { display: none; }
  .fd-cliente .fd-rodape:not(.is-aberto) .fd-botoes { flex-wrap: nowrap; gap: 0.5rem; }
  .fd-cliente .fd-rodape:not(.is-aberto) .fd-midia { flex: 1 1 auto; min-width: 0; gap: 0.5rem; }
  .fd-cliente .fd-rodape:not(.is-aberto) .fd-midia .btn { padding: 0 0.625rem; }
  .fd-cliente .fd-rodape:not(.is-aberto) .fd-enviar { flex: none; margin: 0; }
  .fd-cliente .fd-rodape:not(.is-aberto) .fd-enviar .cmt-status { display: none; }   /* "Rascunho salvo" não cabe na linha */
}


/* 28/10/2026: com a aba Documentação, as abas de visão (Kanban, Indicadores, Tabela, Sprint, Documentação…) não cabem
   no celular e a grade crescia até caber, empurrando a página para o lado. A barra rola por dentro, como a da tarefa. */
@media (max-width: 600px) {
  .view-controls { grid-template-columns: minmax(0, 1fr) !important; }
  .view-tabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tab { flex: 1 0 auto; padding-inline: 0.75rem; }
}

/* Falha ao buscar: fica na tela até resolver */
.falha-carga { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.75rem 1rem; padding: 0.75rem 1rem; border: 1px solid var(--danger); border-radius: 8px; background: var(--danger-bg); color: var(--text-primary); }
.falha-carga-texto { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.falha-carga-texto span { font-size: 0.875rem; color: var(--text-secondary); }

/* Vincular: separa as tarefas dos outros projetos (11/11/2026) */
.vinc-res-grupo { margin: 0; padding: 0.4rem 0.75rem 0.25rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); border-top: 1px solid var(--border-light); }

/* Avisos neste aparelho (push) + instalar como app (25/11/2026) */
.avc-acoes { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.notif-pref-sub.avc-sub .avc-acoes .btn { align-self: auto; }
.avc-aparelhos-t { font-size: 0.6875rem; font-weight: 700; color: var(--text-secondary); margin-top: 0.25rem; }
.avc-aparelho { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.375rem 0; border-top: 1px dashed var(--border-light); font-size: 0.75rem; color: var(--text-primary); }
.avc-aparelho > span { display: flex; flex-direction: column; min-width: 0; }
.avc-aparelho em { font-style: normal; color: var(--accent); font-weight: 600; }
.avc-aparelho small { font-size: 0.6875rem; color: var(--text-muted); }
.avc-faixa { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.875rem; padding: 0.625rem 0.5rem 0.625rem 0.875rem; border: 1px solid var(--border-light); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.avc-faixa-ico { font-size: 1.375rem; line-height: 1; flex: none; }
.avc-faixa-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.avc-faixa-txt b { font-size: 0.875rem; color: var(--text-primary); }
.avc-faixa-txt small { font-size: 0.75rem; color: var(--text-muted); }
.avc-faixa .btn { flex: none; }
.avc-faixa-x { flex: none; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-muted); font-size: 1.25rem; border-radius: 50%; cursor: pointer; }
.avc-faixa-x:hover { background: var(--bg-primary); color: var(--text-primary); }
body.modo-tv-ativo .avc-faixa { display: none; }
.avc-intro { margin: 0 0 0.75rem; color: var(--text-secondary); font-size: 0.875rem; }
.avc-instalar-ja { margin-bottom: 0.75rem; }
.avc-abas { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border-light); margin-bottom: 0.75rem; overflow-x: auto; }
.avc-aba { border: none; background: transparent; padding: 0.5rem 0.75rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.avc-aba.ativa { color: var(--accent); border-bottom-color: var(--accent); }
.avc-conteudo h4 { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-primary); }
.avc-passos ol { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; color: var(--text-primary); line-height: 1.45; }
.avc-nota { margin: 0.75rem 0 0; padding: 0.5rem 0.75rem; background: var(--bg-primary); border-radius: var(--radius-xs); font-size: 0.75rem; color: var(--text-secondary); }
@media (max-width: 560px) {
  .avc-faixa { flex-wrap: wrap; position: relative; padding-right: 2.5rem; }
  .avc-faixa-txt { flex-basis: calc(100% - 2.25rem); }
  .avc-faixa .btn { margin-left: 2.125rem; }
  .avc-faixa-x { position: absolute; top: 0.25rem; right: 0.25rem; }
}
