/* ==========================================================================
   CSS CUSTOM VARIABLES & THEME SETUP
   ========================================================================== */
:root {
  --bg-dark: #070913;
  --card-bg: rgba(13, 19, 39, 0.55);
  --card-hover-bg: rgba(22, 32, 66, 0.7);
  --card-border: rgba(255, 255, 255, 0.07);
  
  --primary: #5c62ec;
  --primary-glow: rgba(92, 98, 236, 0.35);
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  
  --purple: #bf5af2;
  --purple-glow: rgba(191, 90, 242, 0.25);
  
  --blue: #0a84ff;
  --blue-glow: rgba(10, 132, 255, 0.25);
  
  --green: #30d158;
  --green-glow: rgba(48, 209, 88, 0.25);
  
  --orange: #ff9f0a;
  --orange-glow: rgba(255, 159, 10, 0.25);
  
  --red: #ff453a;
  --red-glow: rgba(255, 69, 58, 0.25);
  
  --text-main: #f5f6fa;
  --text-secondary: #9aa4bf;
  --text-muted: #5e6882;
  
  --font-family-title: 'Outfit', 'Inter', sans-serif;
  --font-family-body: 'Inter', sans-serif;
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   GLOBAL STYLES & RESET
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family-body);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Glow Effects */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  mix-blend-mode: screen;
  animation: orbFloat 25s infinite alternate ease-in-out;
}

.orb-1 {
  background: var(--primary);
  width: 45vw;
  height: 45vw;
  top: -10vw;
  left: -5vw;
}

.orb-2 {
  background: var(--cyan);
  width: 40vw;
  height: 40vw;
  bottom: -5vw;
  right: -5vw;
  animation-delay: -5s;
}

.orb-3 {
  background: var(--purple);
  width: 35vw;
  height: 35vw;
  top: 35vh;
  left: 30vw;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8%, 12%) scale(1.15); }
}

/* Glassmorphism General Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  background: var(--card-hover-bg);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Neon Borders */
.border-cyan { border-left: 4px solid var(--cyan); }
.border-purple { border-left: 4px solid var(--purple); }
.border-blue { border-left: 4px solid var(--blue); }
.border-green { border-left: 4px solid var(--green); }
.border-orange { border-left: 4px solid var(--orange); }
.border-red { border-left: 4px solid var(--red); }

.text-cyan { color: var(--cyan) !important; }
.text-purple { color: var(--purple) !important; }
.text-green { color: var(--green) !important; }

/* ==========================================================================
   APP CONTAINER LAYOUT
   ========================================================================== */
.app-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text h1 {
  font-family: var(--font-family-title);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.logo-text h1 span {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: -2px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Connection Badge */
.connection-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-connected .pulse-dot {
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulseGreen 1.8s infinite;
}

.status-syncing .pulse-dot {
  background-color: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: pulseOrange 1.8s infinite;
}

.status-disconnected .pulse-dot {
  background-color: var(--red);
  box-shadow: 0 0 8px var(--red);
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes pulseOrange {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.sync-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
}

.last-sync-label {
  color: var(--text-muted);
}

.last-sync-time {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Info Banner Boxes */
.info-banner {
  display: flex;
  gap: 20px;
  padding: 16px 24px;
  align-items: center;
}

.banner-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-content h4 {
  font-family: var(--font-family-title);
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.banner-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.banner-tooltip {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.banner-tooltip i {
  font-size: 1.15rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-family-title);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3b42cc);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7479f2, var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 98, 236, 0.5);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Rotate Animation */
.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   KPI SUMMARY GRID
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.icon-cyan { background: var(--cyan-glow); color: var(--cyan); }
.icon-purple { background: var(--purple-glow); color: var(--purple); }
.icon-blue { background: var(--blue-glow); color: var(--blue); }
.icon-green { background: var(--green-glow); color: var(--green); }

.kpi-data h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kpi-data h2 {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 4px 0;
  letter-spacing: -0.5px;
}

.kpi-data p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FILTER PANEL
   ========================================================================== */
.dashboard-controls {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px 12px 48px;
  border-radius: var(--border-radius-md);
  color: var(--text-main);
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 15px rgba(92, 98, 236, 0.15);
}

.filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-group select:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   NAVIGATION VIEW TABS
   ========================================================================== */
.view-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family-title);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
  position: relative;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

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

.tab-btn.active {
  color: var(--cyan);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 3px;
}

.badge {
  background: var(--purple);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

/* Tab contents */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* ==========================================================================
   VIEW 1: LIST / GRID OF DEALS
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
}

.count-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Deal Card Style */
.deal-card {
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  overflow: hidden;
}

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

.deal-card.card-won::before { background: var(--green); }
.deal-card.card-lost::before { background: var(--red); }
.deal-card.card-public::before { background: var(--cyan); }
.deal-card.card-private::before { background: var(--purple); }

/* Deal Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.card-id {
  font-size: 0.7rem;
  font-family: var(--font-family-title);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-title {
  font-family: var(--font-family-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 48px;
}

/* Deal Card Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-solucao { background: rgba(0, 240, 255, 0.1); color: var(--cyan); border: 1px solid rgba(0, 240, 255, 0.08); }
.tag-empresa { background: rgba(191, 90, 242, 0.1); color: var(--purple); border: 1px solid rgba(191, 90, 242, 0.08); }
.tag-plataforma { background: rgba(255, 159, 10, 0.1); color: var(--orange); border: 1px solid rgba(255, 159, 10, 0.08); }

/* Deal Card Body & Value */
.card-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.value-box {
  display: flex;
  flex-direction: column;
}

.value-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.value-amount {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.stage-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  color: #fff;
  text-align: center;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Loading states */
.loading-state, .empty-state, .log-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  gap: 16px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--border-radius-lg);
}

.loading-state i, .empty-state i, .log-empty-state i {
  font-size: 2.5rem;
  color: var(--primary);
}

.empty-state h3 {
  font-family: var(--font-family-title);
  color: var(--text-main);
}

/* ==========================================================================
   VIEW 2: KANBAN BOARD
   ========================================================================== */
.kanban-wrapper {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 550px;
}

.kanban-column {
  min-width: 320px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 2px solid;
  border-radius: var(--border-radius-sm);
  background: rgba(0,0,0,0.15);
}

.kanban-column-header h3 {
  font-family: var(--font-family-title);
  font-size: 0.9rem;
  font-weight: 700;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-column-header .col-badge {
  background: rgba(255,255,255,0.08);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.kanban-cards-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 600px;
  padding: 4px;
}

.kanban-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(20, 27, 51, 0.4);
}

.kanban-card:hover {
  background: rgba(28, 38, 71, 0.65);
}

.kanban-card .card-title {
  font-size: 0.95rem;
  height: 38px;
  margin-top: 0;
}

.kanban-card .value-amount {
  font-size: 1.1rem;
}

/* ==========================================================================
   VIEW 3 & 4: EXECUTIVE TABLE & SCROLL STYLINGS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--card-border);
}

.executive-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.executive-table th, .executive-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.executive-table th {
  background-color: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font-family: var(--font-family-title);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.executive-table tbody tr {
  transition: var(--transition-smooth);
}

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

.executive-table .td-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Semaphore Lights */
.semaphore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.8rem;
}

.semaphore-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.semaphore-green .semaphore-dot {
  background-color: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.semaphore-yellow .semaphore-dot {
  background-color: var(--orange);
  box-shadow: 0 0 10px var(--orange);
}

.semaphore-red .semaphore-dot {
  background-color: var(--red);
  box-shadow: 0 0 10px var(--red);
}

/* ==========================================================================
   VIEW 4: ORÇAMENTOS (QUOTES) SUMMARY CARDS
   ========================================================================== */
.quotes-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.quote-sum-card {
  padding: 20px;
}

.quote-sum-card h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.quote-sum-card h3 {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.quote-sum-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Quote Status Badge */
.badge-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.badge-approved { background-color: rgba(48, 209, 88, 0.15); color: var(--green); border: 1px solid rgba(48, 209, 88, 0.2); }
.badge-pending { background-color: rgba(255, 159, 10, 0.15); color: var(--orange); border: 1px solid rgba(255, 159, 10, 0.2); }
.badge-rejected { background-color: rgba(255, 69, 58, 0.15); color: var(--red); border: 1px solid rgba(255, 69, 58, 0.2); }

.quote-link {
  color: var(--cyan);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quote-link:hover {
  text-decoration: underline;
  color: #5ce6ff;
}

/* ==========================================================================
   VIEW 5: BI ANALYTICS & TARGET CONTROLLER
   ========================================================================== */
.analytics-row-top {
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analytics-control-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 16px;
}

.analytics-control-box h3 {
  font-family: var(--font-family-title);
  font-size: 1.15rem;
}

.target-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.2);
  padding: 8px 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255,255,255,0.05);
}

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

.target-input-group input {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
  width: 120px;
  outline: none;
  font-family: var(--font-family-body);
  font-size: 0.85rem;
  font-weight: bold;
}

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

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
}

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

.chart-card {
  padding: 24px;
}

.chart-card h3 {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 10px;
}

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

/* ==========================================================================
   VIEW 6: WEBHOOK LOGS
   ========================================================================== */
.webhook-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.webhook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 14px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
}

.title-with-icon i {
  font-size: 1.3rem;
}

.webhook-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.webhook-logs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  padding: 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255,255,255,0.05);
  font-family: monospace;
}

.log-entry {
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--primary);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideIn 0.3s ease-out;
}

.log-entry.log-deal-update { border-left-color: var(--purple); }
.log-entry.log-deal-add { border-left-color: var(--green); }
.log-entry.log-deal-delete { border-left-color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.log-event {
  font-weight: bold;
  color: var(--cyan);
}

.log-deal-id {
  color: var(--purple);
}

.log-msg {
  color: var(--text-main);
  word-break: break-all;
}

/* Flash effect */
.flash-update {
  animation: flashFX 1.5s ease-out;
}

@keyframes flashFX {
  0% { box-shadow: 0 0 25px var(--cyan); border-color: var(--cyan); }
  100% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); border-color: var(--card-border); }
}

/* ==========================================================================
   MODAL DIALOG (DETAIL VIEW)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 9, 19, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  width: 100%;
  max-width: 740px;
  position: relative;
  padding: 32px;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 50px rgba(0,0,0,0.8);
  animation: modalIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

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

.modal-header {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.modal-header h2 {
  font-family: var(--font-family-title);
  font-size: 1.5rem;
  color: var(--text-main);
  line-height: 1.3;
}

.modal-stage {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  color: #fff;
  margin-top: 6px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255,255,255,0.03);
}

@media (max-width: 480px) {
  .modal-info-grid {
    grid-template-columns: 1fr;
  }
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.info-value {
  font-family: var(--font-family-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.text-muted {
  color: var(--text-secondary);
}

/* Quotes in Modal details */
.modal-quotes-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-quotes-box h4 {
  font-family: var(--font-family-title);
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 6px;
}

.modal-quotes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  background: rgba(0,0,0,0.15);
  padding: 10px;
  border-radius: var(--border-radius-sm);
}

.modal-quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.modal-desc-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-desc-box h4 {
  font-family: var(--font-family-title);
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 6px;
}

.modal-desc-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,0.15);
  padding: 12px;
  border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}
