/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #93c5fd;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --hot: #ef4444;
  --warm: #f59e0b;
  --cold: #3b82f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --top-bar-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
  }
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* === SCREENS === */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; }

/* === TOP BAR === */
.top-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  min-height: var(--top-bar-height);
}
.top-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; gap: 4px; }

/* === BUTTONS === */
.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--bg-secondary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:active { background: var(--bg-secondary); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:active { background: var(--bg-secondary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* === AUTH === */
.auth-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  min-height: 100%;
}
.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}
.logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
}
.auth-logo h1 { font-size: 28px; margin-bottom: 4px; }
.auth-logo p { color: var(--text-secondary); }

/* === FORMS === */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-group textarea { resize: vertical; }

.padded { padding: 16px; }

/* === CONTACTS LIST === */
.contacts-list {
  padding: 8px 16px;
  padding-bottom: calc(var(--nav-height) + 80px + var(--safe-bottom));
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.contact-card:active { transform: scale(0.98); }
.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.contact-info { flex: 1; min-width: 0; }
.contact-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-company {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-tags { display: flex; gap: 4px; margin-top: 4px; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.tag-hot { background: #fef2f2; color: var(--hot); }
.tag-warm { background: #fffbeb; color: var(--warm); }
.tag-cold { background: #eff6ff; color: var(--cold); }
.tag-custom { background: var(--bg-secondary); color: var(--text-secondary); }

@media (prefers-color-scheme: dark) {
  .tag-hot { background: #451a1a; }
  .tag-warm { background: #451a00; }
  .tag-cold { background: #1e293b; }
}

/* === CONTACT DETAIL === */
#contact-detail {
  padding-bottom: calc(80px + var(--safe-bottom));
}
.detail-card-image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--bg-secondary);
}
.detail-section {
  margin-bottom: 20px;
}
.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.detail-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
}
.detail-field svg {
  flex-shrink: 0;
  color: var(--text-muted);
  margin-top: 2px;
}
.detail-field-value {
  font-size: 15px;
  word-break: break-word;
}
.detail-field a {
  color: var(--primary);
  text-decoration: none;
}
.ai-section {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.ai-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.ai-section p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.enrichment-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Notes in contact detail */
.detail-notes { margin-top: 8px; }
.detail-note {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.detail-note-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.note-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.note-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.note-input-row input:focus { outline: none; border-color: var(--primary); }

/* Voice button */
.voice-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.voice-btn.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === SCANNER === */
.scanner-body {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  flex-direction: column;
}
#scanner-video {
  flex: 1;
  width: 100%;
  object-fit: cover;
}
.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.scanner-frame {
  width: 80%;
  max-width: 320px;
  aspect-ratio: 1.6;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 12px;
}
.scanner-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 12px;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  justify-content: center;
}

/* === EDIT FORM === */
#edit-form {
  padding-bottom: calc(80px + var(--safe-bottom));
}
.card-preview {
  margin-bottom: 16px;
}
.card-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-secondary);
}
.tag-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.tag-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tag-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-secondary);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
}
.tag-removable:hover { text-decoration: line-through; }

/* === FAB === */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.9); }

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 5;
  height: calc(var(--nav-height) + var(--safe-bottom));
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 8px;
}
.nav-item.active { color: var(--primary); }

/* === TAB CONTENT === */
.tab-content { display: none; flex: 1; overflow-y: auto; }
.tab-content.active { display: block; }
#main-screen { padding-top: var(--top-bar-height); padding-bottom: 0; }
#main-screen .top-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 6; }

/* === SEARCH === */
.search-bar {
  padding: 8px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.search-bar input {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-filters {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-chip {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.hidden { display: none !important; }

/* === SIDE MENU === */
.side-menu { display: none; }
.side-menu.open { display: block; }
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
}
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--bg);
  z-index: 51;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.menu-header {
  padding: 32px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.menu-user-name { font-size: 18px; font-weight: 700; }
.menu-user-email { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.menu-items { padding: 12px; flex: 1; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.menu-item:active { background: var(--bg-secondary); }
.menu-item.text-danger { color: var(--danger); }
.menu-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* === NOTES LIST === */
.notes-list { padding-bottom: calc(var(--nav-height) + 20px + var(--safe-bottom)); }
.general-note {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.general-note p { font-size: 14px; line-height: 1.5; }
.general-note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.general-note-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--text);
  color: var(--bg);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

/* === LOADING === */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.loading p { color: #fff; margin-top: 16px; font-size: 15px; }
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon { color: var(--text-muted); margin-bottom: 16px; }
.empty-state p { font-size: 16px; font-weight: 500; }
.text-muted { color: var(--text-muted); font-weight: 400; font-size: 14px; margin-top: 4px; }

/* === SHARE MODAL === */
.share-user-list { margin-top: 16px; }
.share-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
}
.share-user:active { background: var(--bg-secondary); }
.share-user-name { font-weight: 600; }
.share-user-email { font-size: 13px; color: var(--text-secondary); }

/* === SHARED CONTACTS === */
.shared-from {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 2px;
}

/* === SCREEN HEADER === */
.screen-header {
  padding: 32px 24px 16px;
  text-align: center;
}
.screen-header h2 { font-size: 24px; margin-bottom: 4px; }
.screen-header p { color: var(--text-secondary); }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Save button highlight */
.save-btn { color: var(--primary) !important; }

/* === VOICE RECORDING === */
.voice-record-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.voice-record-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}
.voice-record-btn.recording {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.voice-duration {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--danger);
  min-width: 50px;
}
.voice-hint {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

/* === VOICE NOTE CARD === */
.voice-note {
  border-left: 3px solid var(--primary);
}
.voice-icon-inline {
  font-size: 14px;
}

/* Transcription status badges */
.transcription-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.transcription-badge.processing {
  background: #eff6ff;
  color: var(--primary);
}
.transcription-badge.error {
  background: #fef2f2;
  color: var(--danger);
}
@media (prefers-color-scheme: dark) {
  .transcription-badge.processing { background: #1e293b; }
  .transcription-badge.error { background: #451a1a; }
}

/* Mini spinner for transcription */
.mini-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(59,130,246,0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* Audio player inline */
.audio-player-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.audio-play-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.audio-play-btn:active { background: var(--primary-dark); }
.audio-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

/* Note actions row */
.note-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.note-action-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

/* === PWA INSTALL BANNER === */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  z-index: 400;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}
.install-banner:active { opacity: 0.9; }
.install-banner-icon {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

/* === iOS INSTALL HINT (bottom-sheet) === */
.ios-install-hint {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  animation: slideUp 0.3s ease-out;
}
.ios-hint-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  font-size: 14px;
  line-height: 1.4;
}
.ios-hint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
}
.ios-hint-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.ios-hint-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ios-hint-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.ios-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-hint-arrow {
  text-align: center;
  font-size: 24px;
  color: var(--text-muted);
  animation: bounce 1.5s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === TEMPERATURE DOT === */
.temp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 4px;
}
.temp-dot.temp-none {
  width: 10px;
  height: 10px;
  border: 2px solid var(--border);
  background: transparent;
}
.temp-cycle-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 0;
}
.temp-cycle-btn:active {
  background: var(--bg-secondary);
}

/* Temperature selector in detail */
.temp-selector {
  display: flex;
  gap: 8px;
}
.temp-selector-btn {
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.temp-selector-btn.selected {
  border-color: var(--temp-color);
  background: var(--temp-color);
  color: #fff;
}

/* Edit temperature selector */
.edit-temp-selector {
  display: flex;
  gap: 8px;
}
.edit-temp-btn {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.edit-temp-btn.selected {
  border-color: var(--temp-color);
  background: var(--temp-color);
  color: #fff;
}

/* === SCAN MODE TABS === */
.scan-mode-tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.scan-mode-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.scan-mode-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* === NETWORK INDICATOR === */
.network-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
.network-indicator.online {
  background: var(--success);
}
.network-indicator.offline {
  background: var(--danger);
  animation: pulse 2s infinite;
}

/* Pending badge */
.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--warning);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
}

/* === OFFLINE ITEM MARKER === */
.offline-item {
  border-style: dashed !important;
  opacity: 0.85;
}
.offline-marker {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  margin-right: 4px;
  vertical-align: middle;
}

/* === SOURCE TYPE BADGE === */
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  margin-right: 4px;
  vertical-align: middle;
}
.source-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Created by label */
.contact-created-by {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.detail-created-by {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Note author */
.note-author {
  font-weight: 600;
  color: var(--primary);
  margin-right: 6px;
}

/* === TEAM HEADER === */
.team-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.team-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.team-org-name {
  font-size: 16px;
  font-weight: 700;
}

/* Active org highlight in picker */
.active-org {
  border-color: var(--primary) !important;
  background: var(--bg-secondary);
}

/* Invite code display */
.invite-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
}

/* Filter divider */
.filter-divider {
  color: var(--border);
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
}
