/* Sync Status (queue + discarded ops indicators) */
.sync-status {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.sync-status-discarded-wrapper,
.sync-status-pending-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sync-status-discarded-wrapper.hidden,
.sync-status-pending-wrapper.hidden {
  display: none;
}

.sync-status-discarded-warning,
.sync-status-pending-icon {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.sync-status-discarded-warning {
  color: #d97706;
}

.sync-status-discarded-warning:hover {
  color: #b45309;
}

.sync-status-pending-icon {
  color: #2563eb;
}

.sync-status-pending-icon:hover {
  color: #1d4ed8;
}

.sync-status-pending-wrapper.online .sync-status-pending-icon {
  color: #dc2626;
  animation: sync-status-pending-blink 1s ease-in-out infinite;
}

.sync-status-pending-wrapper.online .sync-status-pending-icon:hover {
  color: #b91c1c;
}

@keyframes sync-status-pending-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.sync-status-discarded-popup,
.sync-status-pending-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 280px;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 12px;
  font-size: 13px;
  color: #374151;
  text-align: left;
}

.sync-status-discarded-popup p,
.sync-status-pending-popup p {
  margin: 0 0 8px;
  line-height: 1.4;
}

.sync-status-popup-hint {
  color: #6b7280;
  font-size: 12px;
}

.sync-status-discarded-popup .btn {
  margin-top: 4px;
}

.sync-status-popup-link a {
  color: #2563eb;
  text-decoration: underline;
}

.sync-status-popup-link a:hover {
  color: #1d4ed8;
}

.sync-status-page-warning.hidden {
  display: none;
}

.sync-status-page-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #d97706;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #7c2d12;
}

.sync-status-page-warning i {
  color: #d97706;
  font-size: 18px;
  margin-top: 2px;
}

.sync-status-page-warning p {
  margin: 0 0 4px;
  line-height: 1.4;
}

.sync-status-page-warning p:last-child {
  margin-bottom: 0;
}

.sync-status-page-warning ol {
  margin: 4px 0 8px;
  padding-left: 24px;
  list-style-type: decimal;
  list-style-position: outside;
}

.sync-status-page-warning ol li {
  margin-bottom: 4px;
  line-height: 1.4;
  display: list-item;
}

.offline-db-doctor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.offline-db-doctor-actions button {
  gap: 6px;
}

.offline-db-doctor-sync-status {
  font-size: 13px;
  color: #6b7280;
}

.offline-db-doctor-sync-status[data-kind="success"] {
  color: #15803d;
}

.offline-db-doctor-sync-status[data-kind="error"] {
  color: #b91c1c;
}

.offline-db-doctor-delete-icon {
  color: #dc2626;
  cursor: pointer;
}

.offline-db-doctor-delete-icon:hover {
  color: #b91c1c;
}

.offline-db-doctor-details-btn {
  background: none;
  border: 1px solid #2563eb;
  color: #2563eb;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.offline-db-doctor-details-btn:hover {
  background-color: #eff6ff;
}

.offline-db-doctor-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(640px, 90vw);
  max-height: 80vh;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.offline-db-doctor-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.offline-db-doctor-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.offline-db-doctor-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.offline-db-doctor-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
}

.offline-db-doctor-modal-close:hover {
  color: #111827;
}

.offline-db-doctor-modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.offline-db-doctor-modal-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #7f1d1d;
}

.offline-db-doctor-modal-error h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #b91c1c;
}

.offline-db-doctor-modal-error p {
  margin: 2px 0;
}

.offline-db-doctor-error-message {
  margin: 4px 0 0;
  padding: 8px;
  background-color: #ffffff;
  border: 1px solid #fecaca;
  border-radius: 4px;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: #7f1d1d;
}

.offline-db-doctor-error-toggle summary {
  list-style: none;
  cursor: pointer;
}

.offline-db-doctor-error-toggle summary::-webkit-details-marker {
  display: none;
}

.offline-db-doctor-error-preview {
  display: inline;
  font-family: inherit;
  font-size: 12px;
  color: #7f1d1d;
  white-space: pre-wrap;
  word-break: break-word;
}

.offline-db-doctor-error-more,
.offline-db-doctor-error-less {
  display: inline-block;
  margin-left: 6px;
  color: #b91c1c;
  text-decoration: underline;
  font-weight: 600;
  font-size: 12px;
}

.offline-db-doctor-error-toggle .offline-db-doctor-error-less,
.offline-db-doctor-error-toggle[open] .offline-db-doctor-error-more {
  display: none;
}

.offline-db-doctor-error-toggle[open] .offline-db-doctor-error-preview {
  display: none;
}

.offline-db-doctor-error-toggle[open] .offline-db-doctor-error-less {
  display: inline-block;
}

.offline-db-doctor-details-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.offline-db-doctor-details-table th,
.offline-db-doctor-details-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

.offline-db-doctor-details-table th {
  font-weight: 600;
  white-space: nowrap;
  width: 40%;
  color: #374151;
}

.offline-db-doctor-details-table td {
  word-break: break-word;
  color: #111827;
}

.offline-db-doctor-row-error {
  background-color: #fff7ed !important;
}

.offline-db-doctor-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.offline-db-doctor-badge-pending {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.offline-db-doctor-badge-error {
  background-color: #fee2e2;
  color: #b91c1c;
}
