/* Activity Log - Uses contacts-layout.css classes + minimal overrides */

/* ================================
   TABLE OVERRIDES
   ================================ */

/* Table row - clickable with hover effect */
#activity-log-table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#activity-log-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

#activity-log-table tbody tr.activity-inline-timeline:hover {
  background-color: transparent;
  cursor: default;
}

/* Event icon cell */
#activity-log-table td:first-child {
  width: 40px;
  text-align: center;
  padding: 4px 6px;
}

/* Reduce avatar size */
#activity-log-table .contacts-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* Contact cell with avatar */
#activity-log-table td:nth-child(2) {
  min-width: 140px;
  padding: 8px 12px;
}

/* Event icon - Compact */
.activity-event-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.activity-event-icon .material-icons {
  font-size: 14px;
}

/* Compact table cells */
#activity-log-table td {
  padding: 8px 12px !important;
  font-size: 12px;
  line-height: 1.3;
}

#activity-log-table th {
  padding: 6px 8px !important;
  font-size: 11px;
}

#activity-log-table tbody tr {
  height: auto;
}

.activity-event-icon.sent {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-color);
}

.activity-event-icon.opened {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.activity-event-icon.clicked {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.activity-event-icon.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.activity-event-icon.unsubscribed {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

/* Row toggle icon (down arrow) */
.activity-row-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  z-index: 10;
  position: relative;
}

.activity-row-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
}

.activity-row-toggle .material-icons {
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.activity-row-toggle.expanded .material-icons {
  transform: rotate(180deg);
}

.activity-row-toggle:hover .material-icons {
  color: var(--accent-color);
}

/* Ensure table cells allow pointer events */
#activity-log-events td {
  pointer-events: auto;
}

/* Colored Event Badges */
.activity-event-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

/* Event details under badge */
.activity-event-details {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-event-link {
  color: var(--accent-color);
  text-decoration: none;
}

.activity-event-link:hover {
  text-decoration: underline;
}

.activity-event-error {
  color: #ef4444;
  font-weight: 500;
}

/* Time column */
.activity-time {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ================================
   TOOLBAR STYLES
   ================================ */

.activity-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.activity-log-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* Filter dropdowns in toolbar */
.activity-log-filter-select {
  appearance: auto;
  padding: 8px 12px;
  padding-right: 30px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

.activity-log-filter-select:focus {
  outline: none;
  border-color: var(--accent-color);
}

#activity-log-date-filter {
  width: 120px;
}

#activity-log-campaign-filter {
  width: auto;
  min-width: 150px;
  max-width: 200px;
}

#activity-log-campaign-filter option {
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-log-search-wrapper {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

/* ================================
   TABS NAVIGATION
   ================================ */

.activity-log-tabs-row {
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.activity-log-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  background: transparent;
}

.activity-log-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.activity-log-tab:hover {
  color: var(--text-primary);
}

.activity-log-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  font-weight: 600;
}



/* ================================
   RESPONSIVE - Desktop First
   ================================ */

@media (max-width: 1200px) {
  .activity-log-toolbar-left {
    flex-wrap: nowrap;
  }
}

@media (max-width: 900px) {
  .activity-log-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .activity-log-toolbar-left {
    flex-direction: column;
    width: 100%;
  }
  
  .activity-log-search-wrapper {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .activity-log-filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  
}

/* ================================
   MODAL
   ================================ */

.activity-log-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.activity-log-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.activity-log-modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.activity-log-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.activity-log-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.activity-log-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.activity-log-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.activity-log-modal-close .material-icons {
  font-size: 20px;
}

.activity-log-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 65px);
}

/* Detail rows in modal */
.activity-detail-row {
  display: flex;
  margin-bottom: 12px;
  font-size: 14px;
}

.activity-detail-row:last-child {
  margin-bottom: 0;
}

.activity-detail-label {
  width: 100px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.activity-detail-value {
  color: var(--text-primary);
  word-break: break-all;
}

/* ================================
   MODERN PREMIUM LOADING - Circle Animation
   ================================ */

/* Loading row with premium circle animation */
.activity-skeleton-row {
  position: relative;
}

.activity-skeleton-row::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent-color) 0%,
    transparent 30%,
    transparent 100%
  );
  animation: premiumCircleSpin 1.2s linear infinite;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.activity-skeleton-row::after {
  content: '';
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
}

@keyframes premiumCircleSpin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Hide old skeleton elements */
.activity-skeleton-icon,
.activity-skeleton-avatar,
.activity-skeleton-badge,
.activity-skeleton-text,
.activity-skeleton-time {
  display: none;
}

/* ================================
   LAST UPDATED TIMESTAMP
   ================================ */

.activity-log-last-updated {
  font-size: 10px;
  color: var(--text-tertiary);
  padding: 4px 16px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0.7;
  font-family: monospace;
}

.activity-log-last-updated::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

/* Loading row in table */
.activity-loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.activity-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Animation for loading icon */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hide stats-related functions in JS but keep CSS minimal */
.activity-log-stats-bar,
.activity-stat-item,
.activity-stat-divider {
  display: none;
}

/* ================================
   REFRESH BUTTON - NO ANIMATION
   ================================ */

#activity-log-refresh {
  transition: opacity 0.2s ease;
}

#activity-log-refresh:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ================================
   CONTACT TIMELINE MODAL
   ================================ */

/* Event Details Section */
.timeline-event-details {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.timeline-event-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.timeline-event-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-event-info p {
  margin: 0;
}

.activity-detail-section {
  background: var(--bg-primary);
  padding: 16px;
  border-radius: 8px;
}

/* Activity Timeline Section */
.timeline-activity-section {
  margin-top: 20px;
}

.timeline-activity-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.timeline-activity-header:hover {
  background: var(--bg-hover);
}

.timeline-activity-header .material-icons {
  font-size: 20px;
  color: var(--accent-color);
}

.timeline-activity-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-secondary);
}

.timeline-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.timeline-toggle-btn .material-icons {
  font-size: 24px;
  transition: transform 0.3s;
}

.timeline-toggle-btn.expanded .material-icons {
  transform: rotate(180deg);
}

/* Timeline Content */
.timeline-activity-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.timeline-activity-content.expanded {
  max-height: 500px;
  overflow-y: auto;
  margin-top: 16px;
}

/* Timeline Day */
.timeline-day {
  margin-bottom: 24px;
}

.timeline-day:last-child {
  margin-bottom: 0;
}

.timeline-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 8px;
  text-transform: capitalize;
}

/* Timeline Item */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-item-icon .material-icons {
  font-size: 16px;
}

.timeline-item-content-details {
  flex: 1;
  min-width: 0;
}

.timeline-item-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.timeline-contact {
  font-weight: 600;
}

.timeline-action {
  color: var(--text-secondary);
}

.timeline-target {
  color: var(--text-primary);
}

.timeline-campaign {
  color: var(--accent-color);
  font-weight: 500;
}

.timeline-link {
  color: var(--accent-color);
  text-decoration: none;
  word-break: break-all;
}

.timeline-link:hover {
  text-decoration: underline;
}

.timeline-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.timeline-time {
  font-size: 12px;
}

.timeline-loading,
.timeline-error {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ================================
   INLINE TIMELINE IN TABLE
   ================================ */

.activity-inline-timeline {
  background: var(--bg-elevated);
}

.activity-timeline-cell {
  padding: 16px 24px !important;
  border-top: 1px solid var(--border-color);
}

.activity-timeline-loading,
.activity-timeline-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.activity-inline-timeline-container {
  max-height: 400px;
  overflow-y: auto;
}

.activity-inline-day {
  margin-bottom: 20px;
}

.activity-inline-day:last-child {
  margin-bottom: 0;
}

.activity-inline-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.activity-inline-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}

.activity-inline-item:hover {
  background: var(--bg-hover);
}

.activity-inline-item:last-child {
  margin-bottom: 0;
}

.activity-inline-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-inline-icon .material-icons {
  font-size: 18px;
}

.activity-inline-content {
  flex: 1;
  min-width: 0;
}

.activity-inline-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.activity-inline-contact {
  font-weight: 600;
  color: var(--text-primary);
}

.activity-inline-action {
  color: var(--text-secondary);
}

.activity-inline-target {
  color: var(--text-primary);
}

.activity-inline-campaign {
  color: var(--accent-color);
  font-weight: 500;
}

.activity-inline-link {
  color: var(--accent-color);
  text-decoration: none;
  word-break: break-all;
}

.activity-inline-link:hover {
  text-decoration: underline;
}

.activity-inline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.activity-inline-time {
  font-size: 12px;
}

.activity-inline-view {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
  transition: background 0.2s;
}

.activity-inline-view:hover {
  background: rgba(99, 102, 241, 0.2);
  text-decoration: none;
}

/* ================================
   ACTIVITY TIMELINE ROWS - Text Style Like Screenshot
   ================================ */

/* Timeline Day Header */
.activity-inline-day {
  margin-bottom: 16px;
}

.activity-inline-day:last-child {
  margin-bottom: 0;
}

.activity-inline-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

/* Timeline Row - Compact text style */
.activity-timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.activity-timeline-row:hover {
  background: rgba(99, 102, 241, 0.03);
  border-radius: 6px;
}

/* Event Icon - Colored circle backgrounds */
.activity-timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-timeline-icon.sent {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

.activity-timeline-icon.opened {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.activity-timeline-icon.clicked {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.activity-timeline-icon.unsubscribed {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.activity-timeline-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.activity-timeline-icon .material-icons {
  font-size: 14px;
}

/* Text content area */
.activity-timeline-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 13px;
}

.activity-timeline-contact {
  font-weight: 600;
  color: var(--accent-color);
  cursor: pointer;
}

.activity-timeline-contact:hover {
  text-decoration: underline;
}

/* Timeline link for clicked URLs */
.activity-timeline-target-link {
  color: var(--accent-color);
  text-decoration: none;
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.activity-timeline-target-link:hover {
  text-decoration: underline;
}

.activity-timeline-action {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.activity-timeline-action .material-icons {
  font-size: 14px;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* URL/Subject text */
.activity-timeline-target {
  color: var(--accent-color);
  font-weight: 500;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-timeline-target:hover {
  text-decoration: underline;
}

/* Campaign name */
.activity-timeline-campaign {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Clickable link */
.activity-timeline-link {
  color: var(--accent-color);
  text-decoration: none;
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.activity-timeline-link:hover {
  text-decoration: underline;
}

/* Time stamp */
.activity-timeline-time {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  margin-left: 8px;
}

/* View email button */
.activity-timeline-view {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 8px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.activity-timeline-view:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Empty/Loading states */
.activity-timeline-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.activity-timeline-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ================================
   EXPORT MODAL STYLES
   ================================ */

.export-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.export-modal-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.export-modal-stats {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.export-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.export-stat-item .material-icons {
  font-size: 18px;
  color: var(--accent-color);
}

.export-modal-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.export-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.export-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.export-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.export-file-extension {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.export-format-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-primary);
}

.export-radio:hover {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.export-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
}

.export-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.export-radio-label .material-icons {
  font-size: 18px;
  color: var(--accent-color);
}

.export-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.export-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
}

.export-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ================================
   NEW SCHEMA STYLES - Filters Layout
   ================================ */

/* Filters Row - 4 columns layout */
.activity-log-schema-filters {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.activity-filter-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-filter-select {
  width: 100%;
  padding: 10px 12px;
  padding-right: 32px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
}

.activity-filter-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.activity-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.activity-search-wrapper .material-icons {
  position: absolute;
  left: 12px;
  color: var(--text-tertiary);
  font-size: 18px;
  pointer-events: none;
}

.activity-search-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
}

.activity-search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.activity-search-input::placeholder {
  color: var(--text-tertiary);
}

/* ================================
   NEW SCHEMA STYLES - Legend
   ================================ */

.activity-log-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  justify-content: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 20px;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  user-select: none;
  position: relative;
  background: var(--bg-primary);
  white-space: nowrap;
}

/* Badge count - inline aligned */
.legend-item .badge-count {
  position: relative;
  top: auto;
  right: auto;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
  margin-left: 2px;
}

/* Badge colors by action type */
.legend-item[data-filter="sent"] .badge-count {
  background: #6366f1;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.legend-item[data-filter="opened"] .badge-count {
  background: #22c55e;
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.3);
}

.legend-item[data-filter="clicked"] .badge-count {
  background: #3b82f6;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.legend-item[data-filter="followup"] .badge-count {
  background: #a855f7;
  box-shadow: 0 1px 3px rgba(168, 85, 247, 0.3);
}

.legend-item[data-filter="error"] .badge-count {
  background: #ef4444;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.legend-item[data-filter="unsubscribed"] .badge-count {
  background: #f97316;
  box-shadow: 0 1px 3px rgba(249, 115, 22, 0.3);
}

.legend-item:hover .badge-count {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.legend-item.active .badge-count {
  background: var(--accent-color);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
}

.legend-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  transform: translateY(-1px);
}

.legend-item.active {
  background: var(--bg-primary);
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.legend-icon {
  font-size: 16px;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.legend-item:hover .legend-icon {
  transform: scale(1.1);
}

.legend-icon.all {
  color: var(--text-secondary);
  background: rgba(107, 114, 128, 0.1);
}

.legend-item.active .legend-icon.all {
  color: var(--accent-color);
  background: rgba(99, 102, 241, 0.15);
}

.legend-icon.sent {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.legend-item.active .legend-icon.sent {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.2);
}

.legend-icon.opened {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.legend-item.active .legend-icon.opened {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
}

.legend-icon.clicked {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.legend-item.active .legend-icon.clicked {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
}

.legend-icon.followup {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
}

.legend-item.active .legend-icon.followup {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.2);
}

.legend-icon.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.legend-item.active .legend-icon.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.legend-icon.unsubscribed {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}

.legend-item.active .legend-icon.unsubscribed {
  color: #f97316;
  background: rgba(249, 115, 22, 0.2);
}

/* ================================
   Custom Date Range
   ================================ */

.activity-custom-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.activity-date-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12px;
}

.activity-date-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.activity-date-separator {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ================================
   NEW SCHEMA STYLES - Load More
   ================================ */

.activity-load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  margin-top: 16px;
}

.activity-shown-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-load-more {
  padding: 12px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.btn-load-more:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-load-more.loading {
  position: relative;
  color: transparent;
}

.btn-load-more.loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ================================
   RESPONSIVE - Filters
   ================================ */

@media (max-width: 900px) {
  .activity-log-schema-filters {
    flex-wrap: wrap;
  }
  
  .activity-filter-group {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
  }
}

@media (max-width: 600px) {
  .activity-log-schema-filters {
    flex-direction: column;
    gap: 12px;
  }
  
  .activity-filter-group {
    flex: 1 1 100%;
  }
  
  .activity-log-legend {
    gap: 12px;
    padding: 12px;
  }
  
  .legend-item {
    font-size: 12px;
  }
}

/* ================================
   TABLE COLUMNS - Schema Format
   ================================ */

/* Date & Heure column */
#activity-log-table th:first-child,
#activity-log-table td:first-child {
  width: 120px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Action column */
#activity-log-table td:nth-child(3) {
  min-width: 140px;
}

/* Action badge styles */
.activity-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
}

.activity-action-badge.sent {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.activity-action-badge.opened {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.activity-action-badge.clicked {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.activity-action-badge.unsubscribed {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.activity-action-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.activity-action-badge.followup {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

/* Hide old pagination - using Load More instead */
#activity-log-pagination {
  display: none !important;
}


/* ================================
   DELETE MODAL STYLES
   ================================ */

.delete-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.delete-modal-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.delete-modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delete-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-primary);
}

.delete-option:hover {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.delete-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-color);
  cursor: pointer;
  flex-shrink: 0;
}

.delete-option-content {
  flex: 1;
}

.delete-option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.delete-option-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.delete-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.delete-option-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.delete-modal-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 13px;
}

.delete-modal-warning .material-icons {
  font-size: 18px;
  flex-shrink: 0;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.contacts-btn-danger {
  background: #ef4444;
  color: white;
  border: none;
}

.contacts-btn-danger:hover {
  background: #dc2626;
}

.contacts-btn-danger:active {
  background: #b91c1c;
}

.contacts-btn-danger .material-icons {
  color: white;
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */

[data-theme="dark"] .activity-log-schema-filters {
  background: var(--bg-surface);
  border-color: var(--border-color);
}

[data-theme="dark"] .activity-filter-select,
[data-theme="dark"] .activity-search-input,
[data-theme="dark"] .activity-date-input {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .activity-log-legend {
  background: var(--bg-surface);
  border-color: var(--border-color);
}

[data-theme="dark"] .legend-item {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme="dark"] .legend-item.active {
  background: var(--accent-subtle);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

[data-theme="dark"] .activity-log-modal-content {
  background: var(--bg-surface);
  border-color: var(--border-color);
}

[data-theme="dark"] .activity-log-modal-header {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

[data-theme="dark"] .timeline-item,
[data-theme="dark"] .activity-inline-item {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

[data-theme="dark"] .export-modal-stats,
[data-theme="dark"] .delete-option,
[data-theme="dark"] .delete-option-group {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

[data-theme="dark"] .export-radio,
[data-theme="dark"] .activity-timeline-header {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-load-more {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-load-more:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
}
