: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;
  --radius-sm: 6px;
}

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

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.header-actions {
  display: flex;
  align-items: center;
  margin-right: auto;
  margin-left: 20px;
  gap: 10px;
}

.btn-home,
.btn-rfv,
button.btn-home,
button.btn-rfv {
  display: flex;
  align-items: center;
  background-color: #006f67;
  color: white;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
  border: none;
  cursor: pointer;
}

.btn-home:hover,
.btn-rfv:hover,
button.btn-home:hover,
button.btn-rfv:hover {
  background-color: #005852;
  transform: translateY(-1px);
}

.btn-home i,
.btn-rfv i,
button.btn-home i,
button.btn-rfv i {
  margin-right: 8px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .btn-home span,
  .btn-rfv span,
  button.btn-home span,
  button.btn-rfv span {
    display: none;
  }

  .btn-home i,
  .btn-rfv i,
  button.btn-home i,
  button.btn-rfv i {
    margin-right: 0;
  }

  .btn-home,
  .btn-rfv,
  button.btn-home,
  button.btn-rfv {
    padding: 8px 10px;
    min-width: 36px;
  }

  .header-actions {
    margin-left: 10px;
  }

  .user-area {
    gap: 0.5rem;
  }

  .user-area .btn-rfv {
    padding: 8px 10px;
    min-width: 36px;
  }
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
}

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

.logo i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-area .btn-rfv {
  min-height: 36px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.user-notifications {
  position: relative;
}

.user-notifications i {
  font-size: 1.25rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.user-notifications i:hover {
  color: var(--primary-color);
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-activities-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 111, 103, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(0, 111, 103, 0.1);
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.partner-activities-toggle-container:hover {
  background-color: rgba(0, 111, 103, 0.08);
  border-color: rgba(0, 111, 103, 0.2);
}

.partner-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-color);
  user-select: none;
}

.partner-toggle-label i.fas.fa-users {
  font-size: 1rem;
  color: var(--primary-color);
}

.partner-toggle-label .info-icon {
  font-size: 0.75rem;
  color: var(--text-light);
  cursor: help;
  transition: color 0.2s ease;
}

.partner-toggle-label .info-icon:hover {
  color: var(--primary-color);
}

.partner-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  cursor: pointer;
}

.partner-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.partner-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.partner-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.partner-toggle-switch input:checked + .partner-toggle-slider {
  background-color: var(--primary-color);
}

.partner-toggle-switch input:checked + .partner-toggle-slider:before {
  transform: translateX(24px);
}

.partner-toggle-switch:hover .partner-toggle-slider {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 0 0 3px rgba(0, 111, 103, 0.1);
}

@media (max-width: 768px) {
  .partner-activities-toggle-container {
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
  }

  .partner-toggle-label span {
    display: none;
  }

  .partner-toggle-switch {
    width: 40px;
    height: 20px;
  }

  .partner-toggle-slider:before {
    height: 14px;
    width: 14px;
  }

  .dashboard-section div[style*="display: flex"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .dashboard-section .section-title {
    margin-bottom: 0.5rem !important;
  }

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

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-profile span {
  font-weight: 500;
}

.user-profile i {
  color: var(--text-light);
  font-size: 0.85rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.user-info i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.user-info span {
  font-weight: 500;
  font-size: 0.9rem;
}

.content-wrapper {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 320px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 73px);
  position: sticky;
  top: 72px;
  overflow: hidden !important;
  position: relative;
}

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

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
}

.sidebar-header h2 i {
  font-size: 1.2rem;
}

#sidebar-new-activity-btn {
  display: flex;
  align-items: center;
  background-color: #006f67 !important;
  color: white !important;
  padding: 8px 15px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease !important;
  border: none !important;
  cursor: pointer;
  white-space: nowrap;
  gap: 8px !important;
}

#sidebar-new-activity-btn:hover {
  background-color: #005852 !important;
  transform: translateY(-1px) !important;
}

#sidebar-new-activity-btn i {
  margin-right: 0 !important;
  font-size: 16px !important;
}

.sidebar-date-filter {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  background-color: var(--primary-light);
  gap: 0.5rem;
  justify-content: center;
}

.date-nav-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--primary-color);
  font-size: 0.9rem;
}

.date-nav-btn:hover {
  background-color: rgba(0, 111, 103, 0.15);
  color: var(--primary-color);
  transform: scale(1.1);
}

.date-nav-btn:active {
  transform: scale(0.95);
}

.date-selector-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  cursor: pointer;
  text-align: center;
}

.calendar-icon {
  color: var(--primary-color);
  margin-right: 6px;
}

.current-date {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-color);
  text-align: center;
}

.date-picker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  display: block !important;
}

.date-pulse {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

#sidebar-today-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

#sidebar-today-btn:hover {
  background-color: var(--secondary-color);
}

.btn-small {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-small:hover {
  background-color: var(--secondary-color);
}

.sidebar-activities-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0 0.5rem 0;
  min-height: 0;
}

.sidebar-activity-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--border-color);
  cursor: pointer;
  font-size: 0.9rem;
}

.sidebar-activity-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--primary-color);
}

.sidebar-activity-card.completed {
  opacity: 0.7;
  text-decoration: line-through;
}

.sidebar-activity-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: flex-start;
}

.sidebar-activity-title i {
  margin-right: 0.5rem;
  color: var(--primary-color);
  font-size: 0.85rem;
  padding-top: 0.15rem;
}

.sidebar-activity-client {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.sidebar-activity-time {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

.sidebar-activity-time i {
  margin-right: 0.25rem;
  font-size: 0.7rem;
}

@media (max-width: 768px) {
  .sidebar-header {
    padding: 0.75rem;
  }

  .sidebar-header h2 {
    font-size: 1rem;
  }

  #sidebar-new-activity-btn {
    padding: 8px 10px !important;
    font-size: 14px !important;
  }

  #sidebar-new-activity-btn span {
    display: none;
  }

  #sidebar-new-activity-btn i {
    margin-right: 0 !important;
  }

  .sidebar-date-filter {
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .date-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  #sidebar-current-date {
    font-size: 0.8rem;
  }

  .sidebar-activity-card {
    padding: 0.5rem;
  }
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.sidebar li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar li a:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.sidebar li.active a {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
  font-weight: 500;
}

.sidebar i {
  font-size: 1.1rem;
}

.sap-text {
  font-weight: 600;
  color: var(--text-color);
}

main {
  transition: margin-left 0.3s ease, width 0.3s ease;
  padding: 0.5rem;
}

.date-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.date-nav button {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.date-nav button:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

#current-date {
  font-size: 1.5rem;
  font-weight: 600;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 1rem;
}

.btn-rfv#refresh-metrics-btn i {
  transition: transform 0.3s ease;
}

.btn-rfv#refresh-metrics-btn:hover i {
  transform: rotate(180deg);
}

.btn-rfv#refresh-metrics-btn.loading i {
  animation: spin 1s linear infinite;
}

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

.form-group input.valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-group input.invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-group input.valid:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-group input.invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn.loading i {
  animation: spin 1s linear infinite;
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.btn.loading .btn-text {
  opacity: 0.6;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

#save-individual-changes.loading,
#save-company-changes.loading {
  cursor: not-allowed;
}

#save-individual-changes.loading i,
#save-company-changes.loading i {
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
}

.btn.disabled-during-save {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.contacts-table-container {
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  position: relative;
}

.contacts-table-container::-webkit-scrollbar {
  width: 6px;
}

.contacts-table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.contacts-table-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.contacts-table-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background-color: #ffffff;
  height: 100%;
  flex: 1;
}

.contacts-table thead {
  background-color: #f8f9fa;
}

.contacts-table th {
  padding: 8px 4px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  border-right: 1px solid #e9ecef;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contacts-table th:last-child {
  border-right: none;
}

.contacts-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.contacts-table tbody tr:hover {
  background-color: #f8f9fa;
}

.contacts-table td {
  padding: 12px 8px;
  vertical-align: middle;
  color: #495057;
  border-right: 1px solid #f1f3f4;
}

.contacts-table td:last-child {
  border-right: none;
}

.contacts-table .contact-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-start;
  align-items: center;
}

.contacts-table .contact-action-btn {
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
}

.contacts-table .contact-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contacts-table .call-btn {
  background-color: #007bff;
  color: white;
}

.contacts-table .call-btn:hover {
  background-color: #0056b3;
}

.contacts-table .whatsapp-btn {
  background-color: #25d366;
  color: white;
}

.contacts-table .whatsapp-btn:hover {
  background-color: #1da851;
}

.contacts-table .email-btn {
  background-color: #6c757d;
  color: white;
}

.contacts-table .email-btn:hover {
  background-color: #545b62;
}

.contacts-table .edit-btn {
  background-color: #17a2b8;
  color: white;
}

.contacts-table .edit-btn:hover {
  background-color: #138496;
  transform: translateY(-1px);
}

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

.contact-actions-trigger {
  background: none;
  border: none;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #006f67;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.contact-actions-trigger:hover {
  background-color: rgba(0, 111, 103, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contact-actions-trigger:focus {
  outline: none;
  background-color: rgba(0, 111, 103, 0.1);
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.2);
}

.contact-actions-menu {
  display: none;
}

.tippy-box[data-theme~="light-border"] {
  z-index: 9999 !important;
}

.contact-actions-dropdown .tippy-box {
  z-index: 9999 !important;
}

.contact-actions-dropdown .tippy-content {
  min-width: 180px;
  padding: 4px;
  overflow: visible;
}

.contact-action-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  margin: 2px 0;
  font-size: 0.875rem;
  color: #495057;
  white-space: nowrap;
}

.contact-action-item:hover {
  background-color: #f8f9fa;
}

.contact-action-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
  font-size: 0.875rem;
}

.contact-action-item .fas.fa-edit {
  color: #17a2b8;
}

.contact-action-item .fas.fa-phone {
  color: #007bff;
}

.contact-action-item .fas.fa-mobile-alt {
  color: #007bff;
}

.contact-action-item .fab.fa-whatsapp {
  color: #25d366;
}

.contact-action-item .fas.fa-envelope {
  color: #6c757d;
}

.no-actions {
  color: #6c757d;
  font-style: italic;
  font-size: 0.875rem;
}

.contacts-table .no-contacts-row {
  background-color: #f8f9fa;
}

.contacts-table .no-contacts-message {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 2rem;
}

.contacts-table .no-contacts-message i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.contacts-table .contact-name-cell {
  min-width: 200px;
}

.contacts-table .contact-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contacts-table .contact-icon {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
}

.contacts-table .contact-icon.primary-icon {
  color: #ffd700;
}

.contacts-table .contact-icon.company-icon {
  color: #7b1fa2;
}

.contacts-table .contact-icon.contact-icon-default {
  color: #6c757d;
}

.contacts-table .contact-name-text {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.contacts-table .contact-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.contacts-table .contact-badge.primary-badge {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.contacts-table .contact-badge.company-badge {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}

.contacts-table tbody tr.contact-primary {
  background-color: #fffbf0;
  border-left: 3px solid #ffd700;
}

.contacts-table tbody tr.contact-company {
  background-color: #faf5ff;
  border-left: 3px solid #7b1fa2;
}

.contacts-table tbody tr.contact-primary:hover {
  background-color: #fff8e1;
}

.contacts-table tbody tr.contact-company:hover {
  background-color: #f3e5f5;
}

.contacts-table tbody tr.contact-inactive {
  background-color: #f8f9fa;
  border-left: 3px solid #dc3545;
  opacity: 0.7;
  position: relative;
}

.contacts-table tbody tr.contact-inactive:hover {
  background-color: #f1f3f4;
  opacity: 0.8;
}

.contact-badge.inactive-badge {
  background-color: #dc3545;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 8px;
  display: inline-block;
}

.contacts-table tbody tr.contact-inactive td {
  color: #6c757d;
  font-style: italic;
}

.contacts-section-direct {
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  align-self: stretch;
  grid-row: span 2;
  transition: transform 0.2s, box-shadow 0.2s;
}

.contacts-section-direct:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contacts-header {
  background-color: #f8f9fa;
  padding: 6px 12px;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contacts-header-left {
  display: flex;
  align-items: center;
}

.contacts-header-right {
  display: flex;
  align-items: center;
}

.switch-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  margin: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

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

.switch-input:checked + .switch-slider {
  background-color: var(--primary-color);
}

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

.switch-slider:hover {
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.2);
}

.contacts-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #333;
  font-weight: 600;
}

.contacts-header i {
  margin-right: 6px;
  font-size: 0.9rem;
}

.contacts-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 111, 103, 0.3) transparent;
}

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

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

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

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

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background-color: #ffffff;
}

.contacts-table tbody {
  height: 100%;
  vertical-align: top;
}

.contacts-table tbody::after {
  content: "";
  display: table-row;
  height: 100%;
}

@media (max-width: 768px) {
  .contacts-table {
    font-size: 0.75rem;
  }

  .contacts-table th,
  .contacts-table td {
    padding: 8px 4px;
  }

  .contacts-table .contact-actions {
    flex-direction: column;
    gap: 2px;
  }

  .contacts-table .contact-action-btn {
    font-size: 0.7rem;
    min-width: 20px;
    height: 20px;
  }

  .contacts-section-direct {
    margin: 0 -0.5rem 20px -0.5rem;
    border-radius: 0;
  }

  .contacts-header {
    padding: 0.75rem 1rem;
  }
}

.dashboard-section {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  animation: fadeIn 0.5s ease forwards;
}

.metrics-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.metric-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.metric-card i {
  font-size: 2rem;
  color: var(--primary-color);
  background-color: var(--primary-light);
  width: 60px;
  height: 60px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-card.scheduled-activities i {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
}

.metric-card.overdue-activities i {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.metric-card.future-activities i {
  color: #8b5cf6;
  background-color: rgba(139, 92, 246, 0.1);
}

.metric-card.partner-future i {
  color: #059669;
  background-color: rgba(5, 150, 105, 0.1);
}

.metric-card.partner-scheduled i {
  color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.1);
}

.metric-card.partner-overdue i {
  color: #dc2626;
  background-color: rgba(220, 38, 38, 0.1);
}

.metric-card.completed-activities i {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
}

.metric-card.completed-yesterday-activities i {
  color: #047857;
  background-color: rgba(4, 120, 87, 0.1);
}

.metric-card.phone-active i {
  color: #1e40af;
  background-color: rgba(30, 64, 175, 0.1);
}

.metric-card.phone-receptive i {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
}

.metric-card.scheduled-activities:hover {
  border-left: 4px solid #3b82f6;
  transform: translateY(-5px) scale(1.02);
}

.metric-card.overdue-activities:hover {
  border-left: 4px solid #ef4444;
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15);
}

.metric-card.future-activities:hover {
  border-left: 4px solid #8b5cf6;
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.metric-card.partner-scheduled:hover {
  border-left: 4px solid #f59e0b;
  transform: translateY(-5px) scale(1.02);
}

.metric-card.partner-future:hover {
  border-left: 4px solid #059669;
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.15);
}

.metric-card.partner-overdue:hover {
  border-left: 4px solid #dc2626;
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.15);
}

.metric-card.completed-activities:hover {
  border-left: 4px solid #10b981;
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
}

.metric-card.completed-yesterday-activities:hover {
  border-left: 4px solid #047857;
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(4, 120, 87, 0.15);
}

.metric-card.phone-active:hover {
  border-left: 4px solid #1e40af;
  transform: translateY(-5px) scale(1.02);
}

.metric-card.phone-receptive:hover {
  border-left: 4px solid #3b82f6;
  transform: translateY(-5px) scale(1.02);
}

.metric-card.overdue-activities i,
.metric-card.partner-overdue i {
  animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.metric-card.completed-activities i {
  animation: glow-success 3s ease-in-out infinite alternate;
}

@keyframes glow-success {
  from {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
  }
  to {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  }
}

.metric-data h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 600;
}

.activities-container {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.activities-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.activities-list {
  padding: 1rem;
}

.activity-card {
  padding: 1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary-color);
  margin-bottom: 1rem;
  background-color: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.activity-card.completed {
  border-left-color: #10b981;
  opacity: 0.7;
}

.activity-info {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-title i {
  color: var(--primary-color);
  font-size: 0.85rem;
}

.activity-time {
  color: var(--text-light);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-client {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

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

.activity-actions button {
  background: none;
  border: none;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
}

.activity-actions button:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.activity-actions button.complete-btn:hover {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.activity-actions button.edit-btn:hover {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.activity-actions button.delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.priority-high {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.priority-medium {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.priority-low {
  background-color: rgba(110, 191, 77, 0.1);
  color: var(--secondary-color);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: #005951;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background-color: var(--background-color);
  border-color: var(--text-light);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: translateY(0);
}

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

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.edit-contact-modal-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  width: 100%;
}

.edit-contact-modal-header .header-text {
  flex-shrink: 0;
}

.edit-contact-modal-header .header-controls {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.default-contact-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  margin: 0;
  user-select: none;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(0, 111, 103, 0.05);
  border: 1px solid rgba(0, 111, 103, 0.15);
}

.default-contact-toggle:hover {
  color: var(--primary-color);
  background: rgba(0, 111, 103, 0.1);
  border-color: rgba(0, 111, 103, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 111, 103, 0.15);
}

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

.default-contact-toggle .toggle-text {
  font-weight: 600;
  white-space: nowrap;
  color: inherit;
}

.default-contact-toggle input[type="checkbox"]:checked + .toggle-text {
  color: var(--primary-color);
}

.close-modal {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-light);
}

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

.modal-body {
  padding: 1.5rem;
}

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

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

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

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

label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 111, 103, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.toast {
  position: fixed;
  bottom: -100px;
  right: 20px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1500;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
}

.toast.active {
  bottom: 20px;
  opacity: 1;
  visibility: visible;
}

.toast-icon {
  width: 36px;
  height: 36px;
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon i {
  font-size: 1.25rem;
}

.toast-content {
  font-weight: 500;
}

.toast.error .toast-icon {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.toast.error .toast-icon i {
  content: "\f06a";
}

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

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

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

.metric-card {
  animation: slideInUp 0.5s ease forwards;
  opacity: 0;
}

.metric-card:nth-child(1) {
  animation-delay: 0.1s;
}
.metric-card:nth-child(2) {
  animation-delay: 0.2s;
}
.metric-card:nth-child(3) {
  animation-delay: 0.3s;
}
.metric-card:nth-child(4) {
  animation-delay: 0.4s;
}

.activity-card {
  animation: slideInRight 0.5s ease forwards;
  opacity: 0;
}

@media (max-width: 1200px) {
  .metrics-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
    padding: 1.5rem 0;
  }

  .sidebar li a {
    padding: 0.75rem;
    justify-content: center;
  }

  .sidebar li a span {
    display: none;
  }

  main {
    padding: 0.5rem;
  }

  .date-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .metrics-container {
    grid-template-columns: 1fr;
  }

  .dashboard-section {
    padding: 1rem;
  }

  .section-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .metric-card {
    padding: 1rem;
  }

  .metric-card i {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .date-nav h2 {
    font-size: 1.2rem;
  }
}

.sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background-color: var(--background-color);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.search-input:not(:placeholder-shown) + .search-clear-btn,
.search-input:focus + .search-clear-btn {
  opacity: 1;
  visibility: visible;
}

.header-search {
  position: relative;
}

.header-search .search-input-container {
  display: flex;
  align-items: center;
  position: relative;
  background-color: #f0f2f5;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-width: 240px;
}

.header-search .search-input-container:focus-within {
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 111, 103, 0.2);
}

.header-search .search-icon {
  color: #666;
  margin-right: 8px;
  font-size: 14px;
}

.header-search .search-input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  color: var(--text-color);
}

.header-search .search-clear-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  display: none;
}

.header-search .search-clear-btn:hover {
  color: #666;
}

@media (max-width: 992px) {
  .header-search .search-input-container {
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .header-search .search-input-container {
    min-width: 140px;
  }

  .header-search .search-input {
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .header-search {
    display: none;
  }
}

.activity-details-container {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  min-height: calc(100vh - 105px);
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.activity-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.activity-details-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
}

.activity-details-header .activity-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.activity-details-content {
  flex: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.activity-details-section {
  margin-bottom: 0.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

.activity-details-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.activity-details-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.activity-details-section h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.8em;
  background-color: var(--primary-color);
  margin-right: 0.4rem;
  border-radius: 2px;
}

.activity-info-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}

.client-card .activity-info-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.client-card .activity-info-item.span-2-cols {
  grid-column: span 2;
}

.client-card .activity-info-item.span-3-cols {
  grid-column: span 3;
}

.activity-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.client-card .activity-info-item {
  min-width: 0;
  width: 100%;
}

.client-card .info-value {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  min-width: 0;
  width: 100%;
}

.info-value {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  word-break: break-word;
}

.info-value.status-completed {
  color: #10b981;
  font-weight: 600;
}

.info-value.status-pending {
  color: #f59e0b;
  font-weight: 600;
}

.info-value.info-highlight {
  color: #3b82f6;
  font-weight: 600;
}

.endereco-tooltip {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.endereco-tooltip i {
  color: var(--primary-color);
  font-size: 0.75rem;
}

.endereco-tooltip:hover::after {
  content: attr(title);
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 300px;
  padding: 0.5rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
  z-index: 1;
  border: 1px solid var(--border-color);
}

.description-text {
  padding: 0.5rem;
  background-color: var(--background-color);
  border-radius: var(--radius);
  line-height: 1.3;
  overflow-y: auto;
  font-size: 0.8rem;
}

.sales-averages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  background-color: rgba(var(--primary-rgb), 0.05);
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-top: 0.3rem;
}

.sales-averages div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.info-sublabel {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.header-region-filter {
  display: flex;
  align-items: center;
}

.header-region-filter .region-filter-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  transition: var(--transition);
  min-height: 36px;
  white-space: nowrap;
  position: relative;
}

.header-region-filter .region-filter-container:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
}

.header-region-filter .region-icon {
  color: var(--primary-color);
  margin-right: 0.5rem;
  font-size: 14px;
}

.header-region-filter .region-filter-toggle {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-color);
  font-weight: 500;
}

.header-region-filter .region-filter-toggle i {
  margin-left: 0.5rem;
  font-size: 12px;
  transition: transform 0.2s ease-in-out;
}

.header-region-filter .region-filter-toggle.has-filter {
  position: relative;
}

.header-region-filter .region-filter-toggle.has-filter::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
}

.header-region-filter .region-dropdown-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 12px;
  display: none;
  animation: fadeInDropdown 0.2s ease-in-out;
  margin-top: 4px;
  min-width: 250px;
}

.header-region-filter .region-dropdown-container.show {
  display: block;
}

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

@media (max-width: 768px) {
  .header-region-filter {
    margin-right: 0.5rem;
  }

  .header-region-filter .region-filter-container {
    padding: 8px 10px;
    min-width: 36px;
  }

  .header-region-filter .region-filter-toggle span {
    display: none;
  }

  .header-region-filter .region-filter-toggle i {
    display: none;
  }

  .header-region-filter .region-icon {
    margin-right: 0;
  }

  .header-region-filter .region-dropdown-container {
    right: -200px;
    min-width: 280px;
  }
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.product-image {
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
  border-bottom: 1px solid var(--border-color);
}

.product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-image img[src$="no-image.svg"] {
  width: 60%;
  height: auto;
  opacity: 0.6;
  padding: 2rem;
}

.product-info {
  padding: 1rem;
}

.product-code {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.product-name {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.8rem;
  min-height: 2.7rem;
  max-height: 2.7rem;
  overflow: hidden;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
}

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

.product-commission {
  background-color: rgba(0, 111, 103, 0.1);
  color: var(--primary-color);
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e9ecef;
  gap: 0.5rem;
}

.product-footer .product-quantity,
.product-footer .product-date {
  font-size: 0.8rem;
  color: #6c757d;
}

.product-footer .product-quantity {
  flex: 0 0 auto;
  min-width: 60px;
}

.product-footer .product-date {
  flex: 1;
}

.product-footer .product-date {
  text-align: right;
}

.product-image {
  position: relative;
}

.btn-related-items {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(0, 111, 103, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.btn-related-items:hover {
  background: rgba(0, 111, 103, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 111, 103, 0.4);
}

.btn-related-items:active {
  transform: scale(1.05);
}

.btn-related-items span {
  display: none;
}

.product-card.product-inactive {
  opacity: 0.7;
  border: 1px solid #e74c3c;
  background-color: rgba(231, 76, 60, 0.05);
  position: relative;
}

.product-card.product-inactive:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.product-card.product-inactive .product-image {
  position: relative;
}

.product-card.product-inactive .product-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(231, 76, 60, 0.1);
  z-index: 1;
}

.product-card.product-inactive .product-name,
.product-card.product-inactive .product-quantity span {
  color: #7f8c8d;
}

.product-status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e74c3c;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.product-status-badge.inactive {
  background: #e74c3c;
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
  }
  50% {
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.6);
  }
  100% {
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
  }
}

.related-items-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.related-items-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
}

.related-items-modal-content {
  max-width: 900px;
  max-height: 80vh;
  width: 90vw;
}

.related-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 0;
}

.related-item-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.related-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.related-item-image {
  height: 150px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
  border-bottom: 1px solid var(--border-color);
}

.related-item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.related-item-image img[src$="no-image.svg"] {
  width: 50%;
  height: auto;
  opacity: 0.6;
  padding: 1.5rem;
}

.related-item-info {
  padding: 1rem;
}

.related-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.related-item-code {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.related-item-type {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.related-item-type.similar {
  background-color: rgba(52, 152, 219, 0.1);
  color: #3498db;
}

.related-item-type.combina {
  background-color: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}

.related-item-name {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-item-card.purchased {
  position: relative;
}

.related-item-card.purchase-recent {
  border: 2px solid #28a745;
  background-color: #f8fff9;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.related-item-card.purchase-recent::before {
  content: "COMPRA RECENTE";
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.related-item-card.purchase-recent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

.related-item-card.purchase-moderate {
  border: 2px dashed #ffc107;
  background-color: #fffdf0;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.related-item-card.purchase-moderate::before {
  content: "COMPRA MODERADA";
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #ffc107;
  color: #212529;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.related-item-card.purchase-moderate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 193, 7, 0.3);
}

.related-item-card.purchase-old {
  border: 1px solid #dc3545;
  background-color: #fdf2f2;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.related-item-card.purchase-old::before {
  content: "COMPRA ANTIGA";
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #dc3545;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.related-item-card.purchase-old:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

.client-purchased-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  padding: 0.25rem 0.5rem;
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.2);
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  backdrop-filter: blur(2px);
}

.client-purchased-indicator i {
  font-size: 0.75rem;
  opacity: 0.8;
}

.client-purchased-indicator:hover {
  background: rgba(108, 117, 125, 0.15);
  color: #495057;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.related-item-card.purchased:not(.purchase-recent):not(.purchase-moderate):not(
    .purchase-old
  ) {
  border: 2px solid #28a745;
  background-color: #f8fff9;
}

.related-item-card.purchased:not(.purchase-recent):not(.purchase-moderate):not(
    .purchase-old
  )::before {
  content: "JÁ ADQUIRIDO";
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.related-item-card.purchased:not(.purchase-recent):not(.purchase-moderate):not(
    .purchase-old
  ):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

.purchase-info {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 0.6rem;
}

.purchase-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.purchase-info-item:last-child {
  margin-bottom: 0;
}

.purchase-info-label {
  color: #666;
  font-weight: 500;
}

.purchase-info-value {
  color: #28a745;
  font-weight: 600;
}

.no-related-items {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: #666;
}

.no-related-items i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-related-items p {
  font-size: 1.1rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-light);
}

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

.lendings-container {
  padding: 1rem 0;
  position: relative;
}

.lendings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  min-height: 200px;
}

.lendings-loading,
.lendings-empty {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

.lending-card {
  border: 1px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.lending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lending-image {
  position: relative;
  height: 160px;
  background-color: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #eaeaea;
}

.lending-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lending-image img[src$="no-image.svg"] {
  width: 60%;
  height: auto;
  opacity: 0.6;
  padding: 2rem;
}

.lending-info {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.lending-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.lending-code {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
}

.lending-quantity {
  font-size: 0.85rem;
  color: #666;
}

.lending-name {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.8rem;
  min-height: 2.7rem;
  max-height: 2.7rem;
  overflow: hidden;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
}

.lending-status {
  margin-top: auto;
}

.lending-badge {
  display: inline-block;
  background-color: rgba(0, 111, 103, 0.1);
  color: var(--primary-color);
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 500;
}

.quotations-container {
  padding: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.quotations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  flex: 1;
  max-height: none;
}

.quotation-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  padding: 16px;
}

.quotation-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quotation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  gap: 10px;
  flex-wrap: wrap;
}

.quotation-number {
  font-weight: bold;
  font-size: 1rem;
  margin-right: auto;
}

.quotation-date {
  color: #6c757d;
  font-size: 0.9rem;
  white-space: nowrap;
}

.quotation-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-left: auto;
  white-space: nowrap;
}

.quotation-status.open {
  background-color: #ffc107;
  color: #212529;
}

.quotation-status.closed {
  background-color: #dc3545;
  color: white;
}

.quotation-status.order {
  background-color: #28a745;
  color: white;
}

.quotation-two-line-layout {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  width: 100%;
}

.quotation-first-line {
  display: grid;
  grid-template-columns: auto auto auto auto 1fr;
  align-items: center;
  gap: 20px;
}

.quotation-second-line {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 20px;
}

.quotation-number {
  font-weight: bold;
  font-size: 1rem;
  color: #495057;
  white-space: nowrap;
  justify-self: start;
}

.quotation-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  justify-self: center;
}

.quotation-date,
.quotation-due-date {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6c757d;
  font-size: 0.9rem;
  white-space: nowrap;
  justify-self: center;
}

.quotation-date i,
.quotation-due-date i {
  font-size: 0.8rem;
}

.quotation-total {
  color: #006f67;
  font-size: 1rem;
  font-weight: bold;
  justify-self: end;
  white-space: nowrap;
}

.quotation-client {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #495057;
  font-size: 0.95rem;
  font-weight: 500;
  justify-self: start;
}

.quotation-client i {
  color: #006f67;
  font-size: 0.9rem;
}

.quotation-branch,
.quotation-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
  justify-self: center;
}

.quotation-branch i,
.quotation-user i {
  font-size: 0.8rem;
}

.quotation-actions {
  justify-self: end;
}

.btn-view-items {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #006f67;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-view-items:hover {
  background-color: #005952;
  transform: translateY(-1px);
}

.btn-view-items i {
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .quotation-first-line {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quotation-second-line {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quotation-number,
  .quotation-status,
  .quotation-date,
  .quotation-due-date,
  .quotation-total,
  .quotation-client,
  .quotation-branch,
  .quotation-user {
    justify-self: start;
  }

  .quotation-actions {
    justify-self: stretch;
  }

  .btn-view-items {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .quotation-card {
    padding: 12px;
  }

  .quotation-two-line-layout {
    gap: 8px;
  }

  .quotation-first-line,
  .quotation-second-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quotation-second-line {
    padding-left: 0;
    border-left: none;
    border-top: 2px solid #e9ecef;
    padding-top: 8px;
  }
}

.details-search-hidden {
  display: none !important;
}

.quotation-body {
  margin-bottom: 10px;
}

.quotation-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.quotation-detail {
  flex: 1 1 45%;
  min-width: 150px;
}

.quotation-detail-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 2px;
}

.quotation-detail-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.quotation-items {
  margin-top: 15px;
  overflow-y: auto;
  max-height: 200px;
}

.quotation-item {
  padding: 10px;
  border-radius: 6px;
  background-color: #f8f9fa;
  margin-bottom: 8px;
}

.quotation-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.quotation-item-code {
  font-weight: bold;
  font-size: 0.9rem;
}

.quotation-item-price {
  color: #212529;
  font-weight: bold;
}

.quotation-item-description {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
}

.quotation-item-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6c757d;
}

.quotation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.quotation-total {
  font-weight: bold;
  font-size: 1.1rem;
}

.quotation-total-label {
  font-size: 0.9rem;
  color: #6c757d;
}

.status-icon {
  margin-right: 6px;
}

.service-orders-container {
  padding: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-orders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  overflow-y: auto;
  padding-bottom: 30px;
  flex: 1;
  max-height: none;
}

.service-order-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background-color: var(--card-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.service-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.service-order-number {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.service-order-number i {
  margin-right: 8px;
  font-size: 1rem;
}

.service-order-date {
  font-size: 0.9rem;
  color: #6c757d;
  white-space: nowrap;
}

.service-order-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 15px;
}

.service-order-item {
  display: flex;
  flex-direction: column;
}

.service-order-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 2px;
}

.service-order-value {
  font-size: 0.95rem;
  font-weight: 500;
}

.service-order-result {
  background-color: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
}

.service-order-result-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 5px;
  font-weight: 500;
}

.service-order-result-value {
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .service-order-info {
    grid-template-columns: 1fr;
  }
}

.history-container {
  padding: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.history-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.08);
  border-radius: 8px;
}

.history-grid .table-responsive {
  flex: 1;
  min-height: 0;
  border-radius: 8px;
}

.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #ffffff;
}

.history-table thead {
  background-color: #f5f8f8;
}

.history-table th {
  background-color: #f5f8f8;
  font-weight: 600;
  color: #333;
  padding: 0.75rem;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
  font-size: 0.9rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.history-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  font-size: 0.85rem;
}

.history-table tbody tr {
  background-color: #ffffff;
  transition: background-color 0.2s ease;
}

.history-table tbody tr:hover {
  background-color: rgba(0, 111, 103, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

@media (max-width: 768px) {
  .history-container {
    padding: 10px;
  }

  .history-grid .table-responsive {
    flex: 1;
    min-height: 0;
  }

  .history-table {
    font-size: 0.8rem;
  }

  .history-table th,
  .history-table td {
    padding: 0.5rem;
  }

  .history-table th {
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    background-color: #f5f8f8;
    z-index: 100;
  }

  .history-table #filter-row {
    position: sticky;
    top: 52px;
    z-index: 99;
    background-color: #f8f9fa;
  }
}

@media (max-width: 576px) {
  .history-container {
    padding: 10px;
  }

  .history-grid .table-responsive {
    flex: 1;
    min-height: 0;
  }

  .history-table {
    font-size: 0.75rem;
  }

  .history-table th,
  .history-table td {
    padding: 0.4rem;
  }

  .history-table th {
    position: sticky;
    top: 0;
    background-color: #f5f8f8;
    z-index: 100;
  }

  .history-table #filter-row {
    position: sticky;
    top: 50px;
    z-index: 99;
    background-color: #f8f9fa;
  }
}

.history-item {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background-color: var(--card-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.history-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-right: 85px;
}

.history-item-code {
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  font-size: 1rem;
}

.history-item-code i {
  margin-right: 8px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.history-item-date {
  font-size: 0.9rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.history-item-date i {
  margin-right: 5px;
  font-size: 0.85rem;
}

.history-item-content {
  padding: 5px 0;
}

.history-item-subject {
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.history-item-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.history-item-detail {
  display: flex;
  flex-direction: column;
}

.history-item-label {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 2px;
}

.history-item-value {
  font-weight: 500;
}

.history-item-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 5;
}

.history-item-badge.completed {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.history-item-badge.pending {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

@media (max-width: 576px) {
  .history-item-details {
    grid-template-columns: 1fr;
  }

  .history-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding-right: 0;
  }

  .history-item-badge {
    top: 10px;
    right: 10px;
  }
}

.activity-details-section:nth-child(2) .activity-info-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.activity-info-item.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .activity-details-section:nth-child(2) .activity-info-group {
    grid-template-columns: 1fr;
  }
}

.activity-details-section {
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.activity-details-section:hover {
  box-shadow: var(--shadow-sm);
}

.activity-details-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.activity-details-section h3 i {
  opacity: 0.8;
}

.activity-sections-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.activity-details-section.half-width {
  flex: 0 0 calc(50% - 0.5rem);
  width: calc(50% - 0.5rem);
  margin-bottom: 0;
}

.half-width .description-text {
  overflow-y: auto;
}

@media (max-width: 768px) {
  .activity-sections-row {
    flex-direction: column;
    gap: 1rem;
  }

  .activity-details-section.half-width {
    width: 100%;
    margin-bottom: 1rem;
  }
}

.activity-details-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-card.default-contact {
  border-left: 3px solid var(--primary-color);
}

.contact-name {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.default-badge {
  background-color: #006f67;
  color: white;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: middle;
}

.contact-position,
.contact-phone,
.contact-mobile,
.contact-email {
  font-size: 0.9rem;
  margin: 3px 0;
  color: #555;
}

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

.main-navigation {
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.main-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-navigation li {
  margin-bottom: 0.5rem;
}

.main-navigation a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.main-navigation a i {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.main-navigation li.active a {
  background-color: var(--color-primary);
  color: white;
}

.main-navigation a:hover:not(li.active a) {
  background-color: var(--color-background-light);
  color: var(--color-text-primary);
}

.activity-details-card {
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.activity-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
  height: auto;
  align-items: stretch;
  min-height: 200px;
}

.activity-cards-row .activity-details-card {
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.activity-card-column {
  min-width: 0;
}

@media (max-width: 768px) {
  .activity-cards-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .activity-cards-row .activity-details-card .activity-card-body > div {
    flex-wrap: wrap;
  }

  .activity-cards-row .activity-details-card .activity-card-body > div > div {
    min-width: 120px;
  }
}

.activity-card-header {
  background-color: #f8f9fa;
  padding: 6px 12px;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  align-items: center;
}

.activity-card-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #333;
  font-weight: 600;
}

.activity-card-header i {
  margin-right: 6px;
  font-size: 0.9rem;
}

.activity-card-body {
  padding: 12px 16px;
  flex-grow: 1;
}

.activity-info-section {
  margin-bottom: 6px;
}

.activity-info-section:last-child {
  margin-bottom: 0;
}

.activity-info-group {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -6px;
}

.activity-info-item {
  flex: 0 0 calc(100% - 12px);
  margin: 0 6px 8px;
}

.client-card .activity-info-item,
.contact-card .activity-info-item {
  flex: 0 0 calc(50% - 12px);
  position: relative;
}

.client-card .activity-info-item:nth-child(odd),
.contact-card .activity-info-item:nth-child(odd) {
  padding-right: 12px;
  margin-right: 0;
}

.client-card .activity-info-item:nth-child(even),
.contact-card .activity-info-item:nth-child(even) {
  padding-left: 6px;
  margin-left: 0;
}

.client-card .activity-info-item.full-width,
.contact-card .activity-info-item.full-width {
  flex: 0 0 calc(100% - 12px);
  border-right: none !important;
  padding-right: 6px !important;
  padding-left: 6px !important;
}

@media (max-width: 600px) {
  .client-card .activity-info-item,
  .contact-card .activity-info-item {
    flex: 0 0 calc(100% - 12px);
    border-right: none !important;
    padding-right: 6px !important;
    padding-left: 6px !important;
  }
}

.activity-info-item.full-width {
  flex: 0 0 calc(100% - 12px);
}

.info-label {
  display: block;
  font-size: 0.8rem;
  color: var(--primary-color);
  margin-bottom: 4px;
  font-weight: 600;
}

.info-value {
  display: block;
  font-size: 0.9rem;
  color: #333;
  word-break: break-word;
  line-height: 1.3;
}

.description-text {
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  margin: 2px 0;
  line-height: 1.4;
  font-size: 0.85rem;
}

.endereco-tooltip {
  cursor: pointer;
  position: relative;
}

.endereco-tooltip i {
  color: #006f67;
  margin-left: 3px;
  font-size: 10px;
}

.activity-section-title {
  color: #333;
  font-size: 14px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.activity-section-title i {
  margin-right: 6px;
  color: #006f67;
}

.sales-averages {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  background-color: #f8f9fa;
  padding: 6px;
  border-radius: 4px;
}

.sales-averages div {
  flex: 1;
  text-align: center;
  padding: 0 3px;
}

.sales-averages div:not(:last-child) {
  border-right: 1px solid #e0e0e0;
}

.info-sublabel {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 3px;
}

.mini-button {
  background-color: #f1f1f1;
  border: none;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 4px;
  color: #555;
  transition: background-color 0.2s;
}

.mini-button:hover {
  background-color: #e0e0e0;
}

.default-badge {
  background-color: #006f67;
  color: white;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: middle;
}

.contacts-list {
  overflow-y: auto;
}

.contact-card.default-contact {
  background-color: #edf7f6;
  border-left: 3px solid #006f67;
}

.contact-name {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.contact-position,
.contact-phone,
.contact-mobile,
.contact-email {
  font-size: 0.9rem;
  margin: 3px 0;
  color: #555;
}

.sales-indicators-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  justify-content: space-between;
}

.sales-indicator-card {
  flex: 1;
  background: linear-gradient(135deg, #f8fffe 0%, #e8f5f4 100%);
  border: 1px solid #d1e7e5;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sales-indicator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1200px) {
  .sales-indicators-row {
    gap: 8px;
  }

  .sales-indicator-card {
    padding: 10px;
  }
}

@media (max-width: 992px) {
  .sales-indicators-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sales-indicator-card {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .sales-indicators-row {
    flex-direction: column;
    gap: 8px;
  }

  .sales-indicator-card {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .sales-indicator-card {
    padding: 8px;
  }
}

.contact-card .activity-info-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.contact-card .activity-info-item.span-2-cols {
  grid-column: span 2;
}

.contact-card .activity-info-item.span-3-cols {
  grid-column: span 3;
}

.activity-details-card:has(.fas.fa-sticky-note) .activity-info-group,
.observacoes-card .activity-info-group {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 0.6rem;
}

.description-card .activity-card-body {
  padding: 1rem;
  height: calc(100% - 60px);
}

.activity-description-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.description-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: all 0.3s ease;
}

textarea.description-text {
  background-color: #ffffff;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  font-size: 0.9rem !important;
  line-height: 1.5;
}

textarea.description-text:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-light);
  font-size: 0.9rem !important;
}

#cancel-observations-btn {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
  transition: all 0.3s ease;
  animation: slideInRight 0.3s ease-out;
}

#cancel-observations-btn:hover {
  background-color: #5a6268 !important;
  border-color: #545b62 !important;
  transform: scale(1.05);
}

#cancel-observations-btn:active {
  transform: scale(0.95);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#observations-buttons-container {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease-out;
}

.contact-card .activity-card-body {
  padding: 1rem;
  height: calc(100% - 60px);
}

.contact-card .activity-info-group {
  grid-template-columns: 1fr;
}

.contact-card .activity-info-group {
  grid-template-columns: repeat(2, 1fr);
}

.contact-card-compact .activity-card-body {
  padding: 0.8rem;
  height: calc(100% - 50px);
}

.contact-card-compact .activity-info-group {
  gap: 0.4rem;
  grid-template-columns: repeat(3, 1fr) !important;
}

.contact-card-compact .info-label {
  font-size: 0.75rem;
  margin-bottom: 2px;
}

.contact-card-compact .info-value {
  font-size: 0.85rem;
}

.contact-card-compact .activity-info-group {
  grid-template-columns: 1fr !important;
}

.contact-card-compact .activity-info-group {
  grid-template-columns: repeat(2, 1fr);
}

.contact-card-compact .activity-info-group {
  grid-template-columns: repeat(2, 1fr) !important;
}

.contact-card .activity-info-group {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.6rem !important;
}

.contact-card .activity-info-item.span-2-cols {
  grid-column: span 2 !important;
}

.contact-card .activity-info-item.span-3-cols {
  grid-column: span 3 !important;
}

@media (max-width: 768px) and (min-width: 481px) {
  .contact-card .activity-info-group {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .contact-card .activity-info-item.span-2-cols,
  .contact-card .activity-info-item.span-3-cols {
    grid-column: span 2 !important;
  }
}

@media (max-width: 480px) {
  .contact-card .activity-info-group {
    grid-template-columns: 1fr !important;
  }

  .contact-card .activity-info-item.span-2-cols,
  .contact-card .activity-info-item.span-3-cols {
    grid-column: span 1 !important;
  }
}

.contact-card .activity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

.contact-card .activity-card-header h4 {
  margin: 0;
  flex: 1;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-edit-btn {
  background: #28a745;
  border: none;
  border-radius: 6px;
  color: white;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.contact-edit-btn:hover {
  background: #1e7e34;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.contact-edit-btn:active {
  transform: translateY(0);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-edit-btn {
  background: #28a745;
  border: none;
  border-radius: 6px;
  color: white;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.company-edit-btn:hover {
  background: #1e7e34;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.company-edit-btn:active {
  transform: translateY(0);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.phone-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.email-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-card .email-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.contact-card .email-container .info-value {
  word-break: break-all;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.contact-card .email-container .email-btn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
}

.contact-card .activity-info-item:has(.email-container) {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  overflow: visible;
}

.contact-card .activity-info-item .email-container {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.contact-card .activity-info-item .email-container .info-value {
  word-break: break-all !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.2 !important;
  flex: 1 !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.contact-card .activity-info-item .email-container .email-btn {
  flex-shrink: 0 !important;
  align-self: flex-start !important;
  margin-top: 2px !important;
}

.contact-card .activity-info-group .activity-info-item {
  min-width: 0;
  overflow: visible;
}

.contact-card .email-container {
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}

.contact-card .email-container .info-value,
.contact-card .email-container span.info-value {
  word-break: break-all !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.2 !important;
  flex: 1 !important;
  min-width: 0 !important;
  max-width: calc(100% - 36px) !important;
  hyphens: auto !important;
}

.contact-card .email-container .email-btn {
  flex-shrink: 0 !important;
  align-self: flex-start !important;
  margin-top: 2px !important;
  width: 28px !important;
  height: 24px !important;
}

.contact-card .activity-info-item:nth-last-child(1) {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.contact-card .activity-info-item:nth-last-child(1) .email-container {
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}

.contact-card
  .activity-info-item:nth-last-child(1)
  .email-container
  .info-value {
  word-break: break-all !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.2 !important;
  flex: 1 !important;
  min-width: 0 !important;
  max-width: calc(100% - 36px) !important;
  hyphens: auto !important;
}

.contact-card
  .activity-info-item:nth-last-child(1)
  .email-container
  .email-btn {
  flex-shrink: 0 !important;
  align-self: flex-start !important;
  margin-top: 2px !important;
  width: 28px !important;
  height: 24px !important;
}

.column-dropdown {
  position: relative;
}

.column-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 250px;
  overflow-y: auto;
}

.column-dropdown.active .column-dropdown-content {
  display: block;
}

.column-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-dropdown-body {
  padding: 0.5rem;
}

.column-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.column-item:hover {
  background-color: #f8f9fa;
}

.column-item input[type="checkbox"] {
  margin: 0;
}

.column-item label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-size: 0.9rem;
}

.column-dropdown-footer {
  padding: 0.5rem;
  border-top: 1px solid #eee;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.column-action-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.column-action-btn:hover {
  background-color: #f8f9fa;
  border-color: #bbb;
}

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

.column-action-btn.primary:hover {
  background-color: #005a54;
  border-color: #005a54;
}

.sort-indicator {
  margin-left: 0.5rem;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

th.sorted .sort-indicator {
  opacity: 1;
}

th:hover .sort-indicator {
  opacity: 0.8;
}

.filter-input {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.8rem;
  background: white;
}

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

.hidden {
  display: none !important;
}

.dragging {
  opacity: 0.5;
}

@media (max-width: 768px) {
  .column-dropdown-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
  }

  .activity-details-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-container {
    order: 1;
    justify-content: center;
  }

  .tab-controls {
    order: 2;
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
  }

  .tab-controls .search-input-container,
  .tab-controls .sort-select-container {
    width: 48% !important;
  }

  .activity-date-display {
    order: 3;
    margin-top: 0.5rem;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

.activity-date-display i {
  font-size: 0.9rem;
  color: var(--primary-color);
}

.date-time-separator {
  color: #999;
  font-weight: 300;
}

@media (max-width: 768px) {
  .activity-details-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-container {
    order: 1;
    justify-content: center;
  }

  .tab-controls {
    order: 2;
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
  }

  .tab-controls .search-input-container,
  .tab-controls .sort-select-container {
    width: 48% !important;
  }

  .activity-date-display {
    order: 3;
    margin-top: 0.5rem;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

.history-table-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  background-color: #ffffff;
  border-radius: 8px 8px 0 0;
  display: none;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

.tab-controls {
  display: flex;
  gap: 15px;
  margin-left: auto;
}

.history-table-fixed-header table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  table-layout: fixed;
  box-sizing: border-box;
}

.history-table-fixed-header thead {
  background-color: #f5f8f8;
}

.history-table-fixed-header th {
  background-color: #f5f8f8;
  padding: 0.75rem;
  text-align: center;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  margin: 0;
  font-size: inherit;
  white-space: nowrap;
}

.history-table-fixed-header th[data-column="usuario"],
.history-table-fixed-header th[data-column="resultado"],
.history-table-fixed-header th[data-column="assunto"] {
  text-align: left;
}

.history-table-fixed-header th:last-child {
  border-right: none;
}

.history-table-fixed-header .filter-input {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.8rem;
  background: white;
}

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

.history-table-fixed-header #filter-row {
  background-color: #f8f9fa;
}

.history-table-fixed-header #filter-row td {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.history-table-fixed-header th[data-column="numero"] {
  min-width: 60px;
  width: 60px;
}

.history-table-fixed-header th[data-column="status"] {
  min-width: 60px;
  width: 60px;
}

.history-table-fixed-header th[data-column="data"] {
  min-width: 120px;
}

.history-table-fixed-header th[data-column="resultado"] {
  min-width: 300px;
}

.custom-tooltip {
  position: fixed;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  max-width: 250px;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  pointer-events: none;
}

.custom-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #374151;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.custom-tooltip[style*="--arrow-direction: up"]::before {
  top: -12px;
  border-top-color: transparent;
  border-bottom-color: #374151;
}

.custom-tooltip.verde-copapel {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.custom-tooltip.verde-copapel::before {
  border-top-color: #10b981;
}

.custom-tooltip.verde-copapel[style*="--arrow-direction: up"]::before {
  border-bottom-color: #10b981;
}

.custom-tooltip.verde-escuro-copapel {
  background: linear-gradient(135deg, #6ba5e9 0%, #9fc8fa 100%);
  border-color: rgba(159, 200, 250, 0.3);
}

.custom-tooltip.verde-escuro-copapel::before {
  border-top-color: #9fc8fa;
}

.custom-tooltip.verde-escuro-copapel[style*="--arrow-direction: up"]::before {
  border-bottom-color: #9fc8fa;
}

.custom-tooltip.azul-pessoinhas {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

.custom-tooltip.azul-pessoinhas::before {
  border-top-color: #3b82f6;
}

.custom-tooltip.azul-pessoinhas[style*="--arrow-direction: up"]::before {
  border-bottom-color: #3b82f6;
}

.custom-tooltip.cinza-olhinho {
  background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
  border-color: rgba(107, 114, 128, 0.3);
}

.custom-tooltip.cinza-olhinho::before {
  border-top-color: #6b7280;
}

.custom-tooltip.cinza-olhinho[style*="--arrow-direction: up"]::before {
  border-bottom-color: #6b7280;
}

.custom-tooltip.robo {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
  border-color: rgba(139, 92, 246, 0.3);
}

.custom-tooltip.robo::before {
  border-top-color: #8b5cf6;
}

.custom-tooltip.robo[style*="--arrow-direction: up"]::before {
  border-bottom-color: #8b5cf6;
}

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

.custom-tooltip.animate-in {
  animation: tooltipFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (max-width: 768px) {
  .custom-tooltip {
    font-size: 0.75rem;
    padding: 6px 10px;
    max-width: 200px;
  }

  .custom-tooltip::before {
    border-width: 5px;
  }
}

#quotation-items-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

#quotation-items-modal .modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1000px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

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

#quotation-items-modal .modal-header h2 {
  margin: 0;
  color: #006f67;
  font-size: 1.25rem;
  font-weight: 600;
}

#quotation-items-modal .modal-body {
  padding: 1.5rem;
  max-height: calc(80vh - 120px);
  overflow-y: auto;
}

.quotation-items-container {
  position: relative;
}

.quotation-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.quotation-item-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quotation-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #006f67;
}

.quotation-item-image {
  height: 120px;
  overflow: hidden;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quotation-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.quotation-item-card:hover .quotation-item-image img {
  transform: scale(1.05);
}

.quotation-item-info {
  padding: 1rem;
}

.quotation-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.quotation-item-code {
  font-weight: 600;
  color: #006f67;
  font-size: 0.9rem;
}

.quotation-item-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.quotation-item-status.open {
  background-color: #dbeafe;
  color: #1e40af;
}

.quotation-item-status.closed {
  background-color: #dcfce7;
  color: #166534;
}

.quotation-item-description {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
}

.quotation-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quotation-item-details > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quotation-item-details .label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

.quotation-item-details .value {
  font-size: 0.85rem;
  color: #111827;
  font-weight: 600;
}

.quotation-item-total .value {
  color: #006f67;
  font-size: 0.9rem;
}

.quotation-items-loading,
.quotation-items-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: #6b7280;
  min-height: 200px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
}

.quotation-items-loading i,
.quotation-items-empty i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #9ca3af;
}

.quotation-items-loading i {
  color: #006f67;
}

.quotation-items-loading p,
.quotation-items-empty p {
  margin: 0;
  font-size: 1rem;
}

.quotation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.quotation-total-section {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quotation-total-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.quotation-total {
  font-size: 1rem;
  font-weight: 700;
  color: #006f67;
}

.btn-view-items {
  background: linear-gradient(135deg, #006f67 0%, #005a54 100%);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 111, 103, 0.3);
}

.btn-view-items span {
  font-size: 0.7rem;
}

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

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

@media (max-width: 768px) {
  #quotation-items-modal .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  #quotation-items-modal .modal-header {
    padding: 1rem;
  }

  #quotation-items-modal .modal-body {
    padding: 1rem;
    max-height: calc(90vh - 100px);
  }

  .quotation-items-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .quotation-item-card {
    margin-bottom: 0;
  }

  .quotation-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .quotation-total-section {
    text-align: center;
  }

  .btn-view-items {
    justify-content: center;
  }
}

.quotation-card.horizontal-layout {
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.quotation-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quotation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.quotation-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quotation-number {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.quotation-date {
  color: #6c757d;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.quotation-date i {
  color: var(--primary-color);
  font-size: 0.9rem;
}

.quotation-status {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.quotation-client .client-name {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}

.quotation-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

.quotation-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quotation-detail-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 2px;
}

.quotation-detail-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.quotation-items {
  margin-top: 15px;
  overflow-y: auto;
  max-height: 200px;
}

.quotation-item {
  padding: 10px;
  border-radius: 6px;
  background-color: #f8f9fa;
  margin-bottom: 8px;
}

.quotation-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.quotation-item-code {
  font-weight: bold;
  font-size: 0.9rem;
}

.quotation-item-price {
  color: #212529;
  font-weight: bold;
}

.quotation-item-description {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
}

.quotation-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quotation-item-details > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quotation-item-details .label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

.quotation-item-details .value {
  font-size: 0.85rem;
  color: #111827;
  font-weight: 600;
}

.quotation-item-total .value {
  color: #006f67;
  font-size: 0.9rem;
}

.quotation-items-loading,
.quotation-items-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: #6b7280;
  min-height: 200px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
}

.products-loading,
.quotations-loading,
.service-orders-loading,
.history-loading,
.lendings-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
  min-height: 200px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
}

.quotation-items-loading i,
.quotation-items-empty i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #9ca3af;
}

.products-loading i,
.quotations-loading i,
.service-orders-loading i,
.history-loading i,
.lendings-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  animation: spin 1.2s linear infinite;
}

.products-empty,
.quotations-empty,
.service-orders-empty,
.history-empty,
.lendings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
  min-height: 200px;
  background-color: var(--background-color);
  border-radius: var(--radius);
  border: 1px dashed var(--border-color);
}

.products-empty i,
.quotations-empty i,
.service-orders-empty i,
.history-empty i,
.lendings-empty i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--border-color);
  opacity: 0.7;
}

.products-empty p,
.quotations-empty p,
.service-orders-empty p,
.history-empty p,
.lendings-empty p {
  text-align: center;
  line-height: 1.5;
  max-width: 300px;
}

.products-container {
  padding: 1rem 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.product-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.history-table #filter-row {
  position: sticky;
  top: 60px;
  z-index: 99;
  background-color: #f8f9fa;
}

#history-tab {
  height: 100%;
  overflow: visible;
}

#history-tab .history-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#history-tab .history-grid {
  flex: 1;
  overflow: visible;
  min-height: 0;
}

#history-tab .history-grid .table-responsive {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  overflow-x: auto;
}

/* Estilos para aba Histórico de Fluxos - mesma correção aplicada */
#workflow-history-tab {
  height: 100%;
  overflow: visible;
}

#workflow-history-tab .workflow-history-grid {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  overflow-x: auto;
}

/* Estilos para sticky-table-container */
.sticky-table-container {
  overflow: visible;
}

/* Estilos para as abas */
.tab-content {
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

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

#history-advanced-table thead tr {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #f5f8f8;
}

#history-advanced-table #header-row {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #f5f8f8;
}

#history-advanced-table #header-row th {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #f5f8f8;
}

#history-advanced-table #filter-row {
  position: sticky;
  top: 48px;
  z-index: 99;
  background-color: #f8f9fa;
}

#history-advanced-table #filter-row td {
  position: sticky;
  z-index: 99;
  background-color: #f8f9fa;
}

.history-table #filter-row td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

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

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

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

.scroll-to-top-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scroll-to-top-btn:hover {
  background-color: #005a54;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 111, 103, 0.3);
}

.scroll-to-top-btn:active {
  transform: translateX(-50%) translateY(0);
}

.scroll-to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.scroll-to-top-btn {
  z-index: 1001 !important;
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: 15px;
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

.sidebar:not(.expanded) .scroll-to-top-btn {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
  bottom: 15px;
}

.whatsapp-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.whatsapp-loading-overlay.show {
  display: flex;
}

.whatsapp-loading-content {
  background-color: white;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.whatsapp-loading-spinner {
  margin-bottom: 20px;
}

.whatsapp-loading-spinner .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--primary-light);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.whatsapp-loading-text h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.whatsapp-loading-text p {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 0.9rem;
}

.loading-steps {
  text-align: left;
}

.loading-step {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.loading-step i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.loading-step.completed {
  background-color: var(--secondary-light);
  color: var(--secondary-color);
}

.loading-step.completed i {
  color: var(--secondary-color);
}

.loading-step.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.loading-step.active i {
  color: var(--primary-color);
}

.loading-step.pending {
  color: var(--text-light);
}

.loading-step.pending i {
  color: var(--text-light);
}

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

.message-options {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.btn-outline:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

#whatsapp-message-text {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 120px;
  transition: var(--transition);
}

#whatsapp-message-text:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

#whatsapp-message-counter {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 5px;
  display: block;
}

@media (max-width: 768px) {
  .message-options {
    flex-direction: column;
  }

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

/* ===== INDICADORES DE VENDAS E COMODATOS ===== */
.indicators-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}

.indicator-item {
  background: linear-gradient(135deg, #f8fffe 0%, #e8f5f4 100%);
  border: 1px solid #d1e7e5;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 111, 103, 0.08);
  transition: transform 0.2s ease;
  min-height: 44px;
}

.indicator-item:hover {
  transform: translateY(-2px);
}

.indicator-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.indicator-header i {
  font-size: 1rem;
  color: #006f67;
}

.indicator-label {
  font-weight: 600;
  font-size: 0.7rem;
  color: #006f67;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.indicator-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #333;
  text-align: right;
  min-width: 60px;
}

/* Indicadores de Comodatos */
.comodato-indicator {
  background: linear-gradient(135deg, #fff8f0 0%, #f5e6d3 100%);
  border: 1px solid #e6d0b3;
  box-shadow: 0 2px 4px rgba(204, 102, 0, 0.08);
}

.comodato-indicator .indicator-header i {
  color: #cc6600;
}

.comodato-indicator .indicator-label {
  color: #cc6600;
}

/* Responsividade */
@media (max-width: 768px) {
  .indicators-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
