/* ==========================================================================
   METRIFY DESIGN SYSTEM - VANILLA CSS
   ========================================================================== */

/* 1. Global Reset & Variables */
:root {
  --y: #f7cb45;                               /* Dourado Destaque */
  --y-dim: rgba(247, 203, 69, .12);          /* Dourado translúcido */
  --y-glow: rgba(247, 203, 69, .08);         /* Brilho dourado */
  
  --font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Color Palette based on Dash_producao-main */
  --bg-dark: #09090b;
  --bg-sidebar: #111113;
  --bg-card: #18181b;
  --bg-card-hover: #232326;
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-focus: #f7cb45;
  
  /* Core Metrics Colors */
  --color-primary: #fafafa;
  --color-muted: #a1a1aa;
  --color-detail: #52525b;
  
  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-blue-rgb: 59, 130, 246;
  --accent-orange: #f97316;
  --accent-orange-rgb: 249, 115, 22;
  --accent-cyan: #06b6d4;
  --accent-cyan-rgb: 6, 182, 212;
  --accent-purple: #a855f7;
  --accent-purple-rgb: 168, 85, 247;
  --accent-emerald: #22c55e;
  --accent-emerald-rgb: 34, 197, 94;
  --accent-red: #ef4444;
  
  /* Layout Properties */
  --sidebar-width: clamp(220px, 24vw, 260px);
  --header-height: 72px;
  --border-radius-lg: 12px;
  --border-radius-md: 8px;
  --border-radius-sm: 6px;
  --shadow-main: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);
  --transition-smooth: all 0.2s ease-in-out;
  --content-padding: clamp(20px, 3vw, 40px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--color-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 1rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.4vw, 32px);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* 2. Main Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2vw, 24px) 14px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 8px;
}

.logo-icon {
  background: transparent;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--y-glow);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, var(--y));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--color-muted);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background-color: hsla(217, 32%, 18%, 0.4);
  color: var(--color-primary);
}

.nav-item.active {
  background: var(--y-dim);
  color: var(--y);
  border-left: 3px solid var(--y);
  padding-left: 13px;
}

.sidebar-footer {
  padding: 16px 8px 0 8px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vps-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: var(--content-padding);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.4vw, 32px);
  min-width: 0;
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.header-title-wrapper h1 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.small {
  font-size: 0.85rem;
}

.date-indicator {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 9px 14px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}

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

/* 3. Common UI Elements (Cards, Inputs, Buttons) */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: clamp(16px, 2vw, 24px);
}

.card-header {
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 24px 0;
}

/* Forms and Inputs */
.form-input {
  width: 100%;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  color: var(--color-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 8px rgba(247, 203, 69, 0.25);
}

.form-input::placeholder {
  color: hsla(215, 20%, 65%, 0.5);
}

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

.btn-primary {
  background: var(--y);
  color: #000;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px var(--y-glow);
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--border-radius-md);
}

.btn-danger {
  background-color: hsla(350, 89%, 60%, 0.15);
  color: var(--accent-red);
  border: 1px solid hsla(350, 89%, 60%, 0.3);
}

.btn-danger:hover {
  background-color: var(--accent-red);
  color: #fff;
}

.btn-secondary {
  background-color: hsla(215, 20%, 30%, 0.15);
  color: var(--text-color);
  border: 1px solid hsla(215, 20%, 50%, 0.3);
}

.btn-secondary:hover {
  background-color: hsla(215, 20%, 50%, 0.25);
  transform: translateY(-1px);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.badge {
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.info-badge {
  background-color: hsla(180, 100%, 45%, 0.15);
  color: var(--accent-cyan);
  border: 1px solid hsla(180, 100%, 45%, 0.3);
}

/* 4. Dashboard View Specifics */
/* Filters */
.filter-card {
  padding: 20px 24px;
}

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

.filter-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-group label i {
  width: 16px;
  height: 16px;
}

.date-picker-group {
  grid-column: span 1;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-range-inputs input {
  flex: 1;
  min-width: 130px;
  max-width: 150px;
}

.date-range-inputs span {
  font-size: 0.85rem;
  color: var(--color-muted);
  white-space: nowrap;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Glowing borders matching colors */
.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.kpi-card:hover {
  transform: translateY(-3px);
}

.kpi-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-dark);
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

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

.kpi-value {
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-weight: 700;
  margin: 2px 0;
}

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

/* Color codes */
.bg-blue { background: linear-gradient(135deg, hsl(210, 100%, 65%), var(--accent-blue)); }
.bg-orange { background: linear-gradient(135deg, hsl(24, 100%, 60%), var(--accent-orange)); }
.bg-cyan { background: linear-gradient(135deg, hsl(180, 100%, 60%), var(--accent-cyan)); }
.bg-purple { background: linear-gradient(135deg, hsl(263, 100%, 75%), var(--accent-purple)); }
.bg-emerald { background: linear-gradient(135deg, hsl(142, 80%, 60%), var(--accent-emerald)); }

.text-glow-blue:hover { border-color: rgba(var(--accent-blue-rgb), 0.5); box-shadow: 0 0 20px rgba(var(--accent-blue-rgb), 0.15); }
.text-glow-orange:hover { border-color: rgba(var(--accent-orange-rgb), 0.5); box-shadow: 0 0 20px rgba(var(--accent-orange-rgb), 0.15); }
.text-glow-cyan:hover { border-color: rgba(var(--accent-cyan-rgb), 0.5); box-shadow: 0 0 20px rgba(var(--accent-cyan-rgb), 0.15); }
.text-glow-purple:hover { border-color: rgba(var(--accent-purple-rgb), 0.5); box-shadow: 0 0 20px rgba(var(--accent-purple-rgb), 0.15); }
.text-glow-emerald:hover { border-color: rgba(var(--accent-emerald-rgb), 0.5); box-shadow: 0 0 20px rgba(var(--accent-emerald-rgb), 0.15); }

/* Highlight Card for Golden Rule conversion rate */
.highlight-card {
  border: 1px solid rgba(var(--accent-emerald-rgb), 0.3);
  background: linear-gradient(145deg, hsla(222, 47%, 12%, 0.8), hsla(142, 70%, 10%, 0.15));
}
.highlight-card .kpi-value {
  color: var(--accent-emerald);
  text-shadow: 0 0 10px rgba(var(--accent-emerald-rgb), 0.3);
}

/* Charts Layout */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.chart-card {
  display: flex;
  flex-direction: column;
}

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

/* Data Tables & Rankings */
.rankings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}

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

.table-card {
  padding: clamp(16px, 2vw, 24px);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

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

.data-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--color-primary);
}

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

.data-table tbody tr:hover {
  background-color: hsla(217, 32%, 18%, 0.25);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-emerald { color: var(--accent-emerald); font-weight: 600; }
.text-cyan { color: var(--accent-cyan); font-weight: 600; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}

.rank-1 { background-color: hsl(45, 100%, 50%); color: hsl(222, 47%, 7%); }
.rank-2 { background-color: hsl(0, 0%, 75%); color: hsl(222, 47%, 7%); }
.rank-3 { background-color: hsl(30, 60%, 50%); color: hsl(222, 47%, 7%); }
.rank-other { background-color: var(--border-color); color: var(--color-muted); }

/* 5. Launches View (Daily Preenchimento) Specifics */
.placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  gap: 16px;
}

.placeholder-card i {
  width: 60px;
  height: 60px;
  color: hsla(215, 20%, 65%, 0.3);
}

.placeholder-card h3 {
  font-size: 1.25rem;
}

.launch-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.launch-input {
  width: 100px;
  text-align: center;
  margin: 0 auto;
}

.observacoes-input {
  width: 100%;
  text-align: left;
}

.aproveitaveis-cell {
  font-weight: 600;
  color: var(--accent-cyan);
}

.total-row td {
  font-weight: 700;
  background-color: hsla(222, 47%, 5%, 0.4);
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
}

.conversion-total-display {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.form-actions-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  padding-top: 20px;
}

.validation-message {
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  width: 100%;
}

.error-message {
  background-color: hsla(350, 89%, 60%, 0.12);
  color: var(--accent-red);
  border: 1px solid hsla(350, 89%, 60%, 0.3);
}

/* 6. Settings/Cadastros View Specifics */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-card {
  display: flex;
  flex-direction: column;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group-vertical label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
}

.list-wrapper {
  margin-top: 8px;
}

.list-wrapper h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.settings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.settings-list-item {
  background-color: hsla(222, 47%, 7%, 0.5);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.settings-list-item:hover {
  border-color: hsla(217, 32%, 30%, 0.8);
}

.settings-list-item span {
  font-weight: 500;
}

.settings-list-item .item-sub {
  font-size: 0.75rem;
  color: var(--color-muted);
  display: block;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon-delete {
  background: none;
  border: none;
  color: hsla(350, 89%, 60%, 0.6);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-icon-delete:hover {
  background-color: hsla(350, 89%, 60%, 0.15);
  color: var(--accent-red);
}

.btn-icon-delete i {
  width: 16px;
  height: 16px;
}

/* Switch Styles (for Sales Channels active status) */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-emerald);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

@media (max-width: 1200px) {
  .charts-grid,
  .rankings-grid {
    grid-template-columns: 1fr;
  }
  
  .date-range-inputs input {
    max-width: 130px;
  }
}

@media (max-width: 960px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }

  .sidebar-header {
    margin-bottom: 20px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 1 1 calc(50% - 8px);
    min-width: 180px;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .date-indicator {
    width: 100%;
    justify-content: center;
  }

  .filter-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .date-range-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .date-range-inputs span {
    display: none;
  }

  .kpi-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .kpi-card,
  .table-card {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .sidebar-nav {
    flex-direction: column;
  }

  .nav-item {
    flex-basis: auto;
  }

  .main-content {
    padding: 16px;
    gap: 16px;
  }

  .form-input,
  .btn {
    font-size: 0.95rem;
  }

  .btn {
    width: 100%;
  }
  
  .date-range-inputs input {
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .date-range-inputs input {
    max-width: 120px;
  }
}

/* 7. Toast Notification */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1000;
  max-width: 450px;
  width: calc(100vw - 64px);
  transition: var(--transition-smooth);
  animation: slideIn 0.3s ease-out;
}

.toast-content {
  background-color: var(--bg-card);
  border: 1px solid var(--accent-blue);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.95rem;
}

.toast-content i {
  color: var(--accent-blue);
}

.toast.success .toast-content {
  border-color: var(--accent-emerald);
}
.toast.success .toast-content i {
  color: var(--accent-emerald);
}
.toast.error .toast-content {
  border-color: var(--accent-red);
}
.toast.error .toast-content i {
  color: var(--accent-red);
}

/* Utility Helpers */
.hidden {
  display: none !important;
}

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

/* 8. Responsiveness */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }
  .sidebar-header {
    margin-bottom: 16px;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-item {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  .nav-item.active {
    border-left: none;
    border-bottom: 3px solid var(--accent-blue);
    padding-left: 14px;
    padding-bottom: 7px;
  }
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* Evita o zoom automático do iOS Safari ao focar em inputs definindo o tamanho mínimo de fonte como 16px */
  input, 
  select, 
  textarea, 
  .form-input {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   MÓDULO CRM & KANBAN STYLES
   ========================================================================== */

/* Kanban Board Container (Horizontal Scroll) */
.kanban-board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 650px;
  align-items: flex-start;
  justify-content: flex-start;
}

.kanban-column {
  flex: 1 1 270px;
  min-width: 260px;
  max-width: 350px;
  background: rgba(18, 22, 38, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.kanban-column-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--column-color, var(--accent-blue));
}

.kanban-column-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.kanban-column-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.kanban-column-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 0 8px var(--column-color, rgba(99, 102, 241, 0.5));
}

.kanban-column-header-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.kanban-column-total {
  font-size: 0.74rem;
  font-weight: 700;
  color: #10B981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.kanban-column-total:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.kanban-column-total.zero-val {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.kanban-column-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
}

.kanban-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
  min-height: 100px;
  padding-right: 4px;
}

.kanban-cards-wrapper.drag-over {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  border: 2px dashed var(--accent-blue);
}

/* Kanban Cards */
.kanban-card {
  background: rgba(30, 36, 58, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  padding: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0; /* Evita que o card encolha e fique achatado/cortado */
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card-tag {
  height: 4px;
  width: 36px;
  border-radius: 2px;
  background-color: var(--card-color, var(--accent-blue));
  margin-bottom: 8px;
}

.kanban-card-client-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.kanban-card-info {
  font-size: 0.8rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Animacao do Alerta de Aceite Pendente (Pulsante) */
@keyframes alertPulseAnimation {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8), inset 0 0 10px rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 1);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(239, 68, 68, 0), inset 0 0 20px rgba(239, 68, 68, 0.6);
    border-color: rgba(248, 113, 113, 1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), inset 0 0 10px rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 1);
  }
}

.kanban-card.alert-pulsing {
  animation: alertPulseAnimation 1.4s infinite;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(24, 28, 48, 0.95)) !important;
  border: 1px solid #ef4444 !important;
}

.btn-aceitar-lead {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transition: transform 0.15s ease;
}

.btn-aceitar-lead:hover {
  transform: scale(1.02);
  background: linear-gradient(135deg, #f87171, #ef4444);
}

/* Timeline do Cliente */
.timeline-item {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 16px;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  flex-grow: 1;
}

/* Ajustes para Telas Grandes (Design Compacto e Elegante similar a 75% zoom) */
@media (min-width: 1200px) {
  :root {
    --sidebar-width: 200px;
    --header-height: 54px;
    --content-padding: 20px;
  }
  
  html {
    font-size: 13px; /* Zoom reduzido ainda mais (de 14.5px para 13px) */
  }
  
  .sidebar {
    padding: 12px 8px;
  }
  
  .sidebar-header {
    margin-bottom: 20px;
    padding: 0 4px;
  }
  
  .logo-icon {
    width: 28px;
    height: 28px;
  }
  
  .logo-text {
    font-size: 1.15rem;
  }
  
  .sidebar-nav {
    overflow-y: auto; /* Adiciona barra de rolagem nos campos da sidebar */
    padding-right: 2px;
  }
  
  /* Barra de rolagem discreta e fina para a sidebar */
  .sidebar-nav::-webkit-scrollbar {
    width: 4px;
  }
  .sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
  }
  .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
  }
  .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
  
  .nav-item {
    padding: 8px 10px;
    gap: 8px;
    font-size: 0.85rem;
  }
  
  .nav-item i {
    width: 16px;
    height: 16px;
  }
  
  .top-header {
    margin-bottom: 16px;
  }
  
  .kanban-column {
    width: 260px;
    min-width: 260px;
    padding: 12px;
  }
  
  .kanban-column-header {
    padding-bottom: 8px;
    margin-bottom: 10px;
    gap: 6px;
  }
  
  .kanban-column-title {
    font-size: 0.8rem;
  }

  .kanban-column-total {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .kanban-column-count {
    font-size: 0.68rem;
    padding: 2px 6px;
  }
  
  .kanban-board-container {
    gap: 12px;
    min-height: 520px;
  }
  
  .kanban-card {
    padding: 8px 10px;
  }
  
  .kanban-card-client-name {
    font-size: 0.85rem;
  }
  
  .kanban-card-info {
    font-size: 0.72rem;
    gap: 2px;
  }
  
  .kanban-card-footer {
    margin-top: 8px;
    padding-top: 4px;
    font-size: 0.68rem;
  }
}
