.sms-history-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-surface, #f9fafb);
  border-radius: var(--radius, 0.5rem);
  align-items: flex-end;
}

.sms-history-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 150px;
}

.sms-history-filters label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 0.5rem);
  background: white;
  font-size: 0.875rem;
}

.sms-history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.sms-history-entry {
  background: white;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 0.5rem);
  padding: 1rem;
  transition: box-shadow 0.2s;
}

.sms-history-entry:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sms-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.sms-entry-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.sms-entry-type-badge.type-confirmation {
  background: #dbeafe;
  color: #1e40af;
}

.sms-entry-type-badge.type-reminder {
  background: #fef3c7;
  color: #92400e;
}

.sms-entry-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sms-entry-status small.delivery-status-indicator {
  font-size: 0.75rem;
  opacity: 0.7;
  font-style: italic;
}

.sms-entry-status.status-success {
  color: #059669;
}

.sms-entry-status.status-error {
  color: #dc2626;
}

.sms-entry-status.status-warning {
  color: #d97706;
}

  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.sms-entry-status.status-success {
  color: var(--color-success, #10b981);
}

.sms-entry-status.status-error {
  color: var(--color-error, #ef4444);
}

.sms-entry-status.status-warning {
  color: var(--color-warning, #f59e0b);
}

.delivery-status-indicator {
  font-size: 0.75rem;
  opacity: 0.7;
  font-style: italic;
  margin-left: 0.25rem;
}

.delivery-update-time {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-left: 0.25rem;
  cursor: help;
}

.sms-entry-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sms-entry-client {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.sms-entry-phone {
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.875rem;
}

.sms-entry-appointment {
  font-size: 0.875rem;
  color: var(--color-text-secondary, #6b7280);
  padding: 0.5rem;
  background: var(--color-surface, #f9fafb);
  border-radius: 0.25rem;
}

.sms-entry-message {
  padding: 0.75rem;
  background: var(--color-surface, #f9fafb);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.sms-entry-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 0.25rem;
  color: #991b1b;
  font-size: 0.875rem;
}

.sms-entry-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.75rem;
  color: var(--color-text-secondary, #6b7280);
}

.sms-entry-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sms-entry-author {
  font-style: italic;
}

.sms-entry-credits {
  color: var(--color-primary, #3b82f6);
}

.sms-entry-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--color-text-secondary, #6b7280);
}

#refresh-history i.spinning {
  animation: spin 1s linear infinite;
}

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

.modal-large {
  max-width: 900px;
  width: 90vw;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary, #6b7280);
}

.empty-state i {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

