:root {
  --primary-color: #006f67;
  --secondary-color: #6ebf4d;
  --primary-light: rgba(0, 111, 103, 0.1);
  --secondary-light: rgba(110, 191, 77, 0.1);
  --text-color: #333;
  --text-light: #666;
  --background-color: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
  --radius: 8px;
}

.clientes-rfv-container {
  padding: 1rem;
  max-width: 100%;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.client-details-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.create-activity-btn {
  background: linear-gradient(135deg, #71c054 0%, #5a9943 100%) !important;
  color: white !important;
  border: none !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  min-width: 160px !important;
  justify-content: center !important;
}

.create-activity-btn:hover {
  background: linear-gradient(135deg, #63aa49 0%, #4f863b 100%) !important;
  transform: translateY(-2px) !important;
}

.create-activity-btn:active {
  transform: translateY(0) !important;
}

.create-value-proposal-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: white !important;
  border: none !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  min-width: 160px !important;
  justify-content: center !important;
}

.create-value-proposal-btn:hover {
  background: linear-gradient(135deg, #3730a3 0%, #6b21a8 100%) !important;
  transform: translateY(-2px) !important;
}

.create-value-proposal-btn:active {
  transform: translateY(0) !important;
}

.create-funnel-opportunity-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: white !important;
  border: none !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  min-width: 160px !important;
  justify-content: center !important;
}

.create-funnel-opportunity-btn:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
  transform: translateY(-2px) !important;
}

.create-funnel-opportunity-btn:active {
  transform: translateY(0) !important;
}

.create-activity-btn.activity-closed {
  display: none !important;
  visibility: hidden !important;
}

.create-activity-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.create-activity-modal.active {
  display: flex;
}

.create-activity-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.create-activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  background: linear-gradient(135deg, #f8fffe 0%, #e8f5f4 100%);
  border-radius: 12px 12px 0 0;
}

.create-activity-header h3 {
  margin: 0;
  color: #006f67;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-create-activity {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.close-create-activity:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #333;
}

.create-activity-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  color: #333;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #006f67;
  background-color: white;
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.1);
}

/* Estilos para optgroups nos selects de assunto */
.form-group select optgroup {
  font-weight: bold;
  font-style: normal;
  color: #006f67;
  background-color: #f8f9fa;
  padding: 4px 8px;
}

.form-group select optgroup[label="Sucesso"] {
  color: #28a745;
}

.form-group select optgroup[label="Insucesso"] {
  color: #dc3545;
}

.form-group select option {
  padding: 4px 8px;
  font-weight: normal;
  color: #333;
}

.form-group select optgroup option {
  padding-left: 12px;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.create-activity-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid #e5e5e5;
  background-color: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

.btn-cancel,
.btn-save {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel {
  background-color: #f8f9fa;
  color: #666;
  border: 1px solid #ddd;
}

.btn-cancel:hover {
  background-color: #e9ecef;
  color: #333;
}

.btn-save {
  background: linear-gradient(135deg, #006f67 0%, #004d47 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.2);
}

.btn-save:hover {
  background: linear-gradient(135deg, #004d47 0%, #003832 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 111, 103, 0.3);
}

.btn-save:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.2);
}

.filters-card {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 111, 103, 0.1);
}

.filters-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 300px;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.client-counter-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #006f67 0%, #004d47 100%);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.2);
}

.client-counter-display i {
  font-size: 1rem;
}

.client-counter-display span {
  font-weight: 600;
}

.counter-label {
  font-weight: 400 !important;
  opacity: 0.9;
}

.filters-card .search-container {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
}

.filters-card .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.filters-card .search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background-color: #fafafa;
}

.filters-card .search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: white;
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.1);
}

.filters-card .search-icon {
  position: absolute;
  left: 0.75rem;
  color: #666;
  font-size: 0.875rem;
  z-index: 1;
}

.filters-card .clear-search-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.filters-card .clear-search-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

.filters-card .segment-filter {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  background-color: #fafafa;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
}

.filters-card .segment-filter:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: white;
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.1);
}

.filters-card .btn-clear-filter {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  color: #666;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.filters-card .btn-clear-filter:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
}

.filters-card .export-button {
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.filters-card .export-button:hover {
  background-color: #005a54;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filters-card .column-visibility-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.filters-card .column-visibility-button:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .filters-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filters-group {
    flex-direction: column;
    min-width: auto;
  }

  .filters-card .search-container {
    min-width: auto;
    max-width: none;
  }

  .filters-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .client-counter-display {
    order: -1;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

.clientes-rfv-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  margin-bottom: 20px;
}

.table-responsive {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 111, 103, 0.3) transparent;
  flex: 1;
  min-height: 0;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(0, 111, 103, 0.3);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 111, 103, 0.5);
}

.clientes-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  position: relative;
  table-layout: fixed;
}

.clientes-table thead {
  position: sticky;
  top: 0;
  z-index: 999;
}

.clientes-table th {
  background-color: #f5f8f8;
  font-weight: 600;
  color: var(--color-text-primary);
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
}

.clientes-table th::before,
.clientes-table th::after {
  display: none !important;
  content: none !important;
}

.clientes-table tbody {
  position: static;
}

.clientes-table tbody tr {
  background-color: #ffffff;
  position: relative;
  border-left: 4px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease, border-left-color 0.3s ease;
}

.clientes-table td {
  background-color: #ffffff;
}

.clientes-table th,
.clientes-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  min-width: 100px;
}

.clientes-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.clientes-table th:nth-child(1),
.clientes-table td:nth-child(1) {
  min-width: 100px;
  max-width: 120px;
  width: 110px;
}

.clientes-table th:nth-child(2),
.clientes-table td:nth-child(2) {
  min-width: 250px;
  max-width: 300px;
  width: 275px;
}

.clientes-table th:nth-child(3),
.clientes-table td:nth-child(3) {
  min-width: 120px;
  max-width: 150px;
  width: 135px;
}

.clientes-table th:nth-child(4),
.clientes-table td:nth-child(4) {
  text-align: center;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(5),
.clientes-table td:nth-child(5) {
  text-align: center;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(6),
.clientes-table td:nth-child(6) {
  text-align: center;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(7),
.clientes-table td:nth-child(7) {
  text-align: right;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(8),
.clientes-table td:nth-child(8) {
  text-align: right;
  min-width: 120px;
  max-width: 140px;
  width: 130px;
}

.clientes-table th:nth-child(9),
.clientes-table td:nth-child(9) {
  text-align: right;
  min-width: 120px;
  max-width: 140px;
  width: 130px;
}

.clientes-table th:nth-child(10),
.clientes-table td:nth-child(10) {
  text-align: right;
  min-width: 130px;
  max-width: 150px;
  width: 140px;
}

.clientes-table th:nth-child(11),
.clientes-table td:nth-child(11) {
  min-width: 150px;
  max-width: 180px;
  width: 165px;
}

.clientes-table th:nth-child(12),
.clientes-table td:nth-child(12) {
  min-width: 120px;
  max-width: 150px;
  width: 135px;
}

.clientes-table th:nth-child(13),
.clientes-table td:nth-child(13) {
  min-width: 120px;
  max-width: 150px;
  width: 135px;
}

.clientes-table th:nth-child(14),
.clientes-table td:nth-child(14) {
  text-align: center;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(15),
.clientes-table td:nth-child(15) {
  text-align: right;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(16),
.clientes-table td:nth-child(16) {
  text-align: center;
  min-width: 120px;
  max-width: 140px;
  width: 130px;
}

.clientes-table th:nth-child(17),
.clientes-table td:nth-child(17) {
  text-align: right;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(18),
.clientes-table td:nth-child(18) {
  text-align: right;
  min-width: 120px;
  max-width: 140px;
  width: 130px;
}

.clientes-table th:nth-child(19),
.clientes-table td:nth-child(19) {
  min-width: 120px;
  max-width: 150px;
  width: 135px;
}

.clientes-table th:nth-child(20),
.clientes-table td:nth-child(20) {
  text-align: center;
  min-width: 150px;
  max-width: 170px;
  width: 160px;
}

.clientes-table th:nth-child(21),
.clientes-table td:nth-child(21) {
  text-align: right;
  min-width: 140px;
  max-width: 140px;
  width: 140px;
}

.clientes-table th:nth-child(22),
.clientes-table td:nth-child(22) {
  text-align: center;
  min-width: 120px;
  max-width: 120px;
  width: 120px;
}

.clientes-table th:nth-child(23),
.clientes-table td:nth-child(23) {
  text-align: right;
  min-width: 130px;
  max-width: 130px;
  width: 130px;
}

.clientes-table th:nth-child(24),
.clientes-table td:nth-child(24) {
  text-align: right;
  min-width: 120px;
  max-width: 120px;
  width: 120px;
}

.clientes-table th:nth-child(25),
.clientes-table td:nth-child(25) {
  text-align: center;
  min-width: 80px;
  max-width: 80px;
  width: 80px;
}

.clientes-table th:nth-child(26),
.clientes-table td:nth-child(26) {
  text-align: center;
  min-width: 120px;
  max-width: 140px;
  width: 130px;
}

.clientes-table th:nth-child(27),
.clientes-table td:nth-child(27) {
  text-align: center;
  min-width: 120px;
  max-width: 140px;
  width: 130px;
}

.clientes-table td {
  position: relative;
}

.clientes-table td:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.clientes-table td[title]:hover::after {
  opacity: 1;
}

.clientes-table tbody tr.clicking {
  background-color: rgba(0, 111, 103, 0.15) !important;
  transform: scale(0.995);
  transition: all 0.15s ease;
}

.column-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-toggle-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.2);
}

.column-toggle-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 111, 103, 0.3);
}

.column-toggle-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.2);
}

.column-dropdown {
  position: relative;
  display: inline-block;
}

.column-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border-radius: 8px;
  border: 1px solid #e0e6ed;
  overflow: hidden;
  margin-top: 4px;
}

.column-dropdown.active .column-dropdown-content {
  display: block;
  animation: dropdownFadeIn 0.2s ease-out;
}

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

.column-dropdown-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e6ed;
  font-weight: 600;
  font-size: 0.85rem;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.column-dropdown-body::-webkit-scrollbar {
  width: 6px;
}

.column-dropdown-body::-webkit-scrollbar-track {
  background: #f1f3f4;
}

.column-dropdown-body::-webkit-scrollbar-thumb {
  background: #c1c8cd;
  border-radius: 3px;
}

.column-dropdown-body::-webkit-scrollbar-thumb:hover {
  background: #a8b2ba;
}

.column-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.column-item:hover {
  background-color: rgba(0, 111, 103, 0.08);
  border-left-color: rgba(0, 111, 103, 0.3);
}

.column-item:active {
  background-color: rgba(0, 111, 103, 0.12);
}

.column-item input[type="checkbox"] {
  margin: 0;
  margin-right: 0.75rem;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.column-item label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  line-height: 1.4;
  user-select: none;
}

.column-item:hover label {
  color: var(--primary-color);
}

.column-item input[type="checkbox"]:checked + label {
  color: var(--primary-color);
  font-weight: 600;
}

.column-item::after {
  content: "";
  position: absolute;
  right: 1rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.column-item input[type="checkbox"]:checked::after,
.column-item:has(input[type="checkbox"]:checked)::after {
  opacity: 1;
}

.column-dropdown-footer {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e6ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.column-action-btn {
  background: none;
  border: 1px solid #dee2e6;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.2s ease;
}

.column-action-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
}

.column-action-btn.primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.column-action-btn.primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.clientes-table th {
  position: relative;
  cursor: pointer;
  user-select: none;
  padding-right: 2.5rem;
  padding-left: 0.75rem;
}

.clientes-table th:hover {
  background-color: rgba(0, 111, 103, 0.1);
}

.sort-indicator {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.clientes-table th:hover .sort-indicator,
.clientes-table th.sorted .sort-indicator {
  opacity: 1;
}

.clientes-table th.sorted {
  background-color: rgba(0, 111, 103, 0.15);
}

.filter-row {
  background-color: #f8f9fa;
}

.filter-row td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.filter-input {
  width: 100%;
  padding: 0.25rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.8rem;
  box-sizing: border-box;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.2);
}

.clientes-table th.hidden,
.clientes-table td.hidden {
  display: none;
}

.clientes-table th.dragging {
  opacity: 0.5;
  background-color: rgba(0, 111, 103, 0.3);
}

.column-drag-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: transparent;
  cursor: col-resize;
  transition: background-color 0.2s ease;
}

.column-drag-handle:hover {
  background-color: var(--primary-color);
}

.drop-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--primary-color);
  z-index: 1000;
  display: none;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-action-btn {
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.table-action-btn:hover {
  background-color: rgba(0, 111, 103, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

.clientes-table tr:last-child td {
  border-bottom: none;
}

.clientes-table tbody tr:hover {
  background-color: rgba(0, 111, 103, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  border-left-color: rgba(0, 111, 103, 0.3);
  z-index: 1;
}

.clientes-table tbody tr:hover td {
  color: var(--primary-color);
}

.clientes-table tbody tr.active {
  background-color: rgba(0, 111, 103, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border-left-color: var(--primary-color);
  z-index: 2;
}

.clientes-table tbody tr.active td {
  color: var(--primary-color);
  font-weight: 500;
}

.clientes-table tbody tr.clicking {
  transform: scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  background-color: rgba(0, 111, 103, 0.15);
}

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(0, 111, 103, 0.1);
  color: #006f67;
  text-decoration: none;
  transition: all 0.2s ease;
}

.back-button:hover {
  background-color: rgba(0, 111, 103, 0.2);
  transform: translateX(-3px);
}

.back-button i {
  font-size: 16px;
}

.home-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(0, 111, 103, 0.1);
  color: #006f67;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0;
}

.home-button:hover {
  background-color: rgba(0, 111, 103, 0.2);
  transform: translateY(-3px);
}

.home-button i {
  font-size: 16px;
  margin-bottom: 1px;
}

.home-button span {
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
}

.logo {
  display: flex;
  align-items: center;
}

.export-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.export-button:hover {
  background-color: var(--primary-dark);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: rgba(0, 111, 103, 0.1);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.empty-state i {
  font-size: 3rem;
  color: var(--color-text-secondary);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--color-text-primary);
  margin: 0 0 0.5rem 0;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 1rem 0;
  max-width: 450px;
}

.empty-state-standalone {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
  border: 1px solid #e0e0e0;
}

.empty-state-standalone .empty-state {
  padding: 2rem 1rem;
}

.empty-state-standalone .empty-state i {
  font-size: 4rem;
  color: var(--color-primary);
  opacity: 0.7;
}

.empty-state-standalone .empty-state h3 {
  font-size: 1.4rem;
  color: var(--color-text-primary);
  margin: 1rem 0 0.5rem 0;
}

.empty-state-standalone .empty-state p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 500px;
  line-height: 1.5;
}

#toast {
  bottom: -100px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  transition: all 0.3s ease;
}

#toast.active {
  bottom: 20px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.activity-details-section .contact-card {
  display: flex;
  flex-direction: column;
}

.activity-details-section .contact-card .activity-card-body {
  height: calc(100% - 40px) !important;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.activity-details-section .contact-card .activity-info-group {
  margin-bottom: 10px;
}

.activity-details-section .contact-card .separator {
  margin: 10px 0;
  border-top: 1px dashed #ddd;
  width: 100%;
}

.activity-details-section .contact-card .company-info-title {
  margin: 0 0 10px 0;
  color: #006f67;
  font-size: 14px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .activity-grid-container .client-card,
  .activity-grid-container .contact-card {
    grid-row: span 2 !important;
  }
}

.activity-details-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  width: 100%;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 10;
  justify-content: flex-start;
  align-items: center;
}

.tab-button {
  background-color: transparent;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-button i {
  font-size: 1rem;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.tab-button:hover {
  background-color: var(--color-bg-light);
  color: var(--color-text-primary);
}

.tab-button:hover i {
  color: var(--primary-color);
}

.tab-button.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  position: relative;
}

.tab-button.active i {
  color: var(--primary-color);
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 2px;
  border-radius: 2px;
}

.tab-content {
  display: none;
  animation: fadeInContent 0.3s ease;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

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

@media (max-width: 992px) {
  .activity-details-tabs {
    padding: 0.5rem 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .activity-date-display {
    margin-left: auto;
    font-size: 0.85rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
  }
}

@media (max-width: 768px) {
  .activity-details-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
    gap: 0.25rem;
  }

  .tab-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .tab-button.active::after {
    bottom: -6px;
    height: 2px;
    width: 80%;
  }
}

@media (max-width: 576px) {
  .tab-button {
    padding: 0.5rem;
    min-width: auto;
  }

  .tab-button i {
    font-size: 0.9rem;
  }

  .activity-date-display {
    display: none;
  }
}

.segment-filter-container {
  position: relative;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.segment-filter {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background-color: var(--color-background-light, #f9fafb);
  color: var(--color-text-primary, #333);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  cursor: pointer;
}

.segment-filter:focus {
  outline: none;
  border-color: var(--primary-color, #006f67);
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.1);
}

.btn-clear-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 6px;
  background-color: #fff;
  color: var(--primary-color, #006f67);
  border: 1px solid var(--primary-color, #006f67);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-clear-filter:hover {
  background-color: rgba(0, 111, 103, 0.1);
  transform: translateY(-1px);
}

.btn-clear-filter:active {
  transform: translateY(0);
}

.btn-clear-filter i {
  font-size: 0.9rem;
}

.main-navigation-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  .main-navigation-links {
    gap: 0.5rem;
  }
}

.column-visibility-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(2px);
}

.column-visibility-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.column-visibility-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
  overflow: hidden;
}

.column-visibility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.column-visibility-header::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary),
    transparent
  );
}

.column-visibility-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-visibility-header h3::before {
  content: "\f0db";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--color-primary);
  font-size: 1.1rem;
}

#close-column-visibility {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

#close-column-visibility:hover {
  background-color: #f8d7da;
  color: #721c24;
  transform: scale(1.1);
}

.column-visibility-body {
  padding: 1.75rem;
  flex: 1;
  overflow-y: auto;
  background-color: #fafbfc;
}

.column-visibility-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.column-action-btn {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 120px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.column-action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.column-action-btn:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border-color: #adb5bd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.column-action-btn:hover::before {
  left: 100%;
}

.column-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.column-visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  max-height: 350px;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background-color: white;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.column-visibility-grid::-webkit-scrollbar {
  width: 8px;
}

.column-visibility-grid::-webkit-scrollbar-track {
  background: #f1f3f4;
  border-radius: 4px;
}

.column-visibility-grid::-webkit-scrollbar-thumb {
  background: #c1c8cd;
  border-radius: 4px;
}

.column-visibility-grid::-webkit-scrollbar-thumb:hover {
  background: #a8b2ba;
}

.column-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  background-color: #fafbfc;
  position: relative;
}

.column-checkbox-item:hover {
  background-color: rgba(0, 111, 103, 0.08);
  border-color: rgba(0, 111, 103, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 111, 103, 0.1);
}

.column-checkbox-item input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  border-radius: 3px;
}

.column-checkbox-item label {
  margin: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2c3e50;
  flex: 1;
  line-height: 1.4;
  user-select: none;
}

.column-checkbox-item:has(input:checked) {
  background-color: rgba(0, 111, 103, 0.12);
  border-color: var(--color-primary);
}

.column-checkbox-item:has(input:checked) label {
  color: var(--color-primary);
  font-weight: 600;
}

.column-visibility-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.column-count-info {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.column-count-info .count {
  color: var(--color-primary);
  font-weight: 600;
}

.apply-column-btn {
  background: #006f67;
  color: white;
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 120px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.apply-column-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.apply-column-btn:hover {
  background: linear-gradient(135deg, #005a54 0%, #004a44 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 111, 103, 0.3);
}

.apply-column-btn:hover::before {
  left: 100%;
}

.apply-column-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 111, 103, 0.2);
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .column-visibility-content {
    width: 95%;
    max-height: 90vh;
  }

  .column-visibility-grid {
    grid-template-columns: 1fr;
  }

  .column-visibility-actions {
    flex-direction: column;
  }

  .column-action-btn {
    justify-content: center;
  }
}
