/* =====================================================
   QUADRO DE PROJECTOS — kanban.css
   MetrificAI © 2026
   Branding: #0551b5 (primary) · #1A1A1A (dark) · #e8d25a (accent)
   Font: Montserrat
===================================================== */

:root {
  --primary:       #0551b5;
  --primary-light: #dbe8ff;
  --dark:          #1A1A1A;
  --accent:        #e8d25a;
  --bg:            #f0f2f6;
  --col-bg:        #e8ebf0;
  --card-bg:       #ffffff;
  --border:        rgba(0,0,0,0.07);
  --text:          #1A1A1A;
  --muted:         #7a8499;
  --radius-col:    14px;
  --radius-card:   10px;
  --shadow-card:   0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover:  0 6px 24px rgba(5,81,181,0.12), 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── Header ────────────────────────────────────────── */
.kanban-header {
  background: var(--dark);
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.kanban-header .logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.kanban-header .logo img {
  height: 30px;
}

.kanban-header .header-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.kanban-header .header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.kanban-header .header-title i {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.kanban-header .spacer { flex: 1; }

.kanban-header .filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  white-space: nowrap;
}

.kanban-header select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: 0.15s;
}

.kanban-header select:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.25);
}

.kanban-header select option { background: #222; }

.btn-fechar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

.btn-fechar:hover {
  background: rgba(255,255,255,0.13);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}

.btn-fechar i { width: 13px; height: 13px; }

/* ── Subheader com estatísticas ────────────────────── */
.kanban-subheader {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat-pill strong {
  color: var(--text);
  font-weight: 800;
  font-size: 15px;
}

.stat-pill i { width: 15px; height: 15px; color: var(--primary); }

.stat-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

/* ── Board ─────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 14px;
  padding: 16px 16px 60px;
  overflow-x: auto;
  min-height: calc(100vh - 100px);
  align-items: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }

/* ── Coluna ────────────────────────────────────────── */
.kanban-col {
  flex: 1 1 272px;
  min-width: 220px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  border-radius: var(--radius-col);
  background: var(--col-bg);
  border: 1px solid rgba(0,0,0,0.05);
}

.col-header {
  padding: 14px 14px 10px;
  border-radius: var(--radius-col) var(--radius-col) 0 0;
  background: var(--col-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.col-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

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

.col-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #444;
  flex: 1;
}

.col-count {
  background: rgba(0,0,0,0.09);
  color: #555;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  min-width: 22px;
  text-align: center;
}

.col-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  padding-left: 16px;
  letter-spacing: -0.3px;
}

/* ── Corpo da coluna ───────────────────────────────── */
.col-body {
  padding: 10px 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.col-body::-webkit-scrollbar { width: 4px; }
.col-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }

/* ── Empty state ───────────────────────────────────── */
.col-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 12px;
  color: #bbb;
  gap: 8px;
  border: 1.5px dashed rgba(0,0,0,0.1);
  border-radius: 8px;
  margin: 4px;
}

.col-empty i { width: 26px; height: 26px; opacity: 0.4; }
.col-empty span { font-size: 11px; font-weight: 500; }

/* ── Card ──────────────────────────────────────────── */
.kanban-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-card);
  cursor: grab;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  border: 1.5px solid transparent;
  position: relative;
  user-select: none;
}

.kanban-card::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background 0.18s;
}

.kanban-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: rgba(5,81,181,0.12);
}

.kanban-card:hover::before { background: var(--primary); }

/* Alertas */
.kanban-card.alerta-laranja::before { background: #f59e0b; }
.kanban-card.alerta-vermelho::before { background: #ef4444; }

/* Drag states */
.kanban-card.sortable-chosen {
  cursor: grabbing;
  box-shadow: 0 12px 32px rgba(5,81,181,0.2), 0 4px 12px rgba(0,0,0,0.12);
  transform: rotate(1deg) scale(1.02);
  border-color: var(--primary);
  z-index: 999;
}

.kanban-card.sortable-ghost {
  opacity: 0.3;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Card interior ─────────────────────────────────── */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.card-ref {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.card-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.card-cliente {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-valor {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
  margin-bottom: 10px;
  line-height: 1.1;
}

/* ── Meta info ─────────────────────────────────────── */
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

.card-meta-row i { width: 11px; height: 11px; flex-shrink: 0; }

/* ── Badge dias ────────────────────────────────────── */
.card-dias {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 10px;
  background: #f3f4f6;
  color: #888;
}

.card-dias i { width: 10px; height: 10px; }
.card-dias.laranja { background: #fff7ed; color: #d97706; }
.card-dias.vermelho { background: #fef2f2; color: #dc2626; }

/* ── Acções ────────────────────────────────────────── */
.card-actions {
  display: flex;
  gap: 5px;
}

.card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  border: 1px solid #e8eaf0;
  background: #f8f9fc;
  color: #555;
  border-radius: 6px;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.card-btn:hover {
  background: var(--primary-light);
  border-color: rgba(5,81,181,0.2);
  color: var(--primary);
}

.card-btn.danger:hover {
  background: #fff0f0;
  border-color: #ffc5c5;
  color: #dc2626;
}

.card-btn i { width: 11px; height: 11px; }

/* ── Loading ───────────────────────────────────────── */
.kanban-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 100px);
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* ── Spinner ───────────────────────────────────────── */
.k-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(5,81,181,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: kspin 0.7s linear infinite;
}

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

/* ── Modal PDFs ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,20,0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-pdfs {
  background: #fff;
  border-radius: 14px;
  width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-pdfs-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-pdfs-header i { width: 18px; height: 18px; color: var(--primary); }

.modal-pdfs-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.modal-pdfs-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  transition: color 0.12s;
}

.modal-pdfs-close:hover { color: #333; }

.modal-pdfs-body {
  overflow-y: auto;
  padding: 8px 22px 22px;
  flex: 1;
}

.pdf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}

.pdf-item:last-child { border-bottom: none; }

.pdf-item-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdf-item-icon i { width: 16px; height: 16px; color: var(--primary); }

.pdf-item-info { flex: 1; }

.pdf-item-valor {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.pdf-item-data {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.pdf-item-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: 0.12s;
  flex-shrink: 0;
}

.pdf-item-btn:hover { background: #0440a0; }
.pdf-item-btn i { width: 12px; height: 12px; }

.pdf-empty {
  text-align: center;
  padding: 40px;
  color: #bbb;
  font-size: 12px;
}

/* ── Confirm ───────────────────────────────────────── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,20,0.55);
  backdrop-filter: blur(4px);
  z-index: 600;
  align-items: center;
  justify-content: center;
}

.confirm-overlay.show { display: flex; }

.confirm-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 360px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  text-align: center;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  background: #fef2f2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-icon i { width: 22px; height: 22px; color: #dc2626; }

.confirm-box h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
}

.confirm-box p {
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions { display: flex; gap: 8px; justify-content: center; }

.confirm-actions button {
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: 0.12s;
}

.btn-confirmar { background: #dc2626; color: #fff; }
.btn-confirmar:hover { background: #b91c1c; }
.btn-cancelar { background: #f3f4f6; color: #555; }
.btn-cancelar:hover { background: #e5e7eb; }

/* ── Cores das colunas ─────────────────────────────── */
.col-rascunho  .col-header { border-top: 3px solid #94a3b8; }
.col-enviado   .col-header { border-top: 3px solid #3b82f6; }
.col-negociacao .col-header { border-top: 3px solid #f59e0b; }
.col-adjudicado .col-header { border-top: 3px solid #22c55e; }
.col-rejeitado .col-header { border-top: 3px solid #ef4444; }

/* ── Secção Arquivo ────────────────────────────────── */
.arquivo-secao {
  margin: 0 20px 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.arquivo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  background: #f8f9fc;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.15s;
  user-select: none;
}

.arquivo-header:hover { background: #f0f2f8; }

.arquivo-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #444;
}

.arquivo-header-left i { width: 16px; height: 16px; color: var(--muted); }
.arquivo-chevron { width: 16px; height: 16px; color: var(--muted); }

.arquivo-count {
  background: rgba(0,0,0,0.08);
  color: #666;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 8px;
}

.arquivo-body { padding: 0; }

.arquivo-empty {
  padding: 28px;
  text-align: center;
  font-size: 12px;
  color: #bbb;
}

/* ── Tabela arquivo ────────────────────────────────── */
.arquivo-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.arquivo-tabela thead tr {
  background: #fafbfc;
  border-bottom: 1px solid #f0f0f0;
}

.arquivo-tabela th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaa;
}

.arquivo-tabela tbody tr {
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
}

.arquivo-tabela tbody tr:last-child { border-bottom: none; }
.arquivo-tabela tbody tr:hover { background: #fafbff; }

.arquivo-tabela td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.arquivo-ref {
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
}

.arquivo-muted { color: var(--muted); font-size: 11px; }

.arquivo-btn-reactivar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f4ff;
  border: 1px solid rgba(5,81,181,0.2);
  color: var(--primary);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: 0.12s;
  white-space: nowrap;
}

.arquivo-btn-reactivar:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.arquivo-btn-reactivar i { width: 11px; height: 11px; }

.arquivo-btn-apagar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff0f0;
  border: 1px solid #ffc5c5;
  color: #dc2626;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: 0.12s;
}

.arquivo-btn-apagar:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.arquivo-btn-apagar i { width: 12px; height: 12px; }

/* ── Cor da coluna Em Execução ─────────────────────── */
.col-execucao .col-header { border-top: 3px solid #8b5cf6; }