/* ============================================================
   INVENSYS CRM — Feature CSS
   Covers: Lead WA Bar, WO Progress Bars, Site Logs, Real-time
   ============================================================ */

/* ─────────────────────────────────────────────────────────
   LEADS — WhatsApp Action Bar
───────────────────────────────────────────────────────── */
.lead-card { cursor: pointer; }

.lead-wa-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0 2px;
  border-top: 1px solid #f0f4f8;
  margin-top: 8px;
  flex-wrap: wrap;
}

.wa-lead-btn {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.wa-lead-btn:hover {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
  transform: translateY(-1px);
}
.wa-lead-btn i { font-size: 12px; }

.lead-src-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #374151;
}

/* Customer WA buttons */
.wa-cust-btn {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.wa-cust-btn:hover { background: #25d366; color: #fff; border-color: #25d366; }

/* ─────────────────────────────────────────────────────────
   WORK ORDER CARDS — Progress Bars
───────────────────────────────────────────────────────── */
.wo-card { cursor: pointer; }

.wo-today-chip {
  font-size: 10px;
  background: #dcfce7;
  color: #15803d;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  display: inline-block;
  margin-top: 4px;
}

/* Progress section */
.wo-progress-section {
  margin: 10px 0 6px;
  padding: 10px 0 6px;
  border-top: 1px solid #f0f4f8;
  border-bottom: 1px solid #f0f4f8;
}
.wo-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 5px;
}
.wo-progress-pct {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 8px;
}
.pct-done  { background: #dcfce7; color: #15803d; }
.pct-mid   { background: #dbeafe; color: #1d4ed8; }
.pct-low   { background: #fef3c7; color: #92400e; }

.wo-progress-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
.wo-progress-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s ease;
}
.fill-done { background: linear-gradient(90deg, #10b981, #059669); }
.fill-mid  { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.fill-low  { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* Stage indicators */
.wo-progress-stages {
  display: flex;
  justify-content: space-between;
}
.wo-stage {
  font-size: 9px;
  color: #9ca3af;
  text-align: center;
  flex: 1;
  transition: color 0.2s;
}
.wo-stage.stage-done { color: #10b981; font-weight: 700; }

/* ─────────────────────────────────────────────────────────
   SITE LOG MODAL
───────────────────────────────────────────────────────── */
.site-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}
.site-log-entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.05);
}
.site-log-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.site-log-body { flex: 1; min-width: 0; }
.site-log-note {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}
.site-log-meta {
  font-size: 10.5px;
  color: #9ca3af;
  margin-top: 3px;
}

/* Scrollbar styling for site log */
.site-log-list::-webkit-scrollbar { width: 4px; }
.site-log-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ─────────────────────────────────────────────────────────
   REAL-TIME MODULE
───────────────────────────────────────────────────────── */
.rt-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eaed;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rt-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: 16px;
}

/* Flow diagram */
.rt-flow {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}
.rt-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
  text-align: center;
}
.rt-flow-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.rt-flow-text {
  font-size: 11.5px;
  color: #374151;
  line-height: 1.5;
}
.rt-flow-arrow {
  font-size: 22px;
  color: #d1d5db;
  padding: 0 8px;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .rt-flow { flex-direction: column; }
  .rt-flow-arrow { transform: rotate(90deg); }
}

/* Events grid */
.rt-events-grid { display: flex; flex-direction: column; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid #e8eaed; }
.rt-event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.rt-event-row:last-child { border-bottom: none; }
.rt-event-row:hover { background: #f8fafc; }
.rt-event-icon { font-size: 18px; flex-shrink: 0; }
.rt-event-info { flex: 1; }
.rt-instant-badge {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Setup steps */
.rt-setup-steps { display: flex; flex-direction: column; gap: 14px; }
.rt-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e8eaed;
}
.rt-step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
}
.rt-step-title { font-size: 13.5px; font-weight: 700; color: #1a1d2e; margin-bottom: 3px; }
.rt-step-detail { font-size: 12px; color: #6b7280; line-height: 1.5; }

/* Live feed */
.rt-live-feed {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #86efac;
  overflow: hidden;
  margin-bottom: 16px;
}
.rt-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f0fdf4;
  border-bottom: 1px solid #86efac;
  font-size: 12.5px;
  font-weight: 600;
  color: #15803d;
}
.rt-feed-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12.5px;
}
.rt-feed-event:last-child { border-bottom: none; }
.rt-event-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: #10b981; }
.dot-blue  { background: #3b82f6; }
.dot-red   { background: #ef4444; }
.rt-event-desc { flex: 1; color: #374151; }
.rt-event-time { font-size: 10.5px; color: #9ca3af; white-space: nowrap; }

/* Status badges */
.rt-live    { color: #15803d; font-weight: 600; }
.rt-polling { color: #92400e; font-weight: 600; }
.rt-offline { color: #dc2626; font-weight: 600; }
.rt-setup   { color: #6b7280; font-weight: 600; }

/* Pulsing live dot in topbar */
.rt-pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: rt-pulse 2s infinite;
}
@keyframes rt-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.5; transform:scale(1.3); }
}

/* ─────────────────────────────────────────────────────────
   ENGINEER DASHBOARD ENHANCEMENTS
───────────────────────────────────────────────────────── */
.eng-job-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8eaed;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.eng-job-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.eng-site-hero {
  background: linear-gradient(135deg, #0f1b4c, #1a2d6e);
  border-radius: 14px;
  padding: 20px;
  color: #fff;
  margin-bottom: 16px;
}
.eng-site-hero-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.eng-site-hero-sub { font-size: 12px; opacity: 0.7; }

/* Milestone checklist for engineer */
.milestone-list { display: flex; flex-direction: column; gap: 8px; }
.milestone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8eaed;
  cursor: pointer;
  transition: background 0.15s;
}
.milestone-item:hover { background: #eff6ff; }
.milestone-item.done { background: #f0fdf4; border-color: #86efac; }
.milestone-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff;
  flex-shrink: 0;
  transition: all 0.2s;
}
.milestone-item.done .milestone-check { background: #10b981; border-color: #10b981; }
.milestone-text { flex: 1; font-size: 13px; font-weight: 600; color: #374151; }
.milestone-item.done .milestone-text { color: #15803d; text-decoration: line-through; opacity: 0.8; }

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .lead-wa-bar { gap: 4px; }
  .wa-lead-btn { padding: 4px 8px; font-size: 10.5px; }
  .wo-progress-stages { display: none; }
  .rt-events-grid { font-size: 11px; }
}

/* ─────────────────────────────────────────────────────────
   QUOTATIONS — Line-Item Builder
───────────────────────────────────────────────────────── */
.qt-item-table input,
.qt-item-table select {
  background: transparent;
  font-family: 'Inter', sans-serif;
}
.qt-item-table input:focus,
.qt-item-table select:focus {
  background: #fffbeb;
  outline: 2px solid #fbbf24;
  border-radius: 4px;
}
.qt-totals-box {
  background: #f8faff;
  border: 1.5px solid #e0e7ff;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
}
.qt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
  color: #374151;
}
.qt-total-row.grand {
  padding-top: 10px;
  border-top: 2px solid #e0e7ff;
  font-size: 16px;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────────
   EMAIL INBOX
───────────────────────────────────────────────────────── */
.email-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.email-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.email-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(59,130,246,0.1);
  transform: translateY(-1px);
}
.email-item-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 38px;
  text-align: center;
  margin-top: 2px;
}
.email-item-body {
  flex: 1;
  min-width: 0;
}
.email-item-subject {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-item-meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}
.email-item-preview {
  font-size: 11.5px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* Live-sync pulse indicator */
.live-sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}
.poll-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6b7280;
  background: #f0fdf4;
  border: 1px solid #86efac;
  padding: 3px 10px;
  border-radius: 20px;
}
.poll-indicator.syncing {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Lead Won celebration flash */
@keyframes wonFlash {
  0%   { background: #fef9c3; }
  50%  { background: #fde68a; }
  100% { background: inherit; }
}
.lead-won-flash { animation: wonFlash 1s ease; }

/* Quotation status badges in tables */
.qt-badge-approved { background: #dcfce7; color: #15803d; }
.qt-badge-sent     { background: #eff6ff; color: #1d4ed8; }
.qt-badge-draft    { background: #f3f4f6; color: #6b7280; }
.qt-badge-rejected { background: #fef2f2; color: #dc2626; }

/* Relation chip — shows linked record */
.rel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all 0.12s;
}
.rel-chip:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.rel-chip.project { background: #f5f3ff; color: #7c3aed; border-color: #c4b5fd; }
.rel-chip.project:hover { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.rel-chip.invoice { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.rel-chip.invoice:hover { background: #c2410c; color: #fff; border-color: #c2410c; }

@media (max-width: 640px) {
  .email-item { padding: 10px 12px; gap: 8px; }
  .email-item-subject { font-size: 13px; }
  .email-item-icon { font-size: 20px; width: 28px; }
}

/* =============================================================
   SITE MEDIA — Photos & Videos Module
   ============================================================= */

/* Gallery grid */
.site-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

/* Individual media card */
.sm-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
}
.sm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.sm-card.sm-issue { box-shadow: 0 0 0 2px #dc262640, 0 1px 4px rgba(0,0,0,0.07); }
.sm-card.sm-issue:hover { box-shadow: 0 0 0 2px #dc2626, 0 6px 20px rgba(220,38,38,0.18); }

/* Thumbnail area */
.sm-thumb-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: #f3f4f6;
  overflow: hidden;
}
.sm-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.sm-card:hover .sm-thumb-img { transform: scale(1.04); }

.sm-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #d1d5db;
}

/* Video thumb */
.sm-video-thumb {
  position: relative;
  width: 100%;
  height: 100%;
}
.sm-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  font-size: 48px;
  color: rgba(255,255,255,0.9);
  transition: background 0.2s;
}
.sm-card:hover .sm-play-overlay { background: rgba(0,0,0,0.4); }
.sm-play-overlay-sm {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  font-size: 22px;
  color: rgba(255,255,255,0.9);
}

/* Issue badge overlay */
.sm-issue-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* Tag pill overlay */
.sm-tag-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff;
  letter-spacing: 0.3px;
}

/* Info section */
.sm-info {
  padding: 10px 12px;
}
.sm-caption {
  font-size: 12.5px;
  font-weight: 600;
  color: #1a1d2e;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 3px;
}
.sm-meta span { display: flex; align-items: center; gap: 3px; }
.sm-date {
  font-size: 10.5px;
  color: #c4c9d4;
}

/* Timeline row */
.sm-timeline-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.sm-timeline-thumb {
  flex: 0 0 90px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #f3f4f6;
  transition: transform 0.15s;
}
.sm-timeline-thumb:hover { transform: scale(1.06); }
.sm-timeline-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sm-timeline-video-wrap { width: 100%; height: 100%; position: relative; overflow: hidden; }
.sm-timeline-video-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Capture Modal ─── */
.capture-modal {
  padding: 2px 0;
}
.capture-type-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.capture-type-btn {
  flex: 1;
  padding: 9px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.capture-type-btn.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.media-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f9fafb;
  transition: border-color 0.2s, background 0.2s;
  padding: 20px;
  text-align: center;
}
.media-drop-zone:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* ─── Lightbox ─── */
.lightbox-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 640px) {
  .lightbox-container {
    flex-direction: row;
    align-items: flex-start;
  }
}
.lightbox-media-wrap {
  position: relative;
  flex: 1 1 55%;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
.lb-media-img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}
.lb-media-video {
  width: 100%;
  max-height: 400px;
  border-radius: 12px;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}
.lb-nav:hover { background: rgba(255,255,255,0.35); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }

.lightbox-info {
  flex: 1 1 40%;
  min-width: 0;
}
.lb-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lb-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}
.lb-meta-item i {
  width: 16px;
  text-align: center;
  color: #9ca3af;
  flex-shrink: 0;
}

/* =============================================================
   INFLUENCER / ARCHITECTS & IDs MODULE
   ============================================================= */
.inf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.inf-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.inf-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.inf-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.inf-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}
.inf-info { flex: 1; min-width: 0; }
.inf-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1d2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inf-firm {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inf-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.inf-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid #f3f4f6;
}
.inf-stat {
  padding: 10px;
  text-align: center;
  border-right: 1px solid #f3f4f6;
}
.inf-stat:last-child { border-right: none; }
.inf-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d2e;
}
.inf-stat-lbl {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
}
.inf-footer {
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.inf-stars { color: #f59e0b; font-size: 12px; }

/* Influencer card — body sections (used in renderInfluencerCards) */
.inf-type-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}
.inf-card-body {
  padding: 10px 14px 4px;
}
.inf-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  margin: 0 -14px;
  padding: 0 14px;
}
.inf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: #6b7280;
  padding: 8px 0 4px;
}
.inf-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.inf-meta i { font-size: 10px; color: #9ca3af; }
.inf-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid #f3f4f6;
}

/* Influencer detail modal */
.inf-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.inf-detail-item {
  font-size: 13px;
  color: #374151;
}
.inf-detail-item strong {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 2px;
}

/* WA Engine */
.wa-engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.wa-template-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.wa-template-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.wa-template-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.wa-template-letter {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
  margin-bottom: 2px;
}
.wa-template-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d2e;
}
.wa-template-trigger {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}
.wa-template-desc {
  font-size: 12.5px;
  color: #374151;
  margin-bottom: 12px;
  line-height: 1.5;
}
.wa-template-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.wa-status-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
}
.wa-status-live i { font-size: 7px; color: #10b981; }

/* kpi-red */
.kpi-card.kpi-red {
  border-left: 4px solid #dc2626;
}
.kpi-card.kpi-red .kpi-icon { background: #fef2f2; color: #dc2626; }

/* kpi-purple */
.kpi-card.kpi-purple {
  border-left: 4px solid #8b5cf6;
}
.kpi-card.kpi-purple .kpi-icon { background: #f5f3ff; color: #7c3aed; }

/* Site media responsive */
@media (max-width: 640px) {
  .site-media-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .inf-grid { grid-template-columns: 1fr; }
  .wa-engine-grid { grid-template-columns: 1fr; }
  .lightbox-container { flex-direction: column; }
  .lb-media-img, .lb-media-video { max-height: 260px; }
}

/* =============================================================
   SITE MEDIA — View Mode Tabs (Gallery | Albums | Timeline)
   ============================================================= */
.sm-view-tab {
  padding: 8px 18px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -2px;
}
.sm-view-tab:hover { color: #1a1d2e; }
.sm-view-tab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

/* =============================================================
   SITE MEDIA — Album Grid
   ============================================================= */
.sm-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.sm-album-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.sm-album-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.sm-album-cover {
  position: relative;
  aspect-ratio: 4/3;
  background: #f3f4f6;
  overflow: hidden;
}
.sm-album-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.sm-album-card:hover .sm-album-cover img { transform: scale(1.06); }
.sm-album-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}
.sm-album-issue-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}
.sm-album-info {
  padding: 10px 12px 12px;
}
.sm-album-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-album-area {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 5px;
}
.sm-album-counts {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}

/* Album detail grid (inside open album modal) */
.sm-album-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.sm-album-thumb-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sm-album-thumb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* =============================================================
   INFLUENCER — Portfolio Gallery
   ============================================================= */
.inf-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar styling */
.inf-portfolio-grid::-webkit-scrollbar { width: 4px; }
.inf-portfolio-grid::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 2px; }
.inf-portfolio-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.inf-portfolio-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.inf-portfolio-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}
.inf-portfolio-card.inf-portfolio-featured {
  box-shadow: 0 0 0 2px #f59e0b, 0 2px 8px rgba(245,158,11,0.2);
}
.inf-portfolio-thumb {
  width: 100%;
  height: 130px;
  position: relative;
  overflow: hidden;
  background: #f3f4f6;
}
.inf-portfolio-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.inf-portfolio-card:hover .inf-portfolio-thumb img { transform: scale(1.06); }
.inf-portfolio-star {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #f59e0b;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.inf-portfolio-type-chip {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  max-width: calc(100% - 12px);
  text-overflow: ellipsis;
}
.inf-portfolio-info {
  padding: 7px 9px 9px;
}
.inf-portfolio-caption {
  font-size: 11.5px;
  font-weight: 600;
  color: #1a1d2e;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Portfolio Mini Strip (in detail modal) ─── */
.inf-portfolio-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}
.inf-portfolio-strip::-webkit-scrollbar { height: 3px; }
.inf-portfolio-strip::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.inf-strip-thumb {
  flex: 0 0 90px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #f3f4f6;
  transition: transform 0.15s;
}
.inf-strip-thumb:hover { transform: scale(1.06); }
.inf-strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inf-strip-thumb.inf-strip-featured {
  box-shadow: 0 0 0 2px #f59e0b;
}
.inf-strip-more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #6b7280;
  background: #f3f4f6;
  border: 2px dashed #d1d5db;
  cursor: pointer;
  transition: background 0.15s;
}
.inf-strip-more:hover { background: #e9ecf0; }

/* =============================================================
   URL IMPORT — input row styling
   ============================================================= */
.url-input-row input:focus,
.inf-url-field:focus {
  outline: none;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* =============================================================
   RESPONSIVE — Mobile tweaks for new views
   ============================================================= */
@media (max-width: 640px) {
  .sm-album-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sm-album-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .inf-portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .inf-portfolio-thumb { height: 100px; }
  .sm-view-tab { padding: 6px 12px; font-size: 12px; }
}
@media (max-width: 400px) {
  .sm-album-grid { grid-template-columns: 1fr; }
  .inf-portfolio-grid { grid-template-columns: 1fr; }
}

