:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2d3a4f;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #4f8cff;
  --accent-hover: #3a7aef;
  --p0: #ef4444;
  --p1: #f59e0b;
  --p2: #6b7280;
  --todo: #64748b;
  --in-progress: #3b82f6;
  --testing: #a855f7;
  --bug-fix: #f97316;
  --blocked: #ef4444;
  --done: #22c55e;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --header-h: 64px;
  --sidebar-w: 220px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 80;
}

.sidebar__header {
  padding: 1rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.sidebar__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar__hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  opacity: 0.85;
}

.sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar__empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.75rem;
  line-height: 1.4;
}

.project-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.project-item:hover {
  background: rgba(79, 140, 255, 0.08);
  border-color: rgba(79, 140, 255, 0.25);
}

.project-item--active {
  background: rgba(79, 140, 255, 0.15);
  border-color: var(--accent);
}

.project-item__name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-item__meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 156, 179, 0.45) var(--bg);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgba(139, 156, 179, 0.35);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 156, 179, 0.6);
}

.scroll-area {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 156, 179, 0.45) transparent;
}

.scroll-area::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll-area::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: rgba(139, 156, 179, 0.35);
  border-radius: 999px;
  border: 2px solid var(--surface-2);
}

.scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 156, 179, 0.6);
}

.hidden {
  display: none !important;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
}

.header__brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.header__subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  min-width: 220px;
  font-size: 0.9rem;
}

.search-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--border);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.import-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

/* Filters */
.filters {
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 60;
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
  flex: 1 1 150px;
  max-width: 200px;
}

.filter-group__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  min-height: 36px;
  transition: border-color 0.15s, color 0.15s;
}

.filter-dropdown__trigger:hover,
.filter-dropdown--open .filter-dropdown__trigger {
  border-color: var(--accent);
}

.filter-dropdown__trigger:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-dropdown__trigger--active {
  color: var(--text);
  border-color: rgba(79, 140, 255, 0.55);
}

.filter-dropdown__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-dropdown__chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.filter-dropdown--open .filter-dropdown__chevron {
  transform: rotate(180deg);
}

.filter-dropdown__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.35rem;
}

.filter-dropdown__options {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.filter-dropdown__option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
}

.filter-dropdown__option:hover {
  background: rgba(79, 140, 255, 0.1);
}

.filter-dropdown__option input {
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.filter-dropdown__empty {
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.filter-toggle--active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
}

/* Milestones panel */
.milestones-panel {
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.milestones-panel__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.milestones-panel__chevron {
  transition: transform 0.2s;
}

.milestones-panel.collapsed .milestones-panel__chevron {
  transform: rotate(-90deg);
}

.milestones-panel.collapsed .milestones-panel__content {
  display: none;
}

/* Deliveries panel */
.deliveries-panel {
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.deliveries-panel__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.deliveries-panel__chevron {
  transition: transform 0.2s;
}

.deliveries-panel.collapsed .deliveries-panel__chevron {
  transform: rotate(-90deg);
}

.deliveries-panel.collapsed .deliveries-panel__content {
  display: none;
}

.deliveries-panel__content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.delivery-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.delivery-card:hover,
.delivery-card.active {
  border-color: var(--accent);
}

.delivery-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.delivery-card__title {
  font-size: 0.9rem;
  font-weight: 700;
}

.delivery-card__stats {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.delivery-card__focus {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.delivery-card__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.delivery-card__bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.delivery-card__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

.delivery-banner {
  padding: 0.65rem 1.5rem;
  background: rgba(79, 140, 255, 0.1);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.delivery-banner__focus {
  color: var(--text-muted);
}

.chip--delivery {
  background: rgba(79, 140, 255, 0.2);
  color: #93c5fd;
  font-weight: 600;
}

.milestones-panel__content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.milestone-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.milestone-card:hover,
.milestone-card.active {
  border-color: var(--accent);
}

.milestone-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.milestone-card__stats {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.milestone-card__bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.milestone-card__fill {
  height: 100%;
  background: var(--done);
  border-radius: 3px;
  transition: width 0.3s;
}

/* Board */
.board {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem 2rem;
  overflow-x: auto;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-h) - 200px);
}

.column {
  flex: 0 0 260px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
}

.column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

.column__header h2 {
  font-size: 0.9rem;
  font-weight: 600;
}

.column__count {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.column__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 120px;
}

.column[data-status="todo"] .column__header { border-top: 3px solid var(--todo); }
.column[data-status="in_progress"] .column__header { border-top: 3px solid var(--in-progress); }
.column[data-status="testing"] .column__header { border-top: 3px solid var(--testing); }
.column[data-status="bug_fix"] .column__header { border-top: 3px solid var(--bug-fix); }
.column[data-status="done"] .column__header { border-top: 3px solid var(--done); }

.task-card__preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Task cards */
.task-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.task-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.task-card:active {
  cursor: grabbing;
}

.task-card.sortable-ghost {
  opacity: 0.4;
}

.task-card.sortable-drag {
  box-shadow: var(--shadow);
}

.task-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.chip {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
}

.chip--milestone {
  background: rgba(79, 140, 255, 0.15);
  color: var(--accent);
}

.chip--category {
  background: rgba(139, 156, 179, 0.15);
}

.chip--epic {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.priority-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: white;
}

.priority-badge--P0 { background: var(--p0); }
.priority-badge--P1 { background: var(--p1); color: #1a1a1a; }
.priority-badge--P2 { background: var(--p2); }

.task-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.task-card__hours {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.empty-column {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1.5rem 0.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 {
  font-size: 1.1rem;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal__close:hover {
  color: var(--text);
}

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent);
}

.form-group .readonly {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  color: var(--text-muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.task-description {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.task-description__section + .task-description__section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(45, 58, 79, 0.65);
}

.task-description__heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.task-description__body {
  color: var(--text-muted);
  white-space: pre-wrap;
}

/* Task dependencies */
.task-deps__group + .task-deps__group {
  margin-top: 0.65rem;
}

.task-deps__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.task-readiness {
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: calc(var(--radius) - 2px);
  line-height: 1.4;
}

.task-readiness--ready {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.task-readiness--blocked {
  background: rgba(249, 115, 22, 0.1);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.task-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.task-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.task-link:hover {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.08);
}

.task-link__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-link__status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.task-link--done .task-link__status {
  color: #86efac;
}

.task-link--in_progress .task-link__status,
.task-link--testing .task-link__status {
  color: #93c5fd;
}

.task-link--bug_fix .task-link__status {
  color: #fdba74;
}

.chip--deps {
  font-size: 0.65rem;
  font-weight: 700;
}

.chip--starter {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.chip--ready {
  background: rgba(79, 140, 255, 0.18);
  color: #93c5fd;
}

.chip--waiting {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
}

.task-card--blocked {
  border-color: rgba(249, 115, 22, 0.35);
}

.task-card--starter {
  border-color: rgba(34, 197, 94, 0.25);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow);
  z-index: 300;
  font-size: 0.875rem;
  transition: opacity 0.3s;
}

.toast.error {
  border-color: var(--p0);
  color: #fca5a5;
}

.toast.success {
  border-color: var(--done);
  color: #86efac;
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar__list {
    max-height: 160px;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .project-item {
    flex: 0 0 auto;
    min-width: 140px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .header__actions {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }

  .column {
    flex: 0 0 280px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== BEGIN: geracao_com_ia ===== */
.modal--ai {
  max-width: 560px;
}

.ai-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.ai-status--error {
  color: #f7768e;
}

.ai-status__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}
/* ===== END: geracao_com_ia ===== */

/* ===== BEGIN: estado_vazio ===== */
.board-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  flex: 1;
}

.board-empty__card {
  text-align: center;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.board-empty__icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.board-empty__card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.board-empty__card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.board-empty__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.sidebar__cta {
  width: 100%;
  margin-top: 0.75rem;
}
/* ===== END: estado_vazio ===== */

/* ===== BEGIN: crud (form de edição) ===== */
.btn--danger {
  background: #7f1d2e;
  color: #ffd9df;
  border: 1px solid #a13a4c;
}
.btn--danger:hover {
  background: #9b2740;
}

.modal__footer {
  justify-content: space-between;
}
.modal__footer .btn--danger {
  margin-right: auto; /* Excluir fica à esquerda */
}

.readonly--multiline {
  white-space: pre-wrap;
}

.dep-picker__search {
  margin-bottom: 0.4rem;
}

.dep-picker {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dep-picker__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
}
.dep-picker__item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.dep-picker__item input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}
/* ===== END: crud (form de edição) ===== */

/* ===== BEGIN: progresso ===== */
.progress-summary {
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.progress-summary__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.progress-summary__bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-summary__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* barra de progresso por projeto na sidebar */
.project-item__bar {
  display: block;
  height: 3px;
  margin-top: 0.4rem;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.project-item__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
/* ===== END: progresso ===== */

/* ===== BEGIN: auth (login, user chip, novo projeto) ===== */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card__title { margin: 0 0 4px; font-size: 22px; }
.login-card__subtitle { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.login-field input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}
.login-field input:focus { outline: none; border-color: var(--accent); }
.login-submit { margin-top: 6px; padding: 11px; font-size: 15px; }
.login-error {
  margin: 4px 0 0;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.user-chip__logout { padding: 4px 8px; }

.sidebar__new { width: 100%; margin-top: 8px; font-size: 13px; padding: 7px; }
/* ===== END: auth ===== */

/* ===== BEGIN: gestão de usuários (só admin) ===== */
.user-form { margin-bottom: 20px; }
.user-form__title { font-size: 14px; color: var(--text-muted); margin: 0 0 10px; }
.user-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.user-form__grid input,
.user-form__grid select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font-size: 14px;
}
.user-form__grid input:focus,
.user-form__grid select:focus { outline: none; border-color: var(--accent); }
.user-form__msg {
  margin: 10px 0 0;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-list__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.user-list__info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-list__name { color: var(--text); font-size: 14px; }
.user-list__login { color: var(--text-muted); font-size: 12px; }
.user-list__role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}
.user-list__role--admin { color: var(--accent); border-color: var(--accent); }
.user-list__del { padding: 5px 10px; font-size: 13px; }
.user-list__del:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 560px) { .user-form__grid { grid-template-columns: 1fr; } }
/* ===== END: gestão de usuários ===== */
