/* ==========================================================================
   8April ERP - SYSTEM STYLES (8April Tech)
   ========================================================================== */

:root {
  --bg-body: #020617;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-sidebar: #070c18;
  --bg-header: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(0, 255, 180, 0.25);
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-neon: #00ffb4;
  
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --purple: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-dark: #64748b;
  
  --shadow: 0 0 25px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 140, 255, 0.04);
  --shadow-hover: 0 0 30px rgba(0, 255, 180, 0.08), 0 0 40px rgba(0, 140, 255, 0.1);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(2, 6, 23, 0.93), rgba(2, 6, 23, 0.97)),
    url('https://i.ibb.co/Xk81gvBg/fundo-8-April.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 255, 180, 0.06), transparent 30%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 35%);
  pointer-events: none;
  z-index: -1;
}

/* ==========================================================================
   SIDEBAR LAYOUT
   ========================================================================== */

aside {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
  backdrop-filter: blur(15px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0.5rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.brand-logo-img {
  height: 42px;
  object-fit: contain;
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #00ffb4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  font-weight: 700;
  display: block;
  margin-top: 1px;
}

.nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dark);
  font-weight: 700;
  margin: 1.25rem 0.5rem 0.4rem 0.5rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(3px);
}

.nav-item.active a {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(0, 255, 180, 0.04));
  border-left: 3.5px solid var(--accent-neon);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 255, 180, 0.05);
}

.nav-item i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
}

.user-profile {
  margin-top: auto;
  padding: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

.user-info {
  line-height: 1.25;
  overflow: hidden;
}

.user-info .name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-info .role {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */

main {
  margin-left: 270px;
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Status Banner */
.arch-banner {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(0, 255, 180, 0.12));
  border: 1px solid rgba(0, 255, 180, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px var(--danger-glow);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-negociacao { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-aguardando { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-ativo { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-execucao { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-finalizado { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-cancelado { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.badge-pendente { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-pago { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-vencido { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-parcial { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-os { background: rgba(0, 255, 180, 0.12); color: var(--accent-neon); border: 1px solid rgba(0, 255, 180, 0.3); }

/* ==========================================================================
   METRIC CARDS & CARDS
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.metric-title {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.metric-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.metric-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.metric-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.metric-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.metric-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.metric-icon.neon { background: rgba(0, 255, 180, 0.15); color: var(--accent-neon); }

.metric-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* ==========================================================================
   INPUTS, SELECTS & TOOLBAR
   ========================================================================== */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea,
.input-control,
input,
select,
textarea {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

/* Prevenir fundo branco do autofill automático do navegador */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.search-box .input-control {
  padding-left: 40px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 255, 180, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 255, 180, 0.1);
}

.select-control {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.empty-state-row td {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   VIEWS MANAGEMENT
   ========================================================================== */

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Tabs & Timeline System */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 15px;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding-left: 15px;
}

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.timeline-title {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.92rem;
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

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

/* OS Cards Mobile Container */
.cards-container {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.card-os {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: var(--radius-md);
}

.card-os .topo {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-os .nome {
  font-weight: bold;
  font-size: 16px;
}

.card-os .valor {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.card-os .info {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-os .status {
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  display: inline-block;
}

/* ==========================================================================
   MODALS & TOAST
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-container {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 650px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.form-group.full {
  grid-column: span 2;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
}

.recurrence-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  grid-column: span 2;
}

.setup-recalculate-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  grid-column: span 2;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--success);
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Progress bar */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-neon));
  border-radius: 3px;
}

/* Footer */
footer {
  width: 100%;
  text-align: center;
  margin-top: auto;
  padding: 25px 10px 10px 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  letter-spacing: .4px;
}

footer::before {
  content: "";
  display: block;
  width: 180px;
  height: 1px;
  margin: 0 auto 15px auto;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 180, 0.35), transparent);
}

/* Mobile Top Bar */
.mobile-header {
  display: none;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 150;
  width: 100%;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 195;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 900px) {
  body {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  aside {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
  }

  aside.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  main {
    margin-left: 0;
    padding: 1rem;
    width: 100%;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .form-group.full,
  .recurrence-box,
  .setup-recalculate-box {
    grid-column: span 1 !important;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box, select {
    width: 100%;
  }

  .arch-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .table-os-desktop {
    display: none;
  }

  .cards-container {
    display: flex;
  }
}

@media (max-width: 500px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DRE & CUSTOS OPERACIONAIS STYLES
   ========================================================================== */

.dre-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.dre-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dre-header-row {
  background: rgba(255, 255, 255, 0.04) !important;
  font-weight: 700;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color) !important;
}

.dre-header-row td {
  padding: 12px 16px;
  font-size: 0.92rem;
}

.dre-item-row td {
  padding: 10px 16px 10px 32px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.dre-subtotal-row {
  background: rgba(59, 130, 246, 0.06) !important;
  font-weight: 700;
  color: #fff;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.dre-subtotal-row td {
  padding: 12px 16px;
  font-size: 0.95rem;
}

.dre-total-row {
  background: linear-gradient(90deg, rgba(0, 255, 180, 0.12), rgba(59, 130, 246, 0.12)) !important;
  font-weight: 800;
  color: var(--accent-neon);
  border-top: 2px solid var(--accent-neon);
  border-bottom: 2px solid var(--accent-neon) !important;
}

.dre-total-row td {
  padding: 14px 16px;
  font-size: 1.05rem;
}

/* Badges de Categoria de Custos */
.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-infra { background: rgba(6, 182, 212, 0.15); color: #06B6D4; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-ia { background: rgba(168, 85, 247, 0.15); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-ferramentas { background: rgba(245, 158, 11, 0.15); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-impostos { background: rgba(239, 68, 68, 0.15); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-marketing { background: rgba(236, 72, 153, 0.15); color: #F472B6; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-pessoal { background: rgba(20, 184, 166, 0.15); color: #2DD4BF; border: 1px solid rgba(20, 184, 166, 0.3); }
.badge-outros { background: rgba(148, 163, 184, 0.15); color: #CBD5E1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Global Dark Select & Options Styling */
select, .select-control, .select-periodo-dre {
  color-scheme: dark !important;
  background-color: #111827 !important;
  color: #f8fafc !important;
}

select option, .select-control option, .select-periodo-dre option {
  background-color: #111827 !important;
  color: #f8fafc !important;
  padding: 10px 14px;
}

/* Badges de Plataformas de Afiliados */
.badge-shopee { background: rgba(238, 77, 45, 0.18); color: #ee4d2d; border: 1px solid rgba(238, 77, 45, 0.35); font-weight: 700; }
.badge-amazon { background: rgba(255, 153, 0, 0.18); color: #ff9900; border: 1px solid rgba(255, 153, 0, 0.35); font-weight: 700; }
.badge-mercadolivre { background: rgba(255, 222, 0, 0.18); color: #ffd000; border: 1px solid rgba(255, 222, 0, 0.35); font-weight: 700; }
.badge-magalu { background: rgba(0, 134, 255, 0.18); color: #0086ff; border: 1px solid rgba(0, 134, 255, 0.35); font-weight: 700; }
.badge-shein { background: rgba(255, 34, 136, 0.18); color: #ff2288; border: 1px solid rgba(255, 34, 136, 0.35); font-weight: 700; }



