/* ===== 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="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-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-due.due-soon {
  color: var(--warning);
  background: var(--warning-bg);
}

.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; }
.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; }

/* Tooltips customizados na toolbar do editor — aparecem no hover imediato */
.rich-toolbar button[title], .rich-toolbar select[title] { position: relative; }
.rich-toolbar button[title]:hover::after, .rich-toolbar select[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f1f5f9;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.rich-toolbar button[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #0f172a;
  pointer-events: none;
  z-index: 20;
}

/* 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. */
.modal:has(#editPanel:not([style*="display: none"]):not([style*="display:none"])) .modal-body {
  display: none;
}
/* Fallback via classe — adicionado por JS quando ::has nao for suportado */
.modal.editing .modal-body { display: none; }
.modal.editing::after { display: none; } /* gradient de scroll some quando edita, pois nao ha modal-body */
.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-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 1rem; min-height: 52px; border-radius: 12px;
}

/* --- 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; }

/* 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;
  }
}
