* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body { background-color: #0f172a; color: #f8fafc; display: flex; flex-direction: column; min-height: 100vh; }

/* TELA DE LOGIN */
#login-screen {
  position: fixed; inset: 0; background: #0f172a; z-index: 99999;
  display: flex; justify-content: center; align-items: center;
}
.login-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 12px;
  padding: 32px; width: 380px; max-width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.6); text-align: center;
}
.login-card h2 { font-size: 20px; color: #38bdf8; margin-bottom: 6px; }
.login-card p { font-size: 12px; color: #94a3b8; margin-bottom: 24px; }
.login-field { margin-bottom: 16px; text-align: left; }
.login-field label { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; margin-bottom: 6px; text-transform: uppercase; }
.login-field input { width: 100%; padding: 10px 12px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; color: #fff; font-size: 13px; outline: none; }
.login-field input:focus { border-color: #38bdf8; }
.btn-login { width: 100%; padding: 11px; background: #0284c7; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; margin-top: 8px; transition: background 0.2s; }
.btn-login:hover { background: #0369a1; }
#login-error { color: #f87171; font-size: 12px; margin-top: 12px; font-weight: 600; }

/* SISTEMA PRINCIPAL */
#app-system { display: none; flex: 1; flex-direction: column; }

/* Topbar */
header { background-color: #1e293b; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; flex-wrap: wrap; gap: 12px; }
.logo-area { display: flex; align-items: center; gap: 12px; }
.logo-area h1 { font-size: 19px; color: #38bdf8; font-weight: 800; }
.logo-area span { font-size: 11px; background: rgba(56, 189, 248, 0.15); color: #38bdf8; padding: 3px 10px; border-radius: 6px; font-weight: 700; }

.nav-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-tabs button { background: #334155; color: #94a3b8; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.nav-tabs button.active { background: #0284c7; color: #ffffff; }
.nav-tabs button:hover:not(.active) { background: #475569; color: #fff; }
.btn-logout { background: #ef4444 !important; color: #fff !important; }
.btn-logout:hover { background: #dc2626 !important; }

/* PAINEL DE MÉTRICAS & KPIS */
.kpi-container {
  background: #131c2e;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  border-bottom: 1px solid #334155;
}
.kpi-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-title { font-size: 11px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; justify-content: space-between; }
.kpi-value { font-size: 18px; font-weight: 800; color: #f8fafc; }
.kpi-sub { font-size: 10px; color: #64748b; font-weight: 600; }
.kpi-green { color: #4ade80; }
.kpi-blue { color: #38bdf8; }
.kpi-purple { color: #c084fc; }
.kpi-orange { color: #fb923c; }
.kpi-card.kpi-card-clickable {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.kpi-card.kpi-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}
.kpi-card.is-active-filter {
  border: 2px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}

/* Barra de Filtros e Buscas */
.filter-bar { background: #182234; padding: 10px 24px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #334155; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { background: #0f172a; border: 1px solid #334155; border-radius: 8px; color: #f8fafc; padding: 8px 12px; font-size: 12px; outline: none; }
.filter-bar input[type="text"] { flex: 1; min-width: 220px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #38bdf8; }
.btn-action { background: #334155; color: #fff; border: 1px solid #475569; padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-action:hover { background: #475569; }
.btn-action-primary { background: #0284c7; border-color: #0284c7; }
.btn-action-primary:hover { background: #0369a1; }

/* Conteúdo Principal */
main { flex: 1; padding: 16px 24px; overflow-x: auto; }
.view-section { display: none; }
.view-section.active { display: block; }

/* VISÃO KANBAN */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; min-height: 70vh; align-items: flex-start; }
.kanban-col { background: #1e293b; min-width: 290px; width: 290px; border-radius: 10px; border: 1px solid #334155; display: flex; flex-direction: column; max-height: 82vh; }
.kanban-header { padding: 12px 14px; border-bottom: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; }
.kanban-header-title { display: flex; align-items: center; gap: 8px; }
.kanban-header-badge { font-size: 11px; background: #334155; padding: 2px 6px; border-radius: 12px; font-weight: 700; }
.kanban-header-soma { font-size: 11px; color: #4ade80; background: rgba(74, 222, 128, 0.12); padding: 2px 8px; border-radius: 6px; font-weight: 800; }
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; min-height: 120px; }
.kanban-cards.drag-over { background: rgba(56, 189, 248, 0.08); border-radius: 8px; }

.card { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 12px; cursor: grab; box-shadow: 0 4px 8px rgba(0,0,0,0.25); transition: transform 0.15s, border-color 0.15s; }
.card:hover { border-color: #38bdf8; transform: translateY(-2px); }
.card:active { cursor: grabbing; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-attendant { font-size: 10px; font-weight: 800; color: #38bdf8; background: rgba(56, 189, 248, 0.15); padding: 2px 6px; border-radius: 4px; }
.card-title { font-weight: 800; font-size: 13px; color: #f8fafc; margin-bottom: 2px; }
.card-sub { font-size: 11px; color: #94a3b8; font-weight: 600; margin-bottom: 6px; }
.card-price { font-size: 13px; font-weight: 800; color: #4ade80; margin-bottom: 6px; }

.card-prazo { font-size: 10px; padding: 3px 6px; border-radius: 4px; margin-bottom: 6px; width: fit-content; font-weight: 700; }
.card-prazo.normal { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.card-prazo.hoje { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.card-prazo.atrasado { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.card-notes { font-size: 11px; color: #cbd5e1; background: #1e293b; padding: 6px 8px; border-radius: 6px; margin-bottom: 8px; white-space: pre-line; line-height: 1.3; }

.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 6px; border-top: 1px solid #1e293b; padding-top: 8px; margin-top: 4px; }
.btn-card-wa { background: #22c55e; color: #fff; border: none; border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.btn-card-wa:hover { background: #16a34a; }
.btn-card-print { background: #64748b; color: #fff; border: none; border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.btn-card-print:hover { background: #475569; }
.btn-card-edit { background: #0284c7; color: #fff; border: none; border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.btn-card-edit:hover { background: #0369a1; }

.btn-card-maximize {
  background: #1e293b;
  border: 1px solid #475569;
  color: #38bdf8;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}
.btn-card-maximize:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  transform: scale(1.1);
}

.card.is-expanded .card-details-expandable {
  display: block !important;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* VISÃO CALENDÁRIO */
.cal-container { background: #1e293b; border-radius: 12px; border: 1px solid #334155; padding: 20px; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-header h2 { font-size: 17px; color: #38bdf8; font-weight: 800; }
.cal-header button { background: #0f172a; border: 1px solid #334155; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.cal-header button:hover { background: #334155; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-weekday { text-align: center; font-weight: 800; color: #64748b; padding-bottom: 8px; font-size: 12px; text-transform: uppercase; }
.cal-day { background: #0f172a; border: 1px solid #334155; border-radius: 8px; min-height: 100px; padding: 8px; font-size: 11px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.cal-day.has-items { border-color: #22c55e; background: #11222f; cursor: pointer; }
.cal-day.has-items:hover { border-color: #38bdf8; }
.cal-day-header { display: flex; justify-content: space-between; align-items: center; }
.cal-day-num { font-weight: 800; color: #94a3b8; font-size: 12px; }
.cal-day-count { font-size: 9px; color: #4ade80; background: rgba(74, 222, 128, 0.15); padding: 2px 5px; border-radius: 4px; font-weight: 800; }
.cal-items-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.cal-inline-item { background: #065f46; color: #fff; padding: 4px 6px; border-radius: 4px; font-size: 10px; line-height: 1.2; }
.cal-inline-item strong { color: #4ade80; font-size: 10px; display: block; }
.cal-inline-item span { color: #f8fafc; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* MODAIS */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 9999; display: none; align-items: center; justify-content: center; }
.modal-box { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 24px; width: 480px; max-width: 92%; max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
.modal-box.modal-box-wide { width: 840px; max-width: 95%; max-height: 90vh; }
.modal-form-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; }
@media (max-width: 768px) {
  .modal-box.modal-box-wide { width: 95%; }
  .modal-form-grid { grid-template-columns: 1fr; gap: 10px; }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 12px; margin-bottom: 16px; }
.modal-header h3 { font-size: 16px; color: #38bdf8; font-weight: 800; }
.modal-header button { background: transparent; border: none; color: #94a3b8; font-size: 20px; cursor: pointer; }
.modal-header button:hover { color: #fff; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; margin-bottom: 4px; text-transform: uppercase; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; color: #fff; font-size: 12px; outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #38bdf8; }
.form-group textarea { resize: vertical; min-height: 55px; }

.btn-submit { width: 100%; padding: 11px; background: #0284c7; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 13px; margin-top: 8px; transition: background 0.2s; }
.btn-submit:hover { background: #0369a1; }
.btn-danger { width: 100%; padding: 9px; background: #ef4444; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 12px; margin-top: 8px; }
.btn-print-modal { width: 100%; padding: 9px; background: #475569; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 12px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* MODAL DE IMPRESSÃO DA ORDEM DE PRODUÇÃO (PDF/PRINT) */
#print-op-area {
  display: none;
  background: #ffffff;
  color: #000000;
  padding: 24px;
  font-family: Arial, Helvetica, sans-serif;
}

@media print {
  body * { visibility: hidden; }
  #print-op-area, #print-op-area * { visibility: visible; }
  #print-op-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
    background: #fff !important;
    color: #000 !important;
    padding: 20px !important;
  }
}

.op-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
.op-header h1 { font-size: 20px; font-weight: bold; }
.op-header span { font-size: 13px; font-weight: bold; color: #555; }
.op-box { border: 1px solid #000; border-radius: 4px; padding: 10px; margin-bottom: 12px; }
.op-box h4 { font-size: 12px; text-transform: uppercase; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin-bottom: 6px; }
.op-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.op-table th, .op-table td { border: 1px solid #000; padding: 6px 8px; font-size: 11px; text-align: left; }
.op-table th { background: #eee; font-weight: bold; }
.op-signature-line { margin-top: 40px; display: flex; justify-content: space-between; }
.op-signature-box { width: 45%; border-top: 1px solid #000; text-align: center; font-size: 11px; padding-top: 4px; }

/* GERENCIADOR DE STATUS */
.status-config-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.status-config-item { display: flex; gap: 6px; align-items: center; }
.status-config-item input { margin-bottom: 0; }
.status-config-item button { background: #ef4444; color: #fff; border: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 11px; }
.btn-status-reorder { background: #1e293b; color: #38bdf8; border: 1px solid #334155; padding: 3px 6px; border-radius: 4px; cursor: pointer; font-size: 9px; line-height: 1; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-status-reorder:hover:not(:disabled) { background: #0284c7; color: #fff; border-color: #38bdf8; }
.btn-status-reorder:disabled { opacity: 0.25; cursor: not-allowed; }

/* GESTÃO DE ACESSOS E PERMISSÕES */
.perm-group { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.perm-title { font-size: 13px; font-weight: 800; color: #38bdf8; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.perm-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #1e293b; font-size: 12px; color: #cbd5e1; gap: 10px; }
.perm-item:last-child { border-bottom: none; }
.perm-item label { cursor: pointer; flex: 1; margin-bottom: 0; font-size: 12px; text-transform: none; color: #cbd5e1; }
.perm-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: #0284c7; cursor: pointer; }
.tab-usuarios-nav { display: flex; gap: 8px; border-bottom: 1px solid #334155; padding-bottom: 10px; margin-bottom: 14px; }
.tab-usuarios-nav button { background: #0f172a; border: 1px solid #334155; color: #94a3b8; padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.tab-usuarios-nav button.active { background: #0284c7; color: #fff; border-color: #0284c7; }
.user-list-item { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.user-list-info { display: flex; flex-direction: column; gap: 2px; }
.user-list-info strong { font-size: 12px; color: #f8fafc; }
.user-list-info span { font-size: 11px; color: #94a3b8; }

/* TABELAS DE PREÇOS (VENDAS & CUSTOS) */
.price-table-container { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 18px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3); }
.price-table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.price-table-header h2 { font-size: 16px; color: #38bdf8; font-weight: 800; }
.price-table-filters { display: flex; gap: 8px; flex: 1; max-width: 600px; }
.price-table-filters input, .price-table-filters select { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 7px 12px; color: #fff; font-size: 12px; }
.price-table-wrapper { width: 100%; overflow-x: auto; }
.price-table { width: 100%; border-collapse: collapse; text-align: left; }
.price-table th { color: #94a3b8; font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid #334155; }
.price-table td { padding: 12px 14px; border-bottom: 1px solid #334155; font-size: 12px; }
.price-table tr:hover td { background: rgba(51, 65, 85, 0.3); }
.badge-categoria { background: rgba(56, 189, 248, 0.15); color: #38bdf8; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.input-inline-tabela { background: #0f172a; border: 1px solid #334155; border-radius: 6px; color: #fff; padding: 5px 8px; font-size: 12px; font-weight: bold; width: 95px; }
.input-inline-tabela:focus { border-color: #38bdf8; }
.btn-usar-preco { background: #0284c7; color: #fff; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 11px; cursor: pointer; transition: background 0.2s; }
.btn-usar-preco:hover { background: #0369a1; }

/* ITENS MÚLTIPLOS NO MODAL CRM */
.modal-item-box { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 12px; margin-bottom: 10px; position: relative; }
.modal-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #1e293b; }
.modal-item-title { font-size: 11px; font-weight: 800; color: #38bdf8; text-transform: uppercase; }
.btn-remove-item-modal { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; border-radius: 4px; padding: 2px 7px; font-size: 10px; font-weight: bold; cursor: pointer; }
.btn-remove-item-modal:hover { background: #ef4444; color: #fff; }
.btn-add-item-modal { width: 100%; padding: 8px; background: rgba(56, 189, 248, 0.1); color: #38bdf8; border: 1px dashed #0284c7; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s; }
.btn-add-item-modal:hover { background: rgba(56, 189, 248, 0.2); border-color: #38bdf8; }

/* IMPORTADOR DE PDF ERP */
.pdf-dropzone {
  border: 2px dashed #0284c7;
  background: rgba(2, 132, 199, 0.05);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 14px;
}
.pdf-dropzone:hover, .pdf-dropzone.drag-over {
  background: rgba(2, 132, 199, 0.15);
  border-color: #38bdf8;
  transform: scale(1.01);
}
.pdf-dropzone-icon { font-size: 38px; margin-bottom: 8px; }
.pdf-dropzone-text { font-size: 13px; font-weight: 700; color: #f8fafc; margin-bottom: 4px; }
.pdf-dropzone-sub { font-size: 11px; color: #94a3b8; }
.pdf-preview-box { background: #0f172a; border: 1px solid #334155; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.pdf-preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; font-size: 12px; }
.pdf-preview-item { background: #1e293b; padding: 8px 10px; border-radius: 6px; border: 1px solid #334155; }
.pdf-preview-item strong { display: block; font-size: 10px; color: #94a3b8; text-transform: uppercase; margin-bottom: 2px; }
.pdf-preview-item span { font-size: 12px; font-weight: 700; color: #f8fafc; }

/* BARRA DE ROLAGEM SUPERIOR DO KANBAN */
.kanban-top-scrollbar-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-bottom: 10px;
  background: #1e293b;
  border-radius: 8px;
  border: 1px solid #334155;
}
.kanban-top-scrollbar-wrapper::-webkit-scrollbar {
  height: 10px;
}
.kanban-top-scrollbar-wrapper::-webkit-scrollbar-track {
  background: #0f172a;
  border-radius: 6px;
}
.kanban-top-scrollbar-wrapper::-webkit-scrollbar-thumb {
  background: #0284c7;
  border-radius: 6px;
}
.kanban-top-scrollbar-wrapper::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}
.kanban-top-scrollbar-inner {
  height: 1px;
}

/* GUIA DE FATURAMENTO & HISTÓRICO MENSAL (ADMIN) */
.faturamento-container {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}
.faturamento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.faturamento-header h2 {
  font-size: 18px;
  color: #4ade80;
  font-weight: 800;
}
.faturamento-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.faturamento-toggle-mode {
  display: flex;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}
.btn-toggle-mode {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-toggle-mode.active {
  background: #0284c7;
  color: #fff;
}
.faturamento-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.fat-kpi-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fat-kpi-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
}
.fat-kpi-val {
  font-size: 20px;
  font-weight: 800;
}
.fat-kpi-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.faturamento-meses-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fat-mes-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.fat-mes-card:hover {
  border-color: #38bdf8;
}
.fat-mes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.fat-mes-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fat-mes-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fat-mes-val {
  font-size: 16px;
  font-weight: 800;
  color: #4ade80;
}
.fat-mes-qty {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.fat-progress-bg {
  background: #1e293b;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0;
}
.fat-progress-fill {
  background: linear-gradient(90deg, #0284c7, #4ade80);
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.fat-mes-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 8px;
}
.fat-pedidos-expand {
  display: none;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #334155;
}
.btn-expand-mes {
  background: #1e293b;
  border: 1px solid #475569;
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.btn-expand-mes:hover {
  background: #334155;
  color: #fff;
}

/* BARRA DE FILTROS AVANÇADOS DO FATURAMENTO */
.faturamento-filter-bar {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 10px;
  align-items: center;
}
.faturamento-filter-bar input,
.faturamento-filter-bar select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  width: 100%;
}
.faturamento-filter-bar input:focus,
.faturamento-filter-bar select:focus {
  border-color: #38bdf8;
}
.btn-clear-fat {
  background: #334155;
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-clear-fat:hover {
  background: #475569;
  color: #fff;
}

/* PAINEL DE DESEMPENHO & RANKING POR ATENDENTE */
.fat-ranking-panel {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.fat-ranking-title {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fat-ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.fat-ranking-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s;
}
.fat-ranking-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}
.fat-ranking-user {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fat-ranking-val {
  font-size: 15px;
  font-weight: 800;
  color: #4ade80;
}
.fat-ranking-sub {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}
.btn-ver-mais-fat {
  background: #1e293b;
  border: 1px dashed #0284c7;
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  transition: background 0.2s;
}
.btn-ver-mais-fat:hover {
  background: rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   BARRA FLUTUANTE DE AÇÕES EM LOTE (EXCLUSÃO EM MASSA - ADMIN)
   ========================================================================== */
.barra-acoes-lote {
  position: sticky;
  top: 10px;
  z-index: 100;
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
  border: 2px solid #6366f1;
  border-radius: 12px;
  padding: 10px 18px;
  margin: 0 0 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.3);
  animation: slideDownFade 0.25s ease-out;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-lote-todos, .btn-lote-nenhum, .btn-lote-fechar {
  background: #1e293b;
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-lote-todos:hover { background: #334155; color: #fff; border-color: #64748b; }
.btn-lote-nenhum:hover { background: #334155; color: #fff; }
.btn-lote-fechar:hover { background: #475569; color: #fff; }

.btn-lote-excluir {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: 1px solid #ef4444;
  color: #fff;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-lote-excluir:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.6);
}

.card.card-selected-lote {
  border: 2px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3) !important;
}

.card-select-checkbox-wrapper {
  display: flex;
  align-items: center;
  margin-right: 6px;
}
.card-select-checkbox-wrapper input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #ef4444;
}

/* ==========================================================================
   ESTILOS: GESTÃO DE TAREFAS, DELEGAÇÃO & WHATSAPP
   ========================================================================== */

.badge-tarefas {
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1); }
}

.tarefas-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tarefas-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #1e293b;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #334155;
}

.tarefas-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.tarefa-kpi-card {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.tarefa-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
  margin-bottom: 4px;
}

.tarefa-kpi-lbl {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.tarefas-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #1e293b;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  align-items: center;
}

.tarefas-filter-bar input,
.tarefas-filter-bar select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.tarefas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.tarefa-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.tarefa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.tarefa-card-concluida {
  opacity: 0.6;
  background: rgba(15, 23, 42, 0.6);
  border-color: #1e293b;
}

.tarefa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tarefa-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #22c55e;
}

.tarefa-titulo {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.tarefa-texto-riscado {
  text-decoration: line-through;
  color: #94a3b8;
}

.tarefa-descricao {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  margin-top: 4px;
  white-space: pre-wrap;
  background: #0f172a;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.tarefa-card-meta {
  margin-top: auto;
}

.tarefa-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.btn-tarefa-wa {
  background: #059669;
  border: 1px solid #10b981;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-tarefa-wa:hover {
  background: #047857;
  transform: scale(1.02);
}

.btn-tarefa-status {
  background: #0f172a;
  border: 1px solid #334155;
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-tarefa-status:hover {
  background: #1e293b;
  border-color: #38bdf8;
}

.btn-tarefa-edit,
.btn-tarefa-del {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

.btn-tarefa-edit:hover { background: #334155; color: #fff; }
.btn-tarefa-del:hover { background: #dc2626; color: #fff; border-color: #ef4444; }

@media (max-width: 768px) {
  header { flex-direction: column; align-items: stretch; }
  .nav-tabs { justify-content: space-between; }
  .kpi-container { grid-template-columns: repeat(2, 1fr); }
  .price-table-header { flex-direction: column; align-items: stretch; }
  .price-table-filters { max-width: 100%; flex-direction: column; }
}
