/* ============================================================
   ZEUS 3.0 | components.css
   Responsabilidade: Sidebar, modais, badges, status tags,
   cards específicos, PDV, Kanban e todos os componentes UI.
   ============================================================ */

/* ============================================================
   1. SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background-color: #ffffff;
  color: var(--velo-gray);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-family: var(--font-menu);
  border-right: 1px solid #e0e0e0;
  box-shadow: 2px 0 10px rgba(0,0,0,0.03);
  transition: width 0.3s ease;
}

.sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  gap: 12px;
  background-color: #ffffff;
  flex-shrink: 0;
}

.sidebar-logo {
  height: 40px;
  width: auto;
  border-radius: 4px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand span {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  color: var(--velo-purple);
}

.sidebar-brand small {
  font-size: 0.8rem;
  color: #999;
  font-weight: 400;
}

.sidebar-menu {
  flex: 1;
  padding: 15px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Scrollbar da sidebar */
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

.menu-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #bbb;
  font-weight: 600;
  margin: 16px 0 6px 25px;
  letter-spacing: 0.8px;
  font-family: var(--font-menu);
}

/* Item do Menu */
.nav-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 25px;
  color: var(--velo-gray);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 15px;
  font-family: var(--font-menu);
  border-left: 4px solid transparent;
  width: 100%;
  white-space: nowrap;
}

.nav-item i {
  width: 22px;
  text-align: center;
  font-size: 18px;
  color: var(--velo-purple);
  transition: color 0.15s;
  flex-shrink: 0;
}

.nav-item:hover {
  background-color: var(--velo-hover);
  color: #333;
  border-left-color: #ddd;
}

.nav-item.active {
  background-color: var(--velo-orange);
  color: white !important;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(255, 61, 0, 0.2);
  border-left-color: var(--velo-orange);
}

.nav-item.active i {
  color: white !important;
}

/* Submenu */
.nav-submenu {
  display: none;
  flex-direction: column;
  background: #fafafa;
  border-left: 3px solid var(--velo-orange);
  margin-left: 20px;
}

.nav-submenu.open {
  display: flex;
}

.nav-submenu .nav-item {
  font-size: 13px;
  padding: 10px 20px;
  gap: 12px;
}

.nav-submenu .nav-item i {
  font-size: 14px;
}

/* Rodapé da Sidebar */
.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fcfcfc;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--velo-purple);
  font-family: var(--font-menu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.user-role {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 2px;
}

.btn-logout-icon {
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-logout-icon:hover {
  color: var(--danger);
  background: #fee2e2;
}

/* ============================================================
   2. TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.topbar h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-badge {
  background: var(--bg-body);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-sm);
}

.date-badge i {
  color: var(--accent);
}

/* Botão de toggle de valores */
#toggleValor {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

#toggleValor:hover {
  background: var(--border);
}

/* ============================================================
   3. BOTÕES
   ============================================================ */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--primary);
  color: white;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) {
  background: var(--success-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-dark);
}

.btn-outline {
  border: 1px solid var(--border);
  background: white;
  color: var(--text-main);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline-primary {
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
}
.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.btn-danger-outline {
  border: 1px solid var(--danger);
  background: white;
  color: var(--danger);
}
.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon-small {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-small:hover {
  color: var(--primary);
  background: var(--bg-body);
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
}
.btn-icon-danger:hover {
  color: var(--danger);
}

/* Botão Flutuante */
.floating-add {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 58px;
  height: 58px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  border: none;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 100;
}
.floating-add:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.5);
}

/* Botão Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  vertical-align: middle;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider { background-color: var(--primary-light); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* ============================================================
   4. BADGES E STATUS TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Status badges para pedidos */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pendente       { background: #fef3c7; color: #d97706; }
.status-atendimento    { background: #dbeafe; color: #1d4ed8; }
.status-impressão,
.status-impressao      { background: #ede9fe; color: #6d28d9; }
.status-talho          { background: #ffedd5; color: #c2410c; }
.status-estampa        { background: #fce7f3; color: #be185d; }
.status-costura        { background: #d1fae5; color: #065f46; }
.status-acabamento     { background: #cffafe; color: #0e7490; }
.status-finalizado     { background: #f3e8ff; color: #7c3aed; }
.status-entregues      { background: #f1f5f9; color: #475569; }
.status-novo---online  { background: #dcfce7; color: #15803d; }

/* Status tags para financeiro */
.status-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-tag.em-dia     { background: #dcfce7; color: var(--success-dark); }
.status-tag.atrasada   { background: #fef2f2; color: var(--danger-dark); }
.status-tag.quitada    { background: #e0f2fe; color: #0284c7; }
.status-tag.em-rota    { background: #fffbe0; color: #d97706; }
.status-tag.pendente   { background: #fef2f2; color: var(--danger-dark); }

/* Status Dot (ponto colorido) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.green { background-color: var(--success); }
.status-dot.red   { background-color: var(--danger); }
.status-dot.blue  { background-color: #3b82f6; }

/* ============================================================
   5. MODAIS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(2px);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  width: 500px;
  max-width: 95vw;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.visible .modal-content {
  transform: translateY(0);
}

.modal-content.modal-xl {
  width: 95%;
  max-width: 900px;
}

.modal-content.modal-lg {
  width: 700px;
}

.modal-header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: white;
  font-weight: 700;
}

.modal-close,
.modal-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover,
.modal-close-btn:hover {
  color: white;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: #fcfcfc;
}

/* Modal Financeiro */
.finance-body {
  background-color: #f8fafc;
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.finance-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.f-card {
  background: white;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.f-card .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.f-card strong {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 5px;
  color: #1e293b;
}

.f-card .icon-bg {
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 4rem;
  opacity: 0.1;
  transform: rotate(-10deg);
}

.f-card.total { border-bottom: 4px solid #3b82f6; }
.f-card.total .icon-bg { color: #3b82f6; }
.f-card.paid { border-bottom: 4px solid var(--success); }
.f-card.paid strong { color: var(--success-dark); }
.f-card.paid .icon-bg { color: var(--success); }
.f-card.balance { border-bottom: 4px solid var(--danger); }
.f-card.balance strong { color: var(--danger); }
.f-card.balance .icon-bg { color: var(--danger); }

.finance-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

.finance-section {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.section-title {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #e2e8f0;
}

/* Timeline de pagamentos */
.history-timeline {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 5px;
}

.timeline-item {
  display: flex;
  gap: 14px;
  margin-bottom: 1.2rem;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: -20px;
  width: 2px;
  background: #e2e8f0;
}

.t-icon {
  width: 30px;
  height: 30px;
  background: #ecfdf5;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #ecfdf5;
}

.t-content { flex-grow: 1; }
.t-header { display: flex; justify-content: space-between; align-items: center; }
.t-desc { font-weight: 700; color: #334155; font-size: 0.9rem; }
.t-value { font-weight: 800; color: var(--success-dark); font-size: 0.95rem; }
.t-date { font-size: 0.78rem; color: #94a3b8; display: block; margin-top: 2px; }
.t-obs {
  font-size: 0.82rem;
  color: #64748b;
  background: #f8fafc;
  padding: 5px 10px;
  border-radius: 6px;
  margin-top: 6px;
  border: 1px solid #f1f5f9;
}

/* Formas de pagamento (radio cards) */
.payment-methods-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.radio-card { cursor: pointer; flex: 1; min-width: 80px; }
.radio-card input { display: none; }
.radio-card .card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}
.radio-card input:checked + .card-content {
  border-color: var(--primary);
  background: #fdf4ff;
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(74,0,114,0.12);
}

.input-group-merged {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group-merged .prefix {
  position: absolute;
  left: 12px;
  font-weight: 700;
  color: #94a3b8;
}
.input-group-merged input { padding-left: 40px; font-weight: 700; font-size: 1.1rem; }

.btn-mini-action {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  background: #e0f2fe;
  color: #0284c7;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-mini-action:hover { background: #bae6fd; }

/* ============================================================
   6. TOAST / NOTIFICAÇÕES
   ============================================================ */
.central-alert-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(46, 2, 73, 0.45);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeInOverlay 0.3s forwards;
}

.central-alert-card {
  background: white;
  width: 90%;
  max-width: 380px;
  border-radius: 16px;
  padding: 2.5rem 1.8rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  transform: scale(0.8);
  opacity: 0;
  animation: popInCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.central-alert-icon-box {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 2rem;
}

.central-alert-card h2 {
  margin: 0 0 8px;
  color: #2e0249;
  font-size: 1.5rem;
  font-weight: 800;
}

.central-alert-card p {
  margin: 0 0 22px;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

.central-alert-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}
.central-alert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 2, 73, 0.3);
}

.central-alert-card.success .central-alert-icon-box { background: #dcfce7; color: #166534; }
.central-alert-card.success .central-alert-btn { background: #166534; }
.central-alert-card.error .central-alert-icon-box { background: #fee2e2; color: #991b1b; }
.central-alert-card.error .central-alert-btn { background: #991b1b; }
.central-alert-card.warning .central-alert-icon-box { background: #fef3c7; color: #b45309; }
.central-alert-card.warning .central-alert-btn { background: #b45309; }

@keyframes fadeInOverlay { to { opacity: 1; } }
@keyframes popInCard { to { transform: scale(1); opacity: 1; } }

/* ============================================================
   7. CARDS DE PEDIDO (LISTA)
   ============================================================ */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.orc-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: var(--radius);
  background: white;
  transition: all 0.2s;
}

.orc-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.orc-card-info { flex: 1; }
.orc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   8. CARDS DE PRODUTO (PEDIDO)
   ============================================================ */
.produto-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.produto-item:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent);
}

.produto-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed var(--border);
}

.produto-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.p-row-main {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 28px;
  align-items: flex-end;
}

.p-row-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  align-items: center;
  background: #f8fafc;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid #e2e8f0;
}

.produto-grid label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.p-total-display {
  text-align: right;
  border-left: 1px solid #e2e8f0;
  padding-left: 18px;
}

.p-total-display span {
  display: block;
  font-size: 0.68rem;
  color: #aaa;
  font-weight: 700;
}

.p-total-display strong {
  font-size: 1.35rem;
  color: var(--primary);
  display: block;
  line-height: 1.2;
}

.medidas-container {
  margin-top: 16px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* ============================================================
   9. CARDS KPI / DASHBOARD
   ============================================================ */
.dashboard-header-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: rgba(0,0,0,0.03);
  border-radius: 50%;
  z-index: 1;
}

.kpi-icon {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.kpi-info {
  flex-grow: 1;
  position: relative;
  z-index: 2;
}

.kpi-info h3 {
  font-size: 1.9rem;
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
  color: var(--text-main);
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

.kpi-card.purple .kpi-icon { background: #f3e8ff; color: var(--primary); }
.kpi-card.orange .kpi-icon { background: #fff7ed; color: var(--accent); }
.kpi-card.green  .kpi-icon { background: #ecfdf5; color: var(--success); }
.kpi-card.red    .kpi-icon { background: #fef2f2; color: var(--danger); }
.kpi-card.blue   .kpi-icon { background: #eff6ff; color: #2563eb; }

/* Cards Financeiros do Dashboard */
.dashboard-finance-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.finance-card {
  background: white;
  padding: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.finance-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.finance-card.highlight {
  background: #fdf4ff;
  border-color: var(--primary-light);
}

.card-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.finance-card h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finance-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.4rem 0;
  line-height: 1.2;
}

.finance-trend {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.finance-trend.up { color: var(--success); }
.finance-trend.down { color: var(--danger); }

/* Dashboard Grid */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ============================================================
   10. TABELA FINANCEIRA
   ============================================================ */
.full-height-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}

.finance-header-layout {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.finance-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.finance-filters-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.checkbox-group {
  display: flex;
  gap: 1.2rem;
  padding: 0.5rem 0;
}

.checkbox-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-main);
}

.checkbox-custom input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.finance-footer-summary {
  background: #fff;
  border-top: 2px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 2.5rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

.summary-item { text-align: right; }
.summary-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.summary-item strong { font-size: 1rem; color: var(--text-main); }
.summary-item.total strong { font-size: 1.2rem; color: var(--primary); }

/* Paginação */
.pagination-container {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: #fff;
}

.paginacao-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.2s;
}

.paginacao-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.paginacao-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.paginacao-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   11. LAYOUT DO PEDIDO (NOVO)
   ============================================================ */
.order-layout-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.client-header-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary);
}

.order-main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.order-products-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.order-finance-column {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.total-display-card {
  background: var(--primary);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.total-display-card span {
  font-size: 0.85rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.total-display-card strong {
  font-size: 2.2rem;
  display: block;
  margin-top: 5px;
  font-weight: 900;
}

/* Campos de cliente */
.client-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.client-aligned-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 28px;
  align-items: flex-end;
}

.search-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon-fix {
  position: absolute;
  left: 14px;
  color: var(--primary);
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 10;
}

.input-with-icon {
  padding-left: 46px !important;
}

/* ============================================================
   12. PDV (PONTO DE VENDA)
   ============================================================ */
body.pdv-mode .sidebar,
body.pdv-mode .topbar,
body.pdv-mode .floating-add {
  display: none !important;
}

body.pdv-mode .main-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

.pdv-top-header {
  height: 60px;
  background: linear-gradient(90deg, #591B72 0%, #C2185B 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.pdv-logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.pdv-layout-grid {
  display: flex;
  height: calc(100vh - 60px);
  width: 100vw;
  padding: 14px;
  gap: 18px;
  box-sizing: border-box;
}

.pdv-col-left {
  width: 42%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pdv-col-right {
  width: 58%;
  display: flex;
  flex-direction: column;
}

.paper-card {
  background: white;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  padding: 14px;
  position: relative;
  border: 1px solid #e0e0e0;
}

.search-wrapper-pdv { position: relative; width: 100%; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #591B72; font-size: 1.2rem; }
.search-wrapper-pdv input {
  width: 100%; height: 58px; padding: 0 14px 0 44px;
  border: 1px solid #ddd; border-radius: 8px; font-size: 1rem;
  outline: none; transition: 0.2s;
}
.search-wrapper-pdv input:focus { border-color: #591B72; box-shadow: 0 0 0 3px rgba(89,27,114,0.1); }

.input-giant {
  width: 100%; height: 70px; border-radius: 8px; font-size: 2rem;
  text-align: right; padding: 0 18px; border: 1px solid #ddd; outline: none;
  font-weight: 400;
}
.input-giant.white { background: #fff; color: #333; }
.input-giant.gray { background: #e0e0e0; color: #666; border-color: #ccc; }

.btn-pdv {
  flex: 1; border: none; padding: 14px 0; border-radius: 6px;
  color: white; font-weight: 700; cursor: pointer; font-size: 0.82rem;
  transition: 0.1s;
}
.btn-pdv:active { transform: translateY(2px); }
.btn-pdv.purple { background-color: #591B72; }
.btn-pdv.light { background-color: #E1BEE7; color: #4a148c; }

.list-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 5px;
  border-bottom: 1px solid #eee;
}
.list-scroll-area::-webkit-scrollbar { width: 5px; }
.list-scroll-area::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.pdv-item-row {
  display: flex;
  padding: 11px 5px;
  border-bottom: 1px solid #f4f4f4;
  align-items: flex-start;
  animation: fadeInItem 0.2s;
}

.pdv-item-name { font-weight: 600; color: #333; font-size: 0.9rem; }
.pdv-item-calc { font-size: 0.82rem; color: #666; }
.pdv-item-total { font-weight: 700; color: #333; font-size: 0.95rem; }
.btn-del-item { color: #ffcccc; cursor: pointer; margin-left: 10px; transition: 0.2s; }
.btn-del-item:hover { color: #ff3d00; }

.grand-total-bar {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px;
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-finalize-huge {
  background: #FF3D00;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 28px;
  height: 58px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}
.btn-finalize-huge:hover { background: #e63900; }
.btn-finalize-huge:disabled { background: #ccc; cursor: not-allowed; }

.total-value-huge {
  font-size: 3rem;
  font-weight: 800;
  color: #D84315;
  line-height: 1;
}

@keyframes fadeInItem {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sugestões de busca PDV */
#pdvSugestoes {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 500;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}
.search-item:hover { background: #f8f4ff; }
.search-item:last-child { border-bottom: none; }

/* Modal de Pagamento PDV */
.modal-content.modal-pdv-pay {
  width: 90%;
  max-width: 1050px;
  height: 85vh;
}

.modal-header-pdv {
  background: linear-gradient(90deg, #591B72 0%, #4a148c 100%);
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  height: 68px;
  flex-shrink: 0;
}

.modal-header-pdv h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

.pdv-pay-body { display: flex; flex: 1; overflow: hidden; }
.pdv-pay-left {
  width: 60%; background: #f3f4f6;
  padding: 22px; display: flex; flex-direction: column;
  gap: 18px; overflow-y: auto;
}
.pdv-pay-right {
  width: 40%; background: #fff;
  border-left: 1px solid #e0e0e0;
  padding: 22px; display: flex;
  flex-direction: column; position: relative;
}

.payment-methods-grid-pdv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.btn-method {
  height: 68px; border: none; border-radius: 8px;
  color: white; font-weight: 600; font-size: 0.95rem;
  display: flex; align-items: center;
  justify-content: flex-start; padding-left: 18px;
  gap: 14px; cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: 0.1s;
}
.btn-method:active { transform: translateY(2px); box-shadow: none; }
.btn-method.green { background: #2e7d32; }
.btn-method.blue { background: #1565c0; }
.btn-method.purple { background: #6a1b9a; }
.btn-method.light-purple { background: #8e24aa; }

.pay-totals-box {
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.pay-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px dashed #ddd;
}
.pay-row.big { font-size: 1.15rem; font-weight: 800; color: #333; padding-top: 14px; border-bottom: none; }

.btn-finalize-sale {
  margin-top: 18px;
  width: 100%; height: 62px;
  background: #2e7d32; color: white;
  border: none; border-radius: 8px;
  font-weight: 800; font-size: 1.1rem;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  gap: 10px; transition: 0.2s;
}
.btn-finalize-sale:hover { background: #1b5e20; }
.btn-finalize-sale:disabled { background: #ccc; cursor: not-allowed; }

/* ============================================================
   13. CATÁLOGO DE PRODUTOS
   ============================================================ */
.prod-layout-main {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.prod-image-col {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.prod-fields-col { flex-grow: 1; }

.image-upload-circle {
  width: 175px; height: 175px;
  border-radius: 50%;
  background-color: #f3f4f6;
  border: 2px dashed #d1d5db;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
  transition: all 0.3s;
}
.image-upload-circle:hover {
  border-color: var(--primary);
  background-color: #ede9fe;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-top: 10px;
}

.card-section-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.section-divider {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary-light);
  padding-left: 10px;
}

/* ============================================================
   14. ENTREGA E ANEXOS
   ============================================================ */
.delivery-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.delivery-item:last-child { border-bottom: none; }
.delivery-item:hover { background: var(--bg-body); }

.delivery-info { display: flex; flex-direction: column; }
.delivery-date { font-size: 0.73rem; color: var(--text-muted); font-weight: 500; }
.delivery-client { font-size: 0.88rem; font-weight: 600; color: var(--text-main); margin-top: 2px; }
.delivery-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.card-anexo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--bg-body);
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.2s;
  margin-bottom: 5px;
}
.card-anexo:hover { background: var(--primary); color: white; }

/* Upload de anexos */
.anexo-upload-container {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   15. RELATÓRIOS
   ============================================================ */
.report-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.report-title h3 { margin: 0; font-size: 1.3rem; color: var(--primary); font-weight: 700; }
.report-title p { margin: 0; color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }

.report-lists-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.item-fluxo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.item-fluxo:hover { border-color: var(--border); transform: translateX(2px); }
.item-fluxo-info .descricao { font-weight: 600; color: var(--text-main); font-size: 0.88rem; }
.item-fluxo-info .sub-info { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }
.item-fluxo-valor { font-weight: 700; font-size: 0.92rem; }
.item-fluxo-valor.entrada { color: var(--success-dark); }
.item-fluxo-valor.saida { color: var(--danger-dark); }

/* ============================================================
   16. UTILITÁRIOS
   ============================================================ */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-primary { color: var(--primary) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-right   { text-align: right !important; }
.text-center  { text-align: center !important; }
.bg-light     { background: #f8fafc !important; }
.bg-white     { background: white !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1.5rem; }
.small { font-size: 0.8rem; }
.muted { color: var(--text-muted); }
.custom-scroll-box { max-height: 300px

