/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #edf0f7; color: #111827; min-height: 100vh; }
a { cursor: pointer; text-decoration: none; color: inherit; }

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --primary: #1a56db;
  --primary-dark: #1340a8;
  --primary-light: #dbeafe;
  --success: #0d9488;
  --danger: #dc2626;
  --warning: #d97706;
  --text: #111827;
  --text-muted: #4b5563;
  --border: #c7cdd8;
  --surface: #ffffff;
  --sidebar-w: 240px;
  --radius: 8px;
}

/* ── Temas por horário ─────────────────────────────────────────────────── */
body.theme-madrugada .sidebar { background: linear-gradient(170deg,#07091a 0%,#111827 100%); }
body.theme-manha     .sidebar { background: linear-gradient(170deg,#1e3358 0%,#1d4ed8 100%); }
body.theme-almoco    .sidebar { background: linear-gradient(170deg,#7c2d12 0%,#b45309 100%); }
body.theme-tarde     .sidebar { background: linear-gradient(170deg,#3b1e6e 0%,#4c1d95 100%); }
body.theme-noite     .sidebar { background: linear-gradient(170deg,#0a1020 0%,#134e4a 100%); }

body.theme-manha     { background: #e0f2fe; }
body.theme-almoco    { background: #fff3e0; }
body.theme-tarde     { background: #ede9fe; }
body.theme-madrugada { background: #0e1117; }
body.theme-noite     { background: #ecf5ec; }

/* Modo escuro madrugada */
body.theme-madrugada .main-content     { background: #0e1117; }
body.theme-madrugada .card,
body.theme-madrugada .stat-card        { background: #161b25; border-color: #2a3650; color: #d1d5db; }
body.theme-madrugada .table-wrap       { background: #161b25; border-color: #2a3650; }
body.theme-madrugada th                { background: #0e1117; color: #9ca3af; border-color: #2a3650; }
body.theme-madrugada td                { border-color: #2a3650; color: #d1d5db; }
body.theme-madrugada tr:hover td       { background: #1e2a40 !important; }
body.theme-madrugada .page-header      { background: #0e1117; border-color: #2a3650; }
body.theme-madrugada .search-input,
body.theme-madrugada .filter-select,
body.theme-madrugada select,
body.theme-madrugada input             { background: #161b25; border-color: #2a3650; color: #d1d5db; }
body.theme-madrugada .text-muted       { color: #9ca3af !important; }
body.theme-madrugada .field-group label { color: #d1d5db; }
body.theme-madrugada .btn-ghost        { border-color: #2a3650; color: #9ca3af; }
body.theme-madrugada .btn-ghost:hover  { background: #1e2a40; color: #d1d5db; }

/* ── Tema por prazo — LINHA INTEIRA COLORIDA ─────────────────────────────── */
tr.row-vencida td                 { background: #fecaca !important; color: #450a0a; }
tr.row-vencida td:first-child     { border-left: 6px solid #b91c1c; }
tr.row-vencida:hover td           { background: #f87171 !important; color: #450a0a; }

tr.row-hoje td                    { background: #fed7aa !important; color: #431407; }
tr.row-hoje td:first-child        { border-left: 6px solid #c2410c; }
tr.row-hoje:hover td              { background: #fb923c !important; color: #431407; }

tr.row-urgente td                 { background: #fde68a !important; color: #3b1a08; }
tr.row-urgente td:first-child     { border-left: 6px solid #b45309; }
tr.row-urgente:hover td           { background: #fbbf24 !important; color: #3b1a08; }

tr.row-proxima td                 { background: #bfdbfe !important; color: #1e1b4b; }
tr.row-proxima td:first-child     { border-left: 6px solid #1d4ed8; }
tr.row-proxima:hover td           { background: #93c5fd !important; color: #1e1b4b; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.page-login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #1a56db 0%, #0d9488 100%);
  transition: background 1s ease;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-icon { font-size: 40px; margin-bottom: 8px; }
.login-logo h1 { font-size: 22px; color: var(--text); font-weight: 700; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.login-erro { background: #fef2f2; border: 1px solid #f87171; color: #991b1b; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }

/* ── Layout ────────────────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: #1e293b; color: #e2e8f0;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100; transition: transform .2s;
}
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.view { display: none; padding: 28px 32px; animation: fadeIn .2s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar-header {
  padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-empresa { font-weight: 700; font-size: 15px; flex: 1; }
.btn-empresa-troca {
  background: rgba(255,255,255,.12); border: none; color: #e2e8f0;
  padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 16px;
}
.btn-empresa-troca:hover { background: rgba(255,255,255,.22); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 14px; cursor: pointer;
  color: #94a3b8; border-radius: 0; transition: all .15s;
}
.nav-item:hover, .nav-item.active {
  color: #fff; background: rgba(255,255,255,.12);
}
.nav-item.active { border-left: 3px solid #60a5fa; color: #fff; }
.nav-icon { font-size: 16px; }
.nav-divider { padding: 16px 20px 6px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #64748b; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff;
}
.user-details { flex: 1; overflow: hidden; }
.user-nome { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f1f5f9; }
.user-cargo { font-size: 11px; color: #94a3b8; }
.btn-logout { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 18px; }
.btn-logout:hover { color: #f87171; }

/* ── Empresa selector ──────────────────────────────────────────────────── */
.empresa-btn {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 20px; margin-bottom: 12px;
  background: #f8fafc; border: 2px solid var(--border);
  border-radius: 12px; cursor: pointer; transition: all .15s; text-align: left;
}
.empresa-btn:hover { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 4px 12px rgba(26,86,219,.15); }
.empresa-btn-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.empresa-btn-info h3 { font-size: 16px; font-weight: 700; }
.empresa-btn-info p { font-size: 13px; color: var(--text-muted); }

/* ── Page headers ──────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 22px; font-weight: 800; color: var(--text); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all .15s; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 1px 3px rgba(26,86,219,.4); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 10px rgba(26,86,219,.4); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: #94a3b8; }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); border-color: #64748b; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Cards & Stats ─────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); transition: box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.stat-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.stat-value { font-size: 34px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-card.danger  { border-left: 4px solid var(--danger); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.danger .stat-value  { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.primary .stat-value { color: var(--primary); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: auto; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: #e8ecf4; padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: #374151;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
}
td { padding: 13px 16px; border-bottom: 1px solid #e5e9f0; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f0f4fb; }
tr.clickable { cursor: pointer; }

/* ── Filters / Search ──────────────────────────────────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.search-input {
  flex: 1; min-width: 200px; max-width: 320px;
  padding: 9px 13px; border: 1.5px solid #94a3b8; border-radius: 6px; font-size: 14px;
  background: #fff;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
select.filter-select {
  padding: 9px 13px; border: 1.5px solid #94a3b8; border-radius: 6px; font-size: 14px;
  background: #fff; cursor: pointer;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 100px; font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge-novo                    { background: #bfdbfe; color: #1e40af; }
.badge-em_andamento            { background: #bbf7d0; color: #14532d; }
.badge-aguardando_terceiro, .badge-aguardando_orgao, .badge-aguardando_documentacao,
.badge-aguardando_informacao, .badge-aguardando_aprovacao { background: #fde68a; color: #78350f; }
.badge-em_analise              { background: #e9d5ff; color: #4c1d95; }
.badge-concluido, .badge-concluida { background: #bbf7d0; color: #14532d; }
.badge-cancelado, .badge-cancelada { background: #e5e7eb; color: #374151; }
.badge-arquivado               { background: #e5e7eb; color: #6b7280; }
.badge-delegada                { background: #bfdbfe; color: #1e3a8a; }
.badge-vencida                 { background: #fecaca; color: #7f1d1d; }
.badge-nova                    { background: #d1fae5; color: #064e3b; }

.badge-prioridade-baixa    { background: #e5e7eb; color: #374151; }
.badge-prioridade-normal   { background: #bfdbfe; color: #1e40af; }
.badge-prioridade-alta     { background: #fde68a; color: #78350f; }
.badge-prioridade-urgente  { background: #fed7aa; color: #7c2d12; }
.badge-prioridade-critica  { background: #fecaca; color: #7f1d1d; font-weight: 800; }

/* ── Cards de processo/atividade ───────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
  transition: all .15s; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); border-color: #93c5fd; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card-title { font-weight: 700; font-size: 15px; color: var(--text); }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.card-meta-item { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; font-weight: 500; }

/* ── Fields & Forms ────────────────────────────────────────────────────── */
.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.field-group input, .field-group select, .field-group textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid #94a3b8;
  border-radius: 6px; font-size: 14px; font-family: inherit;
  background: #fff; transition: border-color .15s;
}
.field-group input:focus, .field-group select:focus, .field-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.field-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-section-title { font-size: 13px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .5px; margin: 20px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center; z-index: 999; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 640px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.modal.modal-lg { max-width: 900px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 2px solid var(--border);
  background: #f8fafc; border-radius: 12px 12px 0 0;
}
.modal-header h2 { font-size: 17px; font-weight: 800; color: var(--text); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px 8px; border-radius: 4px; }
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 2px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #f8fafc; border-radius: 0 0 12px 12px; }

/* ── Detail sections ───────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.detail-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.detail-item:nth-child(odd) { border-right: 1px solid var(--border); }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 4px; font-weight: 700; }
.detail-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Checklist ─────────────────────────────────────────────────────────── */
.checklist-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid #e5e9f0;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary); }
.checklist-item label { flex: 1; font-size: 14px; cursor: pointer; font-weight: 500; }
.checklist-item.done label { text-decoration: line-through; color: var(--text-muted); }

/* ── Comments ──────────────────────────────────────────────────────────── */
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e9f0; }
.comment-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.comment-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.comment-input { display: flex; gap: 8px; margin-top: 12px; }
.comment-input textarea { flex: 1; padding: 8px 12px; border: 1.5px solid #94a3b8; border-radius: 6px; font-size: 14px; font-family: inherit; resize: none; min-height: 60px; }

/* ── History ───────────────────────────────────────────────────────────── */
.historico-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e5e9f0; font-size: 13px; }
.historico-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; font-weight: 700; }
.historico-desc { flex: 1; font-weight: 500; }
.historico-time { color: var(--text-muted); font-size: 11px; font-weight: 600; }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 0; }
.tab { padding: 10px 20px; font-size: 14px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress-bar { height: 7px; background: #d1d5db; border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 100px; transition: width .3s; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; font-weight: 500; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 13px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.2); animation: slideUp .2s ease;
  max-width: 340px;
}
.toast-success { background: #14532d; color: #fff; border-left: 4px solid #22c55e; }
.toast-error   { background: #7f1d1d; color: #fff; border-left: 4px solid #ef4444; }
.toast-info    { background: #1e3a8a; color: #fff; border-left: 4px solid #60a5fa; }
.toast-warning { background: #78350f; color: #fff; border-left: 4px solid #f59e0b; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid #d1d5db; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 60px; }

/* ── CRM Board ─────────────────────────────────────────────────────────── */
#view-crm { padding: 24px 28px; overflow: hidden; }
.crm-board {
  display: flex; gap: 14px; overflow-x: auto;
  padding-bottom: 24px; min-height: calc(100vh - 160px);
  align-items: flex-start;
}
.crm-board::-webkit-scrollbar { height: 8px; }
.crm-board::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.crm-board::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

.crm-col {
  flex: 0 0 290px; background: #f1f5f9; border-radius: 12px;
  display: flex; flex-direction: column; max-height: calc(100vh - 160px);
  border: 2px solid transparent; transition: border-color .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.crm-col.drag-over { border-color: var(--primary); background: #eff6ff; }

.crm-col-header {
  padding: 14px 16px; border-radius: 10px 10px 0 0;
  display: flex; align-items: center; gap: 10px; color: #fff;
  flex-shrink: 0;
}
.crm-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.crm-col-name  { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-col-cargo { font-size: 11px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-col-badge {
  background: rgba(255,255,255,.3); min-width: 26px; height: 26px;
  border-radius: 100px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.crm-col-body {
  flex: 1; overflow-y: auto; padding: 10px;
}
.crm-col-body::-webkit-scrollbar { width: 4px; }
.crm-col-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.crm-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 32px 0; }

.crm-proc-group { margin-bottom: 10px; background: #fff; border-radius: 8px; border: 1px solid #dde3ed; overflow: hidden; }
.crm-proc-header {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: #f8fafc; border-bottom: 1px solid #dde3ed;
}
.crm-proc-icon { font-size: 13px; flex-shrink: 0; }
.crm-proc-name { font-size: 12px; font-weight: 700; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-proc-code { font-size: 10px; color: #94a3b8; font-family: monospace; letter-spacing: .3px; }
.crm-proc-count {
  background: #e2e8f0; color: #374151; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 100px; flex-shrink: 0;
}

.crm-card {
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9;
  cursor: grab; transition: background .1s; user-select: none;
}
.crm-card:last-child  { border-bottom: none; }
.crm-card:hover       { background: #f8fafc; }
.crm-card.crm-dragging { opacity: .4; }
.crm-card.crm-card-vencida  { background: #fff1f2; border-left: 4px solid #dc2626; }
.crm-card.crm-card-hoje     { background: #fff7ed; border-left: 4px solid #ea580c; }
.crm-card.crm-card-urgente  { background: #fffbeb; border-left: 4px solid #d97706; }

.crm-card-top   { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 4px; }
.crm-card-title { font-size: 13px; font-weight: 600; color: #111827; line-height: 1.4; flex: 1; }
.crm-card-code  { font-size: 10px; font-family: monospace; color: #94a3b8; margin-bottom: 6px; letter-spacing: .3px; }
.crm-card-meta  { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .view { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item:nth-child(odd) { border-right: none; }
}

/* ── Misc ──────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
hr { border: none; border-top: 2px solid var(--border); margin: 16px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.clickable { cursor: pointer; }
