/* style.css - Design System & UI Styling para A Selva - Financeiro */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  /* Color Palette - Inspiração Floresta Escura & Ouro */
  --bg-gradient-start: #040e09;
  --bg-gradient-end: #092215;
  --bg-sidebar: rgba(4, 15, 9, 0.85);
  --bg-surface: rgba(10, 32, 20, 0.55);
  --bg-surface-hover: rgba(16, 48, 30, 0.7);
  --bg-input: rgba(5, 20, 12, 0.8);
  
  --primary: #cda351; /* Dourado */
  --primary-hover: #e5c17d;
  --primary-glow: rgba(205, 163, 81, 0.15);
  --primary-glow-strong: rgba(205, 163, 81, 0.3);
  
  --border-color: rgba(205, 163, 81, 0.12);
  --border-focus: rgba(205, 163, 81, 0.4);
  
  --text-main: #f4fcf6;
  --text-muted: #839b8e;
  --text-inverse: #040e09;
  
  /* Status Colors */
  --status-active-bg: rgba(16, 185, 129, 0.12);
  --status-active-text: #34d399;
  --status-inactive-bg: rgba(239, 68, 68, 0.12);
  --status-inactive-text: #f87171;
  --status-pending-bg: rgba(245, 158, 11, 0.12);
  --status-pending-text: #fbbf24;
  
  /* Layout constraints */
  --sidebar-width: 280px;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: radial-gradient(circle at 80% 20%, var(--bg-gradient-end) 0%, var(--bg-gradient-start) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-gradient-start);
}
::-webkit-scrollbar-thumb {
  background: rgba(205, 163, 81, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(205, 163, 81, 0.4);
}

/* Layout Container */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 3rem;
  text-align: center;
}

.brand-logo-container {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, #103822 0%, #05180f 100%);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

/* Styled Rhino SVG simulation / placeholder container */
.brand-logo-container svg {
  width: 50px;
  height: 50px;
  fill: var(--primary);
}

.brand h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: var(--text-main);
  text-transform: uppercase;
}

.brand h1 span {
  color: var(--primary);
  display: block;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  letter-spacing: 4px;
  font-weight: 500;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-speed) ease;
  border: 1px solid transparent;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-hover);
  background: var(--bg-surface);
  border-color: rgba(205, 163, 81, 0.15);
  box-shadow: inset 0 0 10px rgba(205, 163, 81, 0.05);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(205, 163, 81, 0.06);
  border-color: var(--border-color);
  font-weight: 600;
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: calc(100% - var(--sidebar-width));
}

/* Top bar with filters */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

body.section-vendedores-active .top-bar .filter-container {
  display: none !important;
}

.page-title h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  color: var(--text-main);
  letter-spacing: 1px;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.recovery-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(205, 163, 81, 0.12), rgba(16, 185, 129, 0.07));
  border: 1px solid rgba(205, 163, 81, 0.28);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.recovery-kicker {
  color: var(--primary-hover);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.recovery-banner h3 {
  color: var(--text-main);
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.6px;
  margin-bottom: 0.3rem;
}

.recovery-banner p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 780px;
}

.recovery-banner-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 245px;
}

.recovery-summary {
  color: var(--primary-hover);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

@media (max-width: 900px) {
  .recovery-banner {
    grid-template-columns: 1fr;
  }

  .recovery-banner-actions {
    align-items: stretch;
    min-width: 0;
  }

  .recovery-summary {
    text-align: left;
  }
}

/* Period Filters UI */
.filter-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-sidebar);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-inputs label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.date-inputs input[type="date"] {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.date-inputs input[type="date"]:focus {
  border-color: var(--primary);
}

.quick-filters {
  display: flex;
  gap: 0.35rem;
  border-left: 1px solid var(--border-color);
  padding-left: 0.5rem;
}

.btn-filter {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-filter:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-filter.active {
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 600;
}

/* Glassmorphism Cards & KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-glow-strong);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: background 0.3s;
}

.kpi-card.gold::before { background: var(--primary); }
.kpi-card.green::before { background: var(--success); }
.kpi-card.red::before { background: var(--danger); }
.kpi-card.amber::before { background: var(--warning); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.kpi-header svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
}

.kpi-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.kpi-trend-up { color: var(--status-active-text); }
.kpi-trend-down { color: var(--status-inactive-text); }

/* Dashboard Chart Section */
.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

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

.panel-title h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: 1px;
}

.panel-title p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  border: 1px solid var(--primary);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 12px rgba(205, 163, 81, 0.3);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-glow-strong);
}

/* Interactive Table UI */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.875rem;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

/* User Profile cell */
.user-cell {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: var(--text-main);
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.active {
  background: var(--status-active-bg);
  color: var(--status-active-text);
}

.badge.inactive {
  background: var(--status-inactive-bg);
  color: var(--status-inactive-text);
}

.badge.pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

/* Quick Actions buttons in table */
.action-buttons {
  display: flex;
  gap: 0.35rem;
}

.btn-icon-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-icon-wa:hover {
  background: #10b981;
  color: var(--text-inverse);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-icon-wa svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(205, 163, 81, 0.1);
  border: 1px solid rgba(205, 163, 81, 0.2);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit:hover {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 10px rgba(205, 163, 81, 0.4);
}

.btn-edit svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Filter controls on tables */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

.table-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.table-filters select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.table-filters select:focus {
  border-color: var(--primary);
}

.seller-month-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
}

.seller-month-control label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.seller-month-control select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.seller-month-control select:focus {
  border-color: var(--primary);
}

/* Seller Grid layout */
.sellers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.seller-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.seller-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.seller-profile {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1rem;
}

.seller-info h4 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--text-main);
}

.seller-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

.seller-badge-rank {
  background: rgba(205, 163, 81, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.seller-stats-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.seller-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.seller-stat-row span:first-child {
  color: var(--text-muted);
}

.seller-stat-row span:last-child {
  font-weight: 600;
  color: var(--text-main);
}

.seller-total-earnings {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.seller-total-earnings span:first-child {
  font-weight: 600;
  color: var(--primary);
}

.seller-total-earnings span:last-child {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-hover);
  font-family: 'Cinzel', serif;
}

/* Modals glassmorphic style */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  background: #091d12;
  border: 1px solid var(--primary);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-glow);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms styling inside panels / modals */
.form-group {
  margin-bottom: 1.25rem;
}

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

@media (max-width: 480px) {
  .form-group.row-2 {
    grid-template-columns: 1fr;
  }
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(205, 163, 81, 0.15);
}

/* Hide content sections by default */
.tab-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-section.active {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

/* Simple visual layout for deliverables & access duration */
.deliverables-progress {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
  height: 100%;
  border-radius: 10px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Access icons indicators */
.deliverables-chips {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.deliverables-chips span {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
}

.deliverables-chips span.unlocked {
  background: rgba(205, 163, 81, 0.08);
  border-color: rgba(205, 163, 81, 0.25);
  color: var(--primary-hover);
}

/* Investment / ROI configuration controls page */
.costs-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .costs-dashboard {
    grid-template-columns: 1fr;
  }
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0a2717;
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  color: var(--text-main);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 15px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
}

/* KPI Card Blue/Cyan para "A Receber" */
.kpi-card.cyan::before {
  background: #06b6d4; /* Cyan */
}

/* KPI Card Purple para "Ticket Médio" */
.kpi-card.purple::before {
  background: #a855f7; /* Purple */
}

/* Ficha do Cliente Layout */
.modal-container.large {
  max-width: 1100px;
}

.client-profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  min-height: 450px;
}

@media (max-width: 768px) {
  .client-profile-layout {
    grid-template-columns: 1fr;
  }
}

.client-profile-sidebar {
  border-right: 1px solid var(--border-color);
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .client-profile-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }
}

.client-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.client-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(205, 163, 81, 0.1);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.75rem;
  font-family: 'Cinzel', serif;
}

.client-sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.client-meta-item span:first-child {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

.client-meta-item span:last-child {
  color: var(--text-main);
  font-weight: 500;
}

.selected-product-sale-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 28px;
  gap: 0.75rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--text-main);
}

.selected-product-sale-info {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.selected-product-sale-info strong {
  font-size: 0.8rem;
  line-height: 1.25;
}

.selected-product-sale-info span,
.selected-product-sale-price span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.selected-product-sale-price {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.selected-product-sale-price input {
  width: 100%;
  padding: 0.4rem 0.45rem;
  font-size: 0.78rem;
}

@media (max-width: 620px) {
  .selected-product-sale-row {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .selected-product-sale-price {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.user-email.contact-missing,
.client-meta-item span.contact-missing {
  color: var(--status-inactive-text);
  font-style: italic;
}

.client-profile-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.profile-sub-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.profile-sub-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.profile-sub-tab-btn:hover {
  color: var(--text-main);
}

.profile-sub-tab-btn.active {
  background: rgba(205, 163, 81, 0.08);
  border-color: var(--border-color);
  color: var(--primary-hover);
}

.profile-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.profile-tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Timeline styles */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #091d12;
  box-shadow: 0 0 8px var(--primary-glow);
}

.timeline-item.active::before {
  background: var(--status-active-text);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.timeline-item-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.timeline-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#det-products-timeline.timeline {
  padding-left: 0;
}

#det-products-timeline.timeline::before {
  display: none;
}

.client-ledger-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.client-ledger-summary > div,
.contract-ledger-metrics > div {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  min-width: 0;
}

.client-ledger-summary span,
.contract-ledger-metrics span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.client-ledger-summary strong,
.contract-ledger-metrics strong {
  display: block;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.2;
  word-break: break-word;
}

.client-ledger-summary .attention,
.contract-ledger-metrics .attention {
  border-color: rgba(205, 163, 81, 0.35);
  background: rgba(205, 163, 81, 0.06);
}

.client-ledger-summary .danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.contract-ledger-card {
  border: 1px solid rgba(205, 163, 81, 0.16);
  border-radius: 8px;
  background: rgba(6, 20, 12, 0.72);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contract-ledger-card.has-overdue {
  border-color: rgba(239, 68, 68, 0.35);
}

.contract-ledger-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.contract-ledger-title {
  color: var(--text-main);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
}

.contract-ledger-subtitle {
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-top: 0.25rem;
}

.contract-ledger-badges {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.contract-products-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contract-products-list span {
  color: var(--text-main);
  border: 1px solid rgba(205, 163, 81, 0.18);
  background: rgba(205, 163, 81, 0.06);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.contract-ledger-metrics {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.contract-movements-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contract-movements-heading .btn-secondary {
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  text-transform: none;
}

.contract-movements-table {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.contract-movements-table table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}

.contract-movements-table th,
.contract-movements-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.contract-movements-table th {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contract-movements-table tbody tr:last-child td {
  border-bottom: 0;
}

.contract-movement-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.contract-movement-actions button {
  padding: 0.35rem 0.55rem;
  font-size: 0.7rem;
  min-height: 28px;
}

.contract-empty-movements,
.muted-action,
.paid-action {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.contract-empty-movements {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
}

.paid-action {
  color: var(--status-active-text);
}

.danger-action {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

@media (max-width: 980px) {
  .client-ledger-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contract-ledger-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .client-ledger-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contract-ledger-header,
  .contract-movements-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .contract-ledger-badges {
    justify-content: flex-start;
  }
}

/* Upsell Opportunity Card */
.upsell-opportunity-card {
  background: linear-gradient(135deg, rgba(205, 163, 81, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px dashed var(--primary);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.upsell-opportunity-card::after {
  content: '🎯';
  position: absolute;
  right: 0.5rem;
  bottom: 0.25rem;
  font-size: 3rem;
  opacity: 0.08;
}

.upsell-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--primary-hover);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upsell-description {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.4;
}

.upsell-pitch-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: inherit;
  white-space: pre-wrap;
  user-select: all;
  cursor: pointer;
  max-height: 120px;
  overflow-y: auto;
}

#modal-refinance {
  z-index: 110;
}

/* Garante legibilidade e contraste das opções dos selects em todos os navegadores/sistemas */
select option {
  background-color: #092215;
  color: var(--text-main);
}

/* ==========================================
   Estilização do Date Range Picker Customizado
   ========================================== */

/* Botão Trigger */
.btn-datepicker-trigger {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  font-family: inherit;
}

.btn-datepicker-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(205, 163, 81, 0.3);
  box-shadow: 0 0 10px rgba(205, 163, 81, 0.05);
}

.btn-datepicker-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Popover do Datepicker */
.datepicker-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(8, 25, 16, 0.96); /* Verde escuro do tema floresta */
  border: 1px solid rgba(205, 163, 81, 0.18);
  border-radius: 12px;
  padding: 1.25rem;
  z-index: 1000;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.65), 0 0 20px rgba(205, 163, 81, 0.06);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  width: 580px; /* Largura para acomodar dois calendários lado a lado */
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: pickerFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Presets / Atalhos rápidos */
.datepicker-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(205, 163, 81, 0.08);
  padding-bottom: 0.85rem;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.preset-btn:hover {
  color: var(--text-main);
  border-color: rgba(205, 163, 81, 0.2);
  background: rgba(205, 163, 81, 0.03);
}

.preset-btn.active {
  background: #008f82; /* Verde esmeralda escuro igual ao da referência */
  border-color: #00a896;
  color: #ffffff;
  font-weight: 600;
}

/* Calendários */
.datepicker-calendars {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
}

.datepicker-calendar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
}

.calendar-month-year {
  text-transform: capitalize;
}

.cal-nav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  outline: none;
}

.cal-nav:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.04);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.25rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
}

.datepicker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-radius 0.15s;
  position: relative;
  user-select: none;
  border-radius: 4px;
}

.datepicker-day:hover:not(.day-prev-month):not(.day-next-month):not(.day-start):not(.day-end) {
  background: rgba(255, 255, 255, 0.05);
}

/* Dias fora do mês atual */
.day-prev-month, .day-next-month {
  color: rgba(255, 255, 255, 0.15);
  cursor: default;
}

/* Seleção do Intervalo */
.datepicker-day.day-start {
  background: #008f82 !important; /* Verde esmeralda escuro igual ao da referência */
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 50% 0 0 50% !important;
}

.datepicker-day.day-end {
  background: #008f82 !important; /* Verde esmeralda escuro */
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 0 50% 50% 0 !important;
}

/* Se início e fim forem o mesmo dia */
.datepicker-day.day-start.day-end {
  border-radius: 50% !important;
}

.datepicker-day.day-in-range {
  background: rgba(0, 143, 130, 0.12) !important; /* Destaque verde esmeralda translúcido */
  color: #34d399 !important;
  border-radius: 0 !important;
}

/* Rodapé */
.datepicker-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(205, 163, 81, 0.08);
  padding-top: 0.85rem;
  font-size: 0.8rem;
}

#datepicker-footer-range {
  font-weight: 600;
  color: var(--text-main);
}

.datepicker-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-cancel {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-cancel:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.btn-apply {
  background: #008f82; /* Verde esmeralda igual ao da referência */
  border: 1px solid #00a896;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-apply:hover {
  background: #00a896;
  box-shadow: 0 0 10px rgba(0, 168, 150, 0.3);
}

/* ==========================================
   Sub-abas do CRM (Operacional vs Financeira)
   ========================================== */
.crm-subtabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  margin-bottom: 1.25rem;
}

.crm-subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-speed);
  outline: none;
}

.crm-subtab-btn:hover {
  color: var(--text-main);
}

.crm-subtab-btn.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
  text-shadow: 0 0 10px rgba(205, 163, 81, 0.15);
}
/* ==========================================
   Autenticação & Status de Nuvem (Supabase)
   ========================================== */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #05140b 0%, #000000 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cloud-pulse {
  animation: cloudBlink 1.5s infinite alternate;
}

@keyframes cloudBlink {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

#cloud-sql-script {
  border-color: rgba(205, 163, 81, 0.2);
  transition: border-color 0.2s;
}
#cloud-sql-script:focus {
  border-color: var(--primary);
}
