/* =============================================================================
 * styles.css — Identidade visual do KAIRO
 * -----------------------------------------------------------------------------
 * Tema claro e moderno. Cor primária: violeta-índigo.
 * As cores ficam em "variáveis" (:root) — mude lá para reestilizar tudo.
 * ===========================================================================*/

:root {
  /* Paleta da marca */
  --primary: #5b46e5;
  --primary-dark: #4734c4;
  --primary-soft: #ece9fc;

  /* Neutros */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e7e8ef;
  --text: #1c1e2b;
  --muted: #767a8a;

  /* Status */
  --backlog: #8b90a3;
  --andamento: #2f6df6;
  --concluida: #18a558;
  --atrasada: #e0413e;

  /* Prioridade */
  --pr-baixa: #6b7280;
  --pr-media: #d08700;
  --pr-alta: #e0413e;

  --shadow: 0 1px 3px rgba(20, 22, 40, 0.08), 0 4px 16px rgba(20, 22, 40, 0.05);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2 { margin: 0; }
button { font-family: inherit; cursor: pointer; }

/* ---- Marca / logo ---------------------------------------------------------*/
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 700;
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
.brand-lg .brand-name { font-size: 30px; }
.brand-lg { justify-content: center; }

/* ===========================================================================
   LOGIN
=========================================================================== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #efeafc 0%, var(--bg) 60%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; padding: 34px 30px;
  box-shadow: var(--shadow);
}
.login-sub { text-align: center; color: var(--muted); margin: 4px 0 26px; }
.login-erro { color: var(--atrasada); min-height: 20px; margin: 8px 0 0; font-size: 13.5px; }
.login-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 22px; line-height: 1.6; }

/* ===========================================================================
   CAMPOS / BOTÕES
=========================================================================== */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: #444a5e; margin-bottom: 6px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

input, textarea, select, .input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14.5px; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus, .input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f0f1f6; }
.btn-danger { background: var(--atrasada); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 7px 11px; font-size: 13px; }

.btn-icon {
  background: transparent; border: none; font-size: 15px; padding: 4px 7px;
  border-radius: 7px; color: var(--muted);
}
.btn-icon:hover { background: #f0f1f6; color: var(--text); }
.btn-icon-danger:hover { background: #fdeaea; color: var(--atrasada); }
.btn-icon:disabled { opacity: .3; cursor: not-allowed; }

/* ===========================================================================
   APP / TOPO
=========================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.nav { display: flex; gap: 4px; }
.nav-btn {
  background: transparent; border: none; padding: 8px 14px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.nav-btn:hover { background: #f0f1f6; color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 8px; border-left: 1px solid var(--border); margin-left: 4px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.user-nome { font-size: 13.5px; font-weight: 700; }
.user-papel { font-size: 11.5px; color: var(--muted); }

/* ===========================================================================
   CONTEÚDO
=========================================================================== */
.main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }
/* No board, usa a largura cheia (a tabela tem muitas colunas) */
body.board-mode .main { max-width: 1600px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); margin: 4px 0 22px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card.no-pad { padding: 0; overflow: hidden; }
.card-head { font-weight: 700; font-size: 15px; margin-bottom: 14px; }

/* ---- Toolbar de filtros ---- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: auto; flex: 1; min-width: 160px; }
.toolbar #filter-status, .toolbar #filter-assignee { flex: 0 0 auto; min-width: 180px; }

/* ===========================================================================
   TABELAS
=========================================================================== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfd;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfd; }
.col-acoes { width: 1%; white-space: nowrap; text-align: right; }
.cell-strong { font-weight: 600; }
.link-title { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); text-align: left; }
.link-title:hover { color: var(--primary); text-decoration: underline; }
.muted-sm { color: var(--muted); font-size: 12.5px; }
.prazo-vencido { color: var(--atrasada); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.tag-voce { font-size: 11px; background: var(--primary-soft); color: var(--primary); padding: 1px 7px; border-radius: 20px; font-weight: 700; margin-left: 4px; }

/* ---- Badges ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; line-height: 1.6;
}
.st-backlog   { background: #f0f1f4; color: var(--backlog); }
.st-andamento { background: #e7f0ff; color: var(--andamento); }
.st-concluida { background: #e3f6ec; color: var(--concluida); }
.st-atrasada  { background: #fdeaea; color: var(--atrasada); }
.pr-baixa { background: #f0f1f4; color: var(--pr-baixa); }
.pr-media { background: #fdf3e0; color: var(--pr-media); }
.pr-alta  { background: #fdeaea; color: var(--pr-alta); }
.badge-admin  { background: var(--primary-soft); color: var(--primary); }
.badge-membro { background: #f0f1f4; color: var(--muted); }

/* ===========================================================================
   DASHBOARD
=========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat-valor { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; background: transparent; padding: 0; border-radius: 0; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-total { color: var(--primary); }

.progress-row { display: flex; align-items: center; gap: 14px; }
.progress-bar { flex: 1; height: 12px; background: #eef0f5; border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s; }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Gráfico de barras */
.bars { display: flex; align-items: flex-end; gap: 16px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-valor { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 8px 8px 0 0; min-height: 4px; transition: height .4s; }
.bar.st-backlog   { background: var(--backlog); }
.bar.st-andamento { background: var(--andamento); }
.bar.st-concluida { background: var(--concluida); }
.bar.st-atrasada  { background: var(--atrasada); }
.bar-label { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

/* Por responsável */
.resp-list { display: flex; flex-direction: column; gap: 14px; }
.resp-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.resp-nome { font-weight: 600; }
.resp-num { color: var(--muted); }
.resp-bar { height: 8px; background: #eef0f5; border-radius: 20px; overflow: hidden; }
.resp-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s; }

/* ===========================================================================
   MODAIS
=========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 22, 40, 0.45);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-overlay.open { display: flex; animation: fade .15s ease; }
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(20, 22, 40, 0.25); max-height: 90vh; overflow: auto;
}
.modal-sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; font-weight: 700; }
.modal-x { background: none; border: none; font-size: 24px; color: var(--muted); line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ===========================================================================
   TOASTS
=========================================================================== */
.toast-box { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  padding: 12px 18px; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; transform: translateX(20px); transition: all .3s; max-width: 320px;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { background: var(--concluida); }
.toast-erro { background: var(--atrasada); }
.toast-info { background: var(--text); }

/* ===========================================================================
   ABAS / PÍLULAS / TOGGLE
=========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-num { opacity: .7; font-weight: 700; margin-left: 2px; }

.view-toggle, .toggle-btn { display: inline-flex; }
.view-toggle { background: #eef0f5; border-radius: 10px; padding: 3px; gap: 2px; }
.toggle-btn { background: transparent; border: none; padding: 6px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.toggle-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ===========================================================================
   PROJETOS
=========================================================================== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .1s; }
.proj-card[data-open-proj]:not([data-open-proj=""]) { cursor: pointer; }
.proj-card:hover { border-color: #d6d8e4; }
.proj-card-top { display: flex; align-items: center; gap: 10px; }
.proj-dot { width: 14px; height: 14px; border-radius: 5px; flex: 0 0 auto; }
.proj-card-titles { min-width: 0; }
.proj-card-title { font-weight: 700; font-size: 15.5px; }
.proj-card-code { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.proj-card-desc { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-card-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.proj-card-actions { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.proj-card-actions .btn-sm { margin-right: auto; }

/* ===========================================================================
   BOARD (detalhe do projeto)
=========================================================================== */
.board-back { margin-bottom: 14px; }
.board-header { margin-bottom: 18px; }
.board-head-top { display: flex; align-items: center; gap: 10px; }
.board-dot { width: 18px; height: 18px; border-radius: 6px; }
.board-head-top .page-title { font-size: 24px; }
.board-desc-wrap { margin-top: 8px; position: relative; }
.board-desc { border: 1px dashed var(--border); background: #fcfcfe; border-radius: 10px; font-size: 14px; color: var(--text); resize: vertical; }
.board-desc:focus { border-style: solid; }
.save-status { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-toolbar-right { display: flex; gap: 8px; }

.bulk-bar { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border: 1px solid #d8d3f7; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-count { font-weight: 700; color: var(--primary); font-size: 13.5px; }
.input-sm { width: auto; padding: 6px 10px; font-size: 13px; }

/* ---- Tabela estilo planilha ---- */
.table-sheet td { padding: 5px 8px; }
.table-sheet th { padding: 9px 8px; }
.c-check, .c-grip, .c-done { width: 30px; text-align: center; }
.c-acoes { width: 1%; white-space: nowrap; text-align: right; }
.c-title { min-width: 200px; }
.grip { cursor: grab; color: #c2c5d2; user-select: none; }
.grip:active { cursor: grabbing; }
.cell-input, .cell-select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 13.5px; }
.cell-input:hover, .cell-select:hover { background: #f5f6fa; }
.cell-input:focus, .cell-select:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cell-select.badge { font-weight: 700; border: none; -webkit-appearance: none; appearance: none; padding-right: 8px; }
.done-text { text-decoration: line-through; color: var(--muted); }
.row-sel td { background: var(--primary-soft) !important; }
.mini { font-size: 10.5px; padding: 1px 6px; margin-left: 4px; }

/* ===========================================================================
   KANBAN
=========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kb-col { background: #eef0f5; border-radius: 14px; padding: 10px; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kb-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kb-empty { color: #c2c5d2; text-align: center; padding: 8px; font-size: 13px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; }
.kb-card:active { cursor: grabbing; }
.kb-card-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.kb-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kb-due { font-size: 12px; color: var(--muted); }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; }
.kb-resp { font-size: 12px; color: var(--muted); }

/* ===========================================================================
   DRAWER (painel de detalhe)
=========================================================================== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,22,40,.4); display: none; z-index: 60; }
.drawer-overlay.show, .drawer.open ~ .drawer-overlay { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); box-shadow: -8px 0 40px rgba(20,22,40,.18); transform: translateX(100%); transition: transform .22s ease; z-index: 70; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; }
.drawer-body { padding: 22px; overflow: auto; }
#drawer.open + #drawer-overlay, #drawer-overlay.show { display: block; }
.input-color { height: 42px; padding: 4px; cursor: pointer; }
.check-field { flex-direction: row !important; align-items: center; gap: 8px; }
.check-field input { width: auto; }
.check-field span { margin: 0; }

/* ===========================================================================
   STATUS EXTRAS / FLUXO / ETAPAS  (v2)
=========================================================================== */
.st-revisar  { background: #fdf0e3; color: #c2630a; }
.st-cancelada{ background: #eceef3; color: #6b7280; }
.st-entregue { background: #e0f2fe; color: #0369a1; }
.st-entregar { background: var(--primary-soft); color: var(--primary); }
.st-enviado { background: #e7e9fb; color: #4338ca; }
.st-cancelado { background: #fde2e2; color: #c0271d; }

/* Datas das ações (abaixo da coluna correspondente) */
.cell-date { font-size: 10px; color: var(--muted); line-height: 1.4; margin-top: 3px; padding: 0 8px; }
.no-prazo { color: var(--concluida); font-weight: 700; }
.fora-prazo { color: var(--atrasada); font-weight: 700; }
/* Prazo por fase (input pequeno dentro da célula do fluxo) */
/* Prazos alinhados sob as colunas na linha da ETAPA */
.stage-main { vertical-align: middle; }
.stage-prazo-cell { vertical-align: middle; }
.stage-actions-cell { vertical-align: middle; text-align: right; }
.stage-prazo-lbl { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 1px; }
.stage-prazo-input { width: 100%; padding: 4px 6px; font-size: 11px; border-radius: 6px; }
.stage-prazo-ind { font-size: 10px; font-weight: 700; margin-top: 2px; }
.bar.st-revisar { background: #d97916; }
.bar.st-cancelada { background: #9aa1ad; }
.bar.st-entregue { background: #0ea5e9; }

/* Chips de status (resumo no dashboard da etapa) */
.status-chips { display: flex; flex-wrap: wrap; gap: 14px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status-chip strong { color: var(--text); }

/* Modal grande / seções de formulário */
.modal-lg { max-width: 620px; }
.form-section { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Painel de dados do projeto */
.board-info { background: #fafbfd; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; font-size: 13.5px; }
.info-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.info-links { display: flex; flex-direction: column; gap: 2px; }
.info-link { color: var(--primary); font-weight: 600; text-decoration: none; }
.info-link:hover { text-decoration: underline; }
.info-brief { grid-column: 1 / -1; }
.info-text { white-space: pre-wrap; font-size: 13px; max-height: 90px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }

/* Tabela com rolagem horizontal (muitas colunas) */
.table-scroll { overflow-x: auto; }
.table-sheet { min-width: 1360px; }
.c-status { width: 130px; }
.c-resp { width: 160px; }
.c-hours { width: 76px; }
.c-flow { width: 156px; }
.c-pct { width: 104px; }
.c-acoes { width: 104px; }

/* Linha de etapa (título de seção dentro da tabela) */
.stage-row td { background: #f1f0fb; padding: 10px 12px; border-top: 2px solid #e2def7; }
.stage-name { font-weight: 800; font-size: 14px; }
.stage-nc { font-size: 11.5px; color: var(--muted); margin-left: 8px; font-weight: 600; }
.stage-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.stage-actions .btn-icon { font-size: 12.5px; font-weight: 600; }
.stage-empty .empty-sm { text-align: center; color: #b7bac6; font-size: 12.5px; padding: 8px; }

/* Rodapé da etapa: adicionar tarefa direto na tabela */
.add-task-row td { padding: 0; }
.add-task-btn { width: 100%; text-align: left; background: transparent; border: none; padding: 8px 14px; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 0; }
.add-task-btn:hover { background: var(--primary-soft); color: var(--primary); }

/* Kanban: nome da etapa no cartão e título da coluna */
.kb-col-title { font-weight: 700; font-size: 13.5px; }
.kb-card-stage { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }

/* Dashboard da etapa: linha de total */
.dash-total td { font-weight: 700; background: #fafbfd; border-top: 2px solid var(--border); }

/* ===========================================================================
   ABAS / PÍLULAS / TOGGLE
=========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-num { opacity: .7; font-weight: 700; margin-left: 2px; }

.view-toggle { background: #eef0f5; border-radius: 10px; padding: 3px; gap: 2px; display: inline-flex; }
.toggle-btn { background: transparent; border: none; padding: 6px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.toggle-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ===========================================================================
   PROJETOS
=========================================================================== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.proj-card[data-open-proj] { cursor: pointer; }
.proj-card:hover { border-color: #d6d8e4; }
.proj-card-top { display: flex; align-items: center; gap: 10px; }
.proj-dot { width: 14px; height: 14px; border-radius: 5px; flex: 0 0 auto; }
.proj-card-titles { min-width: 0; }
.proj-card-title { font-weight: 700; font-size: 15.5px; }
.proj-card-code { font-size: 12px; color: var(--muted); font-weight: 600; }
.proj-card-desc { font-size: 12.5px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-card-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.proj-card-actions { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.proj-card-actions .btn-sm { margin-right: auto; }

/* ===========================================================================
   BOARD
=========================================================================== */
.board-back { margin-bottom: 14px; }
.board-header { margin-bottom: 18px; }
.board-head-top { display: flex; align-items: center; gap: 10px; }
.board-dot { width: 18px; height: 18px; border-radius: 6px; }
.board-head-top .page-title { font-size: 24px; }
.board-desc-wrap { margin-top: 8px; }
.board-desc { border: 1px dashed var(--border); background: #fcfcfe; border-radius: 10px; font-size: 14px; color: var(--text); resize: vertical; }
.board-desc:focus { border-style: solid; }
.save-status { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-toolbar-right { display: flex; gap: 8px; }

.bulk-bar { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border: 1px solid #d8d3f7; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-count { font-weight: 700; color: var(--primary); font-size: 13.5px; }
.input-sm { width: auto; padding: 6px 10px; font-size: 13px; }

/* Tabela estilo planilha */
.table-sheet td { padding: 5px 8px; }
.table-sheet th { padding: 9px 8px; }
.c-check, .c-grip { width: 30px; text-align: center; }
.c-acoes { white-space: nowrap; text-align: right; }
.c-title { width: 260px; }
.table-sheet th { white-space: nowrap; }
.grip { cursor: grab; color: #c2c5d2; user-select: none; }
.cell-input, .cell-select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 13.5px; }
.cell-input:hover, .cell-select:hover { background: #f5f6fa; }
.cell-input:focus, .cell-select:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cell-select:disabled { opacity: .45; cursor: not-allowed; }
.row-sel td { background: var(--primary-soft) !important; }
.mini { font-size: 10.5px; padding: 1px 6px; margin-left: 4px; }

/* ===========================================================================
   KANBAN
=========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kb-col { background: #eef0f5; border-radius: 14px; padding: 10px; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kb-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kb-empty { color: #c2c5d2; text-align: center; padding: 8px; font-size: 13px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; }
.kb-card-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; }

/* ===========================================================================
   DRAWER
=========================================================================== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,22,40,.4); display: none; z-index: 60; }
.drawer-overlay.show { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); box-shadow: -8px 0 40px rgba(20,22,40,.18); transform: translateX(100%); transition: transform .22s ease; z-index: 70; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; }
.drawer-body { padding: 22px; overflow: auto; }
.input-color { height: 42px; padding: 4px; cursor: pointer; }

/* ===========================================================================
   PROGRESSO (%) E CHECKLIST  (v3)
=========================================================================== */
/* Barrinha de % na tabela e nos dashboards */
.pctmini { display: flex; align-items: center; gap: 6px; }
.pctmini-bar { flex: 1; min-width: 46px; height: 6px; background: #eef0f5; border-radius: 20px; overflow: hidden; }
.pctmini-bar span { display: block; height: 100%; background: var(--primary); border-radius: 20px; }
.pctmini-num { font-size: 11.5px; color: var(--muted); font-weight: 700; min-width: 32px; text-align: right; }
.c-pct { width: 100px; }

/* (A coluna "Ações" não é mais fixa — a fixação cobria as colunas Entrega/%.) */

/* Checklist no drawer */
.cl-progress { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.cl-list { display: flex; flex-direction: column; gap: 4px; }
.cl-item { display: flex; align-items: center; gap: 8px; }
.cl-item input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.cl-text { flex: 1; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 8px; font-size: 13.5px; }
.cl-text:hover { background: #f5f6fa; }
.cl-text:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cl-done { text-decoration: line-through; color: var(--muted); }
.cl-add { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cl-add input[type="text"] { flex: 1; min-width: 140px; }
.cl-paste { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

/* Listas de modelos (etapa) */
.tpl-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; max-height: 320px; overflow: auto; }
.tpl-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fafbfd; }
.tpl-row-name { font-weight: 600; flex: 1; }
.tpl-row-actions { display: inline-flex; gap: 4px; }
.field-label-span { display: block; font-size: 13px; font-weight: 600; color: #444a5e; margin: 6px 0; }

/* ===========================================================================
   RESPONSIVO
=========================================================================== */
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .topbar { gap: 12px; }
  .user-meta { display: none; }
  .field-row { flex-direction: column; gap: 0; }
}
